MK3S-E3DREVO_HF_60W_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 dc 57 jmp 0xafb8 ; 0xafb8 <__dtors_end> 4: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 8: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> c: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 10: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 14: 0d 94 22 bc jmp 0x37844 ; 0x37844 <__vector_5> 18: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 1c: 0c 94 50 76 jmp 0xeca0 ; 0xeca0 <__vector_7> 20: 0c 94 6d 76 jmp 0xecda ; 0xecda <__vector_8> 24: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 28: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 2c: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 30: 0c 94 a8 68 jmp 0xd150 ; 0xd150 <__vector_12> 34: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 38: 0d 94 15 48 jmp 0x2902a ; 0x2902a <__vector_14> 3c: 0d 94 9d 41 jmp 0x2833a ; 0x2833a <__vector_15> 40: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 44: 0d 94 e1 58 jmp 0x2b1c2 ; 0x2b1c2 <__vector_17> 48: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 4c: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 50: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 54: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 58: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 5c: 0c 94 57 75 jmp 0xeaae ; 0xeaae <__vector_23> 60: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 64: 0d 94 c4 d6 jmp 0x3ad88 ; 0x3ad88 <__vector_25> 68: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 6c: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 70: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 74: 0c 94 5a 8f jmp 0x11eb4 ; 0x11eb4 <__vector_29> 78: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 7c: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 80: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 84: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 88: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 8c: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 90: 0d 94 80 d6 jmp 0x3ad00 ; 0x3ad00 <__vector_36> 94: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 98: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> 9c: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> a0: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> a4: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> a8: 0d 94 33 37 jmp 0x26e66 ; 0x26e66 <__vector_42> ac: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> b0: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> b4: 0d 94 15 37 jmp 0x26e2a ; 0x26e2a <__vector_45> b8: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> bc: 0d 94 5f 4d jmp 0x29abe ; 0x29abe <__vector_47> c0: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> c4: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> c8: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> cc: 0d 94 d5 36 jmp 0x26daa ; 0x26daa <__vector_51> d0: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> d4: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> d8: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> dc: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__bad_interrupt> e0: 0c 94 0d 58 jmp 0xb01a ; 0xb01a <__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 50 49 4e 44 41 20 63 61 6c 2e 00 ..PINDA cal.. 00003a90 : 3a90: ff ff 52 65 73 65 74 20 58 59 5a 20 63 61 6c 69 ..Reset XYZ cali 3aa0: 62 72 2e 00 br.. 00003aa4 : 3aa4: ff ff 50 49 44 20 63 61 6c 69 62 72 61 74 69 6f ..PID calibratio 3ab4: 6e 00 n. 00003ab6 : 3ab6: ff ff 42 65 64 20 6c 65 76 65 6c 20 63 6f 72 72 ..Bed level corr 3ac6: 65 63 74 00 ect. 00003aca : 3aca: ff ff 4d 65 73 68 20 42 65 64 20 4c 65 76 65 6c ..Mesh Bed Level 3ada: 69 6e 67 00 ing. 00003ade : 3ade: ff ff 43 61 6c 69 62 72 61 74 65 20 5a 00 ..Calibrate Z. 00003aec : 3aec: ff ff 43 61 6c 69 62 72 61 74 65 20 58 59 5a 00 ..Calibrate XYZ. 00003afc : 3afc: ff ff 53 65 6c 66 74 65 73 74 00 ..Selftest. 00003b07 : 3b07: ff ff 42 65 6c 74 20 74 65 73 74 00 ..Belt test. 00003b13 : 3b13: ff ff 57 69 7a 61 72 64 00 ..Wizard. 00003b1c : 3b1c: ff ff 54 65 73 74 69 6e 67 20 66 69 6c 61 6d 65 ..Testing filame 3b2c: 6e 74 00 nt. 00003b2f : 3b2f: ff ff 4c 6f 61 64 20 41 6c 6c 00 ..Load All. 00003b3a : 3b3a: ff ff 50 6c 65 61 73 65 20 70 75 6c 6c 20 6f 75 ..Please pull ou 3b4a: 74 20 66 69 6c 61 6d 65 6e 74 20 69 6d 6d 65 64 t filament immed 3b5a: 69 61 74 65 6c 79 00 iately. 00003b61 : 3b61: ff ff 52 65 73 65 74 00 ..Reset. 00003b69 : 3b69: ff ff 52 65 6e 61 6d 65 00 ..Rename. 00003b72 : 3b72: ff ff 46 69 72 73 74 20 6c 61 79 65 72 20 63 61 ..First layer ca 3b82: 6c 2e 00 l.. 00003b85 : 3b85: ff ff 53 65 6c 65 63 74 00 ..Select. 00003b8e : 3b8e: ff ff 53 74 65 65 6c 20 73 68 65 65 74 73 00 ..Steel sheets. 00003b9d : 3b9d: ff ff 53 75 70 70 6f 72 74 00 ..Support. 00003ba7 : 3ba7: ff ff 46 61 69 6c 20 73 74 61 74 73 20 4d 4d 55 ..Fail stats MMU ... 00003bb8 : 3bb8: ff ff 46 61 69 6c 20 73 74 61 74 73 00 ..Fail stats. 00003bc5 : 3bc5: ff ff 53 74 61 74 69 73 74 69 63 73 00 ..Statistics. 00003bd2 : 3bd2: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 00 ..Calibration. 00003be0 : 3be0: ff ff 41 75 74 6f 4c 6f 61 64 20 66 69 6c 61 6d ..AutoLoad filam 3bf0: 65 6e 74 00 ent. 00003bf4 : 3bf4: ff ff 4c 6f 61 64 20 66 69 6c 61 6d 65 6e 74 00 ..Load filament. 00003c04 : 3c04: ff ff 55 6e 6c 6f 61 64 20 66 69 6c 61 6d 65 6e ..Unload filamen 3c14: 74 00 t. 00003c16 : 3c16: ff ff 4c 6f 61 64 20 74 6f 20 6e 6f 7a 7a 6c 65 ..Load to nozzle ... 00003c27 : 3c27: ff ff 50 72 65 6c 6f 61 64 20 74 6f 20 4d 4d 55 ..Preload to MMU ... 00003c38 : 3c38: ff ff 4e 6f 7a 7a 6c 65 20 64 2e 00 ..Nozzle d.. 00003c44 : 3c44: ff ff 4e 6f 20 53 44 20 63 61 72 64 00 ..No SD card. 00003c51 : 3c51: ff ff 50 72 69 6e 74 20 66 72 6f 6d 20 53 44 00 ..Print from SD. 00003c61 : 3c61: ff ff 43 6c 65 61 72 20 54 4d 20 65 72 72 6f 72 ..Clear TM error ... 00003c72 : 3c72: ff ff 52 65 73 75 6d 65 20 70 72 69 6e 74 00 ..Resume print. 00003c81 : 3c81: ff ff 50 61 75 73 65 20 70 72 69 6e 74 00 ..Pause print. 00003c8f : 3c8f: ff ff 53 65 74 20 52 65 61 64 79 00 ..Set Ready. 00003c9b : 3c9b: ff ff 53 65 74 20 6e 6f 74 20 52 65 61 64 79 00 ..Set not Ready. 00003cab : 3cab: ff ff 50 72 65 68 65 61 74 00 ..Preheat. 00003cb5 : 3cb5: ff ff 54 75 6e 65 00 ..Tune. 00003cbc : 3cbc: ff ff 4c 69 76 65 20 61 64 6a 75 73 74 20 5a 00 ..Live adjust Z. 00003ccc : 3ccc: ff ff 52 65 70 72 69 6e 74 00 ..Reprint. 00003cd6 : 3cd6: ff ff 49 6e 66 6f 20 73 63 72 65 65 6e 00 ..Info screen. 00003ce4 : 3ce4: ff ff 42 72 69 67 68 74 6e 65 73 73 00 ..Brightness. 00003cf1 : 3cf1: ff ff 41 73 73 69 73 74 00 ..Assist. 00003cfa : 3cfa: ff ff 53 69 6c 65 6e 74 00 ..Silent. 00003d03 : 3d03: ff ff 4f 6e 63 65 00 ..Once. 00003d0a : 3d0a: ff ff 53 6f 75 6e 64 00 ..Sound. 00003d12 : 3d12: ff ff 4c 6f 75 64 00 ..Loud. 00003d19 : 3d19: ff ff 46 69 6c 2e 20 73 65 6e 73 6f 72 00 ..Fil. sensor. 00003d27 : 3d27: ff ff 43 68 61 6e 67 65 20 66 69 6c 61 6d 65 6e ..Change filamen 3d37: 74 00 t. 00003d39 : 3d39: ff ff 46 6c 6f 77 00 ..Flow. 00003d40 : 3d40: ff ff 53 70 65 65 64 00 ..Speed. 00003d48 : 3d48: ff ff 4d 61 67 6e 65 74 73 20 63 6f 6d 70 2e 00 ..Magnets comp.. 00003d58 : 3d58: ff ff 4e 2f 41 00 ..N/A. 00003d5e : 3d5e: ff ff 5a 2d 70 72 6f 62 65 20 6e 72 2e 00 ..Z-probe nr.. 00003d6c : 3d6c: ff ff 4d 65 73 68 00 ..Mesh. 00003d73 : 3d73: ff ff 54 69 6d 65 6f 75 74 00 ..Timeout. 00003d7d : 3d7d: ff ff 4d 6f 64 65 00 ..Mode. 00003d84 : 3d84: ff ff 41 75 74 6f 00 ..Auto. 00003d8b : 3d8b: ff ff 44 69 6d 00 ..Dim. 00003d91 : 3d91: ff ff 42 72 69 67 68 74 00 ..Bright. 00003d9a : 3d9a: ff ff 4c 65 76 65 6c 20 44 69 6d 6d 65 64 00 ..Level Dimmed. 00003da9 : 3da9: ff ff 4c 65 76 65 6c 20 42 72 69 67 68 74 00 ..Level Bright. 00003db8 : 3db8: ff ff 53 65 74 74 69 6e 67 73 00 ..Settings. 00003dc3 : 3dc3: ff ff 59 65 73 00 ..Yes. 00003dc9 : 3dc9: ff ff 4e 6f 00 ..No. 00003dce : 3dce: ff ff 53 74 6f 70 20 70 72 69 6e 74 00 ..Stop print. 00003ddb : 3ddb: ff ff 43 68 65 63 6b 69 6e 67 20 66 69 6c 65 00 ..Checking file. 00003deb : 3deb: ff ff 46 69 6c 65 20 69 6e 63 6f 6d 70 6c 65 74 ..File incomplet 3dfb: 65 2e 20 43 6f 6e 74 69 6e 75 65 20 61 6e 79 77 e. Continue anyw 3e0b: 61 79 3f 00 ay?. 00003e0f : 3e0f: ff ff 84 52 65 66 72 65 73 68 00 ...Refresh. 00003e1a : 3e1a: ff ff 4d 61 69 6e 00 ..Main. 00003e21 : 3e21: ff ff 49 6e 73 65 72 74 20 74 68 65 20 66 69 6c ..Insert the fil 3e31: 61 6d 65 6e 74 20 28 64 6f 20 6e 6f 74 20 6c 6f ament (do not lo 3e41: 61 64 20 69 74 29 20 69 6e 74 6f 20 74 68 65 20 ad it) into the 3e51: 65 78 74 72 75 64 65 72 20 61 6e 64 20 74 68 65 extruder and the 3e61: 6e 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 n press the knob 3e71: 2e 00 .. 00003e73 : 3e73: ff ff 53 65 6e 73 6f 72 20 76 65 72 69 66 69 65 ..Sensor verifie 3e83: 64 2c 20 72 65 6d 6f 76 65 20 74 68 65 20 66 69 d, remove the fi 3e93: 6c 61 6d 65 6e 74 20 6e 6f 77 2e 00 lament now.. 00003e9f : 3e9f: ff ff 56 65 72 69 66 69 63 61 74 69 6f 6e 20 66 ..Verification f 3eaf: 61 69 6c 65 64 2c 20 72 65 6d 6f 76 65 20 74 68 ailed, remove th 3ebf: 65 20 66 69 6c 61 6d 65 6e 74 20 61 6e 64 20 74 e filament and t 3ecf: 72 79 20 61 67 61 69 6e 2e 00 ry again.. 00003ed9 : 3ed9: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 74 ..Please check t 3ee9: 68 65 20 49 52 20 73 65 6e 73 6f 72 20 63 6f 6e he IR sensor con 3ef9: 6e 65 63 74 69 6f 6e 2c 20 75 6e 6c 6f 61 64 20 nection, unload 3f09: 66 69 6c 61 6d 65 6e 74 20 69 66 20 70 72 65 73 filament if pres 3f19: 65 6e 74 2e 00 ent.. 00003f1e : 3f1e: ff ff 50 6c 65 61 73 65 20 75 6e 6c 6f 61 64 20 ..Please unload 3f2e: 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 66 69 72 the filament fir 3f3e: 73 74 2c 20 74 68 65 6e 20 72 65 70 65 61 74 20 st, then repeat 3f4e: 74 68 69 73 20 61 63 74 69 6f 6e 2e 00 this action.. 00003f5b : 3f5b: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 6e 6f ..Waiting for no 3f6b: 7a 7a 6c 65 20 61 6e 64 20 62 65 64 20 63 6f 6f zzle and bed coo 3f7b: 6c 69 6e 67 00 ling. 00003f80 : 3f80: ff ff 53 65 6c 65 63 74 20 66 69 6c 61 6d 65 6e ..Select filamen 3f90: 74 3a 00 t:. 00003f93 : 3f93: ff ff 53 65 6c 66 74 65 73 74 20 4f 4b 00 ..Selftest OK. 00003fa1 : 3fa1: ff ff 53 65 6c 66 74 65 73 74 20 73 74 61 72 74 ..Selftest start ... 00003fb2 : 3fb2: ff ff 50 72 69 6e 74 20 66 61 6e 3a 00 ..Print fan:. 00003fbf : 3fbf: ff ff 48 6f 74 65 6e 64 20 66 61 6e 3a 00 ..Hotend fan:. 00003fcd : 3fcd: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 68 6f ..Calibrating ho 3fdd: 6d 65 00 me. 00003fe0 : 3fe0: ff ff 41 6c 6c 20 63 6f 72 72 65 63 74 00 ..All correct. 00003fee : 3fee: ff ff 43 68 65 63 6b 69 6e 67 20 73 65 6e 73 6f ..Checking senso 3ffe: 72 73 00 rs. 00004001 : 4001: ff ff 43 68 65 63 6b 69 6e 67 20 68 6f 74 65 6e ..Checking hoten 4011: 64 00 d. 00004013 : 4013: ff ff 43 68 65 63 6b 69 6e 67 20 62 65 64 00 ..Checking bed. 00004022 : 4022: ff ff 43 68 65 63 6b 69 6e 67 20 5a 20 61 78 69 ..Checking Z axi 4032: 73 00 s. 00004034 : 4034: ff ff 43 68 65 63 6b 69 6e 67 20 59 20 61 78 69 ..Checking Y axi 4044: 73 00 s. 00004046 : 4046: ff ff 43 68 65 63 6b 69 6e 67 20 58 20 61 78 69 ..Checking X axi 4056: 73 00 s. 00004058 : 4058: ff ff 43 68 65 63 6b 69 6e 67 20 65 6e 64 73 74 ..Checking endst 4068: 6f 70 73 00 ops. 0000406c : 406c: ff ff 43 61 72 64 20 72 65 6d 6f 76 65 64 00 ..Card removed. 0000407b : 407b: ff ff 42 61 63 6b 00 ..Back. 00004082 : 4082: ff ff 53 74 72 69 63 74 00 ..Strict. 0000408b : 408b: ff ff 57 61 72 6e 00 ..Warn. 00004092 : 4092: ff ff 4e 6f 6e 65 00 ..None. 00004099 : 4099: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 64 ..Nozzle changed 40a9: 3f 00 ?. 000040ab : 40ab: ff ff 4e 6f 7a 7a 6c 65 20 69 73 20 68 6f 74 21 ..Nozzle is hot! 40bb: 20 57 61 69 74 20 66 6f 72 20 63 6f 6f 6c 64 6f Wait for cooldo 40cb: 77 6e 2e 00 wn.. 000040cf : 40cf: ff ff 50 49 44 20 63 61 6c 2e 20 66 69 6e 69 73 ..PID cal. finis 40df: 68 65 64 00 hed. 000040e3 : 40e3: ff ff 50 49 44 20 63 61 6c 2e 00 ..PID cal.. 000040ee : 40ee: ff ff 50 72 69 6e 74 20 70 61 75 73 65 64 00 ..Print paused. 000040fd : 40fd: ff ff 50 72 69 6e 74 20 61 62 6f 72 74 65 64 00 ..Print aborted. 0000410d : 410d: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 411d: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 412d: 68 65 20 47 2d 63 6f 64 65 2e 20 43 6f 6e 74 69 he G-code. Conti 413d: 6e 75 65 3f 00 nue?. 00004142 : 4142: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4152: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4162: 68 65 20 47 2d 63 6f 64 65 2e 20 50 6c 65 61 73 he G-code. Pleas 4172: 65 20 63 68 65 63 6b 20 74 68 65 20 76 61 6c 75 e check the valu 4182: 65 20 69 6e 20 73 65 74 74 69 6e 67 73 2e 20 50 e in settings. P 4192: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 000041a2 : 41a2: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 41b2: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 20 43 lament loaded. C 41c2: 6f 6e 74 69 6e 75 65 3f 00 ontinue?. 000041cb : 41cb: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 41db: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 20 50 lament loaded. P 41eb: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 000041fb : 41fb: ff ff 4d 4b 33 53 20 66 69 72 6d 77 61 72 65 20 ..MK3S firmware 420b: 64 65 74 65 63 74 65 64 20 6f 6e 20 4d 4b 33 20 detected on MK3 421b: 70 72 69 6e 74 65 72 00 printer. 00004223 : 4223: ff ff 42 6c 61 63 6b 6f 75 74 20 6f 63 63 75 72 ..Blackout occur 4233: 72 65 64 2e 20 52 65 63 6f 76 65 72 20 70 72 69 red. Recover pri 4243: 6e 74 3f 00 nt?. 00004247 : 4247: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 4257: 6e 6f 74 20 63 61 6c 69 62 72 61 74 65 64 20 79 not calibrated y 4267: 65 74 2e 00 et.. 0000426b : 426b: ff ff 54 68 65 72 65 20 69 73 20 73 74 69 6c 6c ..There is still 427b: 20 61 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 a need to make 428b: 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 20 50 Z calibration. P 429b: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 42ab: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 42bb: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 42cb: 63 74 69 6f 6e 20 43 61 6c 69 62 72 61 74 69 6f ction Calibratio 42db: 6e 20 66 6c 6f 77 2e 00 n flow.. 000042e3 : 42e3: ff ff 50 72 69 6e 74 65 72 20 68 61 73 20 6e 6f ..Printer has no 42f3: 74 20 62 65 65 6e 20 63 61 6c 69 62 72 61 74 65 t been calibrate 4303: 64 20 79 65 74 2e 20 50 6c 65 61 73 65 20 66 6f d yet. Please fo 4313: 6c 6c 6f 77 20 74 68 65 20 6d 61 6e 75 61 6c 2c llow the manual, 4323: 20 63 68 61 70 74 65 72 20 46 69 72 73 74 20 73 chapter First s 4333: 74 65 70 73 2c 20 73 65 63 74 69 6f 6e 20 43 61 teps, section Ca 4343: 6c 69 62 72 61 74 69 6f 6e 20 66 6c 6f 77 2e 00 libration flow.. 00004353 : 4353: ff ff 53 65 6c 66 74 65 73 74 20 77 69 6c 6c 20 ..Selftest will 4363: 62 65 20 72 75 6e 20 74 6f 20 63 61 6c 69 62 72 be run to calibr 4373: 61 74 65 20 61 63 63 75 72 61 74 65 20 73 65 6e ate accurate sen 4383: 73 6f 72 6c 65 73 73 20 72 65 68 6f 6d 69 6e 67 sorless rehoming 4393: 2e 00 .. 00004395 : 4395: ff ff 4f 6c 64 20 73 65 74 74 69 6e 67 73 20 66 ..Old settings f 43a5: 6f 75 6e 64 2e 20 44 65 66 61 75 6c 74 20 50 49 ound. Default PI 43b5: 44 2c 20 45 73 74 65 70 73 20 65 74 63 2e 20 77 D, Esteps etc. w 43c5: 69 6c 6c 20 62 65 20 73 65 74 2e 00 ill be set.. 000043d1 : 43d1: ff ff 57 61 72 6e 69 6e 67 3a 20 62 6f 74 68 20 ..Warning: both 43e1: 70 72 69 6e 74 65 72 20 74 79 70 65 20 61 6e 64 printer type and 43f1: 20 6d 6f 74 68 65 72 62 6f 61 72 64 20 74 79 70 motherboard typ 4401: 65 20 63 68 61 6e 67 65 64 2e 00 e changed.. 0000440c : 440c: ff ff 57 61 72 6e 69 6e 67 3a 20 70 72 69 6e 74 ..Warning: print 441c: 65 72 20 74 79 70 65 20 63 68 61 6e 67 65 64 2e er type changed. ... 0000442d : 442d: ff ff 57 61 72 6e 69 6e 67 3a 20 6d 6f 74 68 65 ..Warning: mothe 443d: 72 62 6f 61 72 64 20 74 79 70 65 20 63 68 61 6e rboard type chan 444d: 67 65 64 2e 00 ged.. 00004452 : 4452: ff ff 53 68 65 65 74 00 ..Sheet. 0000445a : 445a: ff ff 4e 6f 74 20 73 70 69 6e 6e 69 6e 67 00 ..Not spinning. 00004469 : 4469: ff ff 53 70 69 6e 6e 69 6e 67 00 ..Spinning. 00004474 : 4474: ff ff 46 61 6e 20 74 65 73 74 00 ..Fan test. 0000447f : 447f: ff ff 53 65 6c 66 74 65 73 74 20 66 61 69 6c 65 ..Selftest faile 448f: 64 00 d. 00004491 : 4491: ff ff 25 73 20 6c 65 76 65 6c 20 65 78 70 65 63 ..%s level expec 44a1: 74 65 64 00 ted. 000044a5 : 44a5: ff ff 46 61 6c 73 65 20 74 72 69 67 67 65 72 69 ..False triggeri 44b5: 6e 67 00 ng. 000044b8 : 44b8: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 44c8: 72 00 r. 000044ca : 44ca: ff ff 53 77 61 70 70 65 64 00 ..Swapped. 000044d4 : 44d4: ff ff 46 72 6f 6e 74 2f 6c 65 66 74 20 66 61 6e ..Front/left fan 44e4: 73 00 s. 000044e6 : 44e6: ff ff 41 78 69 73 00 ..Axis. 000044ed : 44ed: ff ff 41 78 69 73 20 6c 65 6e 67 74 68 00 ..Axis length. 000044fb : 44fb: ff ff 4c 6f 6f 73 65 20 70 75 6c 6c 65 79 00 ..Loose pulley. 0000450a : 450a: ff ff 4c 65 66 74 20 68 6f 74 65 6e 64 20 66 61 ..Left hotend fa 451a: 6e 3f 00 n?. 0000451d : 451d: ff ff 46 72 6f 6e 74 20 70 72 69 6e 74 20 66 61 ..Front print fa 452d: 6e 3f 00 n?. 00004530 : 4530: ff ff 45 6e 64 73 74 6f 70 20 6e 6f 74 20 68 69 ..Endstop not hi 4540: 74 00 t. 00004542 : 4542: ff ff 45 6e 64 73 74 6f 70 00 ..Endstop. 0000454c : 454c: ff ff 4d 6f 74 6f 72 00 ..Motor. 00004554 : 4554: ff ff 45 6e 64 73 74 6f 70 73 00 ..Endstops. 0000455f : 455f: ff ff 57 69 72 69 6e 67 20 65 72 72 6f 72 00 ..Wiring error. 0000456e : 456e: ff ff 42 65 64 2f 48 65 61 74 65 72 00 ..Bed/Heater. 0000457b : 457b: ff ff 4e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 00 ..Not connected. 0000458b : 458b: ff ff 48 65 61 74 65 72 2f 54 68 65 72 6d 69 73 ..Heater/Thermis 459b: 74 6f 72 00 tor. 0000459f : 459f: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 3a 00 ..Please check:. 000045af : 45af: ff ff 53 65 6c 66 74 65 73 74 20 65 72 72 6f 72 ..Selftest error 45bf: 21 00 !. 000045c1 : 45c1: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 45d1: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 53 6b 65 n all right. Ske 45e1: 77 20 77 69 6c 6c 20 62 65 20 63 6f 72 72 65 63 w will be correc 45f1: 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ted automaticall 4601: 79 2e 00 y.. 00004604 : 4604: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4614: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 58 2f 59 n all right. X/Y 4624: 20 61 78 65 73 20 61 72 65 20 73 6c 69 67 68 74 axes are slight 4634: 6c 79 20 73 6b 65 77 65 64 2e 20 47 6f 6f 64 20 ly skewed. Good 4644: 6a 6f 62 21 00 job!. 00004649 : 4649: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4659: 6e 20 6f 6b 2e 20 58 2f 59 20 61 78 65 73 20 61 n ok. X/Y axes a 4669: 72 65 20 70 65 72 70 65 6e 64 69 63 75 6c 61 72 re perpendicular 4679: 2e 20 43 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e . Congratulation 4689: 73 21 00 s!. 0000468c : 468c: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 469c: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 52 n compromised. R 46ac: 69 67 68 74 20 66 72 6f 6e 74 20 63 61 6c 69 62 ight front calib 46bc: 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 6e 6f 74 ration point not 46cc: 20 72 65 61 63 68 61 62 6c 65 2e 00 reachable.. 000046d8 : 46d8: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 46e8: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 46 n compromised. F 46f8: 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e ront calibration 4708: 20 70 6f 69 6e 74 73 20 6e 6f 74 20 72 65 61 63 points not reac 4718: 68 61 62 6c 65 2e 00 hable.. 0000471f : 471f: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 472f: 6e 20 66 61 69 6c 65 64 2e 20 52 69 67 68 74 20 n failed. Right 473f: 66 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f front calibratio 474f: 6e 20 70 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 n point not reac 475f: 68 61 62 6c 65 2e 00 hable.. 00004766 : 4766: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4776: 6e 20 66 61 69 6c 65 64 2e 20 46 72 6f 6e 74 20 n failed. Front 4786: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 4796: 74 73 20 6e 6f 74 20 72 65 61 63 68 61 62 6c 65 ts not reachable 47a6: 2e 00 .. 000047a8 : 47a8: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 47b8: 6e 20 66 61 69 6c 65 64 2e 20 50 6c 65 61 73 65 n failed. Please 47c8: 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 6d 61 6e consult the man 47d8: 75 61 6c 2e 00 ual.. 000047dd : 47dd: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 47ed: 6e 20 66 61 69 6c 65 64 2e 20 42 65 64 20 63 61 n failed. Bed ca 47fd: 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 libration point 480d: 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 was not found.. 0000481c : 481c: ff ff 50 6c 65 61 73 65 20 70 6c 61 63 65 20 73 ..Please place s 482c: 74 65 65 6c 20 73 68 65 65 74 20 6f 6e 20 68 65 teel sheet on he 483c: 61 74 62 65 64 2e 00 atbed.. 00004843 : 4843: ff ff 44 69 73 74 61 6e 63 65 20 62 65 74 77 65 ..Distance betwe 4853: 65 6e 20 74 69 70 20 6f 66 20 74 68 65 20 6e 6f en tip of the no 4863: 7a 7a 6c 65 20 61 6e 64 20 74 68 65 20 62 65 64 zzle and the bed 4873: 20 73 75 72 66 61 63 65 20 68 61 73 20 6e 6f 74 surface has not 4883: 20 62 65 65 6e 20 73 65 74 20 79 65 74 2e 20 50 been set yet. P 4893: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 48a3: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 48b3: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 48c3: 63 74 69 6f 6e 20 46 69 72 73 74 20 6c 61 79 65 ction First laye 48d3: 72 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 00 r calibration.. 000048e2 : 48e2: ff ff 50 6c 61 63 65 20 61 20 73 68 65 65 74 20 ..Place a sheet 48f2: 6f 66 20 70 61 70 65 72 20 75 6e 64 65 72 20 74 of paper under t 4902: 68 65 20 6e 6f 7a 7a 6c 65 20 64 75 72 69 6e 67 he nozzle during 4912: 20 74 68 65 20 63 61 6c 69 62 72 61 74 69 6f 6e the calibration 4922: 20 6f 66 20 66 69 72 73 74 20 34 20 70 6f 69 6e of first 4 poin 4932: 74 73 2e 20 49 66 20 74 68 65 20 6e 6f 7a 7a 6c ts. If the nozzl 4942: 65 20 63 61 74 63 68 65 73 20 74 68 65 20 70 61 e catches the pa 4952: 70 65 72 2c 20 70 6f 77 65 72 20 6f 66 66 20 74 per, power off t 4962: 68 65 20 70 72 69 6e 74 65 72 20 69 6d 6d 65 64 he printer immed 4972: 69 61 74 65 6c 79 2e 00 iately.. 0000497a : 497a: ff ff 53 65 61 72 63 68 69 6e 67 20 62 65 64 20 ..Searching bed 498a: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 499a: 74 00 t. 0000499c : 499c: ff ff 4d 65 61 73 75 72 69 6e 67 20 72 65 66 65 ..Measuring refe 49ac: 72 65 6e 63 65 20 68 65 69 67 68 74 20 6f 66 20 rence height of 49bc: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 49cc: 74 00 t. 000049ce : 49ce: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 74 ..Please clean t 49de: 68 65 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 63 61 he nozzle for ca 49ee: 6c 69 62 72 61 74 69 6f 6e 2e 20 43 6c 69 63 6b libration. Click 49fe: 20 77 68 65 6e 20 64 6f 6e 65 2e 00 when done.. 00004a0a : 4a0a: ff ff 41 75 74 6f 20 68 6f 6d 65 00 ..Auto home. 00004a16 : 4a16: ff ff 54 48 45 52 4d 41 4c 20 41 4e 4f 4d 41 4c ..THERMAL ANOMAL 4a26: 59 00 Y. 00004a28 : 4a28: ff ff 52 65 73 75 6d 69 6e 67 20 70 72 69 6e 74 ..Resuming print ... 00004a39 : 4a39: ff ff 50 49 4e 44 41 20 48 65 61 74 69 6e 67 00 ..PINDA Heating. 00004a49 : 4a49: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 20 64 6f ..Calibration do 4a59: 6e 65 00 ne. 00004a5c : 4a5c: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 00 ..Calibrating Z. 00004a6c : 4a6c: ff ff 42 65 64 20 64 6f 6e 65 00 ..Bed done. 00004a77 : 4a77: ff ff 42 65 64 20 48 65 61 74 69 6e 67 00 ..Bed Heating. 00004a85 : 4a85: ff ff 48 65 61 74 69 6e 67 20 64 6f 6e 65 2e 00 ..Heating done.. 00004a95 : 4a95: ff ff 48 65 61 74 69 6e 67 00 ..Heating. 00004a9f : 4a9f: ff ff 4d 4d 55 20 66 61 69 6c 73 00 ..MMU fails. 00004aab : 4aab: ff ff 4d 4d 55 20 6c 6f 61 64 20 66 61 69 6c 73 ..MMU load fails ... 00004abc : 4abc: ff ff 4d 4d 55 20 70 6f 77 65 72 20 66 61 69 6c ..MMU power fail 4acc: 73 00 s. 00004ace : 4ace: ff ff 4d 61 74 65 72 69 61 6c 20 63 68 61 6e 67 ..Material chang 4ade: 65 73 00 es. 00004ae1 : 4ae1: ff ff 54 6f 74 61 6c 20 66 61 69 6c 75 72 65 73 ..Total failures ... 00004af2 : 4af2: ff ff 4c 61 73 74 20 70 72 69 6e 74 20 66 61 69 ..Last print fai 4b02: 6c 75 72 65 73 00 lures. 00004b08 : 4b08: ff ff 50 6f 77 65 72 20 66 61 69 6c 75 72 65 73 ..Power failures ... 00004b19 : 4b19: ff ff 46 69 6c 2e 20 72 75 6e 6f 75 74 73 00 ..Fil. runouts. 00004b28 : 4b28: ff ff 43 72 61 73 68 00 ..Crash. 00004b30 : 4b30: ff ff 54 6f 74 61 6c 00 ..Total. 00004b38 : 4b38: ff ff 4c 61 73 74 20 70 72 69 6e 74 00 ..Last print. 00004b45 : 4b45: ff ff 41 6d 62 69 65 6e 74 00 ..Ambient. 00004b4f : 4b4f: ff ff 56 6f 6c 74 61 67 65 73 00 ..Voltages. 00004b5a : 4b5a: ff ff 54 65 6d 70 65 72 61 74 75 72 65 73 00 ..Temperatures. 00004b69 : 4b69: ff ff 42 65 6c 74 20 73 74 61 74 75 73 00 ..Belt status. 00004b77 : 4b77: ff ff 53 65 6e 73 6f 72 20 69 6e 66 6f 00 ..Sensor info. 00004b85 : 4b85: ff ff 45 78 74 72 75 64 65 72 20 69 6e 66 6f 00 ..Extruder info. 00004b95 : 4b95: ff ff 58 59 5a 20 63 61 6c 2e 20 64 65 74 61 69 ..XYZ cal. detai 4ba5: 6c 73 00 ls. 00004ba8 : 4ba8: ff ff 50 72 69 6e 74 65 72 20 49 50 20 41 64 64 ..Printer IP Add 4bb8: 72 3a 00 r:. 00004bbb : 4bbb: ff ff 75 6e 6b 6e 6f 77 6e 00 ..unknown. 00004bc5 : 4bc5: ff ff 4d 4d 55 20 63 6f 6e 6e 65 63 74 65 64 00 ..MMU connected. 00004bd5 : 4bd5: ff ff 44 61 74 65 3a 00 ..Date:. 00004bdd : 4bdd: ff ff 74 6f 20 75 6e 6c 6f 61 64 20 66 69 6c 61 ..to unload fila 4bed: 6d 65 6e 74 00 ment. 00004bf2 : 4bf2: ff ff 74 6f 20 6c 6f 61 64 20 66 69 6c 61 6d 65 ..to load filame 4c02: 6e 74 00 nt. 00004c05 : 4c05: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob ... 00004c16 : 4c16: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4c26: 63 75 74 00 cut. 00004c2a : 4c2a: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4c3a: 65 6a 65 63 74 00 eject. 00004c40 : 4c40: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4c50: 75 6e 6c 6f 61 64 00 unload. 00004c57 : 4c57: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4c67: 6c 6f 61 64 00 load. 00004c6c : 4c6c: ff ff 43 6f 6f 6c 64 6f 77 6e 00 ..Cooldown. 00004c77 : 4c77: ff ff 46 69 6c 61 6d 65 6e 74 20 65 78 74 72 75 ..Filament extru 4c87: 64 69 6e 67 20 26 20 77 69 74 68 20 63 6f 72 72 ding & with corr 4c97: 65 63 74 20 63 6f 6c 6f 72 3f 00 ect color?. 00004ca2 : 4ca2: ff ff 45 6a 65 63 74 00 ..Eject. 00004caa : 4caa: ff ff 41 75 74 6f 6c 6f 61 64 69 6e 67 20 66 69 ..Autoloading fi 4cba: 6c 61 6d 65 6e 74 20 69 73 20 61 63 74 69 76 65 lament is active 4cca: 2c 20 6a 75 73 74 20 70 72 65 73 73 20 74 68 65 , just press the 4cda: 20 6b 6e 6f 62 20 61 6e 64 20 69 6e 73 65 72 74 knob and insert 4cea: 20 66 69 6c 61 6d 65 6e 74 2e 2e 2e 00 filament.... 00004cf7 : 4cf7: ff ff 54 6f 74 61 6c 20 66 69 6c 61 6d 65 6e 74 ..Total filament ... 00004d08 : 4d08: ff ff 54 6f 74 61 6c 20 70 72 69 6e 74 20 74 69 ..Total print ti 4d18: 6d 65 00 me. 00004d1b : 4d1b: ff ff 46 69 6c 61 6d 65 6e 74 20 75 73 65 64 00 ..Filament used. 00004d2b : 4d2b: ff ff 50 72 69 6e 74 20 74 69 6d 65 00 ..Print time. 00004d38 : 4d38: ff ff 50 72 65 68 65 61 74 20 74 68 65 20 6e 6f ..Preheat the no 4d48: 7a 7a 6c 65 21 00 zzle!. 00004d4e : 4d4e: ff ff 45 52 52 4f 52 3a 00 ..ERROR:. 00004d57 : 4d57: ff ff 59 20 64 69 73 74 61 6e 63 65 20 66 72 6f ..Y distance fro 4d67: 6d 20 6d 69 6e 00 m min. 00004d6d : 4d6d: ff ff 4c 65 66 74 00 ..Left. 00004d74 : 4d74: ff ff 52 69 67 68 74 00 ..Right. 00004d7c : 4d7c: ff ff 4d 65 61 73 75 72 65 64 20 73 6b 65 77 00 ..Measured skew. 00004d8c : 4d8c: ff ff 53 6c 69 67 68 74 20 73 6b 65 77 00 ..Slight skew. 00004d9a : 4d9a: ff ff 53 65 76 65 72 65 20 73 6b 65 77 00 ..Severe skew. 00004da8 : 4da8: ff ff 5b 30 3b 30 5d 20 70 6f 69 6e 74 20 6f 66 ..[0;0] point of 4db8: 66 73 65 74 00 fset. 00004dbd : 4dbd: ff ff 41 64 6a 75 73 74 69 6e 67 20 5a 00 ..Adjusting Z. 00004dcb : 4dcb: ff ff 52 65 61 72 20 73 69 64 65 20 5b e4 6d 5d ..Rear side [.m] ... 00004ddc : 4ddc: ff ff 46 72 6f 6e 74 20 73 69 64 65 5b e4 6d 5d ..Front side[.m] ... 00004ded : 4ded: ff ff 52 69 67 68 74 20 73 69 64 65 5b e4 6d 5d ..Right side[.m] ... 00004dfe : 4dfe: ff ff 4c 65 66 74 20 73 69 64 65 20 5b e4 6d 5d ..Left side [.m] ... 00004e0f : 4e0f: ff ff 53 65 74 20 74 65 6d 70 65 72 61 74 75 72 ..Set temperatur 4e1f: 65 3a 00 e:. 00004e22 : 4e22: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4e32: 69 6f 6e 20 66 61 69 6c 65 64 00 ion failed. 00004e3d : 4e3d: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4e4d: 69 6f 6e 20 69 73 20 66 69 6e 69 73 68 65 64 20 ion is finished 4e5d: 61 6e 64 20 61 63 74 69 76 65 2e 20 49 74 20 63 and active. It c 4e6d: 61 6e 20 62 65 20 64 69 73 61 62 6c 65 64 20 69 an be disabled i 4e7d: 6e 20 6d 65 6e 75 20 53 65 74 74 69 6e 67 73 2d n menu Settings- 4e8d: 3e 50 49 4e 44 41 20 63 61 6c 2e 00 >PINDA cal.. 00004e99 : 4e99: ff ff 45 78 74 72 75 64 65 72 00 ..Extruder. 00004ea4 : 4ea4: ff ff 4d 6f 76 65 20 5a 00 ..Move Z. 00004ead : 4ead: ff ff 4d 6f 76 65 20 59 00 ..Move Y. 00004eb6 : 4eb6: ff ff 4d 6f 76 65 20 58 00 ..Move X. 00004ebf : 4ebf: ff ff 43 72 61 73 68 20 64 65 74 65 63 74 69 6f ..Crash detectio 4ecf: 6e 20 63 61 6e 0a 62 65 20 74 75 72 6e 65 64 20 n can.be turned 4edf: 6f 6e 20 6f 6e 6c 79 20 69 6e 0a 4e 6f 72 6d 61 on only in.Norma 4eef: 6c 20 6d 6f 64 65 00 l mode. 00004ef6 : 4ef6: ff ff 57 41 52 4e 49 4e 47 3a 0a 43 72 61 73 68 ..WARNING:.Crash 4f06: 20 64 65 74 65 63 74 69 6f 6e 0a 64 69 73 61 62 detection.disab 4f16: 6c 65 64 20 69 6e 0a 53 74 65 61 6c 74 68 20 6d led in.Stealth m 4f26: 6f 64 65 00 ode. 00004f2a : 4f2a: ff ff 4d 6f 64 65 20 63 68 61 6e 67 65 20 69 6e ..Mode change in 4f3a: 20 70 72 6f 67 72 65 73 73 2e 2e 2e 00 progress.... 00004f47 : 4f47: ff ff 43 6f 70 79 20 73 65 6c 65 63 74 65 64 20 ..Copy selected 4f57: 6c 61 6e 67 75 61 67 65 3f 00 language?. 00004f61 : 4f61: ff ff 43 6f 6d 6d 75 6e 69 74 79 20 6d 61 64 65 ..Community made ... 00004f72 : 4f72: ff ff 53 68 65 65 74 20 25 2e 37 73 0a 5a 20 6f ..Sheet %.7s.Z o 4f82: 66 66 73 65 74 3a 20 25 2b 31 2e 33 66 6d 6d 0a ffset: %+1.3fmm. 4f92: 25 63 43 6f 6e 74 69 6e 75 65 0a 25 63 52 65 73 %cContinue.%cRes 4fa2: 65 74 00 et. 00004fa5 : 4fa5: ff ff 50 6c 65 61 73 65 20 6c 6f 61 64 20 66 69 ..Please load fi 4fb5: 6c 61 6d 65 6e 74 20 66 69 72 73 74 2e 00 lament first.. 00004fc3 : 4fc3: ff ff 3e 43 61 6e 63 65 6c 00 ..>Cancel. 00004fcd : 4fcd: ff ff 52 75 6e 6e 69 6e 67 20 57 69 7a 61 72 64 ..Running Wizard 4fdd: 20 77 69 6c 6c 20 64 65 6c 65 74 65 20 63 75 72 will delete cur 4fed: 72 65 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e rent calibration 4ffd: 20 72 65 73 75 6c 74 73 20 61 6e 64 20 73 74 61 results and sta 500d: 72 74 20 66 72 6f 6d 20 74 68 65 20 62 65 67 69 rt from the begi 501d: 6e 6e 69 6e 67 2e 20 43 6f 6e 74 69 6e 75 65 3f nning. Continue? ... 0000502e : 502e: ff ff 50 72 65 68 65 61 74 69 6e 67 20 6e 6f 7a ..Preheating noz 503e: 7a 6c 65 2e 20 50 6c 65 61 73 65 20 77 61 69 74 zle. Please wait 504e: 2e 00 .. 00005050 : 5050: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 5060: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 5070: 65 20 65 78 74 72 75 64 65 72 2c 20 74 68 65 6e e extruder, then 5080: 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 press the knob 5090: 74 6f 20 6c 6f 61 64 20 69 74 2e 00 to load it.. 0000509c : 509c: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 50ac: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 50bc: 65 20 66 69 72 73 74 20 74 75 62 65 20 6f 66 20 e first tube of 50cc: 74 68 65 20 4d 4d 55 2c 20 74 68 65 6e 20 70 72 the MMU, then pr 50dc: 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 74 6f 20 ess the knob to 50ec: 6c 6f 61 64 20 69 74 2e 00 load it.. 000050f5 : 50f5: ff ff 54 68 65 20 70 72 69 6e 74 65 72 20 77 69 ..The printer wi 5105: 6c 6c 20 73 74 61 72 74 20 70 72 69 6e 74 69 6e ll start printin 5115: 67 20 61 20 7a 69 67 2d 7a 61 67 20 6c 69 6e 65 g a zig-zag line 5125: 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f . Rotate the kno 5135: 62 20 75 6e 74 69 6c 20 79 6f 75 20 72 65 61 63 b until you reac 5145: 68 20 74 68 65 20 6f 70 74 69 6d 61 6c 20 68 65 h the optimal he 5155: 69 67 68 74 2e 20 43 68 65 63 6b 20 74 68 65 20 ight. Check the 5165: 70 69 63 74 75 72 65 73 20 69 6e 20 74 68 65 20 pictures in the 5175: 68 61 6e 64 62 6f 6f 6b 20 28 43 61 6c 69 62 72 handbook (Calibr 5185: 61 74 69 6f 6e 20 63 68 61 70 74 65 72 29 2e 00 ation chapter).. 00005195 : 5195: ff ff 53 65 6c 65 63 74 20 74 65 6d 70 65 72 61 ..Select tempera 51a5: 74 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 ture which match 51b5: 65 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c es your material 51c5: 2e 00 .. 000051c7 : 51c7: ff ff 53 65 6c 65 63 74 20 61 20 66 69 6c 61 6d ..Select a filam 51d7: 65 6e 74 20 66 6f 72 20 74 68 65 20 46 69 72 73 ent for the Firs 51e7: 74 20 4c 61 79 65 72 20 43 61 6c 69 62 72 61 74 t Layer Calibrat 51f7: 69 6f 6e 20 61 6e 64 20 73 65 6c 65 63 74 20 69 ion and select i 5207: 74 20 69 6e 20 74 68 65 20 6f 6e 2d 73 63 72 65 t in the on-scre 5217: 65 6e 20 6d 65 6e 75 2e 00 en menu.. 00005220 : 5220: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 63 61 6c ..Now I will cal 5230: 69 62 72 61 74 65 20 64 69 73 74 61 6e 63 65 20 ibrate distance 5240: 62 65 74 77 65 65 6e 20 74 69 70 20 6f 66 20 74 between tip of t 5250: 68 65 20 6e 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 he nozzle and he 5260: 61 74 62 65 64 20 73 75 72 66 61 63 65 2e 00 atbed surface.. 0000526f : 526f: ff ff 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 ..Z calibration 527f: 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 52 75 6e recommended. Run 528f: 20 69 74 20 6e 6f 77 3f 00 it now?. 00005298 : 5298: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 52a8: 73 74 65 65 6c 20 73 68 65 65 74 20 66 72 6f 6d steel sheet from 52b8: 20 68 65 61 74 62 65 64 2e 00 heatbed.. 000052c2 : 52c2: ff ff 49 73 20 73 74 65 65 6c 20 73 68 65 65 74 ..Is steel sheet 52d2: 20 6f 6e 20 68 65 61 74 62 65 64 3f 00 on heatbed?. 000052df : 52df: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 6f ..Please check o 52ef: 75 72 20 68 61 6e 64 62 6f 6f 6b 20 61 6e 64 20 ur handbook and 52ff: 66 69 78 20 74 68 65 20 70 72 6f 62 6c 65 6d 2e fix the problem. 530f: 20 54 68 65 6e 20 72 65 73 75 6d 65 20 74 68 65 Then resume the 531f: 20 57 69 7a 61 72 64 20 62 79 20 72 65 62 6f 6f Wizard by reboo 532f: 74 69 6e 67 20 74 68 65 20 70 72 69 6e 74 65 72 ting the printer 533f: 2e 00 .. 00005341 : 5341: ff ff 41 6c 6c 20 69 73 20 64 6f 6e 65 2e 20 48 ..All is done. H 5351: 61 70 70 79 20 70 72 69 6e 74 69 6e 67 21 00 appy printing!. 00005360 : 5360: ff ff 59 6f 75 20 63 61 6e 20 61 6c 77 61 79 73 ..You can always 5370: 20 72 65 73 75 6d 65 20 74 68 65 20 57 69 7a 61 resume the Wiza 5380: 72 64 20 66 72 6f 6d 20 43 61 6c 69 62 72 61 74 rd from Calibrat 5390: 69 6f 6e 20 2d 3e 20 57 69 7a 61 72 64 2e 00 ion -> Wizard.. 0000539f : 539f: ff ff 49 66 20 79 6f 75 20 68 61 76 65 20 61 64 ..If you have ad 53af: 64 69 74 69 6f 6e 61 6c 20 73 74 65 65 6c 20 73 ditional steel s 53bf: 68 65 65 74 73 2c 20 63 61 6c 69 62 72 61 74 65 heets, calibrate 53cf: 20 74 68 65 69 72 20 70 72 65 73 65 74 73 20 69 their presets i 53df: 6e 20 53 65 74 74 69 6e 67 73 20 2d 20 48 57 20 n Settings - HW 53ef: 53 65 74 75 70 20 2d 20 53 74 65 65 6c 20 73 68 Setup - Steel sh 53ff: 65 65 74 73 2e 00 eets.. 00005405 : 5405: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 68 ..Please clean h 5415: 65 61 74 62 65 64 20 61 6e 64 20 74 68 65 6e 20 eatbed and then 5425: 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 2e 00 press the knob.. 00005435 : 5435: ff ff 44 6f 20 79 6f 75 20 77 61 6e 74 20 74 6f ..Do you want to 5445: 20 72 65 70 65 61 74 20 6c 61 73 74 20 73 74 65 repeat last ste 5455: 70 20 74 6f 20 72 65 61 64 6a 75 73 74 20 64 69 p to readjust di 5465: 73 74 61 6e 63 65 20 62 65 74 77 65 65 6e 20 6e stance between n 5475: 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 61 74 62 65 ozzle and heatbe 5485: 64 3f 00 d?. 00005488 : 5488: ff ff 53 65 6c 65 63 74 20 6e 6f 7a 7a 6c 65 20 ..Select nozzle 5498: 70 72 65 68 65 61 74 20 74 65 6d 70 65 72 61 74 preheat temperat 54a8: 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 65 ure which matche 54b8: 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c 2e s your material. ... 000054c9 : 54c9: ff ff 49 73 20 66 69 6c 61 6d 65 6e 74 20 6c 6f ..Is filament lo 54d9: 61 64 65 64 3f 00 aded?. 000054df : 54df: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 54ef: 63 61 6c 2e 20 74 61 6b 65 73 20 61 70 70 72 6f cal. takes appro 54ff: 78 2e 20 31 32 20 6d 69 6e 73 2e 20 53 65 65 0a x. 12 mins. See. 550f: 70 72 75 73 61 2e 69 6f 2f 74 6d 2d 63 61 6c 00 prusa.io/tm-cal. 0000551f : 551f: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 70 72 65 ..Now I will pre 552f: 68 65 61 74 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 heat nozzle for 553f: 50 4c 41 2e 00 PLA.. 00005544 : 5544: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 7a 20 63 ..I will run z c 5554: 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 2e 00 alibration now.. 00005564 : 5564: ff ff 4e 6f 77 20 72 65 6d 6f 76 65 20 74 68 65 ..Now remove the 5574: 20 74 65 73 74 20 70 72 69 6e 74 20 66 72 6f 6d test print from 5584: 20 73 74 65 65 6c 20 73 68 65 65 74 2e 00 steel sheet.. 00005592 : 5592: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 55a2: 73 68 69 70 70 69 6e 67 20 68 65 6c 70 65 72 73 shipping helpers 55b2: 20 66 69 72 73 74 2e 00 first.. 000055ba : 55ba: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 78 79 7a ..I will run xyz 55ca: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 calibration now 55da: 2e 20 49 74 20 77 69 6c 6c 20 74 61 6b 65 20 75 . It will take u 55ea: 70 20 74 6f 20 32 34 20 6d 69 6e 73 2e 00 p to 24 mins.. 000055f8 : 55f8: ff ff 46 69 72 73 74 2c 20 49 20 77 69 6c 6c 20 ..First, I will 5608: 72 75 6e 20 74 68 65 20 73 65 6c 66 74 65 73 74 run the selftest 5618: 20 74 6f 20 63 68 65 63 6b 20 6d 6f 73 74 20 63 to check most c 5628: 6f 6d 6d 6f 6e 20 61 73 73 65 6d 62 6c 79 20 70 ommon assembly p 5638: 72 6f 62 6c 65 6d 73 2e 00 roblems.. 00005641 : 5641: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 5651: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 5661: 33 20 70 72 69 6e 74 65 72 2e 20 57 6f 75 6c 64 3 printer. Would 5671: 20 79 6f 75 20 6c 69 6b 65 20 6d 65 20 74 6f 20 you like me to 5681: 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f 75 67 guide you throug 5691: 68 20 74 68 65 20 73 65 74 75 70 20 70 72 6f 63 h the setup proc 56a1: 65 73 73 3f 00 ess?. 000056a6 : 56a6: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 56b6: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 56c6: 33 20 70 72 69 6e 74 65 72 2e 20 49 20 77 69 6c 3 printer. I wil 56d6: 6c 20 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f l guide you thro 56e6: 75 67 68 20 61 20 73 68 6f 72 74 20 73 65 74 75 ugh a short setu 56f6: 70 20 70 72 6f 63 65 73 73 2c 20 69 6e 20 77 68 p process, in wh 5706: 69 63 68 20 74 68 65 20 5a 2d 61 78 69 73 20 77 ich the Z-axis w 5716: 69 6c 6c 20 62 65 20 63 61 6c 69 62 72 61 74 65 ill be calibrate 5726: 64 2e 20 54 68 65 6e 2c 20 79 6f 75 20 77 69 6c d. Then, you wil 5736: 6c 20 62 65 20 72 65 61 64 79 20 74 6f 20 70 72 l be ready to pr 5746: 69 6e 74 2e 00 int.. 0000574b : 574b: ff ff 45 2d 63 6f 72 72 65 63 74 00 ..E-correct. 00005757 : 5757: ff ff 5a 2d 63 6f 72 72 65 63 74 00 ..Z-correct. 00005763 : 5763: ff ff 59 2d 63 6f 72 72 65 63 74 00 ..Y-correct. 0000576f : 576f: ff ff 58 2d 63 6f 72 72 65 63 74 00 ..X-correct. 0000577b : 577b: ff ff 50 61 75 73 65 00 ..Pause. 00005783 : 5783: ff ff 46 53 20 41 63 74 69 6f 6e 00 ..FS Action. 0000578f : 578f: ff ff 43 6f 6e 74 2e 00 ..Cont.. 00005797 : 5797: ff ff 46 2e 20 61 75 74 6f 6c 6f 61 64 00 ..F. autoload. 000057a5 : 57a5: ff ff 46 2e 20 72 75 6e 6f 75 74 00 ..F. runout. 000057b1 : 57b1: ff ff 4d 4d 55 20 4d 6f 64 65 00 ..MMU Mode. 000057bc : 57bc: ff ff 43 75 74 74 65 72 00 ..Cutter. 000057c5 : 57c5: ff ff 53 74 65 61 6c 74 68 00 ..Stealth. 000057cf : 57cf: ff ff 43 72 61 73 68 20 64 65 74 2e 00 ..Crash det.. 000057dc : 57dc: ff ff 46 61 6e 20 73 70 65 65 64 00 ..Fan speed. 000057e8 : 57e8: ff ff 42 65 64 00 ..Bed. 000057ee : 57ee: ff ff 46 61 6e 73 20 63 68 65 63 6b 00 ..Fans check. 000057fb : 57fb: ff ff 4d 6f 64 65 6c 00 ..Model. 00005803 : 5803: ff ff 4e 6f 7a 7a 6c 65 00 ..Nozzle. 0000580c : 580c: ff ff 43 68 65 63 6b 73 00 ..Checks. 00005815 : 5815: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 00 ..Nozzle change. 00005825 : 5825: ff ff 41 6c 70 68 61 62 65 74 00 ..Alphabet. 00005830 : 5830: ff ff 53 6f 72 74 00 ..Sort. 00005837 : 5837: ff ff 54 69 6d 65 00 ..Time. 0000583e : 583e: ff ff 4e 6f 72 6d 61 6c 00 ..Normal. 00005847 : 5847: ff ff 53 44 20 63 61 72 64 00 ..SD card. 00005851 : 5851: ff ff 53 65 6c 65 63 74 20 6c 61 6e 67 75 61 67 ..Select languag 5861: 65 00 e. 00005863 : 5863: ff ff 52 50 69 20 70 6f 72 74 00 ..RPi port. 0000586e : 586e: ff ff 4c 69 6e 2e 20 63 6f 72 72 65 63 74 69 6f ..Lin. correctio 587e: 6e 00 n. 00005880 : 5880: ff ff 48 57 20 53 65 74 75 70 00 ..HW Setup. 0000588b : 588b: ff ff 4c 6f 61 64 69 6e 67 20 54 65 73 74 00 ..Loading Test. 0000589a : 589a: ff ff 44 69 73 61 62 6c 65 20 73 74 65 70 70 65 ..Disable steppe 58aa: 72 73 00 rs. 000058ad : 58ad: ff ff 4d 6f 76 65 20 61 78 69 73 00 ..Move axis. 000058b9 : 58b9: ff ff 54 65 6d 70 65 72 61 74 75 72 65 00 ..Temperature. 000058c7 : 58c7: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 53 65 ..Feeding to FSe 58d7: 6e 73 6f 72 00 nsor. 000058dc : 58dc: ff ff 4d 6f 76 69 6e 67 20 73 65 6c 65 63 74 6f ..Moving selecto 58ec: 72 00 r. 000058ee : 58ee: ff ff 48 6f 6d 69 6e 67 00 ..Homing. 000058f7 : 58f7: ff ff 52 65 74 72 61 63 74 20 66 72 6f 6d 20 46 ..Retract from F 5907: 49 4e 44 41 00 INDA. 0000590c : 590c: ff ff 45 6a 65 63 74 69 6e 67 20 66 69 6c 61 6d ..Ejecting filam 591c: 65 6e 74 00 ent. 00005920 : 5920: ff ff 50 61 72 6b 69 6e 67 20 73 65 6c 65 63 74 ..Parking select 5930: 6f 72 00 or. 00005933 : 5933: ff ff 52 65 74 75 72 6e 69 6e 67 20 73 65 6c 65 ..Returning sele 5943: 63 74 6f 72 00 ctor. 00005948 : 5948: ff ff 50 65 72 66 6f 72 6d 69 6e 67 20 63 75 74 ..Performing cut ... 00005959 : 5959: ff ff 50 75 73 68 69 6e 67 20 66 69 6c 61 6d 65 ..Pushing filame 5969: 6e 74 00 nt. 0000596c : 596c: ff ff 50 72 65 70 61 72 69 6e 67 20 62 6c 61 64 ..Preparing blad 597c: 65 00 e. 0000597e : 597e: ff ff 53 65 6c 65 63 74 69 6e 67 20 66 69 6c 2e ..Selecting fil. 598e: 20 73 6c 6f 74 00 slot. 00005994 : 5994: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 ..Unloading fila 59a4: 6d 65 6e 74 00 ment. 000059a9 : 59a9: ff ff 45 52 52 20 54 4d 43 20 66 61 69 6c 65 64 ..ERR TMC failed ... 000059ba : 59ba: ff ff 45 52 52 20 48 65 6c 70 20 66 69 6c 61 6d ..ERR Help filam 59ca: 65 6e 74 00 ent. 000059ce : 59ce: ff ff 45 52 52 20 49 6e 74 65 72 6e 61 6c 00 ..ERR Internal. 000059dd : 59dd: ff ff 45 52 52 20 57 61 69 74 20 66 6f 72 20 55 ..ERR Wait for U 59ed: 73 65 72 00 ser. 000059f1 : 59f1: ff ff 46 69 6e 69 73 68 69 6e 67 20 6d 6f 76 65 ..Finishing move 5a01: 6d 65 6e 74 73 00 ments. 00005a07 : 5a07: ff ff 41 76 6f 69 64 69 6e 67 20 67 72 69 6e 64 ..Avoiding grind ... 00005a18 : 5a18: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 6e 6f 7a ..Feeding to noz 5a28: 7a 6c 65 00 zle. 00005a2c : 5a2c: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 65 78 74 ..Feeding to ext 5a3c: 72 75 64 65 72 00 ruder. 00005a42 : 5a42: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 49 4e ..Feeding to FIN 5a52: 44 41 00 DA. 00005a55 : 5a55: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 70 ..Unloading to p 5a65: 75 6c 6c 65 79 00 ulley. 00005a6b : 5a6b: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 46 ..Unloading to F 5a7b: 49 4e 44 41 00 INDA. 00005a80 : 5a80: ff ff 44 69 73 65 6e 67 61 67 69 6e 67 20 69 64 ..Disengaging id 5a90: 6c 65 72 00 ler. 00005a94 : 5a94: ff ff 45 6e 67 61 67 69 6e 67 20 69 64 6c 65 72 ..Engaging idler ... 00005aa5 : 5aa5: ff ff 4f 4b 00 ..OK. 00005aaa <_ZN4MMU2L23MSG_TITLE_UNKNOWN_ERRORE.lto_priv.545>: 5aaa: ff ff 55 4e 4b 4e 4f 57 4e 20 45 52 52 4f 52 00 ..UNKNOWN ERROR. 00005aba <_ZN4MMU2L25MSG_TITLE_FILAMENT_CHANGEE.lto_priv.544>: 5aba: ff ff 46 49 4c 41 4d 45 4e 54 20 43 48 41 4e 47 ..FILAMENT CHANG 5aca: 45 00 E. 00005acc <_ZN4MMU2L26MSG_TITLE_FILAMENT_EJECTEDE.lto_priv.543>: 5acc: ff ff 46 49 4c 41 4d 45 4e 54 20 45 4a 45 43 54 ..FILAMENT EJECT 5adc: 45 44 00 ED. 00005adf <_ZN4MMU2L25MSG_TITLE_UNLOAD_MANUALLYE.lto_priv.542>: 5adf: ff ff 55 4e 4c 4f 41 44 20 4d 41 4e 55 41 4c 4c ..UNLOAD MANUALL 5aef: 59 00 Y. 00005af1 <_ZN4MMU2L26MSG_TITLE_FW_RUNTIME_ERRORE.lto_priv.541>: 5af1: ff ff 46 57 20 52 55 4e 54 49 4d 45 20 45 52 52 ..FW RUNTIME ERR 5b01: 4f 52 00 OR. 00005b04 <_ZN4MMU2L26MSG_TITLE_FW_UPDATE_NEEDEDE.lto_priv.540>: 5b04: ff ff 4d 4d 55 20 46 57 20 55 50 44 41 54 45 20 ..MMU FW UPDATE 5b14: 4e 45 45 44 45 44 00 NEEDED. 00005b1b <_ZN4MMU2L20MSG_TITLE_QUEUE_FULLE.lto_priv.539>: 5b1b: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 00005b28 <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.538>: 5b28: ff ff 49 4e 56 41 4c 49 44 20 54 4f 4f 4c 00 ..INVALID TOOL. 00005b37 <_ZN4MMU2L33MSG_TITLE_FILAMENT_ALREADY_LOADEDE.lto_priv.537>: 5b37: ff ff 46 49 4c 2e 20 41 4c 52 45 41 44 59 20 4c ..FIL. ALREADY L 5b47: 4f 41 44 45 44 00 OADED. 00005b4d <_ZN4MMU2L29MSG_TITLE_COMMUNICATION_ERRORE.lto_priv.536>: 5b4d: ff ff 43 4f 4d 4d 55 4e 49 43 41 54 49 4f 4e 20 ..COMMUNICATION 5b5d: 45 52 52 4f 52 00 ERROR. 00005b63 <_ZN4MMU2L28MSG_TITLE_MMU_NOT_RESPONDINGE.lto_priv.535>: 5b63: ff ff 4d 4d 55 20 4e 4f 54 20 52 45 53 50 4f 4e ..MMU NOT RESPON 5b73: 44 49 4e 47 00 DING. 00005b78 <_ZN4MMU2L23MSG_TITLE_MMU_MCU_ERRORE.lto_priv.534>: 5b78: ff ff 4d 4d 55 20 4d 43 55 20 45 52 52 4f 52 00 ..MMU MCU ERROR. 00005b88 <_ZN4MMU2L25MSG_TITLE_SELFTEST_FAILEDE.lto_priv.533>: 5b88: ff ff 4d 4d 55 20 53 45 4c 46 54 45 53 54 20 46 ..MMU SELFTEST F 5b98: 41 49 4c 45 44 00 AILED. 00005b9e <_ZN4MMU2L28MSG_TITLE_TMC_DRIVER_SHORTEDE.lto_priv.532>: 5b9e: ff ff 54 4d 43 20 44 52 49 56 45 52 20 53 48 4f ..TMC DRIVER SHO 5bae: 52 54 45 44 00 RTED. 00005bb3 <_ZN4MMU2L32MSG_TITLE_TMC_UNDERVOLTAGE_ERRORE.lto_priv.531>: 5bb3: ff ff 54 4d 43 20 55 4e 44 45 52 56 4f 4c 54 41 ..TMC UNDERVOLTA 5bc3: 47 45 20 45 52 52 00 GE ERR. 00005bca <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_RESETE.lto_priv.530>: 5bca: ff ff 54 4d 43 20 44 52 49 56 45 52 20 52 45 53 ..TMC DRIVER RES 5bda: 45 54 00 ET. 00005bdd <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_ERRORE.lto_priv.529>: 5bdd: ff ff 54 4d 43 20 44 52 49 56 45 52 20 45 52 52 ..TMC DRIVER ERR 5bed: 4f 52 00 OR. 00005bf0 <_ZN4MMU2L28MSG_TITLE_TMC_OVERHEAT_ERRORE.lto_priv.528>: 5bf0: ff ff 54 4d 43 20 4f 56 45 52 48 45 41 54 20 45 ..TMC OVERHEAT E 5c00: 52 52 4f 52 00 RROR. 00005c05 <_ZN4MMU2L33MSG_TITLE_TMC_WARNING_TMC_TOO_HOTE.lto_priv.527>: 5c05: ff ff 57 41 52 4e 49 4e 47 20 54 4d 43 20 54 4f ..WARNING TMC TO 5c15: 4f 20 48 4f 54 00 O HOT. 00005c1b <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_MOVEE.lto_priv.526>: 5c1b: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 4d ..IDLER CANNOT M 5c2b: 4f 56 45 00 OVE. 00005c2f <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_HOMEE.lto_priv.525>: 5c2f: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 48 ..IDLER CANNOT H 5c3f: 4f 4d 45 00 OME. 00005c43 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_MOVEE.lto_priv.524>: 5c43: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5c53: 54 20 4d 4f 56 45 00 T MOVE. 00005c5a <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_HOMEE.lto_priv.523>: 5c5a: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5c6a: 54 20 48 4f 4d 45 00 T HOME. 00005c71 <_ZN4MMU2L33MSG_TITLE_LOAD_TO_EXTRUDER_FAILEDE.lto_priv.522>: 5c71: ff ff 4c 4f 41 44 20 54 4f 20 45 58 54 52 2e 20 ..LOAD TO EXTR. 5c81: 46 41 49 4c 45 44 00 FAILED. 00005c88 <_ZN4MMU2L23MSG_TITLE_INSPECT_FINDAE.lto_priv.521>: 5c88: ff ff 49 4e 53 50 45 43 54 20 46 49 4e 44 41 00 ..INSPECT FINDA. 00005c98 <_ZN4MMU2L27MSG_TITLE_FSENSOR_TOO_EARLYE.lto_priv.520>: 5c98: ff ff 46 53 45 4e 53 4f 52 20 54 4f 4f 20 45 41 ..FSENSOR TOO EA 5ca8: 52 4c 59 00 RLY. 00005cac <_ZN4MMU2L28MSG_TITLE_PULLEY_CANNOT_MOVEE.lto_priv.519>: 5cac: ff ff 50 55 4c 4c 45 59 20 43 41 4e 4e 4f 54 20 ..PULLEY CANNOT 5cbc: 4d 4f 56 45 00 MOVE. 00005cc1 <_ZN4MMU2L32MSG_TITLE_FSENSOR_FILAMENT_STUCKE.lto_priv.518>: 5cc1: ff ff 46 53 45 4e 53 4f 52 20 46 49 4c 2e 20 53 ..FSENSOR FIL. S 5cd1: 54 55 43 4b 00 TUCK. 00005cd6 <_ZN4MMU2L31MSG_TITLE_FSENSOR_DIDNT_TRIGGERE.lto_priv.517>: 5cd6: ff ff 46 53 45 4e 53 4f 52 20 44 49 44 4e 54 20 ..FSENSOR DIDNT 5ce6: 54 52 49 47 47 2e 00 TRIGG.. 00005ced <_ZN4MMU2L30MSG_TITLE_FINDA_FILAMENT_STUCKE.lto_priv.516>: 5ced: ff ff 46 49 4e 44 41 20 46 49 4c 41 4d 2e 20 53 ..FINDA FILAM. S 5cfd: 54 55 43 4b 00 TUCK. 00005d02 <_ZN4MMU2L29MSG_TITLE_FINDA_DIDNT_TRIGGERE.lto_priv.515>: 5d02: ff ff 46 49 4e 44 41 20 44 49 44 4e 54 20 54 52 ..FINDA DIDNT TR 5d12: 49 47 47 45 52 00 IGGER. 00005d18 : 5d18: ff ff 43 75 74 20 66 69 6c 61 6d 65 6e 74 00 ..Cut filament. 00005d27 : 5d27: ff ff 45 6a 65 63 74 20 66 72 6f 6d 20 4d 4d 55 ..Eject from MMU ... 00005d38 : 5d38: ff ff 4c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 ..Loading filame 5d48: 6e 74 00 nt. 00005d4b : 5d4b: ff ff 4d 4d 55 20 52 65 74 72 79 3a 20 52 65 73 ..MMU Retry: Res 5d5b: 74 6f 72 69 6e 67 20 74 65 6d 70 65 72 61 74 75 toring temperatu 5d6b: 72 65 2e 2e 2e 00 re.... 00005d71 : 5d71: ff ff 53 6f 72 74 69 6e 67 20 66 69 6c 65 73 00 ..Sorting files. 00005d81 : 5d81: ff ff 53 6f 6d 65 20 66 69 6c 65 73 20 77 69 6c ..Some files wil 5d91: 6c 20 6e 6f 74 20 62 65 20 73 6f 72 74 65 64 2e l not be sorted. 5da1: 20 4d 61 78 2e 20 4e 6f 2e 20 6f 66 20 66 69 6c Max. No. of fil 5db1: 65 73 20 69 6e 20 31 20 66 6f 6c 64 65 72 20 66 es in 1 folder f 5dc1: 6f 72 20 73 6f 72 74 69 6e 67 20 69 73 20 31 30 or sorting is 10 5dd1: 30 2e 00 0.. 00005dd4 : 5dd4: ff ff 75 6e 6b 6e 6f 77 6e 20 73 74 61 74 65 00 ..unknown state. 00005de4 : 5de4: ff ff 20 30 2e 34 20 6f 72 20 6e 65 77 65 72 00 .. 0.4 or newer. 00005df4 : 5df4: ff ff 20 30 2e 33 20 6f 72 20 6f 6c 64 65 72 00 .. 0.3 or older. 00005e04 : 5e04: ff ff 4f 66 66 00 ..Off. 00005e0a : 5e0a: ff ff 4f 6e 00 ..On. 00005e0f : 5e0f: ff ff 55 6e 65 78 70 65 63 74 65 64 20 65 72 72 ..Unexpected err 5e1f: 6f 72 20 6f 63 63 75 72 72 65 64 2e 00 or occurred.. 00005e2c : 5e2c: ff ff 4d 36 30 30 20 46 69 6c 61 6d 65 6e 74 20 ..M600 Filament 5e3c: 43 68 61 6e 67 65 2e 20 4c 6f 61 64 20 61 20 6e Change. Load a n 5e4c: 65 77 20 66 69 6c 61 6d 65 6e 74 20 6f 72 20 65 ew filament or e 5e5c: 6a 65 63 74 20 74 68 65 20 6f 6c 64 20 6f 6e 65 ject the old one 5e6c: 2e 00 .. 00005e6e : 5e6e: ff ff 52 65 6d 6f 76 65 20 74 68 65 20 65 6a 65 ..Remove the eje 5e7e: 63 74 65 64 20 66 69 6c 61 6d 65 6e 74 20 66 72 cted filament fr 5e8e: 6f 6d 20 74 68 65 20 66 72 6f 6e 74 20 6f 66 20 om the front of 5e9e: 74 68 65 20 4d 4d 55 2e 00 the MMU.. 00005ea7 : 5ea7: ff ff 46 69 6c 61 6d 65 6e 74 20 64 65 74 65 63 ..Filament detec 5eb7: 74 65 64 20 75 6e 65 78 70 65 63 74 65 64 6c 79 ted unexpectedly 5ec7: 2e 20 45 6e 73 75 72 65 20 6e 6f 20 66 69 6c 61 . Ensure no fila 5ed7: 6d 65 6e 74 20 69 73 20 6c 6f 61 64 65 64 2e 20 ment is loaded. 5ee7: 43 68 65 63 6b 20 74 68 65 20 73 65 6e 73 6f 72 Check the sensor 5ef7: 73 20 61 6e 64 20 77 69 72 69 6e 67 2e 00 s and wiring.. 00005f05 : 5f05: ff ff 49 6e 74 65 72 6e 61 6c 20 72 75 6e 74 69 ..Internal runti 5f15: 6d 65 20 65 72 72 6f 72 2e 20 54 72 79 20 72 65 me error. Try re 5f25: 73 65 74 74 69 6e 67 20 74 68 65 20 4d 4d 55 20 setting the MMU 5f35: 6f 72 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 or updating the 5f45: 66 69 72 6d 77 61 72 65 2e 00 firmware.. 00005f4f : 5f4f: ff ff 4d 4d 55 20 46 57 20 76 65 72 73 69 6f 6e ..MMU FW version 5f5f: 20 69 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 is incompatible 5f6f: 20 77 69 74 68 20 70 72 69 6e 74 65 72 20 46 57 with printer FW 5f7f: 2e 55 70 64 61 74 65 20 74 6f 20 76 65 72 73 69 .Update to versi 5f8f: 6f 6e 20 33 2e 30 2e 33 2e 00 on 3.0.3.. 00005f99 : 5f99: ff ff 4d 4d 55 20 46 69 72 6d 77 61 72 65 20 69 ..MMU Firmware i 5fa9: 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 2c 20 70 nternal error, p 5fb9: 6c 65 61 73 65 20 72 65 73 65 74 20 74 68 65 20 lease reset the 5fc9: 4d 4d 55 2e 00 MMU.. 00005fce : 5fce: ff ff 52 65 71 75 65 73 74 65 64 20 66 69 6c 61 ..Requested fila 5fde: 6d 65 6e 74 20 74 6f 6f 6c 20 69 73 20 6e 6f 74 ment tool is not 5fee: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 available on th 5ffe: 69 73 20 68 61 72 64 77 61 72 65 2e 20 43 68 65 is hardware. Che 600e: 63 6b 20 74 68 65 20 47 2d 63 6f 64 65 20 66 6f ck the G-code fo 601e: 72 20 74 6f 6f 6c 20 69 6e 64 65 78 20 6f 75 74 r tool index out 602e: 20 6f 66 20 72 61 6e 67 65 20 28 54 30 2d 54 34 of range (T0-T4 603e: 29 2e 00 ).. 00006041 : 6041: ff ff 43 61 6e 6e 6f 74 20 70 65 72 66 6f 72 6d ..Cannot perform 6051: 20 74 68 65 20 61 63 74 69 6f 6e 2c 20 66 69 6c the action, fil 6061: 61 6d 65 6e 74 20 69 73 20 61 6c 72 65 61 64 79 ament is already 6071: 20 6c 6f 61 64 65 64 2e 20 55 6e 6c 6f 61 64 20 loaded. Unload 6081: 69 74 20 66 69 72 73 74 2e 00 it first.. 0000608b : 608b: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 609b: 64 69 6e 67 20 63 6f 72 72 65 63 74 6c 79 2e 20 ding correctly. 60ab: 43 68 65 63 6b 20 74 68 65 20 77 69 72 69 6e 67 Check the wiring 60bb: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 6f 72 73 2e and connectors. ... 000060cc : 60cc: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 60dc: 64 69 6e 67 2e 20 43 68 65 63 6b 20 74 68 65 20 ding. Check the 60ec: 77 69 72 69 6e 67 20 61 6e 64 20 63 6f 6e 6e 65 wiring and conne 60fc: 63 74 6f 72 73 2e 00 ctors.. 00006103 : 6103: ff ff 4d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f ..More details o 6113: 6e 6c 69 6e 65 2e 00 nline.. 0000611a : 611a: ff ff 54 68 65 20 49 64 6c 65 72 20 63 61 6e 6e ..The Idler cann 612a: 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 72 6c 79 ot home properly 613a: 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 6e 79 74 . Check for anyt 614a: 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 20 69 74 hing blocking it 615a: 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 s movement.. 00006166 : 6166: ff ff 43 61 6e 27 74 20 6d 6f 76 65 20 53 65 6c ..Can't move Sel 6176: 65 63 74 6f 72 20 6f 72 20 49 64 6c 65 72 2e 00 ector or Idler.. 00006186 : 6186: ff ff 54 68 65 20 53 65 6c 65 63 74 6f 72 20 63 ..The Selector c 6196: 61 6e 6e 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 annot home prope 61a6: 72 6c 79 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 rly. Check for a 61b6: 6e 79 74 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 nything blocking 61c6: 20 69 74 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 its movement.. 000061d5 : 61d5: ff ff 4c 6f 61 64 69 6e 67 20 74 6f 20 65 78 74 ..Loading to ext 61e5: 72 75 64 65 72 20 66 61 69 6c 65 64 2e 20 49 6e ruder failed. In 61f5: 73 70 65 63 74 20 74 68 65 20 66 69 6c 61 6d 65 spect the filame 6205: 6e 74 20 74 69 70 20 73 68 61 70 65 2e 20 52 65 nt tip shape. Re 6215: 66 69 6e 65 20 74 68 65 20 73 65 6e 73 6f 72 20 fine the sensor 6225: 63 61 6c 69 62 72 61 74 69 6f 6e 2c 20 69 66 20 calibration, if 6235: 6e 65 65 64 65 64 2e 00 needed.. 0000623d : 623d: ff ff 53 65 6c 65 63 74 6f 72 20 63 61 6e 27 74 ..Selector can't 624d: 20 6d 6f 76 65 20 64 75 65 20 74 6f 20 46 49 4e move due to FIN 625d: 44 41 20 64 65 74 65 63 74 69 6e 67 20 61 20 66 DA detecting a f 626d: 69 6c 61 6d 65 6e 74 2e 20 4d 61 6b 65 20 73 75 ilament. Make su 627d: 72 65 20 6e 6f 20 66 69 6c 61 6d 65 6e 74 20 69 re no filament i 628d: 73 20 69 6e 20 53 65 6c 65 63 74 6f 72 20 61 6e s in Selector an 629d: 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 20 70 72 d FINDA works pr 62ad: 6f 70 65 72 6c 79 2e 00 operly.. 000062b5 : 62b5: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 62c5: 72 20 74 72 69 67 67 65 72 65 64 20 74 6f 6f 20 r triggered too 62d5: 65 61 72 6c 79 20 77 68 69 6c 65 20 6c 6f 61 64 early while load 62e5: 69 6e 67 20 74 6f 20 65 78 74 72 75 64 65 72 2e ing to extruder. 62f5: 20 43 68 65 63 6b 20 74 68 65 72 65 20 69 73 6e Check there isn 6305: 27 74 20 61 6e 79 74 68 69 6e 67 20 73 74 75 63 't anything stuc 6315: 6b 20 69 6e 20 50 54 46 45 20 74 75 62 65 2e 20 k in PTFE tube. 6325: 43 68 65 63 6b 20 74 68 61 74 20 73 65 6e 73 6f Check that senso 6335: 72 20 72 65 61 64 73 20 70 72 6f 70 65 72 6c 79 r reads properly 6345: 2e 00 .. 00006347 : 6347: ff ff 50 75 6c 6c 65 79 20 6d 6f 74 6f 72 20 73 ..Pulley motor s 6357: 74 61 6c 6c 65 64 2e 20 45 6e 73 75 72 65 20 74 talled. Ensure t 6367: 68 65 20 70 75 6c 6c 65 79 20 63 61 6e 20 6d 6f he pulley can mo 6377: 76 65 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 ve and check the 6387: 20 77 69 72 69 6e 67 2e 00 wiring.. 00006390 : 6390: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 63a0: 72 20 64 69 64 6e 27 74 20 73 77 69 74 63 68 20 r didn't switch 63b0: 6f 66 66 20 77 68 69 6c 65 20 75 6e 6c 6f 61 64 off while unload 63c0: 69 6e 67 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e ing filament. En 63d0: 73 75 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 sure filament ca 63e0: 6e 20 6d 6f 76 65 20 61 6e 64 20 74 68 65 20 73 n move and the s 63f0: 65 6e 73 6f 72 20 77 6f 72 6b 73 2e 00 ensor works.. 000063fd : 63fd: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 640d: 72 20 64 69 64 6e 27 74 20 74 72 69 67 67 65 72 r didn't trigger 641d: 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e 67 20 74 while loading t 642d: 68 65 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e 73 he filament. Ens 643d: 75 72 65 20 74 68 65 20 73 65 6e 73 6f 72 20 69 ure the sensor i 644d: 73 20 63 61 6c 69 62 72 61 74 65 64 20 61 6e 64 s calibrated and 645d: 20 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 72 65 the filament re 646d: 61 63 68 65 64 20 69 74 2e 00 ached it.. 00006477 : 6477: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 73 ..FINDA didn't s 6487: 77 69 74 63 68 20 6f 66 66 20 77 68 69 6c 65 20 witch off while 6497: 75 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 unloading filame 64a7: 6e 74 2e 20 54 72 79 20 75 6e 6c 6f 61 64 69 6e nt. Try unloadin 64b7: 67 20 6d 61 6e 75 61 6c 6c 79 2e 20 45 6e 73 75 g manually. Ensu 64c7: 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 6e 20 re filament can 64d7: 6d 6f 76 65 20 61 6e 64 20 46 49 4e 44 41 20 77 move and FINDA w 64e7: 6f 72 6b 73 2e 00 orks.. 000064ed : 64ed: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 74 ..FINDA didn't t 64fd: 72 69 67 67 65 72 20 77 68 69 6c 65 20 6c 6f 61 rigger while loa 650d: 64 69 6e 67 20 74 68 65 20 66 69 6c 61 6d 65 6e ding the filamen 651d: 74 2e 20 45 6e 73 75 72 65 20 74 68 65 20 66 69 t. Ensure the fi 652d: 6c 61 6d 65 6e 74 20 63 61 6e 20 6d 6f 76 65 20 lament can move 653d: 61 6e 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 2e and FINDA works. ... 0000654e : 654e: ff ff 44 69 73 61 62 6c 65 00 ..Disable. 00006558 : 6558: ff ff 53 74 6f 70 00 ..Stop. 0000655f : 655f: ff ff 4c 6f 61 64 00 ..Load. 00006566 : 6566: ff ff 55 6e 6c 6f 61 64 00 ..Unload. 0000656f : 656f: ff ff 52 65 73 65 74 4d 4d 55 00 ..ResetMMU. 0000657a : 657a: ff ff 52 65 74 72 79 00 ..Retry. 00006582 : 6582: ff ff 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 ..Bed leveling f 6592: 61 69 6c 65 64 2e 20 53 65 6e 73 6f 72 20 64 69 ailed. Sensor di 65a2: 64 6e 27 74 20 74 72 69 67 67 65 72 2e 20 44 65 dn't trigger. De 65b2: 62 72 69 73 20 6f 6e 20 6e 6f 7a 7a 6c 65 3f 20 bris on nozzle? 65c2: 57 61 69 74 69 6e 67 20 66 6f 72 20 72 65 73 65 Waiting for rese 65d2: 74 2e 00 t.. 000065d5 : 65d5: ff ff 53 65 6e 73 69 74 69 76 69 74 79 00 ..Sensitivity. 000065e3 : 65e3: ff ff 44 6f 6e 65 00 ..Done. 000065ea : 65ea: ff ff 52 65 63 6f 76 65 72 69 6e 67 20 70 72 69 ..Recovering pri 65fa: 6e 74 00 nt. 000065fd <__loc_pri_end>: 65fd: 65 6e ori r22, 0xE5 ; 229 65ff: 71 75 andi r23, 0x51 ; 81 6601: 65 69 ori r22, 0x95 ; 149 6603: 6e 67 ori r22, 0x7E ; 126 6605: 20 22 and r2, r16 ... 00006608 : 6608: 44 6f 6e 65 20 70 72 69 6e 74 69 6e 67 20 66 69 Done printing fi 6618: 6c 65 00 le. 0000661b : 661b: 4e 6f 20 4c 69 6e 65 20 4e 75 6d 62 65 72 20 77 No Line Number w 662b: 69 74 68 20 63 68 65 63 6b 73 75 6d 2c 20 4c 61 ith checksum, La 663b: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 00006645 : 6645: 4e 6f 20 43 68 65 63 6b 73 75 6d 20 77 69 74 68 No Checksum with 6655: 20 6c 69 6e 65 20 6e 75 6d 62 65 72 2c 20 4c 61 line number, La 6665: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 0000666f : 666f: 63 68 65 63 6b 73 75 6d 20 6d 69 73 6d 61 74 63 checksum mismatc 667f: 68 2c 20 4c 61 73 74 20 4c 69 6e 65 3a 20 00 h, Last Line: . 0000668e : 668e: 4c 69 6e 65 20 4e 75 6d 62 65 72 20 69 73 20 6e Line Number is n 669e: 6f 74 20 4c 61 73 74 20 4c 69 6e 65 20 4e 75 6d ot Last Line Num 66ae: 62 65 72 2b 31 2c 20 4c 61 73 74 20 4c 69 6e 65 ber+1, Last Line 66be: 3a 20 00 : . 000066c1 : 66c1: 25 6c 75 20 62 79 74 65 73 20 77 72 69 74 74 65 %lu bytes writte 66d1: 6e 20 74 6f 20 25 53 20 61 74 20 61 64 64 72 65 n to %S at addre 66e1: 73 73 20 30 78 25 30 34 6c 78 0a 00 ss 0x%04lx.. 000066ed : 66ed: 44 25 64 20 2d 20 52 65 61 64 2f 57 72 69 74 65 D%d - Read/Write 66fd: 20 25 53 0a 00 %S.. 00006702 <__c.2367>: 6702: 3f 3f 00 ??. 00006705 <__c.2365>: 6705: 52 6f 6d 61 6e 61 00 Romana. 0000670c <__c.2362>: 670c: 48 72 76 61 74 73 6b 69 00 Hrvatski. 00006715 <__c.2359>: 6715: 4d 61 67 79 61 72 00 Magyar. 0000671c <__c.2356>: 671c: 53 6c 6f 76 65 6e 63 69 6e 61 00 Slovencina. 00006727 <__c.2353>: 6727: 4e 6f 72 73 6b 00 Norsk. 0000672d <__c.2350>: 672d: 53 76 65 6e 73 6b 61 00 Svenska. 00006735 <__c.2347>: 6735: 4e 65 64 65 72 6c 61 6e 64 73 00 Nederlands. 00006740 <__c.2344>: 6740: 50 6f 6c 73 6b 69 00 Polski. 00006747 <__c.2341>: 6747: 49 74 61 6c 69 61 6e 6f 00 Italiano. 00006750 <__c.2338>: 6750: 46 72 61 6e 63 61 69 73 00 Francais. 00006759 <__c.2335>: 6759: 45 73 70 61 6e 6f 6c 00 Espanol. 00006761 <__c.2332>: 6761: 44 65 75 74 73 63 68 00 Deutsch. 00006769 <__c.2329>: 6769: 43 65 73 74 69 6e 61 00 Cestina. 00006771 <__c.2326>: 6771: 45 6e 67 6c 69 73 68 00 English. 00006779 : 6779: 20 43 6f 75 6e 74 20 58 3a 20 00 Count X: . 00006784 : 6784: 45 30 3a 25 64 20 52 50 4d 20 50 52 4e 31 3a 25 E0:%d RPM PRN1:% 6794: 64 20 52 50 4d 20 45 30 40 3a 25 75 20 50 52 4e d RPM E0@:%u PRN 67a4: 31 40 3a 25 75 0a 00 1@:%u.. 000067ab : 67ab: 52 65 73 65 6e 64 00 Resend. 000067b2 : 67b2: 25 53 3a 20 25 6c 64 0a 25 53 0a 00 %S: %ld.%S.. 000067be : 67be: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 69 66 69 63 //action:notific 67ce: 61 74 69 6f 6e 20 25 53 0a 00 ation %S.. 000067d8 : 67d8: 46 69 6c 61 6d 65 6e 74 20 72 75 6e 6f 75 74 20 Filament runout 67e8: 64 65 74 65 63 74 65 64 21 00 detected!. 000067f2 : 67f2: 50 72 69 6e 74 65 72 20 73 74 6f 70 70 65 64 20 Printer stopped 6802: 64 75 65 20 74 6f 20 65 72 72 6f 72 73 2e 20 53 due to errors. S 6812: 75 70 65 72 76 69 73 69 6f 6e 20 72 65 71 75 69 upervision requi 6822: 72 65 64 2e 00 red.. 00006827 : 6827: 64 75 6d 70 20 63 6c 65 61 72 65 64 0a 00 dump cleared.. 00006835 : 6835: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 6845: 65 0a 00 e.. 00006848 : 6848: 44 32 31 20 2d 20 72 65 61 64 20 63 72 61 73 68 D21 - read crash 6858: 20 64 75 6d 70 0a 00 dump.. 0000685f : 685f: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 686f: 65 0a 00 e.. 00006872 : 6872: 64 75 6d 70 20 63 6f 6d 70 6c 65 74 65 64 20 69 dump completed i 6882: 6e 20 25 6c 75 6d 73 0a 00 n %lums.. 0000688b : 688b: 58 46 4c 41 53 48 00 XFLASH. 00006892 : 6892: 45 45 50 52 4f 4d 00 EEPROM. 00006899 : 6899: 53 52 41 4d 00 SRAM. 0000689e : 689e: 44 2d 31 20 2d 20 45 6e 64 6c 65 73 73 20 6c 6f D-1 - Endless lo 68ae: 6f 70 0a 00 op.. 000068b2 : 68b2: 41 63 74 69 76 65 20 45 78 74 72 75 64 65 72 3a Active Extruder: 68c2: 20 30 00 0. 000068c5 : 68c5: 49 6e 76 61 6c 69 64 20 65 78 74 72 75 64 65 72 Invalid extruder ... 000068d6 : 68d6: 74 6d 63 32 31 33 30 5f 70 72 69 6e 74 5f 63 75 tmc2130_print_cu 68e6: 72 72 65 6e 74 73 28 29 0a 09 48 09 52 0a 58 09 rrents()..H.R.X. 68f6: 25 64 09 25 64 0a 59 09 25 64 09 25 64 0a 5a 09 %d.%d.Y.%d.%d.Z. 6906: 25 64 09 25 64 0a 45 09 25 64 09 25 64 0a 00 %d.%d.E.%d.%d.. 00006915 : 6915: 53 44 20 70 72 69 6e 74 69 6e 67 20 62 79 74 65 SD printing byte 6925: 20 00 . 00006927 : 6927: 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 3a Unknown command: 6937: 20 22 00 ". 0000693a <_ZZ16process_commandsvE3__c__67_>: 693a: 4d 32 30 30 20 49 6e 76 61 6c 69 64 20 65 78 74 M200 Invalid ext 694a: 72 75 64 65 72 20 00 ruder . 00006951 : 6951: 7a 5f 6d 61 78 3a 20 00 z_max: . 00006959 : 6959: 7a 5f 6d 69 6e 3a 20 00 z_min: . 00006961 <_ZZ16process_commandsvE3__c__66_>: 6961: 79 5f 6d 61 78 3a 20 00 y_max: . 00006969 <_ZZ16process_commandsvE3__c__65_>: 6969: 79 5f 6d 69 6e 3a 20 00 y_min: . 00006971 <_ZZ16process_commandsvE3__c__64_>: 6971: 78 5f 6d 61 78 3a 20 00 x_max: . 00006979 : 6979: 54 52 49 47 47 45 52 45 44 00 TRIGGERED. 00006983 : 6983: 6f 70 65 6e 00 open. 00006988 <_ZZ16process_commandsvE3__c__63_>: 6988: 78 5f 6d 69 6e 3a 20 00 x_min: . 00006990 <_ZZ16process_commandsvE3__c__62_>: 6990: 52 65 70 6f 72 74 69 6e 67 20 65 6e 64 73 74 6f Reporting endsto 69a0: 70 20 73 74 61 74 75 73 00 p status. 000069a9 : 69a9: 4d 31 31 32 20 63 61 6c 6c 65 64 2e 20 45 6d 65 M112 called. Eme 69b9: 72 67 65 6e 63 79 20 53 74 6f 70 2e 00 rgency Stop.. 000069c6 : 69c6: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 72 65 //action:uvlo_re 69d6: 63 6f 76 65 72 79 5f 72 65 61 64 79 00 covery_ready. 000069e3 : 69e3: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 61 75 //action:uvlo_au 69f3: 74 6f 5f 72 65 63 6f 76 65 72 79 5f 72 65 61 64 to_recovery_read 6a03: 79 00 y. 00006a05 <_ZZ16process_commandsvE3__c__45_>: 6a05: 53 49 4c 45 4e 54 00 SILENT. 00006a0c <_ZZ16process_commandsvE3__c__44_>: 6a0c: 4e 4f 52 4d 41 4c 00 NORMAL. 00006a13 <_ZZ16process_commandsvE3__c__43_>: 6a13: 25 53 20 4d 4f 44 45 3a 20 50 65 72 63 65 6e 74 %S MODE: Percent 6a23: 20 64 6f 6e 65 3a 20 25 68 68 64 3b 20 70 72 69 done: %hhd; pri 6a33: 6e 74 20 74 69 6d 65 20 72 65 6d 61 69 6e 69 6e nt time remainin 6a43: 67 20 69 6e 20 6d 69 6e 73 3a 20 25 64 3b 20 43 g in mins: %d; C 6a53: 68 61 6e 67 65 20 69 6e 20 6d 69 6e 73 3a 20 25 hange in mins: % 6a63: 64 0a 00 d.. 00006a66 <_ZZ16process_commandsvE3__c__42_>: 6a66: 50 72 69 6e 74 65 72 53 74 61 74 65 3a 20 25 64 PrinterState: %d 6a76: 0a 00 .. 00006a78 <_ZZ16process_commandsvE3__c__38_>: 6a78: 45 6e 64 20 66 69 6c 65 20 6c 69 73 74 00 End file list. 00006a86 <_ZZ16process_commandsvE3__c__37_>: 6a86: 42 65 67 69 6e 20 66 69 6c 65 20 6c 69 73 74 00 Begin file list. 00006a96 : 6a96: 55 6e 6b 6e 6f 77 6e 20 25 63 20 63 6f 64 65 3a Unknown %c code: 6aa6: 20 25 73 0a 00 %s.. 00006aab <_ZZ16process_commandsvE3__c__35_>: 6aab: 0a 50 49 4e 44 41 20 74 65 6d 70 65 72 61 74 75 .PINDA temperatu 6abb: 72 65 3a 20 25 2e 31 66 20 5a 20 73 68 69 66 74 re: %.1f Z shift 6acb: 20 28 6d 6d 29 3a 20 25 2e 33 66 00 (mm): %.3f. 00006ad7 <_ZZ16process_commandsvE3__c__34_>: 6ad7: 0a 53 74 65 70 3a 20 25 64 2f 36 0a 00 .Step: %d/6.. 00006ae4 <_ZZ16process_commandsvE3__c__33_>: 6ae4: 0a 53 74 65 70 3a 20 25 64 2f 36 20 28 73 6b 69 .Step: %d/6 (ski 6af4: 70 70 65 64 29 0a 50 49 4e 44 41 20 74 65 6d 70 pped).PINDA temp 6b04: 65 72 61 74 75 72 65 3a 20 25 64 20 5a 20 73 68 erature: %d Z sh 6b14: 69 66 74 20 28 6d 6d 29 3a 30 0a 00 ift (mm):0.. 00006b20 <_ZZ16process_commandsvE3__c__32_>: 6b20: 0a 5a 45 52 4f 3a 20 25 2e 33 66 0a 00 .ZERO: %.3f.. 00006b2d <_ZZ16process_commandsvE3__c__31_>: 6b2d: 73 74 61 72 74 20 74 65 6d 70 65 72 61 74 75 72 start temperatur 6b3d: 65 3a 20 25 2e 31 66 0a 00 e: %.1f.. 00006b46 <_ZZ16process_commandsvE3__c__28_>: 6b46: 25 64 20 20 25 2e 32 66 00 %d %.2f. 00006b4f <_ZZ16process_commandsvE3__c__27_>: 6b4f: 25 53 20 58 3a 20 25 2e 35 66 20 59 3a 20 25 2e %S X: %.5f Y: %. 6b5f: 35 66 20 5a 3a 20 25 2e 35 66 0a 00 5f Z: %.5f.. 00006b6b <_ZZ16process_commandsvE3__c__26_>: 6b6b: 53 6c 65 65 70 2e 2e 2e 00 Sleep.... 00006b74 <_ZZ16process_commandsvE3__c__10_>: 6b74: 45 30 3a 25 64 20 52 50 4d 0a 50 52 4e 30 3a 25 E0:%d RPM.PRN0:% 6b84: 64 20 52 50 4d 0a 00 d RPM.. 00006b8b : 6b8b: 4d 31 30 37 00 M107. 00006b90 : 6b90: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 63 61 Thermal Model ca 6ba0: 6c 2e 00 l.. 00006ba3 : 6ba3: 45 72 72 3a 50 52 49 4e 54 20 46 41 4e 20 45 52 Err:PRINT FAN ER 6bb3: 52 4f 52 00 ROR. 00006bb7 : 6bb7: 45 72 72 3a 48 4f 54 45 4e 44 20 46 41 4e 20 45 Err:HOTEND FAN E 6bc7: 52 52 4f 52 00 RROR. 00006bcc : 6bcc: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 64 //action:resumed ... 00006bdd : 6bdd: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 00 //action:resume. 00006bed : 6bed: 2f 2f 61 63 74 69 6f 6e 3a 72 65 61 64 79 00 //action:ready. 00006bfc : 6bfc: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 5f 72 65 61 //action:not_rea 6c0c: 64 79 00 dy. 00006c0f : 6c0f: 2f 2f 61 63 74 69 6f 6e 3a 63 61 6e 63 65 6c 00 //action:cancel. 00006c1f : 6c1f: 41 78 69 73 20 6c 65 6e 67 74 68 20 64 69 66 66 Axis length diff 6c2f: 65 72 65 6e 63 65 3a 25 2e 33 66 0a 00 erence:%.3f.. 00006c3c : 6c3c: 4d 65 61 73 75 72 65 64 20 61 78 69 73 20 6c 65 Measured axis le 6c4c: 6e 67 74 68 3a 25 2e 33 66 0a 00 ngth:%.3f.. 00006c57 : 6c57: 4f 4b 00 OK. 00006c5a : 6c5a: 4c 43 44 20 73 74 61 74 75 73 20 63 68 61 6e 67 LCD status chang 6c6a: 65 64 00 ed. 00006c6d <_ZZN10CardReader7releaseEvE3__c.lto_priv.553>: 6c6d: 53 44 20 63 61 72 64 20 72 65 6c 65 61 73 65 64 SD card released ... 00006c7e : 6c7e: 46 61 6b 65 20 73 65 72 69 61 6c 20 6e 75 6d 62 Fake serial numb 6c8e: 65 72 00 er. 00006c91 : 6c91: 45 2d 63 6f 6f 6c 20 6d 6f 64 65 00 E-cool mode. 00006c9d : 6c9d: 41 4c 54 46 41 4e 20 64 65 74 2e 00 ALTFAN det.. 00006ca9 : 6ca9: 2f 2f 61 63 74 69 6f 6e 3a 73 74 61 72 74 00 //action:start. 00006cb8 : 6cb8: 4d 38 34 00 M84. 00006cbc : 6cbc: 4d 37 30 32 00 M702. 00006cc1 : 6cc1: 4d 38 33 00 M83. 00006cc5 : 6cc5: 47 32 38 20 57 00 G28 W. 00006ccb : 6ccb: 4d 35 30 30 00 M500. 00006cd0 : 6cd0: 45 78 74 65 72 6e 61 6c 20 53 50 49 20 66 6c 61 External SPI fla 6ce0: 73 68 0a 58 46 4c 41 53 48 20 69 73 20 6e 6f 74 sh.XFLASH is not 6cf0: 20 72 65 73 2d 0a 70 6f 6e 64 69 6e 67 2e 20 4c res-.ponding. L 6d00: 61 6e 67 75 61 67 65 0a 73 77 69 74 63 68 20 75 anguage.switch u 6d10: 6e 61 76 61 69 6c 61 62 6c 65 2e 00 navailable.. 00006d1c : 6d1c: 58 46 4c 41 53 48 20 6e 6f 74 20 72 65 73 70 6f XFLASH not respo 6d2c: 6e 64 69 6e 67 2e 00 nding.. 00006d33 : 6d33: 46 57 20 63 72 61 73 68 20 64 65 74 65 63 74 65 FW crash detecte 6d43: 64 21 20 59 6f 75 20 63 61 6e 20 63 6f 6e 74 69 d! You can conti 6d53: 6e 75 65 20 70 72 69 6e 74 69 6e 67 2e 20 44 65 nue printing. De 6d63: 62 75 67 20 64 61 74 61 20 61 76 61 69 6c 61 62 bug data availab 6d73: 6c 65 20 66 6f 72 20 61 6e 61 6c 79 73 69 73 2e le for analysis. 6d83: 20 43 6f 6e 74 61 63 74 20 73 75 70 70 6f 72 74 Contact support 6d93: 20 74 6f 20 73 75 62 6d 69 74 20 64 65 74 61 69 to submit detai 6da3: 6c 73 2e 00 ls.. 00006da7 : 6da7: 2f 2f 61 63 74 69 6f 6e 3a 64 75 6d 70 5f 61 76 //action:dump_av 6db7: 61 69 6c 61 62 6c 65 00 ailable. 00006dbf <_ZZ5setupE3__c__14_>: 6dbf: 43 72 61 73 68 44 65 74 65 63 74 20 44 49 53 41 CrashDetect DISA 6dcf: 42 4c 45 44 00 BLED. 00006dd4 <_ZZ5setupE3__c__13_>: 6dd4: 43 72 61 73 68 44 65 74 65 63 74 20 45 4e 41 42 CrashDetect ENAB 6de4: 4c 45 44 21 00 LED!. 00006de9 <_ZZ5setupE3__c__10_>: 6de9: 48 6f 74 65 6e 64 20 66 61 6e 20 74 79 70 65 3a Hotend fan type: 6df9: 20 00 . 00006dfb : 6dfb: 20 20 50 6c 61 6e 6e 65 72 42 75 66 66 65 72 42 PlannerBufferB 6e0b: 79 74 65 73 3a 20 00 ytes: . 00006e12 : 6e12: 20 46 72 65 65 20 4d 65 6d 6f 72 79 3a 20 00 Free Memory: . 00006e21 : 6e21: 20 7c 20 41 75 74 68 6f 72 3a 20 00 | Author: . 00006e2d : 6e2d: 20 4c 61 73 74 20 55 70 64 61 74 65 64 3a 20 00 Last Updated: . 00006e3d : 6e3d: 20 53 6f 66 74 77 61 72 65 20 52 65 73 65 74 00 Software Reset. 00006e4d : 6e4d: 20 57 61 74 63 68 64 6f 67 20 52 65 73 65 74 00 Watchdog Reset. 00006e5d : 6e5d: 20 42 72 6f 77 6e 20 6f 75 74 20 52 65 73 65 74 Brown out Reset ... 00006e6e : 6e6e: 20 45 78 74 65 72 6e 61 6c 20 52 65 73 65 74 00 External Reset. 00006e7e : 6e7e: 50 6f 77 65 72 55 70 00 PowerUp. 00006e86 : 6e86: 65 72 72 6f 72 20 77 72 69 74 69 6e 67 20 74 6f error writing to 6e96: 20 66 69 6c 65 00 file. 00006e9c : 6e9c: 44 6f 6e 65 20 73 61 76 69 6e 67 20 66 69 6c 65 Done saving file 6eac: 2e 00 .. 00006eae : 6eae: 6f 6b 00 ok. 00006eb1 : 6eb1: 46 69 6c 61 6d 65 6e 74 00 Filament. 00006eba : 6eba: 4d 65 61 73 75 72 65 64 20 73 6b 65 77 73 3a 20 Measured skews: 6eca: 25 66 20 25 66 0a 00 %f %f.. 00006ed1 : 6ed1: 46 69 74 74 69 6e 67 20 66 61 69 6c 65 64 20 3d Fitting failed = 6ee1: 3e 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 > calibration fa 6ef1: 69 6c 65 64 2e 0a 00 iled... 00006ef8 : 6ef8: 43 61 6c 69 62 72 61 74 69 6f 6e 20 73 75 63 63 Calibration succ 6f08: 65 73 73 2e 0a 00 ess... 00006f0e : 6f0e: 41 6c 6c 20 34 20 63 61 6c 69 62 72 61 74 69 6f All 4 calibratio 6f1e: 6e 20 70 6f 69 6e 74 73 20 66 6f 75 6e 64 2e 0a n points found.. ... 00006f2f : 6f2f: 31 2f 34 00 1/4. 00006f33 : 6f33: 31 2f 34 00 1/4. 00006f37 : 6f37: 31 2f 39 00 1/9. 00006f3b : 6f3b: 54 4d 43 20 44 52 49 56 45 52 20 4f 56 45 52 54 TMC DRIVER OVERT 6f4b: 45 4d 50 00 EMP. 00006f4f : 6f4f: 48 6f 6c 64 20 63 75 72 72 65 6e 74 20 74 72 75 Hold current tru 6f5f: 6e 63 61 74 65 64 20 74 6f 20 52 75 6e 20 63 75 ncated to Run cu 6f6f: 72 72 65 6e 74 00 rrent. 00006f75 : 6f75: 25 63 25 33 64 2f 25 64 81 00 %c%3d/%d.. 00006f7f : 6f7f: 5a 25 36 2e 32 66 25 63 00 Z%6.2f%c. 00006f88 : 6f88: 5a 20 20 20 2d 2d 2d 20 00 Z --- . 00006f91 : 6f91: 86 25 33 64 25 25 00 .%3d%%. 00006f98 : 6f98: 2d 2d 2d 25 25 00 ---%%. 00006f9e : 6f9e: 25 33 64 25 25 00 %3d%%. 00006fa4 : 6fa4: 20 53 44 00 SD. 00006fa8 : 6fa8: 20 20 20 00 . 00006fac : 6fac: 20 48 4f 00 HO. 00006fb0 : 6fb0: 87 25 33 75 68 20 25 63 25 63 00 .%3uh %c%c. 00006fbb : 6fbb: 87 25 30 32 75 3a 25 30 32 75 25 63 25 63 00 .%02u:%02u%c%c. 00006fca : 6fca: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 64 00 //action:paused. 00006fda : 6fda: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 00 //action:pause. 00006fe9 <_ZZL16lcd_support_menuvE3__c__17_>: 6fe9: 44 75 6d 70 20 6d 65 6d 6f 72 79 00 Dump memory. 00006ff5 : 6ff5: 68 65 6c 70 2e 70 72 75 73 61 33 64 2e 63 6f 6d help.prusa3d.com ... 00007006 : 7006: 66 6f 72 75 6d 2e 70 72 75 73 61 33 64 2e 63 6f forum.prusa3d.co 7016: 6d 00 m. 00007018 : 7018: 70 72 75 73 61 33 64 2e 63 6f 6d 00 prusa3d.com. 00007024 : 7024: 4d 37 30 31 00 M701. 00007029 : 7029: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 7039: 0a 25 31 30 6c 64 64 20 25 30 32 64 68 20 25 30 .%10ldd %02dh %0 7049: 32 64 6d 00 2dm. 0000704d : 704d: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 705d: 0a 25 31 30 6c 64 68 20 25 30 32 64 6d 20 25 30 .%10ldh %02dm %0 706d: 32 64 73 00 2ds. 00007071 : 7071: 25 36 2e 32 66 6d 6d 00 %6.2fmm. 00007079 : 7079: 25 53 0a 25 53 0a 25 53 3a 0a 25 53 3a 00 %S.%S.%S:.%S:. 00007087 : 7087: 25 33 2e 32 66 81 00 %3.2f.. 0000708e : 708e: 25 2d 31 34 2e 31 34 53 3a 0a 25 53 0a 25 2d 31 %-14.14S:.%S.%-1 709e: 34 2e 31 34 53 3a 25 33 2e 32 66 81 0a 25 2d 31 4.14S:%3.2f..%-1 70ae: 34 2e 31 34 53 3a 25 33 2e 32 66 81 00 4.14S:%3.2f.. 000070bb : 70bb: 20 20 30 00 0. 000070bf : 70bf: 20 20 31 00 1. 000070c3 : 70c3: 46 49 4e 44 41 00 FINDA. 000070c9 : 70c9: 50 49 4e 44 41 00 PINDA. 000070cf : 70cf: 57 69 7a 61 72 64 20 65 6e 64 20 73 74 61 74 65 Wizard end state 70df: 3a 20 25 64 0a 00 : %d.. 000070e5 : 70e5: 53 70 6f 6f 6c 4a 6f 69 6e 00 SpoolJoin. 000070ef : 70ef: 46 69 72 6d 77 61 72 65 00 Firmware. 000070f8 : 70f8: 48 42 65 64 20 6f 6e 20 6c 6f 61 64 00 HBed on load. 00007105 : 7105: 46 6c 61 73 68 41 69 72 00 FlashAir. 0000710e : 710e: 50 72 75 73 61 20 4d 4b 33 53 2b 52 48 46 36 30 Prusa MK3S+RHF60 711e: 20 4f 4b 2e 00 OK.. 00007123 : 7123: 4d 36 30 30 00 M600. 00007128 : 7128: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 00007133 : 7133: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 00007143 : 7143: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 7153: 65 64 00 ed. 00007156 : 7156: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 00007163 : 7163: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 7173: 65 3a 20 00 e: . 00007177 : 7177: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 7187: 64 69 72 3a 20 00 dir: . 0000718d : 718d: 4d 32 34 00 M24. 00007191 : 7191: 4d 32 33 20 25 73 00 M23 %s. 00007198 : 7198: 31 2f 39 00 1/9. 0000719c : 719c: 88 00 .. 0000719e : 719e: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 71ae: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 000071bc : 71bc: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 71cc: 70 72 65 76 65 6e 74 65 64 00 prevented. 000071d6 : 71d6: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 000071e3 : 71e3: 50 4f 57 45 52 20 50 41 4e 49 43 20 44 45 54 45 POWER PANIC DETE 71f3: 43 54 45 44 00 CTED. 000071f8 : 71f8: 55 56 4c 4f 20 2d 20 65 6e 64 20 25 64 0a 00 UVLO - end %d.. 00007207 : 7207: 55 56 4c 4f 5f 54 49 4e 59 20 2d 20 65 6e 64 20 UVLO_TINY - end 7217: 25 64 0a 00 %d.. 0000721b : 721b: 77 6f 72 6c 64 20 63 6f 6f 72 64 69 6e 61 74 65 world coordinate 722b: 73 3a 20 28 25 2e 33 66 2c 20 25 2e 33 66 2c 20 s: (%.3f, %.3f, 723b: 25 2e 33 66 29 0a 00 %.3f).. 00007242 : 7242: 4d 32 32 30 20 53 25 64 00 M220 S%d. 0000724b : 724b: 44 6f 6e 65 20 72 65 61 64 69 6e 67 20 45 45 50 Done reading EEP 725b: 52 4f 4d 0a 00 ROM.. 00007260 : 7260: 54 65 6d 70 65 72 61 74 75 72 65 20 52 65 73 74 Temperature Rest 7270: 6f 72 65 64 0a 00 ored.. 00007276 : 7276: 47 31 20 45 25 2d 2e 33 66 20 46 32 37 30 30 00 G1 E%-.3f F2700. 00007286 <__noloc_end>: 7286: 08 4a sbci r16, 0xA8 ; 168 7288: d7 3b cpi r29, 0xB7 ; 183 728a: 3b ce rjmp .-906 ; 0x6f02 728c: 01 6e ori r16, 0xE1 ; 225 728e: 84 bc out 0x24, r8 ; 36 7290: bf fd .word 0xfdbf ; ???? 7292: c1 2f mov r28, r17 7294: 3d 6c ori r19, 0xCD ; 205 7296: 74 31 cpi r23, 0x14 ; 20 7298: 9a bd out 0x2a, r25 ; 42 729a: 56 83 std Z+6, r21 ; 0x06 729c: 3d da rcall .-2950 ; 0x6718 <__c.2359+0x3> 729e: 3d 00 .word 0x003d ; ???? 72a0: c7 7f andi r28, 0xF7 ; 247 72a2: 11 be out 0x31, r1 ; 49 72a4: d9 e4 ldi r29, 0x49 ; 73 72a6: bb 4c sbci r27, 0xCB ; 203 72a8: 3e 91 ld r19, -X 72aa: 6b aa std Y+51, r6 ; 0x33 72ac: aa be out 0x3a, r10 ; 58 72ae: 00 00 nop 72b0: 00 80 ld r0, Z 72b2: 3f 05 cpc r19, r15 72b4: a8 4c sbci r26, 0xC8 ; 200 72b6: cd b2 in r12, 0x1d ; 29 72b8: d4 4e sbci r29, 0xE4 ; 228 72ba: b9 38 cpi r27, 0x89 ; 137 72bc: 36 a9 ldd r19, Z+54 ; 0x36 72be: 02 0c add r0, r2 72c0: 50 b9 out 0x00, r21 ; 0 72c2: 91 86 std Z+9, r9 ; 0x09 72c4: 88 08 sbc r8, r8 72c6: 3c a6 std Y+44, r3 ; 0x2c 72c8: aa aa std Y+50, r10 ; 0x32 72ca: 2a be out 0x3a, r2 ; 58 72cc: 00 00 nop 72ce: 00 80 ld r0, Z 72d0: 3f 07 cpc r19, r31 72d2: 63 42 sbci r22, 0x23 ; 35 72d4: 36 b7 in r19, 0x36 ; 54 72d6: 9b d8 rcall .-3786 ; 0x640e 72d8: a7 1a sub r10, r23 72da: 39 68 ori r19, 0x89 ; 137 72dc: 56 18 sub r5, r6 72de: ae ba out 0x1e, r10 ; 30 72e0: ab 55 subi r26, 0x5B ; 91 72e2: 8c 1d adc r24, r12 72e4: 3c b7 in r19, 0x3c ; 60 72e6: cc 57 subi r28, 0x7C ; 124 72e8: 63 bd out 0x23, r22 ; 35 72ea: 6d ed ldi r22, 0xDD ; 221 72ec: fd 75 andi r31, 0x5D ; 93 72ee: 3e f6 brtc .-114 ; 0x727e 72f0: 17 72 andi r17, 0x27 ; 39 72f2: 31 bf out 0x31, r19 ; 49 72f4: 00 00 nop 72f6: 00 80 ld r0, Z 72f8: 3f 08 sbc r3, r15 72fa: 00 00 nop 72fc: 00 be out 0x30, r0 ; 48 72fe: 92 24 eor r9, r2 7300: 49 12 cpse r4, r25 7302: 3e ab std Y+54, r19 ; 0x36 7304: aa aa std Y+50, r10 ; 0x32 7306: 2a be out 0x3a, r2 ; 58 7308: cd cc rjmp .-1638 ; 0x6ca4 730a: cc 4c sbci r28, 0xCC ; 204 730c: 3e 00 .word 0x003e ; ???? 730e: 00 00 nop 7310: 80 be out 0x30, r8 ; 48 7312: ab aa std Y+51, r10 ; 0x33 7314: aa aa std Y+50, r10 ; 0x32 7316: 3e 00 .word 0x003e ; ???? 7318: 00 00 nop 731a: 00 bf out 0x30, r16 ; 48 731c: 00 00 nop 731e: 00 80 ld r0, Z 7320: 3f 00 .word 0x003f ; ???? 7322: 00 00 nop 7324: 00 00 nop 7326: 08 41 sbci r16, 0x18 ; 24 7328: 78 d3 rcall .+1776 ; 0x7a1a 732a: bb 43 sbci r27, 0x3B ; 59 732c: 87 d1 rcall .+782 ; 0x763c <__trampolines_start+0x2e8> 732e: 13 3d cpi r17, 0xD3 ; 211 7330: 19 0e add r1, r25 7332: 3c c3 rjmp .+1656 ; 0x79ac 7334: bd 42 sbci r27, 0x2D ; 45 7336: 82 ad ldd r24, Z+58 ; 0x3a 7338: 2b 3e cpi r18, 0xEB ; 235 733a: 68 ec ldi r22, 0xC8 ; 200 733c: 82 76 andi r24, 0x62 ; 98 733e: be d9 rcall .-3204 ; 0x66bc 7340: 8f e1 ldi r24, 0x1F ; 31 7342: a9 3e cpi r26, 0xE9 ; 233 7344: 4c 80 ldd r4, Y+4 ; 0x04 7346: ef ff .word 0xffef ; ???? 7348: be 01 movw r22, r28 734a: c4 ff sbrs r28, 4 734c: 7f 3f cpi r23, 0xFF ; 255 734e: 00 00 nop 7350: 00 00 nop ... 00007354 <__trampolines_start>: 7354: 0c 94 d3 ce jmp 0x19da6 ; 0x19da6 7358: 0d 94 12 2c jmp 0x25824 ; 0x25824 735c: 0d 94 63 0f jmp 0x21ec6 ; 0x21ec6 7360: 0d 94 1f 69 jmp 0x2d23e ; 0x2d23e 7364: 0d 94 8f 1d jmp 0x23b1e ; 0x23b1e 7368: 0d 94 e6 06 jmp 0x20dcc ; 0x20dcc 736c: 0d 94 0f 24 jmp 0x2481e ; 0x2481e 7370: 0d 94 f1 3d jmp 0x27be2 ; 0x27be2 7374: 0d 94 81 9f jmp 0x33f02 ; 0x33f02 7378: 0c 94 15 d8 jmp 0x1b02a ; 0x1b02a 737c: 0c 94 cb ce jmp 0x19d96 ; 0x19d96 7380: 0d 94 97 26 jmp 0x24d2e ; 0x24d2e 7384: 0d 94 28 0a jmp 0x21450 ; 0x21450 7388: 0c 94 da ce jmp 0x19db4 ; 0x19db4 738c: 0d 94 25 10 jmp 0x2204a ; 0x2204a 7390: 0c 94 1b d8 jmp 0x1b036 ; 0x1b036 7394: 0d 94 ea 9f jmp 0x33fd4 ; 0x33fd4 7398: 0c 94 bf 75 jmp 0xeb7e ; 0xeb7e <__vector_23+0xd0> 739c: 0d 94 e4 65 jmp 0x2cbc8 ; 0x2cbc8 73a0: 0d 94 1a 2c jmp 0x25834 ; 0x25834 73a4: 0d 94 f8 9f jmp 0x33ff0 ; 0x33ff0 73a8: 0c 94 35 df jmp 0x1be6a ; 0x1be6a 73ac: 0d 94 71 14 jmp 0x228e2 ; 0x228e2 73b0: 0c 94 42 d3 jmp 0x1a684 ; 0x1a684 () [clone .lto_priv.448]> 73b4: 0d 94 45 23 jmp 0x2468a ; 0x2468a 73b8: 0d 94 9f 36 jmp 0x26d3e ; 0x26d3e 73bc: 0d 94 0a 11 jmp 0x22214 ; 0x22214 73c0: 0d 94 0b 2e jmp 0x25c16 ; 0x25c16 73c4: 0d 94 e3 06 jmp 0x20dc6 ; 0x20dc6 73c8: 0d 94 25 66 jmp 0x2cc4a ; 0x2cc4a 73cc: 0d 94 ec 06 jmp 0x20dd8 ; 0x20dd8 73d0: 0c 94 fd de jmp 0x1bdfa ; 0x1bdfa 73d4: 0c 94 93 d6 jmp 0x1ad26 ; 0x1ad26 73d8: 0d 94 73 68 jmp 0x2d0e6 ; 0x2d0e6 73dc: 0c 94 11 df jmp 0x1be22 ; 0x1be22 73e0: 0c 94 ee d3 jmp 0x1a7dc ; 0x1a7dc 73e4: 0c 94 c8 75 jmp 0xeb90 ; 0xeb90 <__vector_23+0xe2> 73e8: 0d 94 a8 22 jmp 0x24550 ; 0x24550 73ec: 0d 94 0f 69 jmp 0x2d21e ; 0x2d21e 73f0: 0d 94 e4 0e jmp 0x21dc8 ; 0x21dc8 73f4: 0c 94 12 cf jmp 0x19e24 ; 0x19e24 73f8: 0d 94 64 2c jmp 0x258c8 ; 0x258c8 73fc: 0c 94 e4 e3 jmp 0x1c7c8 ; 0x1c7c8 7400: 0c 94 2e d3 jmp 0x1a65c ; 0x1a65c () [clone .lto_priv.452]> 7404: 0c 94 e1 d5 jmp 0x1abc2 ; 0x1abc2 7408: 0c 94 c9 d1 jmp 0x1a392 ; 0x1a392 740c: 0d 94 ee 25 jmp 0x24bdc ; 0x24bdc 7410: 0c 94 3f df jmp 0x1be7e ; 0x1be7e 7414: 0d 94 27 69 jmp 0x2d24e ; 0x2d24e 7418: 0d 94 fa 25 jmp 0x24bf4 ; 0x24bf4 741c: 0d 94 69 68 jmp 0x2d0d2 ; 0x2d0d2 7420: 0d 94 06 1c jmp 0x2380c ; 0x2380c 7424: 0d 94 6e 06 jmp 0x20cdc ; 0x20cdc 7428: 0d 94 35 29 jmp 0x2526a ; 0x2526a 742c: 0d 94 84 0c jmp 0x21908 ; 0x21908 7430: 0d 94 d8 68 jmp 0x2d1b0 ; 0x2d1b0 7434: 0c 94 eb 75 jmp 0xebd6 ; 0xebd6 <__vector_23+0x128> 7438: 0c 94 80 df jmp 0x1bf00 ; 0x1bf00 743c: 0d 94 f8 06 jmp 0x20df0 ; 0x20df0 7440: 0d 94 32 26 jmp 0x24c64 ; 0x24c64 7444: 0c 94 be d6 jmp 0x1ad7c ; 0x1ad7c 7448: 0d 94 13 07 jmp 0x20e26 ; 0x20e26 744c: 0d 94 77 1d jmp 0x23aee ; 0x23aee 7450: 0c 94 a2 ce jmp 0x19d44 ; 0x19d44 7454: 0d 94 03 24 jmp 0x24806 ; 0x24806 7458: 0d 94 2b 22 jmp 0x24456 ; 0x24456 745c: 0c 94 f2 ce jmp 0x19de4 ; 0x19de4 7460: 0c 94 a9 75 jmp 0xeb52 ; 0xeb52 <__vector_23+0xa4> 7464: 0d 94 16 3b jmp 0x2762c ; 0x2762c 7468: 0c 94 9b 75 jmp 0xeb36 ; 0xeb36 <__vector_23+0x88> 746c: 0c 94 58 df jmp 0x1beb0 ; 0x1beb0 7470: 0d 94 9e 26 jmp 0x24d3c ; 0x24d3c 7474: 0d 94 6b 0f jmp 0x21ed6 ; 0x21ed6 7478: 0d 94 41 2a jmp 0x25482 ; 0x25482 747c: 0c 94 cc d8 jmp 0x1b198 ; 0x1b198 7480: 0c 94 f8 de jmp 0x1bdf0 ; 0x1bdf0 7484: 0d 94 14 31 jmp 0x26228 ; 0x26228 7488: 0d 94 59 28 jmp 0x250b2 ; 0x250b2 748c: 0d 94 4c 26 jmp 0x24c98 ; 0x24c98 7490: 0d 94 89 26 jmp 0x24d12 ; 0x24d12 7494: 0c 94 e4 ce jmp 0x19dc8 ; 0x19dc8 7498: 0d 94 28 26 jmp 0x24c50 ; 0x24c50 749c: 0c 94 20 d2 jmp 0x1a440 ; 0x1a440 74a0: 0c 94 62 df jmp 0x1bec4 ; 0x1bec4 74a4: 0d 94 48 23 jmp 0x24690 ; 0x24690 74a8: 0d 94 f4 0d jmp 0x21be8 ; 0x21be8 74ac: 0c 94 ae cf jmp 0x19f5c ; 0x19f5c 74b0: 0c 94 ad d8 jmp 0x1b15a ; 0x1b15a 74b4: 0c 94 be d1 jmp 0x1a37c ; 0x1a37c 74b8: 0d 94 06 69 jmp 0x2d20c ; 0x2d20c 74bc: 0c 94 55 d3 jmp 0x1a6aa ; 0x1a6aa 74c0: 0c 94 47 d3 jmp 0x1a68e ; 0x1a68e () [clone .lto_priv.447]> 74c4: 0d 94 f3 9f jmp 0x33fe6 ; 0x33fe6 74c8: 0d 94 f4 54 jmp 0x2a9e8 ; 0x2a9e8 74cc: 0c 94 38 d3 jmp 0x1a670 ; 0x1a670 () [clone .lto_priv.450]> 74d0: 0d 94 25 14 jmp 0x2284a ; 0x2284a 74d4: 0c 94 76 df jmp 0x1beec ; 0x1beec 74d8: 0d 94 e9 06 jmp 0x20dd2 ; 0x20dd2 74dc: 0d 94 db 23 jmp 0x247b6 ; 0x247b6 74e0: 0d 94 07 07 jmp 0x20e0e ; 0x20e0e 74e4: 0c 94 9d d8 jmp 0x1b13a ; 0x1b13a 74e8: 0d 94 fb 66 jmp 0x2cdf6 ; 0x2cdf6 74ec: 0c 94 33 d3 jmp 0x1a666 ; 0x1a666 () [clone .lto_priv.451]> 74f0: 0c 94 f0 de jmp 0x1bde0 ; 0x1bde0 74f4: 0d 94 e3 9f jmp 0x33fc6 ; 0x33fc6 74f8: 0c 94 a8 cf jmp 0x19f50 ; 0x19f50 74fc: 0c 94 3d d3 jmp 0x1a67a ; 0x1a67a () [clone .lto_priv.449]> 7500: 0d 94 8f 22 jmp 0x2451e ; 0x2451e 7504: 0d 94 33 66 jmp 0x2cc66 ; 0x2cc66 7508: 0d 94 5f 26 jmp 0x24cbe ; 0x24cbe 750c: 0c 94 37 d7 jmp 0x1ae6e ; 0x1ae6e 7510: 0c 94 00 cf jmp 0x19e00 ; 0x19e00 7514: 0d 94 5b 05 jmp 0x20ab6 ; 0x20ab6 7518: 0d 94 d7 06 jmp 0x20dae ; 0x20dae 751c: 0d 94 70 2e jmp 0x25ce0 ; 0x25ce0 7520: 0c 94 0e d4 jmp 0x1a81c ; 0x1a81c 7524: 0d 94 0c 69 jmp 0x2d218 ; 0x2d218 7528: 0c 94 05 cf jmp 0x19e0a ; 0x19e0a 752c: 0d 94 d1 25 jmp 0x24ba2 ; 0x24ba2 7530: 0d 94 92 06 jmp 0x20d24 ; 0x20d24 7534: 0c 94 6c df jmp 0x1bed8 ; 0x1bed8 7538: 0d 94 c7 9f jmp 0x33f8e ; 0x33f8e 753c: 0d 94 c3 cf jmp 0x39f86 ; 0x39f86 <_menu_edit_P()> 7540: 0d 94 1f 2c jmp 0x2583e ; 0x2583e 7544: 0d 94 67 0f jmp 0x21ece ; 0x21ece 7548: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 754c: 0d 94 18 25 jmp 0x24a30 ; 0x24a30 7550: 0d 94 c0 3c jmp 0x27980 ; 0x27980 7554: 0c 94 47 d7 jmp 0x1ae8e ; 0x1ae8e 7558: 0d 94 05 25 jmp 0x24a0a ; 0x24a0a 755c: 0d 94 5f 0e jmp 0x21cbe ; 0x21cbe 7560: 0d 94 7e 0c jmp 0x218fc ; 0x218fc 7564: 0d 94 9d 58 jmp 0x2b13a ; 0x2b13a 7568: 0c 94 d8 d7 jmp 0x1afb0 ; 0x1afb0 756c: 0c 94 0a cf jmp 0x19e14 ; 0x19e14 7570: 0d 94 f0 65 jmp 0x2cbe0 ; 0x2cbe0 7574: 0d 94 ed 21 jmp 0x243da ; 0x243da 7578: 0d 94 94 65 jmp 0x2cb28 ; 0x2cb28 757c: 0d 94 ef 23 jmp 0x247de ; 0x247de 7580: 0c 94 51 d3 jmp 0x1a6a2 ; 0x1a6a2 () [clone .lto_priv.445]> 7584: 0d 94 3c 66 jmp 0x2cc78 ; 0x2cc78 7588: 0c 94 4c d3 jmp 0x1a698 ; 0x1a698 () [clone .lto_priv.446]> 758c: 0d 94 93 22 jmp 0x24526 ; 0x24526 7590: 0d 94 50 66 jmp 0x2cca0 ; 0x2cca0 7594: 0d 94 14 54 jmp 0x2a828 ; 0x2a828 7598: 0d 94 5f 0f jmp 0x21ebe ; 0x21ebe 759c: 0c 94 68 5d jmp 0xbad0 ; 0xbad0 75a0: 0d 94 85 99 jmp 0x3330a ; 0x3330a 75a4: 0d 94 84 29 jmp 0x25308 ; 0x25308 75a8: 0d 94 d1 24 jmp 0x249a2 ; 0x249a2 75ac: 0d 94 c7 99 jmp 0x3338e ; 0x3338e 75b0: 0d 94 70 68 jmp 0x2d0e0 ; 0x2d0e0 75b4: 0c 94 ea ce jmp 0x19dd4 ; 0x19dd4 75b8: 0d 94 f2 0a jmp 0x215e4 ; 0x215e4 75bc: 0c 94 0e cf jmp 0x19e1c ; 0x19e1c 75c0: 0d 94 37 69 jmp 0x2d26e ; 0x2d26e 75c4: 0d 94 c6 40 jmp 0x2818c ; 0x2818c 75c8: 0c 94 76 75 jmp 0xeaec ; 0xeaec <__vector_23+0x3e> 75cc: 0d 94 0a 6e jmp 0x2dc14 ; 0x2dc14 75d0: 0d 94 f9 40 jmp 0x281f2 ; 0x281f2 75d4: 0d 94 29 68 jmp 0x2d052 ; 0x2d052 75d8: 0d 94 9f 66 jmp 0x2cd3e ; 0x2cd3e 75dc: 0d 94 35 27 jmp 0x24e6a ; 0x24e6a 75e0: 0d 94 45 26 jmp 0x24c8a ; 0x24c8a 75e4: 0d 94 1e 6e jmp 0x2dc3c ; 0x2dc3c 75e8: 0d 94 2f 69 jmp 0x2d25e ; 0x2d25e 75ec: 0c 94 a5 d8 jmp 0x1b14a ; 0x1b14a 75f0: 0d 94 ca d1 jmp 0x3a394 ; 0x3a394 75f4: 0c 94 41 e6 jmp 0x1cc82 ; 0x1cc82 75f8: 0d 94 4b 2f jmp 0x25e96 ; 0x25e96 75fc: 0d 94 e7 99 jmp 0x333ce ; 0x333ce 7600: 0d 94 0a 66 jmp 0x2cc14 ; 0x2cc14 7604: 0c 94 c5 ce jmp 0x19d8a ; 0x19d8a 7608: 0d 94 ef 26 jmp 0x24dde ; 0x24dde 760c: 0c 94 23 df jmp 0x1be46 ; 0x1be46 7610: 0d 94 90 26 jmp 0x24d20 ; 0x24d20 7614: 0d 94 83 2b jmp 0x25706 ; 0x25706 7618: 0d 94 a6 27 jmp 0x24f4c ; 0x24f4c 761c: 0d 94 e6 9f jmp 0x33fcc ; 0x33fcc 7620: 0c 94 89 d6 jmp 0x1ad12 ; 0x1ad12 7624: 0d 94 1b 66 jmp 0x2cc36 ; 0x2cc36 7628: 0c 94 b5 d8 jmp 0x1b16a ; 0x1b16a 762c: 0d 94 e3 24 jmp 0x249c6 ; 0x249c6 7630: 0d 94 d2 3b jmp 0x277a4 ; 0x277a4 7634: 0d 94 97 23 jmp 0x2472e ; 0x2472e 7638: 0d 94 17 74 jmp 0x2e82e ; 0x2e82e 763c: 0d 94 67 44 jmp 0x288ce ; 0x288ce 7640: 0c 94 b2 d1 jmp 0x1a364 ; 0x1a364 7644: 0d 94 47 69 jmp 0x2d28e ; 0x2d28e 7648: 0c 94 1b df jmp 0x1be36 ; 0x1be36 764c: 0d 94 7b 6e jmp 0x2dcf6 ; 0x2dcf6 7650: 0c 94 e0 ce jmp 0x19dc0 ; 0x19dc0 7654: 0c 94 aa 65 jmp 0xcb54 ; 0xcb54 <_GLOBAL__sub_D_card> 7658: 0d 94 7d 40 jmp 0x280fa ; 0x280fa 765c: 0d 94 e4 99 jmp 0x333c8 ; 0x333c8 7660: 0d 94 7a 06 jmp 0x20cf4 ; 0x20cf4 7664: 0c 94 07 df jmp 0x1be0e ; 0x1be0e 7668: 0d 94 5b 0e jmp 0x21cb6 ; 0x21cb6 766c: 0d 94 c3 2e jmp 0x25d86 ; 0x25d86 7670: 0c 94 12 d8 jmp 0x1b024 ; 0x1b024 7674: 0d 94 65 15 jmp 0x22aca ; 0x22aca 7678: 0d 94 81 0f jmp 0x21f02 ; 0x21f02 767c: 0c 94 a3 cf jmp 0x19f46 ; 0x19f46 7680: 0d 94 41 68 jmp 0x2d082 ; 0x2d082 7684: 0c 94 17 d2 jmp 0x1a42e ; 0x1a42e 7688: 0d 94 4f 69 jmp 0x2d29e ; 0x2d29e 768c: 0c 94 6e 78 jmp 0xf0dc ; 0xf0dc 7690: 0c 94 5d d2 jmp 0x1a4ba ; 0x1a4ba 7694: 0c 94 ee ce jmp 0x19ddc ; 0x19ddc 7698: 0c 94 49 df jmp 0x1be92 ; 0x1be92 769c: 0c 94 06 cf jmp 0x19e0c ; 0x19e0c 76a0: 0d 94 11 14 jmp 0x22822 ; 0x22822 76a4: 0c 94 18 d8 jmp 0x1b030 ; 0x1b030 76a8: 0d 94 59 0f jmp 0x21eb2 ; 0x21eb2 76ac: 0d 94 f8 27 jmp 0x24ff0 ; 0x24ff0 76b0: 0c 94 8a df jmp 0x1bf14 ; 0x1bf14 76b4: 0c 94 27 d8 jmp 0x1b04e ; 0x1b04e 76b8: 0d 94 a5 26 jmp 0x24d4a ; 0x24d4a 76bc: 0d 94 bc 32 jmp 0x26578 ; 0x26578 76c0: 0c 94 2b df jmp 0x1be56 ; 0x1be56 76c4: 0d 94 3f 69 jmp 0x2d27e ; 0x2d27e 76c8: 0c 94 c1 d8 jmp 0x1b182 ; 0x1b182 76cc: 0d 94 a0 65 jmp 0x2cb40 ; 0x2cb40 76d0: 0c 94 d7 ce jmp 0x19dae ; 0x19dae 76d4: 0d 94 c7 24 jmp 0x2498e ; 0x2498e 76d8: 0d 94 f9 23 jmp 0x247f2 ; 0x247f2 76dc: 0c 94 fc ce jmp 0x19df8 ; 0x19df8 76e0: 0d 94 f9 2d jmp 0x25bf2 ; 0x25bf2 76e4: 0d 94 6a 40 jmp 0x280d4 ; 0x280d4 76e8: 0d 94 bd 24 jmp 0x2497a ; 0x2497a 76ec: 0d 94 26 41 jmp 0x2824c ; 0x2824c 76f0: 0c 94 56 79 jmp 0xf2ac ; 0xf2ac 76f4: 0d 94 04 07 jmp 0x20e08 ; 0x20e08 76f8: 0c 94 1e d8 jmp 0x1b03c ; 0x1b03c 76fc: 0c 94 db d8 jmp 0x1b1b6 ; 0x1b1b6 7700: 0d 94 04 1c jmp 0x23808 ; 0x23808 7704: 0d 94 d5 68 jmp 0x2d1aa ; 0x2d1aa 7708: 0c 94 fd 75 jmp 0xebfa ; 0xebfa <__vector_23+0x14c> 770c: 0d 94 59 22 jmp 0x244b2 ; 0x244b2 7710: 0c 94 90 75 jmp 0xeb20 ; 0xeb20 <__vector_23+0x72> 7714: 0d 94 a5 1c jmp 0x2394a ; 0x2394a 7718: 0d 94 dd 25 jmp 0x24bba ; 0x24bba 771c: 0d 94 ce 28 jmp 0x2519c ; 0x2519c 7720: 0d 94 0a 41 jmp 0x28214 ; 0x28214 7724: 0d 94 09 69 jmp 0x2d212 ; 0x2d212 7728: 0c 94 f8 ce jmp 0x19df0 ; 0x19df0 772c: 0d 94 d2 68 jmp 0x2d1a4 ; 0x2d1a4 7730: 0c 94 90 d1 jmp 0x1a320 ; 0x1a320 7734: 0d 94 ea 99 jmp 0x333d4 ; 0x333d4 7738: 0d 94 b3 24 jmp 0x24966 ; 0x24966 773c: 0d 94 66 68 jmp 0x2d0cc ; 0x2d0cc 7740: 0d 94 57 69 jmp 0x2d2ae ; 0x2d2ae 7744: 0d 94 92 3e jmp 0x27d24 ; 0x27d24 7748: 0d 94 a6 05 jmp 0x20b4c ; 0x20b4c 774c: 0d 94 e5 23 jmp 0x247ca ; 0x247ca 7750: 0d 94 21 66 jmp 0x2cc42 ; 0x2cc42 7754: 0d 94 1b 1c jmp 0x23836 ; 0x23836 7758: 0d 94 f2 35 jmp 0x26be4 ; 0x26be4 775c: 0d 94 1e 65 jmp 0x2ca3c ; 0x2ca3c 7760: 0d 94 6e 65 jmp 0x2cadc ; 0x2cadc 7764: 0c 94 84 d1 jmp 0x1a308 ; 0x1a308 7768: 0d 94 5f 69 jmp 0x2d2be ; 0x2d2be 776c: 0c 94 cf ce jmp 0x19d9e ; 0x19d9e 7770: 0d 94 ee 24 jmp 0x249dc ; 0x249dc 7774: 0c 94 28 72 jmp 0xe450 ; 0xe450 7778: 0c 94 0f d8 jmp 0x1b01e ; 0x1b01e 777c: 0d 94 17 69 jmp 0x2d22e ; 0x2d22e 7780: 0d 94 a6 68 jmp 0x2d14c ; 0x2d14c 7784: 0d 94 51 67 jmp 0x2cea2 ; 0x2cea2 7788: 0d 94 aa 65 jmp 0x2cb54 ; 0x2cb54 778c: 0d 94 02 2e jmp 0x25c04 ; 0x25c04 7790: 0d 94 6c 99 jmp 0x332d8 ; 0x332d8 7794: 0c 94 a3 d1 jmp 0x1a346 ; 0x1a346 00007798 <__trampolines_end>: 7798: 6e 61 ori r22, 0x1E ; 30 779a: 6e 00 .word 0x006e ; ???? 0000779c <__c.2228>: 779c: 69 6e 66 00 00 40 7a 10 f3 5a 00 a0 72 4e 18 09 inf..@z..Z..rN.. 77ac: 00 10 a5 d4 e8 00 00 e8 76 48 17 00 00 e4 0b 54 ........vH.....T 77bc: 02 00 00 ca 9a 3b 00 00 00 e1 f5 05 00 00 80 96 .....;.......... 77cc: 98 00 00 00 40 42 0f 00 00 00 a0 86 01 00 00 00 ....@B.......... 77dc: 10 27 00 00 00 00 e8 03 00 00 00 00 64 00 00 00 .'..........d... 77ec: 00 00 0a 00 00 00 00 00 01 00 00 00 00 00 2c 76 ..............,v 77fc: d8 88 dc 67 4f 08 23 df c1 df ae 59 e1 b1 b7 96 ...gO.#....Y.... 780c: e5 e3 e4 53 c6 3a e6 51 99 76 96 e8 e6 c2 84 26 ...S.:.Q.v.....& 781c: eb 89 8c 9b 62 ed 40 7c 6f fc ef bc 9c 9f 40 f2 ....b.@|o.....@. 782c: ba a5 6f a5 f4 90 05 5a 2a f7 5c 93 6b 6c f9 67 ..o....Z*.\.kl.g 783c: 6d c1 1b fc e0 e4 0d 47 fe f5 20 e6 b5 00 d0 ed m......G.. ..... 784c: 90 2e 03 00 94 35 77 05 00 80 84 1e 08 00 00 20 .....5w........ 785c: 4e 0a 00 00 00 c8 0c 33 33 33 33 0f 98 6e 12 83 N......3333..n.. 786c: 11 41 ef 8d 21 14 89 3b e6 55 16 cf fe e6 db 18 .A..!..;.U...... 787c: d1 84 4b 38 1b f7 7c 1d 90 1d a4 bb e4 24 20 32 ..K8..|......$ 2 788c: 84 72 5e 22 81 00 c9 f1 24 ec a1 e5 3d 27 .r^"....$...=' 0000789a : 789a: 22 00 ". 0000789c : ... 0000789d : 789d: 20 45 53 50 00 ESP. 000078a2 : 78a2: 20 4e 53 50 00 NSP. 000078a7 : 78a7: 20 4f 46 46 00 OFF. 000078ac : 78ac: 20 4f 4e 00 ON. 000078b0 : 78b0: 50 56 30 31 00 PV01. 000078b5 : 78b5: 20 5b 4d 50 5d 20 00 [MP] . 000078bc : 78bc: 25 69 20 68 6f 75 72 73 20 25 69 20 6d 69 6e 75 %i hours %i minu 78cc: 74 65 73 00 tes. 000078d0 : 78d0: 52 58 20 74 69 6d 65 6f 75 74 00 RX timeout. 000078db : 78db: 4d 33 31 30 00 M310. 000078e0 : 78e0: 4d 31 31 32 00 M112. 000078e5 : 78e5: 4d 31 31 30 00 M110. 000078ea : 78ea: 46 75 6c 6c 20 52 58 20 42 75 66 66 65 72 00 Full RX Buffer. 000078f9 : 78f9: 53 65 74 74 69 6e 67 73 20 53 74 6f 72 65 64 00 Settings Stored. 00007909 : 7909: 54 4d 3a 20 73 74 6f 72 65 64 20 63 61 6c 69 62 TM: stored calib 7919: 72 61 74 69 6f 6e 20 69 6e 76 61 6c 69 64 2c 20 ration invalid, 7929: 72 65 73 65 74 74 69 6e 67 00 resetting. 00007933 : 7933: 53 74 6f 72 65 64 20 73 65 74 74 69 6e 67 73 20 Stored settings 7943: 72 65 74 72 69 65 76 65 64 00 retrieved. 0000794d : 794d: 48 61 72 64 63 6f 64 65 64 20 44 65 66 61 75 6c Hardcoded Defaul 795d: 74 20 53 65 74 74 69 6e 67 73 20 4c 6f 61 64 65 t Settings Loade 796d: 64 00 d. 0000796f : 796f: 56 32 00 00 00 00 c8 42 00 00 c8 42 00 00 c8 43 V2.....B...B...C 797f: 00 00 8c 43 00 00 48 43 00 00 48 43 00 00 40 41 ...C..HC..HC..@A 798f: 00 00 f0 42 e8 03 00 00 e8 03 00 00 c8 00 00 00 ...B............ 799f: 88 13 00 00 00 40 9c 44 00 40 9c 44 00 00 00 00 .....@.D.@.D.... 79af: 00 00 00 00 20 4e 00 00 00 00 20 41 00 00 20 41 .... N.... A.. A 79bf: cd cc cc 3e 00 00 90 40 00 00 00 00 00 00 00 00 ...>...@........ 79cf: 00 00 00 00 cd cc cc 3e 00 00 70 41 07 45 f3 3e .......>..pA.E.> 79df: 01 60 ea 42 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 .`.B.B.B.Z4?Lb.E 79ef: 00 00 00 00 00 40 40 00 00 34 42 00 00 00 00 00 .....@@..4B..... 79ff: 00 00 00 00 00 00 41 00 00 00 e0 3f 00 00 c8 42 ......A....?...B 7a0f: 00 00 c8 42 00 00 40 41 00 00 f0 42 c0 03 00 00 ...B..@A...B.... 7a1f: c0 03 00 00 c8 00 00 00 88 13 00 00 10 10 10 20 ............... 7a2f: 00 40 9c 44 00 00 80 3f 00 00 00 3f 19 14 00 00 .@.D...?...?.... ... 00007a40 : 7a40: 43 75 73 74 6f 6d 00 Custom. 00007a47 : 7a47: 4e 79 6c 6f 6e 50 41 00 NylonPA. 00007a4f : 7a4f: 53 61 74 69 6e 20 20 00 Satin . 00007a57 : 7a57: 54 65 78 74 75 72 00 Textur. 00007a5e : 7a5e: 53 6d 6f 6f 74 68 00 Smooth. 00007a65 : 7a65: 48 6f 74 65 6e 64 20 66 61 6e 20 73 70 65 65 64 Hotend fan speed 7a75: 20 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 is lower than e 7a85: 78 70 65 63 74 65 64 00 xpected. 00007a8d : 7a8d: 50 72 69 6e 74 20 66 61 6e 20 73 70 65 65 64 20 Print fan speed 7a9d: 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 78 is lower than ex 7aad: 70 65 63 74 65 64 00 pected. 00007ab4 : 7ab4: 31 2e 30 00 1.0. 00007ab8 : 7ab8: 31 2e 35 00 1.5. 00007abc : 7abc: 55 4e 4b 4e 4f 57 4e 00 UNKNOWN. 00007ac4 : 7ac4: 4c 41 31 30 43 3a 20 4c 69 6e 65 61 72 20 41 64 LA10C: Linear Ad 7ad4: 76 61 6e 63 65 20 6d 6f 64 65 3a 20 00 vance mode: . 00007ae1 : 7ae1: 4c 41 31 30 43 3a 20 41 64 6a 75 73 74 65 64 20 LA10C: Adjusted 7af1: 45 2d 4a 65 72 6b 3a 20 00 E-Jerk: . 00007afa <_PRI_LANG_SIGNATURE>: 7afa: ff ff ff ff .... 00007afe : 7afe: 3e 0f a8 af 00 48 00 69 96 00 00 df 60 25 55 58 >....H.i....`%UX 7b0e: 87 68 04 27 f2 e0 00 5e 34 03 cc 19 60 f3 3c 0e .h.'...^4...`.<. 7b1e: f8 8f 00 db 08 02 94 92 00 3e 1c 07 9a 87 00 e5 .........>...... 7b2e: 24 00 85 28 52 7e 06 00 1b e4 00 7e 78 12 70 78 $..(R~.....~x.px 7b3e: 70 61 f8 12 78 8f 88 41 78 42 70 78 70 61 78 25 pa..x..AxBpxpax% 7b4e: 70 78 70 61 f8 50 78 8f 88 d1 f0 25 27 07 87 61 pxpa.Px....%'..a 7b5e: f0 25 27 8f 88 41 2c 0d 27 aa 50 d1 bc 07 07 87 .%'..A,.'.P..... 7b6e: 11 61 be 78 8f 88 11 41 78 52 70 78 70 61 f8 52 .a.x...AxRpxpa.R 7b7e: 78 8f 88 41 20 12 78 88 70 63 20 52 78 88 70 63 x..A .x.pc Rx.pc 7b8e: 48 52 78 88 87 43 03 11 17 99 70 64 18 12 78 f8 HRx..C....pd..x. 7b9e: 70 65 44 12 f8 f8 f0 45 18 42 78 f8 70 65 18 25 peD....E.Bx.pe.% 7bae: 78 f8 70 65 18 52 78 f8 70 65 18 50 78 f8 70 65 x.pe.Rx.pe.Px.pe 7bbe: 0c 07 8f 87 23 65 a2 0f 8f 8f 11 45 00 12 06 22 ....#e.....E..." 7bce: 70 69 00 12 07 22 27 49 00 25 06 22 70 69 00 25 pi..."'I.%."pi.% 7bde: 07 22 27 49 00 12 06 22 27 6c 02 62 36 a2 70 6c ."'I..."'l.b6.pl 7bee: 40 45 6c 44 70 4c 03 62 22 22 70 6c 43 88 88 88 @ElDpL.b""plC... 7bfe: f0 4c 78 12 bc 88 80 6e 78 52 bc 88 80 6e 38 12 .Lx....nxR...n8. 7c0e: 78 88 70 6f 78 12 78 88 87 4f 38 42 78 88 70 6f x.pox.x..O8Bx.po 7c1e: 38 25 78 88 70 6f 3a 00 79 ac 78 6f 3d 07 9a ac 8%x.po:.y.xo=... 7c2e: 78 6f 78 50 78 88 87 ef 39 49 78 88 70 6f 08 52 xoxPx...9Ix.po.R 7c3e: bc 88 80 72 98 52 f8 8f 98 52 20 12 78 70 f0 73 ...r.R...R .xp.s 7c4e: 48 12 78 63 87 53 20 52 78 70 f0 73 48 52 78 63 H.xc.S Rxp.sHRxc 7c5e: 87 53 10 07 87 0f 24 73 12 78 63 87 24 53 60 69 .S....$s.xc.$S`i 7c6e: 9a 98 8b e2 23 04 e4 44 30 74 10 4e 44 43 24 74 ....#..D0t.NDC$t 7c7e: 7c 12 88 89 60 75 3c 50 88 88 70 55 78 25 28 89 |...`u: 7cba: 00 40 14 54 .@.T 00007cbe : 7cbe: cd cc cc 3d 0a d7 23 3c 17 b7 d1 38 77 cc 2b 32 ...=..#<...8w.+2 7cce: 95 95 e6 24 1f b1 4f 0a ...$..O. 00007cd6 : 7cd6: 00 00 20 41 00 00 c8 42 00 40 1c 46 20 bc be 4c .. A...B.@.F ..L 7ce6: ca 1b 0e 5a ae c5 9d 74 ...Z...t 00007cee : 7cee: 4e 41 4e NAN 00007cf1 : 7cf1: 49 4e 46 INF 00007cf4 : 7cf4: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7d04: 20 69 6e 70 75 74 00 input. 00007d0b : 7d0b: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7d1b: 20 75 73 65 72 00 user. 00007d21 : 7d21: 62 75 73 79 3a 20 70 72 6f 63 65 73 73 69 6e 67 busy: processing ... 00007d32 : 7d32: 00 00 7f 43 00 80 54 43 00 00 52 43 ...C..TC..RC 00007d3e : 7d3e: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007d4a : 7d4a: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007d56 : 7d56: 00 00 a0 40 00 00 a0 40 00 00 00 40 ...@...@...@ 00007d62 : 7d62: 25 33 64 20 73 74 65 70 3d 25 32 64 20 6d 73 63 %3d step=%2d msc 7d72: 6e 74 3d 25 34 64 0a 00 nt=%4d.. 00007d7a : 7d7a: 00 00 7f 43 00 80 58 43 9a d9 51 43 ...C..XC..QC 00007d86 : 7d86: ff ff ff ... 00007d89 : 7d89: 20 41 3a 00 A:. 00007d8d : 7d8d: 20 50 3a 00 P:. 00007d91 : 7d91: 20 42 40 3a 00 B@:. 00007d96 : 7d96: 20 40 3a 00 @:. 00007d9a : 7d9a: 20 2f 00 /. 00007d9d : 7d9d: 20 54 30 3a 00 T0:. 00007da2 : 7da2: 20 2f 00 /. 00007da5 : 7da5: 20 42 3a 00 B:. 00007da9 : 7da9: 20 2f 00 /. 00007dac : 7dac: 54 3a 00 T:. 00007daf : 7daf: 25 53 45 78 63 65 73 73 69 76 65 20 62 65 64 20 %SExcessive bed 7dbf: 6c 65 76 65 6c 69 6e 67 20 63 6f 72 72 65 63 74 leveling correct 7dcf: 69 6f 6e 3a 20 25 69 20 6d 69 63 72 6f 6e 73 0a ion: %i microns. ... 00007de0 : 7de0: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7df0: 6c 65 64 2e 20 54 6f 6f 20 6d 75 63 68 20 76 61 led. Too much va 7e00: 72 69 61 74 69 6f 6e 20 66 72 6f 6d 20 65 65 70 riation from eep 7e10: 72 6f 6d 20 6d 65 73 68 00 rom mesh. 00007e19 : 7e19: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7e29: 6c 65 64 2e 20 53 65 6e 73 6f 72 20 74 72 69 67 led. Sensor trig 7e39: 67 65 72 65 64 20 74 6f 6f 20 73 6f 6f 6e 00 gered too soon. 00007e48 : 7e48: 20 20 00 . 00007e4b : 7e4b: 4d 65 61 73 75 72 65 64 20 70 6f 69 6e 74 73 3a Measured points: ... 00007e5c : 7e5c: 5a 20 73 65 61 72 63 68 20 68 65 69 67 68 74 3a Z search height: 7e6c: 20 35 2e 30 66 00 5.0f. 00007e72 : 7e72: 4e 75 6d 20 58 2c 59 3a 20 37 2c 37 00 Num X,Y: 7,7. 00007e7f : 7e7f: 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c 69 6e Mesh bed levelin 7e8f: 67 20 6e 6f 74 20 61 63 74 69 76 65 2e 00 g not active.. 00007e9d : 7e9d: 20 45 3a 00 E:. 00007ea1 : 7ea1: 20 5a 3a 00 Z:. 00007ea5 : 7ea5: 20 59 3a 00 Y:. 00007ea9 : 7ea9: 20 45 3a 00 E:. 00007ead : 7ead: 20 5a 3a 00 Z:. 00007eb1 : 7eb1: 20 59 3a 00 Y:. 00007eb5 : 7eb5: 58 3a 00 X:. 00007eb8 : 7eb8: 20 2d 3e 20 00 -> . 00007ebd : 7ebd: 53 70 6f 6f 6c 4a 6f 69 6e 3a 20 00 SpoolJoin: . 00007ec9 : 7ec9: 2c 20 00 , . 00007ecc : 7ecc: 66 73 65 6e 73 6f 72 20 76 30 2e 34 20 69 6e 20 fsensor v0.4 in 7edc: 66 61 75 6c 74 20 72 61 6e 67 65 20 34 2e 36 2d fault range 4.6- 7eec: 35 56 20 2d 20 75 6e 63 6f 6e 6e 65 63 74 65 64 5V - unconnected ... 00007efd : 7efd: 66 73 65 6e 73 6f 72 20 69 6e 20 66 6f 72 62 69 fsensor in forbi 7f0d: 64 64 65 6e 20 72 61 6e 67 65 20 31 2e 35 2d 33 dden range 1.5-3 7f1d: 56 20 2d 20 63 68 65 63 6b 20 73 65 6e 73 6f 72 V - check sensor ... 00007f2e : 7f2e: 49 6e 61 63 74 69 76 69 74 79 20 53 68 75 74 64 Inactivity Shutd 7f3e: 6f 77 6e 00 own. 00007f42 : 7f42: 4b 49 4c 4c 45 44 2e 00 KILLED.. 00007f4a : 7f4a: 50 72 69 6e 74 65 72 20 68 61 6c 74 65 64 2e 20 Printer halted. 7f5a: 6b 69 6c 6c 28 29 20 63 61 6c 6c 65 64 21 00 kill() called!. 00007f69 : 7f69: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7f79: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7f89: 69 6e 67 20 74 6f 20 30 2e 20 43 6c 69 63 6b 20 ing to 0. Click 7f99: 74 6f 20 63 6f 6e 74 69 6e 75 65 2e 00 to continue.. 00007fa6 : 7fa6: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7fb6: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7fc6: 69 6e 67 20 74 6f 20 30 00 ing to 0. 00007fcf : 7fcf: 20 45 3a 30 20 42 3a 00 E:0 B:. 00007fd7 : 7fd7: 54 3a 00 T:. 00007fda : 7fda: 47 31 20 5a 25 2d 2e 33 66 20 46 25 2d 2e 33 66 G1 Z%-.3f F%-.3f ... 00007feb : 7feb: 49 6e 76 61 6c 69 64 20 54 20 63 6f 64 65 2e 00 Invalid T code.. 00007ffb : 7ffb: 44 75 70 6c 69 63 61 74 65 20 54 2d 63 6f 64 65 Duplicate T-code 800b: 20 69 67 6e 6f 72 65 64 2e 00 ignored.. 00008015 : 8015: 41 64 76 61 6e 63 65 20 4b 3d 00 Advance K=. 00008020 : 8020: 4b 20 6f 75 74 20 6f 66 20 61 6c 6c 6f 77 65 64 K out of allowed 8030: 20 72 61 6e 67 65 21 00 range!. 00008038 <_sPrinterName>: 8038: 4d 4b 33 53 00 MK3S. 0000803d <_sPrinterMmuName>: 803d: 4d 4b 33 53 4d 4d 55 33 00 MK3SMMU3. 00008046 <_nPrinterMmuType>: 8046: 5e 76 ^v 00008048 <_nPrinterType>: 8048: 2e 01 .. 0000804a : 804a: 25 33 64 2f 25 33 64 00 %3d/%3d. 00008052 : 8052: 25 33 64 00 %3d. 00008056 : 8056: 20 0a 20 0a 20 0a 20 00 . . . . 0000805e : 805e: 25 53 41 72 63 20 53 65 74 74 69 6e 67 73 3a 20 %SArc Settings: 806e: 50 3a 4d 61 78 20 6c 65 6e 67 74 68 28 6d 6d 29 P:Max length(mm) 807e: 20 53 3a 4d 69 6e 20 6c 65 6e 67 74 68 20 28 6d S:Min length (m 808e: 6d 29 20 4e 3a 43 6f 72 72 65 63 74 69 6f 6e 73 m) N:Corrections 809e: 20 52 3a 4d 69 6e 20 73 65 67 6d 65 6e 74 73 20 R:Min segments 80ae: 46 3a 53 65 67 6d 65 6e 74 73 2f 73 65 63 2e 0a F:Segments/sec.. 80be: 25 53 20 20 4d 32 31 34 20 50 25 2e 32 66 20 53 %S M214 P%.2f S 80ce: 25 2e 32 66 20 4e 25 64 20 52 25 64 20 46 25 64 %.2f N%d R%d F%d 80de: 0a 00 .. 000080e0 : 80e0: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 80f0: 6e 67 73 3a 20 44 69 73 61 62 6c 65 64 0a 00 ngs: Disabled.. 000080ff : 80ff: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 810f: 6e 67 73 3a 0a 25 53 20 20 20 4d 32 30 30 20 44 ngs:.%S M200 D 811f: 25 2e 32 66 0a 00 %.2f.. 00008125 : 8125: 25 53 52 65 74 72 61 63 74 3a 20 53 3d 4c 65 6e %SRetract: S=Len 8135: 67 74 68 20 28 6d 6d 29 20 46 3a 53 70 65 65 64 gth (mm) F:Speed 8145: 20 28 6d 6d 2f 6d 29 20 5a 3a 20 5a 4c 69 66 74 (mm/m) Z: ZLift 8155: 20 28 6d 6d 29 0a 25 53 20 20 20 4d 32 30 37 20 (mm).%S M207 8165: 53 25 2e 32 66 20 46 25 2e 32 66 20 5a 25 2e 32 S%.2f F%.2f Z%.2 8175: 66 0a 25 53 52 65 63 6f 76 65 72 3a 20 53 3d 45 f.%SRecover: S=E 8185: 78 74 72 61 20 6c 65 6e 67 74 68 20 28 6d 6d 29 xtra length (mm) 8195: 20 46 3a 53 70 65 65 64 20 28 6d 6d 2f 6d 29 0a F:Speed (mm/m). 81a5: 25 53 20 20 20 4d 32 30 38 20 53 25 2e 32 66 20 %S M208 S%.2f 81b5: 46 25 2e 32 66 0a 25 53 41 75 74 6f 2d 52 65 74 F%.2f.%SAuto-Ret 81c5: 72 61 63 74 3a 20 53 3d 30 20 74 6f 20 64 69 73 ract: S=0 to dis 81d5: 61 62 6c 65 2c 20 31 20 74 6f 20 69 6e 74 65 72 able, 1 to inter 81e5: 70 72 65 74 20 65 78 74 72 75 64 65 2d 6f 6e 6c pret extrude-onl 81f5: 79 20 6d 6f 76 65 73 20 61 73 20 72 65 74 72 61 y moves as retra 8205: 63 74 73 20 6f 72 20 72 65 63 6f 76 65 72 69 65 cts or recoverie 8215: 73 0a 25 53 20 20 20 4d 32 30 39 20 53 25 64 0a s.%S M209 S%d. ... 00008226 : 8226: 25 53 50 49 44 20 68 65 61 74 62 65 64 20 73 65 %SPID heatbed se 8236: 74 74 69 6e 67 73 3a 0a 25 53 20 20 20 4d 33 30 ttings:.%S M30 8246: 34 20 50 25 2e 32 66 20 49 25 2e 32 66 20 44 25 4 P%.2f I%.2f D% 8256: 2e 32 66 0a 00 .2f.. 0000825b : 825b: 25 53 50 49 44 20 73 65 74 74 69 6e 67 73 3a 0a %SPID settings:. 826b: 25 53 20 20 20 4d 33 30 31 20 50 25 2e 32 66 20 %S M301 P%.2f 827b: 49 25 2e 32 66 20 44 25 2e 32 66 0a 00 I%.2f D%.2f.. 00008288 : 8288: 25 53 53 74 65 70 73 20 70 65 72 20 75 6e 69 74 %SSteps per unit 8298: 3a 0a 25 53 20 20 4d 39 32 20 58 25 2e 32 66 20 :.%S M92 X%.2f 82a8: 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 Y%.2f Z%.2f E%.2 82b8: 66 0a 25 53 55 53 74 65 70 20 72 65 73 6f 6c 75 f.%SUStep resolu 82c8: 74 69 6f 6e 3a 20 0a 25 53 20 4d 33 35 30 20 58 tion: .%S M350 X 82d8: 25 64 20 59 25 64 20 5a 25 64 20 45 25 64 0a 25 %d Y%d Z%d E%d.% 82e8: 53 4d 61 78 69 6d 75 6d 20 66 65 65 64 72 61 74 SMaximum feedrat 82f8: 65 73 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f es - normal (mm/ 8308: 73 29 3a 0a 25 53 20 20 4d 32 30 33 20 58 25 2e s):.%S M203 X%. 8318: 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 2f Y%.2f Z%.2f E 8328: 25 2e 32 66 0a 25 53 4d 61 78 69 6d 75 6d 20 66 %.2f.%SMaximum f 8338: 65 65 64 72 61 74 65 73 20 2d 20 73 74 65 61 6c eedrates - steal 8348: 74 68 20 28 6d 6d 2f 73 29 3a 0a 25 53 20 20 4d th (mm/s):.%S M 8358: 32 30 33 20 58 25 2e 32 66 20 59 25 2e 32 66 20 203 X%.2f Y%.2f 8368: 5a 25 2e 32 66 20 45 25 2e 32 66 0a 25 53 4d 61 Z%.2f E%.2f.%SMa 8378: 78 69 6d 75 6d 20 61 63 63 65 6c 65 72 61 74 69 ximum accelerati 8388: 6f 6e 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f on - normal (mm/ 8398: 73 32 29 3a 0a 25 53 20 20 4d 32 30 31 20 58 25 s2):.%S M201 X% 83a8: 6c 75 20 59 25 6c 75 20 5a 25 6c 75 20 45 25 6c lu Y%lu Z%lu E%l 83b8: 75 0a 25 53 4d 61 78 69 6d 75 6d 20 61 63 63 65 u.%SMaximum acce 83c8: 6c 65 72 61 74 69 6f 6e 20 2d 20 73 74 65 61 6c leration - steal 83d8: 74 68 20 28 6d 6d 2f 73 32 29 3a 0a 25 53 20 20 th (mm/s2):.%S 83e8: 4d 32 30 31 20 58 25 6c 75 20 59 25 6c 75 20 5a M201 X%lu Y%lu Z 83f8: 25 6c 75 20 45 25 6c 75 0a 25 53 41 63 63 65 6c %lu E%lu.%SAccel 8408: 65 72 61 74 69 6f 6e 3a 20 50 3d 70 72 69 6e 74 eration: P=print 8418: 2c 20 52 3d 72 65 74 72 61 63 74 2c 20 54 3d 74 , R=retract, T=t 8428: 72 61 76 65 6c 0a 25 53 20 20 4d 32 30 34 20 50 ravel.%S M204 P 8438: 25 2e 32 66 20 52 25 2e 32 66 20 54 25 2e 32 66 %.2f R%.2f T%.2f 8448: 0a 25 53 41 64 76 61 6e 63 65 64 20 76 61 72 69 .%SAdvanced vari 8458: 61 62 6c 65 73 3a 20 53 3d 4d 69 6e 20 66 65 65 ables: S=Min fee 8468: 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c 20 54 3d drate (mm/s), T= 8478: 4d 69 6e 20 74 72 61 76 65 6c 20 66 65 65 64 72 Min travel feedr 8488: 61 74 65 20 28 6d 6d 2f 73 29 2c 20 42 3d 6d 69 ate (mm/s), B=mi 8498: 6e 69 6d 75 6d 20 73 65 67 6d 65 6e 74 20 74 69 nimum segment ti 84a8: 6d 65 20 28 75 73 29 2c 20 58 3d 6d 61 78 69 6d me (us), X=maxim 84b8: 75 6d 20 58 59 20 6a 65 72 6b 20 28 6d 6d 2f 73 um XY jerk (mm/s 84c8: 29 2c 20 20 5a 3d 6d 61 78 69 6d 75 6d 20 5a 20 ), Z=maximum Z 84d8: 6a 65 72 6b 20 28 6d 6d 2f 73 29 2c 20 20 45 3d jerk (mm/s), E= 84e8: 6d 61 78 69 6d 75 6d 20 45 20 6a 65 72 6b 20 28 maximum E jerk ( 84f8: 6d 6d 2f 73 29 0a 25 53 20 20 4d 32 30 35 20 53 mm/s).%S M205 S 8508: 25 2e 32 66 20 54 25 2e 32 66 20 42 25 6c 75 20 %.2f T%.2f B%lu 8518: 58 25 2e 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 X%.2f Y%.2f Z%.2 8528: 66 20 45 25 2e 32 66 0a 25 53 48 6f 6d 65 20 6f f E%.2f.%SHome o 8538: 66 66 73 65 74 20 28 6d 6d 29 3a 0a 25 53 20 20 ffset (mm):.%S 8548: 4d 32 30 36 20 58 25 2e 32 66 20 59 25 2e 32 66 M206 X%.2f Y%.2f 8558: 20 5a 25 2e 32 66 0a 00 Z%.2f.. 00008560 : 8560: 54 4d 3a 20 52 5b 25 75 5d 20 65 73 74 69 6d 61 TM: R[%u] estima 8570: 74 65 2e 00 te.. 00008574 : 8574: 54 4d 3a 20 25 53 20 52 20 25 64 43 00 TM: %S R %dC. 00008581 : 8581: 54 4d 3a 20 25 53 20 43 20 65 73 74 2e 00 TM: %S C est.. 0000858f : 858f: 54 4d 3a 20 63 6f 6f 6c 20 64 6f 77 6e 20 3c 25 TM: cool down <% 859f: 64 43 00 dC. 000085a2 : 85a2: 72 65 66 69 6e 65 00 refine. 000085a9 : 85a9: 69 6e 69 74 69 61 6c 00 initial. 000085b1 : 85b1: 54 4d 3a 20 63 61 6c 69 62 72 2e 20 66 61 69 6c TM: calibr. fail 85c1: 65 64 21 00 ed!. 000085c5 : 85c5: 54 4d 3a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 TM: calibration 85d5: 73 74 61 72 74 00 start. 000085db : 85db: 54 4d 3a 20 43 61 6c 2e 20 4e 4f 54 20 49 44 4c TM: Cal. NOT IDL 85eb: 45 00 E. 000085ed : 85ed: 43 61 70 3a 25 53 3a 25 63 0a 00 Cap:%S:%c.. 000085f8 : 85f8: 50 52 55 53 41 5f 4d 4d 55 32 00 PRUSA_MMU2. 00008603 : 8603: 45 58 54 45 4e 44 45 44 5f 4d 32 30 00 EXTENDED_M20. 00008610 : 8610: 41 55 54 4f 52 45 50 4f 52 54 5f 50 4f 53 49 54 AUTOREPORT_POSIT 8620: 49 4f 4e 00 ION. 00008624 : 8624: 41 55 54 4f 52 45 50 4f 52 54 5f 46 41 4e 53 00 AUTOREPORT_FANS. 00008634 : 8634: 41 55 54 4f 52 45 50 4f 52 54 5f 54 45 4d 50 00 AUTOREPORT_TEMP. 00008644 : ... 00008645 : 8645: 33 2e 31 34 2e 31 00 3.14.1. 0000864c : 864c: 44 65 6c 65 74 69 6f 6e 20 66 61 69 6c 65 64 2c Deletion failed, 865c: 20 46 69 6c 65 3a 20 00 File: . 00008664 : 8664: 46 69 6c 65 20 64 65 6c 65 74 65 64 3a 00 File deleted:. 00008672 : 8672: 4e 6f 74 20 53 44 20 70 72 69 6e 74 69 6e 67 00 Not SD printing. 00008682 : 8682: 50 72 69 6e 74 20 73 61 76 65 64 00 Print saved. 0000868e : 868e: 53 44 20 70 72 69 6e 74 20 70 61 75 73 65 64 00 SD print paused. 0000869e : 869e: 25 33 64 2f 25 33 64 00 %3d/%3d. 000086a6 : 86a6: 4f 4b 00 OK. 000086a9 : 86a9: 42 41 44 00 BAD. 000086ad : 86ad: 52 41 4d 42 6f 20 46 41 4e 20 00 RAMBo FAN . 000086b8 : 86b8: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 000086c5 : 86c5: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 000086d3 : 86d3: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 000086e1 <_ZZ16process_commandsvE3__c__98_>: 86e1: 22 28 32 29 00 "(2). 000086e6 <_ZZ16process_commandsvE3__c__97_>: 86e6: 25 53 3a 20 25 53 0a 00 %S: %S.. 000086ee <_ZZ16process_commandsvE3__c__96_>: 86ee: 2c 20 4d 39 30 37 20 45 20 69 67 6e 6f 72 65 64 , M907 E ignored ... 000086ff <_ZZ16process_commandsvE3__c__95_>: 86ff: 6e 6f 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 no valid command ... 00008710 <_ZZ16process_commandsvE3__c__94_>: 8710: 7a 65 72 6f 72 69 7a 65 64 00 zerorized. 0000871a <_ZZ16process_commandsvE3__c__93_>: 871a: 66 61 63 74 6f 72 79 20 72 65 73 74 6f 72 65 64 factory restored ... 0000872b <_ZZ16process_commandsvE3__c__91_>: 872b: 69 6e 64 65 78 2c 20 74 65 6d 70 2c 20 75 73 74 index, temp, ust 873b: 65 70 2c 20 75 6d 00 ep, um. 00008742 <_ZZ16process_commandsvE3__c__92_>: 8742: 50 49 4e 44 41 20 63 61 6c 20 73 74 61 74 75 73 PINDA cal status 8752: 3a 20 00 : . 00008755 <_ZZ16process_commandsvE3__c__90_>: 8755: 50 3a 00 P:. 00008758 <_ZZ16process_commandsvE3__c__89_>: 8758: 57 61 69 74 20 66 6f 72 20 50 49 4e 44 41 20 74 Wait for PINDA t 8768: 61 72 67 65 74 20 74 65 6d 70 65 72 61 74 75 72 arget temperatur 8778: 65 3a 00 e:. 0000877b <_ZZ16process_commandsvE3__c__88_>: 877b: 20 41 00 A. 0000877e <_ZZ16process_commandsvE3__c__87_>: 877e: 20 50 00 P. 00008781 <_ZZ16process_commandsvE3__c__86_>: 8781: 20 42 00 B. 00008784 <_ZZ16process_commandsvE3__c__85_>: 8784: 20 4c 00 L. 00008787 <_ZZ16process_commandsvE3__c__84_>: 8787: 20 52 00 R. 0000878a <_ZZ16process_commandsvE3__c__83_>: 878a: 20 5a 00 Z. 0000878d <_ZZ16process_commandsvE3__c__82_>: 878d: 20 4e 4f 54 20 49 4e 49 54 49 41 4c 49 5a 45 44 NOT INITIALIZED ... 0000879e <_ZZ16process_commandsvE3__c__81_>: 879e: 53 68 65 65 74 20 00 Sheet . 000087a5 <_ZZ16process_commandsvE3__c__80_>: 87a5: 20 5a 20 56 41 4c 55 45 20 4f 55 54 20 4f 46 20 Z VALUE OUT OF 87b5: 52 41 4e 47 45 00 RANGE. 000087bb <_ZZ16process_commandsvE3__c__79_>: 87bb: 49 6e 76 61 6c 69 64 20 73 68 65 65 74 20 49 44 Invalid sheet ID 87cb: 2e 20 41 6c 6c 6f 77 65 64 3a 20 30 2e 2e 00 . Allowed: 0... 000087da <_ZZ16process_commandsvE3__c__78_>: 87da: 41 55 54 4f 00 AUTO. 000087df <_ZZ16process_commandsvE3__c__77_>: 87df: 4c 41 4e 47 20 53 45 4c 20 46 4f 52 43 45 44 00 LANG SEL FORCED. 000087ef <_ZZ16process_commandsvE3__c__76_>: 87ef: 20 64 3a 00 d:. 000087f3 <_ZZ16process_commandsvE3__c__75_>: 87f3: 20 69 3a 00 i:. 000087f7 <_ZZ16process_commandsvE3__c__74_>: 87f7: 20 70 3a 00 p:. 000087fb <_ZZ16process_commandsvE3__c__73_>: 87fb: 20 64 3a 00 d:. 000087ff <_ZZ16process_commandsvE3__c__72_>: 87ff: 20 69 3a 00 i:. 00008803 <_ZZ16process_commandsvE3__c__71_>: 8803: 20 70 3a 00 p:. 00008807 <_ZZ16process_commandsvE3__c__70_>: 8807: 25 69 25 25 0a 00 %i%%.. 0000880d <_ZZ16process_commandsvE3__c__69_>: 880d: 25 69 25 25 0a 00 %i%%.. 00008813 <_ZZ16process_commandsvE3__c__68_>: 8813: 22 28 31 29 00 "(1). 00008818 <_ZZ16process_commandsvE3__c__61_>: 8818: 2f 2f 00 //. 0000881b <_ZZ16process_commandsvE3__c__60_>: ... 0000881c <_ZZ16process_commandsvE3__c__59_>: 881c: 20 45 58 54 52 55 44 45 52 5f 43 4f 55 4e 54 3a EXTRUDER_COUNT: 882c: 31 00 1. 0000882e <_ZZ16process_commandsvE3__c__58_>: 882e: 20 4d 41 43 48 49 4e 45 5f 54 59 50 45 3a 00 MACHINE_TYPE:. 0000883d <_ZZ16process_commandsvE3__c__57_>: 883d: 31 2e 30 00 1.0. 00008841 <_ZZ16process_commandsvE3__c__56_>: 8841: 20 62 61 73 65 64 20 6f 6e 20 4d 61 72 6c 69 6e based on Marlin 8851: 20 46 49 52 4d 57 41 52 45 5f 55 52 4c 3a 68 74 FIRMWARE_URL:ht 8861: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com 8871: 2f 70 72 75 73 61 33 64 2f 50 72 75 73 61 2d 46 /prusa3d/Prusa-F 8881: 69 72 6d 77 61 72 65 20 50 52 4f 54 4f 43 4f 4c irmware PROTOCOL 8891: 5f 56 45 52 53 49 4f 4e 3a 00 _VERSION:. 0000889b <_ZZ16process_commandsvE3__c__55_>: 889b: 30 30 30 30 30 30 30 30 30 00 000000000. 000088a5 <_ZZ16process_commandsvE3__c__54_>: 88a5: 5f 00 _. 000088a7 <_ZZ16process_commandsvE3__c__53_>: 88a7: 38 32 33 37 00 8237. 000088ac <_ZZ16process_commandsvE3__c__52_>: 88ac: 2b 00 +. 000088ae <_ZZ16process_commandsvE3__c__51_>: 88ae: 46 49 52 4d 57 41 52 45 5f 4e 41 4d 45 3a 50 72 FIRMWARE_NAME:Pr 88be: 75 73 61 2d 46 69 72 6d 77 61 72 65 20 00 usa-Firmware . 000088cc <_ZZ16process_commandsvE3__c__50_>: 88cc: 4d 31 31 33 20 53 00 M113 S. 000088d3 <_ZZ16process_commandsvE3__c__49_>: 88d3: 6f 6b 20 00 ok . 000088d7 <_ZZ16process_commandsvE3__c__48_>: 88d7: 20 63 6d 2e 00 cm.. 000088dc <_ZZ16process_commandsvE3__c__47_>: 88dc: 20 6d 69 6e 20 00 min . 000088e2 <_ZZ16process_commandsvE3__c__46_>: 88e2: 53 54 41 54 53 20 00 STATS . 000088e9 <_ZZ16process_commandsvE3__c__41_>: 88e9: 6e 2f 61 00 n/a. 000088ed <_ZZ16process_commandsvE3__c__40_>: 88ed: 3f 54 6f 73 68 69 62 61 20 46 6c 61 73 68 41 69 ?Toshiba FlashAi 88fd: 72 20 47 65 74 49 50 20 66 61 69 6c 65 64 0a 00 r GetIP failed.. 0000890d : 890d: 00 01 25 31 1d 0c 40 24 30 1c 0b 45 23 2f 1b 0a ..%1..@$0..E#/.. 891d: 17 ff 04 06 22 2b 1a 03 36 37 35 38 ...."+..6758 00008929 <_ZZ16process_commandsvE3__c__39_>: 8929: 25 69 20 6d 69 6e 2c 20 25 69 20 73 65 63 00 %i min, %i sec. 00008938 <_ZZ16process_commandsvE3__c__36_>: 8938: 49 6e 76 61 6c 69 64 20 4d 20 63 6f 64 65 3a 20 Invalid M code: 8948: 25 73 0a 00 %s.. 0000894c <_ZZ16process_commandsvE3__c__30_>: 894c: 50 49 4e 44 41 20 70 72 6f 62 65 20 63 61 6c 69 PINDA probe cali 895c: 62 72 61 74 69 6f 6e 20 73 74 61 72 74 00 bration start. 0000896a <_ZZ16process_commandsvE3__c__29_>: 896a: 4e 6f 20 50 49 4e 44 41 20 74 68 65 72 6d 69 73 No PINDA thermis 897a: 74 6f 72 00 tor. 0000897e <_ZZ16process_commandsvE3__c__25_>: 897e: 73 65 74 00 set. 00008982 <_ZZ16process_commandsvE3__c__24_>: 8982: 6e 6f 7a 7a 6c 65 00 nozzle. 00008989 <_ZZ16process_commandsvE3__c__23_>: 8989: 4d 42 4c 00 MBL. 0000898d <_ZZ16process_commandsvE3__c__22_>: 898d: 46 52 00 FR. 00008990 <_ZZ16process_commandsvE3__c__21_>: 8990: 4c 7a 00 Lz. 00008993 <_ZZ16process_commandsvE3__c__20_>: 8993: 4c 61 6e 67 00 Lang. 00008998 <_ZZ16process_commandsvE3__c__19_>: 8998: 31 5f 37 35 6d 6d 5f 4d 4b 33 53 2d 45 49 4e 53 1_75mm_MK3S-EINS 89a8: 79 5f 31 30 61 2d 45 33 44 52 45 56 4f 5f 48 46 y_10a-E3DREVO_HF 89b8: 5f 36 30 57 00 _60W. 000089bd <_ZZ16process_commandsvE3__c__18_>: 89bd: 52 65 76 00 Rev. 000089c1 <_ZZ16process_commandsvE3__c__17_>: 89c1: 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 000089cd <_ZZ16process_commandsvE3__c__16_>: 89cd: 46 69 72 00 Fir. 000089d1 <_ZZ16process_commandsvE3__c__15_>: 89d1: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 000089dc <_ZZ16process_commandsvE3__c__14_>: 89dc: 53 4e 00 SN. 000089df <_ZZ16process_commandsvE3__c__13_>: 89df: 52 45 53 45 54 00 RESET. 000089e5 <_ZZ16process_commandsvE3__c__12_>: 89e5: 4d 4d 55 52 45 53 00 MMURES. 000089ec <_ZZ16process_commandsvE3__c__11_>: 89ec: 75 76 6c 6f 00 uvlo. 000089f1 : 89f1: 46 41 4e 00 FAN. 000089f5 : 89f5: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 000089ff : 89ff: 50 52 55 53 41 00 PRUSA. 00008a05 : 8a05: 53 45 54 5f 43 48 4f 50 5f 00 SET_CHOP_. 00008a0f : 8a0f: 53 45 54 5f 53 54 45 50 5f 00 SET_STEP_. 00008a19 : 8a19: 53 45 54 5f 57 41 56 45 5f 00 SET_WAVE_. 00008a23 : 8a23: 54 4d 43 5f 00 TMC_. 00008a28 : 8a28: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 00008a35 : 8a35: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008a43 : 8a43: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 00 CRASH_DETECTED. 00008a52 : 8a52: 43 52 41 53 48 5f 00 CRASH_. 00008a59 : 8a59: 47 31 20 58 31 30 20 59 31 38 30 20 46 34 30 30 G1 X10 Y180 F400 8a69: 30 00 0. 00008a6b : 8a6b: 47 31 20 5a 31 30 20 46 31 33 30 30 00 G1 Z10 F1300. 00008a78 : 8a78: 4d 31 34 30 20 53 30 00 M140 S0. 00008a80 : 8a80: 4d 31 30 34 20 53 30 00 M104 S0. 00008a88 : 8a88: 47 31 20 45 2d 30 2e 30 37 35 20 46 32 31 30 30 G1 E-0.075 F2100 ... 00008a99 : 8a99: 47 31 20 46 34 30 30 30 00 G1 F4000. 00008aa2 : 8aa2: 4d 32 30 34 20 53 31 30 30 30 00 M204 S1000. 00008aad : 8aad: 47 31 20 5a 35 20 46 37 32 30 30 00 G1 Z5 F7200. 00008ab9 : 8ab9: 47 31 20 45 2d 31 2e 35 20 46 32 31 30 30 00 G1 E-1.5 F2100. 00008ac8 : 8ac8: 47 39 30 00 G90. 00008acc : 8acc: 47 31 20 58 35 20 45 34 20 46 31 30 30 30 00 G1 X5 E4 F1000. 00008adb : 8adb: 47 31 20 5a 30 2e 32 20 46 31 30 30 30 00 G1 Z0.2 F1000. 00008ae9 : 8ae9: 47 31 20 58 35 35 20 45 32 35 20 46 31 34 30 30 G1 X55 E25 F1400 ... 00008afa : 8afa: 47 31 20 59 2d 32 20 46 31 30 30 30 00 G1 Y-2 F1000. 00008b07 : 8b07: 47 31 20 58 32 34 30 20 45 32 35 20 20 46 32 32 G1 X240 E25 F22 8b17: 30 30 00 00. 00008b1a : 8b1a: 47 31 20 5a 30 2e 33 20 46 31 30 30 30 00 G1 Z0.3 F1000. 00008b28 : 8b28: 47 31 20 58 35 35 20 45 38 20 46 32 30 30 30 00 G1 X55 E8 F2000. 00008b38 : 8b38: 47 31 20 58 35 20 45 32 39 20 46 31 38 30 30 00 G1 X5 E29 F1800. 00008b48 : 8b48: 47 31 20 58 35 35 20 45 32 39 20 46 31 30 37 33 G1 X55 E29 F1073 ... 00008b59 : 8b59: 47 39 32 20 45 30 00 G92 E0. 00008b60 : 8b60: 47 32 38 00 G28. 00008b64 : 8b64: 4d 31 30 39 00 M109. 00008b69 : 8b69: 4d 31 39 30 00 M190. 00008b6e : 8b6e: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... 8b7e: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... 8b8e: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... 8b9e: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ 8bae: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. 8bbe: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. 8bce: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. 8bde: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 00008bee : 8bee: 4d 34 34 00 M44. 00008bf2 : 8bf2: 30 2e 38 30 00 0.80. 00008bf7 : 8bf7: 30 2e 36 30 00 0.60. 00008bfc : 8bfc: 30 2e 34 30 00 0.40. 00008c01 : 8c01: 30 2e 32 35 00 0.25. 00008c06 : 8c06: 47 32 38 20 58 59 00 G28 XY. 00008c0d : 8c0d: 4d 20 38 34 00 M 84. 00008c12 : 8c12: 85 2e 2e 00 .... 00008c16 : 8c16: 59 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 Y: %u -> .... 00008c23 : 8c23: 58 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 X: %u -> .... 00008c30 : 8c30: 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f 72 20 Filament sensor 8c40: 62 6f 61 72 64 20 63 68 61 6e 67 65 20 64 65 74 board change det 8c50: 65 63 74 65 64 3a 20 72 65 76 69 73 69 6f 6e 25 ected: revision% 8c60: 53 0a 00 S.. 00008c63 : 8c63: 4d 65 61 73 75 72 65 64 20 66 69 6c 61 6d 65 6e Measured filamen 8c73: 74 20 73 65 6e 73 6f 72 20 6c 6f 77 20 6c 65 76 t sensor low lev 8c83: 65 6c 3a 20 25 34 2e 32 66 56 0a 00 el: %4.2fV.. 00008c8f : 8c8f: 4d 65 61 73 75 72 65 64 20 66 69 6c 61 6d 65 6e Measured filamen 8c9f: 74 20 73 65 6e 73 6f 72 20 68 69 67 68 20 6c 65 t sensor high le 8caf: 76 65 6c 3a 20 25 34 2e 32 66 56 0a 00 vel: %4.2fV.. 00008cbc : 8cbc: 25 33 64 2f 30 00 %3d/0. 00008cc2 : 8cc2: 25 33 64 2f 30 00 %3d/0. 00008cc8 : 8cc8: 25 63 20 41 58 49 53 20 53 47 31 3d 25 64 0a 00 %c AXIS SG1=%d.. 00008cd8 : 8cd8: 48 6f 74 65 6e 64 00 Hotend. 00008cdf : 8cdf: 42 65 64 00 Bed. 00008ce3 : 8ce3: 5a 00 Z. 00008ce5 : 8ce5: 59 00 Y. 00008ce7 : 8ce7: 58 00 X. 00008ce9 <_ZL13STR_SEPARATOR.lto_priv.456>: 8ce9: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 8cf9: 2d 2d 2d 2d 00 ----. 00008cfe : 8cfe: 43 5a 50 58 49 6e 76 61 6c 69 64 53 65 72 69 61 CZPXInvalidSeria 8d0e: 6c 4e 72 00 lNr. 00008d12 : 8d12: 8b 6b 88 8a 80 8a 78 8a 6b 8a 59 8a .k....x.k.Y. 00008d1e : 8d1e: 47 31 20 58 25 64 20 59 25 64 20 45 25 2d 2e 35 G1 X%d Y%d E%-.5 8d2e: 66 00 f. 00008d30 : 8d30: 47 31 20 46 31 30 38 30 00 G1 F1080. 00008d39 : 8d39: 47 31 20 5a 25 2d 2e 33 66 20 46 37 32 30 30 00 G1 Z%-.3f F7200. 00008d49 : 8d49: 47 31 20 58 35 30 20 59 31 35 35 00 G1 X50 Y155. 00008d55 : 8d55: 59 8b c8 8a c1 6c b9 8a ad 8a a2 8a 99 8a Y....l........ 00008d63 : 8d63: 47 31 20 58 25 64 20 45 25 2d 2e 33 66 20 46 31 G1 X%d E%-.3f F1 8d73: 30 30 30 00 000. 00008d77 : 8d77: 48 8b 38 8b 28 8b 1a 8b 59 8b 07 8b fa 8a e9 8a H.8.(...Y....... 8d87: db 8a cc 8a .... 00008d8b : 8d8b: 54 25 64 00 T%d. 00008d8f : 8d8f: 47 31 20 5a 30 2e 34 20 46 31 30 30 30 00 G1 Z0.4 F1000. 00008d9d : 8d9d: 47 31 20 59 2d 33 20 46 31 30 30 30 00 G1 Y-3 F1000. 00008daa : 8daa: 8b 6b 69 8b 64 8b 60 8b 59 8b .ki.d.`.Y. 00008db4 : 8db4: 4d 38 34 20 58 59 00 M84 XY. 00008dbb : 8dbb: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 8dcb: 30 30 00 00. 00008dce : 8dce: 4d 33 31 30 20 41 20 46 31 00 M310 A F1. 00008dd8 : 8dd8: 47 31 20 58 31 32 35 20 59 31 30 35 20 5a 31 20 G1 X125 Y105 Z1 8de8: 46 38 30 30 30 00 F8000. 00008dee : 8dee: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 8dfe: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 8e0e: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 00008e1e : 8e1e: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 8e2e: 20 44 25 2e 32 66 00 D%.2f. 00008e35 : 8e35: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 00008e42 : 8e42: 52 43 00 RC. 00008e45 : 8e45: 44 45 56 00 DEV. 00008e49 : 8e49: 42 45 54 41 00 BETA. 00008e4e : 8e4e: 41 4c 50 48 41 00 ALPHA. 00008e54 : 8e54: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 8e64: 01 01 00 00 04 01 07 01 0a 01 .......... 00008e6e : 8e6e: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 8e7e: 02 01 00 00 05 01 08 01 0b 01 .......... 00008e88 : 8e88: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 8e98: 00 01 00 00 03 01 06 01 09 01 .......... 00008ea2 : 8ea2: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 8eb2: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 8ec2: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 8ed2: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 8ee2: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 8ef2: 05 04 04 04 08 08 ...... 00008ef8 : 8ef8: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 8f08: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 8f18: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 8f28: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 8f38: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 8f48: 80 10 20 40 04 80 .. @.. 00008f4e : 8f4e: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8f7a: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 00008fa4 : 8fa4: 33 2e 31 34 2e 31 00 3.14.1. 00008fab : 8fab: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 8fbb: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 8fcb: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 00008fd9 : 8fd9: 4c 61 6e 67 75 61 67 65 20 75 70 64 61 74 65 00 Language update. 00008fe9 : 8fe9: 43 5a 50 58 00 CZPX. 00008fee : 8fee: 3b 53 00 ;S. 00008ff1 : 8ff1: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 00008fff : 8fff: 61 64 63 5f 69 6e 69 74 00 adc_init. 00009008 : 9008: 20 0a 20 0a 20 0a 20 00 . . . . 00009010 : 9010: 41 6c 6c 20 44 61 74 61 00 All Data. 00009019 : 9019: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 00009026 : 9026: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 00009034 : 9034: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 0000903f : 903f: 4c 61 6e 67 75 61 67 65 00 Language. 00009048 <_ZZL13factory_resetcE3__c.lto_priv.552>: 9048: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 00009059 : 9059: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 00009067 : 9067: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 00009071 <_ZL8MSG_INT4.lto_priv.502>: 9071: 49 4e 54 34 00 INT4. 00009076 : 9076: 03 00 0e 00 01 00 40 00 ......@. 0000907e : 907e: 03 00 02 00 00 00 04 00 ........ 00009086 <_ZZ5setupE3__c__12_>: 9086: 4e 4f 43 54 55 41 00 NOCTUA. 0000908d <_ZZ5setupE3__c__11_>: 908d: 41 4c 54 46 41 4e 00 ALTFAN. 00009094 : 9094: 55 6e 6b 6e 6f 77 6e 00 Unknown. 0000909c : 909c: 31 39 37 30 2d 30 31 2d 30 31 20 30 31 3a 30 30 1970-01-01 01:00 90ac: 3a 30 30 00 :00. 000090b0 : 90b0: 20 33 2e 31 34 2e 31 2d 38 32 33 37 5f 30 30 30 3.14.1-8237_000 90c0: 30 30 30 30 30 30 00 000000. 000090c7 : 90c7: 73 74 61 72 74 00 start. 000090cd : 90cd: 53 4e 20 75 70 64 61 74 65 20 66 61 69 6c 65 64 SN update failed ... 000090de : 90de: 53 4e 20 75 70 64 61 74 65 64 00 SN updated. 000090e9 : 90e9: 43 5a 50 58 00 CZPX. 000090ee : 90ee: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 59 CRASH_DETECTEDXY ... 000090ff : 90ff: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 59 00 CRASH_DETECTEDY. 0000910f : 910f: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 00 CRASH_DETECTEDX. 0000911f : 911f: 4d 32 39 00 M29. 00009123 : 9123: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 0000912b : 912b: 54 4d 20 65 73 74 69 6d 61 74 69 6f 6e 20 64 69 TM estimation di 913b: 64 20 6e 6f 74 20 63 6f 6e 76 65 72 67 65 00 d not converge. 0000914a : 914a: 54 4d 20 69 74 65 72 3a 25 75 20 76 3a 25 2e 32 TM iter:%u v:%.2 915a: 66 20 65 3a 25 2e 33 66 0a 00 f e:%.3f.. 00009164 : 9164: 33 33 29 42 00 00 58 41 9a 99 8d 41 33 33 53 40 33)B..XA...A33S@ 00009174 : 9174: 20 0a 20 0a 20 00 . . . 0000917a : 917a: 4d 4d 55 32 3a 00 MMU2:. 00009180 : 9180: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 00009191 : 9191: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e 91a1: 6e 74 65 72 0a 00 nter.. 000091a7 : 91a7: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c 91b7: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 91c7: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 91d7: 20 61 64 3d 25 64 0a 00 ad=%d.. 000091df : 91df: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n 91ef: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld 91ff: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 0000920c : 920c: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= 921c: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= 922c: 25 64 0a 00 %d.. 00009230 : 9230: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x 9240: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld 9250: 0a 00 .. 00009252 : 9252: 25 30 32 78 00 %02x. 00009257 : 9257: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt 9267: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 00009273 : 9273: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm 9283: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 0000928f : 928f: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ 929f: fc 03 f8 01 f0 00 00 00 ........ 000092a7 : 92a7: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ 92b7: f8 01 f0 00 00 00 00 00 ........ 000092bf : 92bf: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l 92cf: 65 61 76 65 0a 00 eave.. 000092d5 : 92d5: 20 3c 20 00 < . 000092d9 : 92d9: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p 92e9: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab 92f9: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate 9309: 3a 00 :. 0000930b : ... 0000930c : 930c: 00 00 40 41 00 00 c0 40 00 00 5c 43 00 00 c0 40 ..@A...@..\C...@ 931c: 00 00 5c 43 00 00 46 43 00 00 40 41 00 00 46 43 ..\C..FC..@A..FC 0000932c : 932c: 25 64 2f 34 00 %d/4. 00009331 : 9331: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 0000933d : 933d: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail 934d: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax 935d: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again 936d: 2e 00 .. 0000936f : 936f: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 937f: 64 00 d. 00009381 : 9381: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 9391: 69 78 65 64 00 ixed. 00009396 : 9396: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 93a6: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 93b6: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 93c6: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 93d6: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 93e6: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 93f6: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 9406: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 9416: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 9426: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 9436: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 9446: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 9456: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 9466: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 9476: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 9486: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 9496: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 94a6: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 94b6: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 94c6: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 94d6: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 94e6: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 94f6: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 9506: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 9516: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 9526: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 9536: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 9546: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 9556: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 9566: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 9576: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 9586: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 9596: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 95a6: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 95b6: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 95c6: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 95d6: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 95e6: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 95f6: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 9606: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 9616: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 9626: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 9636: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 9646: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 9656: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 9666: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 9676: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 9686: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 9696: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 96a6: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 96b6: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 96c6: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 96d6: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 96e6: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 96f6: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 9706: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 9716: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 9726: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 9736: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 9746: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 9756: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 9766: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 9776: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 9786: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 00009796 : 9796: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 97a6: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 97b6: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 97c6: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 97d6: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 97e6: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 97f6: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 9806: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 9816: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 9826: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 9836: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 9846: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 9856: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 9866: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 9876: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 9886: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 9896: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 98a6: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 98b6: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 98c6: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 98d6: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 98e6: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 98f6: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 9906: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 9916: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 9926: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 9936: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 9946: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 9956: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 9966: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 9976: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 9986: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 9996: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 99a6: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 99b6: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 99c6: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 99d6: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 99e6: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 99f6: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 9a06: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 9a16: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 9a26: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 9a36: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 9a46: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 9a56: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 9a66: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 9a76: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 9a86: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 9a96: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 9aa6: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 9ab6: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 9ac6: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 9ad6: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 9ae6: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 9af6: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 9b06: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 9b16: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 9b26: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 9b36: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9b46: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9b56: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 9b66: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 9b76: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 9b86: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 00009b96 <_ZZ12PID_autotunefiiE3__c__16_>: 9b96: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 9ba6: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 9bb6: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 9bc6: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 9bd6: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 9be6: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 00009bf2 <_ZZ12PID_autotunefiiE3__c__15_>: 9bf2: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9c02: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 00009c0f <_ZZ12PID_autotunefiiE3__c__14_>: 9c0f: 20 40 3a 00 @:. 00009c13 <_ZZ12PID_autotunefiiE3__c__13_>: 9c13: 54 3a 00 T:. 00009c16 <_ZZ12PID_autotunefiiE3__c__12_>: 9c16: 42 3a 00 B:. 00009c19 <_ZZ12PID_autotunefiiE3__c__11_>: 9c19: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9c29: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 9c39: 20 74 6f 6f 20 68 69 67 68 00 too high. 00009c43 <_ZZ12PID_autotunefiiE3__c__10_>: 9c43: 20 4b 64 3a 20 00 Kd: . 00009c49 : 9c49: 20 4b 69 3a 20 00 Ki: . 00009c4f : 9c4f: 20 4b 70 3a 20 00 Kp: . 00009c55 : 9c55: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 00009c63 : 9c63: 20 54 75 3a 20 00 Tu: . 00009c69 : 9c69: 20 4b 75 3a 20 00 Ku: . 00009c6f : 9c6f: 20 6d 61 78 3a 20 00 max: . 00009c76 : 9c76: 20 6d 69 6e 3a 20 00 min: . 00009c7d : 9c7d: 20 64 3a 20 00 d: . 00009c82 : 9c82: 20 62 69 61 73 3a 20 00 bias: . 00009c8a : 9c8a: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 9c9a: 72 74 00 rt. 00009c9d : 9c9d: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9cad: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 9cbd: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 00009cc7 : 9cc7: 54 4d 4c 20 25 64 20 25 64 20 25 78 20 25 6c 78 TML %d %d %x %lx 9cd7: 20 25 6c 78 0a 00 %lx.. 00009cdd : 9cdd: 4d 49 4e 54 45 4d 50 00 MINTEMP. 00009ce5 : 9ce5: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 00009cf1 : 9cf1: 4d 49 4e 54 45 4d 50 20 41 4d 42 00 MINTEMP AMB. 00009cfd : 9cfd: 4d 41 58 54 45 4d 50 00 MAXTEMP. 00009d05 : 9d05: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 00009d11 : 9d11: 4d 41 58 54 45 4d 50 20 41 4d 42 00 MAXTEMP AMB. 00009d1d : 9d1d: 54 4d 3a 20 65 72 72 6f 72 20 63 6c 65 61 72 65 TM: error cleare 9d2d: 64 00 d. 00009d2f : 9d2f: 54 4d 3a 20 65 72 72 6f 72 20 74 72 69 67 67 65 TM: error trigge 9d3f: 72 65 64 21 00 red!. 00009d44 : 9d44: 54 4d 3a 20 65 72 72 6f 72 20 7c 25 66 7c 3e 25 TM: error |%f|>% 9d54: 66 0a 00 f.. 00009d57 : 9d57: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 9d67: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 9d77: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 9d87: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 9d97: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 9da7: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 9db7: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 9dc7: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 9dd7: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 9de7: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 9df7: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 9e07: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 9e17: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 9e27: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 9e37: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 9e47: 00 3f 00 00 .?.. 00009e4b : 9e4b: 90 13 7d 00 b0 15 78 00 f0 17 73 00 60 1a 6e 00 ..}...x...s.`.n. 9e5b: f0 1c 69 00 a0 1f 64 00 50 22 5f 00 20 25 5a 00 ..i...d.P"_. %Z. 9e6b: e0 27 55 00 90 2a 50 00 20 2d 4b 00 a0 2f 46 00 .'U..*P. -K../F. 9e7b: f0 31 41 00 10 34 3c 00 f0 35 37 00 a0 37 32 00 .1A..4<..57..72. 9e8b: 20 39 2d 00 60 3a 28 00 70 3b 23 00 60 3c 1e 00 9-.`:(.p;#.`<.. 9e9b: 20 3d 19 00 c0 3d 14 00 40 3e 0f 00 a0 3e 0a 00 =...=..@>...>.. 9eab: f0 3e 05 00 40 3f 00 00 70 3f fb ff 90 3f f6 ff .>..@?..p?...?.. 9ebb: b0 3f f1 ff c0 3f ec ff d0 3f e7 ff e0 3f e2 ff .?...?...?...?.. 9ecb: f0 3f dd ff f0 3f d8 ff .?...?.. 00009ed3 : 9ed3: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 9ee3: 52 55 4e 41 57 41 59 00 RUNAWAY. 00009eeb : 9eeb: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 9efb: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 00009f04 : 9f04: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 00009f14 : 9f14: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 9f24: 57 41 59 00 WAY. 00009f28 : 9f28: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9f38: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 9f48: 29 00 ). 00009f4a : 9f4a: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9f5a: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 9f6a: 44 29 00 D). 00009f6d : 9f6d: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 00009f7b : 9f7b: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 9f8b: 52 00 R. 00009f8d : 9f8d: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009f99 : 9f99: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9fa9: 20 6f 66 66 2e 20 00 off. . 00009fb0 : 9fb0: 3a 20 00 : . 00009fb3 : 9fb3: 45 72 72 3a 20 00 Err: . 00009fb9 : 9fb9: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009fc9 : 9fc9: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 00009fd8 : 9fd8: 54 4d 3a 20 69 6e 76 61 6c 69 64 20 70 61 72 61 TM: invalid para 9fe8: 6d 65 74 65 72 73 2c 20 63 61 6e 6e 6f 74 20 65 meters, cannot e 9ff8: 6e 61 62 6c 65 00 nable. 00009ffe : 9ffe: 25 53 20 20 4d 33 31 30 20 50 25 2e 32 66 20 55 %S M310 P%.2f U a00e: 25 2e 34 66 20 56 25 2e 32 66 20 43 25 2e 32 66 %.4f V%.2f C%.2f a01e: 20 44 25 2e 34 66 20 4c 25 75 20 53 25 75 20 42 D%.4f L%u S%u B a02e: 25 75 20 45 25 2e 32 66 20 57 25 2e 32 66 20 54 %u E%.2f W%.2f T a03e: 25 2e 32 66 0a 00 %.2f.. 0000a044 : a044: 25 53 20 20 4d 33 31 30 20 49 25 75 20 52 25 2e %S M310 I%u R%. a054: 32 66 0a 00 2f.. 0000a058 : a058: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 73 65 Thermal Model se a068: 74 74 69 6e 67 73 3a 00 ttings:. 0000a070 : a070: cd cc f4 41 00 00 e8 41 00 00 dc 41 00 00 c4 41 ...A...A...A...A a080: 33 33 bb 41 66 66 b2 41 9a 99 a9 41 9a 99 a1 41 33.Aff.A...A...A a090: 66 66 9e 41 33 33 9b 41 00 00 98 41 cd cc 94 41 ff.A33.A...A...A a0a0: 66 66 92 41 cd cc 90 41 33 33 8f 41 9a 99 8d 41 ff.A...A33.A...A 0000a0b0 : a0b0: 45 2d 6d 6f 74 6f 72 20 63 75 72 72 65 6e 74 20 E-motor current a0c0: 73 63 61 6c 69 6e 67 20 65 6e 61 62 6c 65 64 00 scaling enabled. 0000a0d0 : a0d0: 01 08 08 01 0a 0a 01 14 14 01 12 12 ............ 0000a0dc : a0dc: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 6e 74 tmc2130_home_ent a0ec: 65 72 28 61 78 65 73 5f 6d 61 73 6b 3d 30 78 25 er(axes_mask=0x% a0fc: 30 32 78 29 0a 00 02x).. 0000a102 : a102: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 78 69 tmc2130_home_exi a112: 74 20 74 6d 63 32 31 33 30 5f 73 67 5f 68 6f 6d t tmc2130_sg_hom a122: 69 6e 67 5f 61 78 65 73 5f 6d 61 73 6b 3d 30 78 ing_axes_mask=0x a132: 25 30 32 78 0a 00 %02x.. 0000a138 : a138: 72 65 73 75 6c 74 20 76 61 6c 75 65 3a 20 25 64 result value: %d a148: 0a 00 .. 0000a14a : a14a: 20 69 3d 25 32 64 20 63 6e 74 3d 25 32 64 20 76 i=%2d cnt=%2d v a15a: 61 6c 3d 25 32 64 0a 00 al=%2d.. 0000a162 : a162: 63 6c 75 73 74 65 72 73 3a 00 clusters:. 0000a16c : a16c: 20 69 3d 25 32 64 20 73 74 65 70 3d 25 32 64 0a i=%2d step=%2d. ... 0000a17d : a17d: 73 6f 72 74 65 64 20 73 61 6d 70 6c 65 73 3a 00 sorted samples:. 0000a18d <__c.1906>: a18d: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! a19d: 21 00 !. 0000a19f : a19f: 3a 20 00 : . 0000a1a2 : a1a2: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 0000a1b0 : a1b0: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 0000a1b9 : a1b9: 20 3a 20 00 : . 0000a1bd : a1bd: 25 33 53 00 %3S. 0000a1c1 : a1c1: 25 2d 37 73 00 %-7s. 0000a1c6 : a1c6: 4e 64 20 25 34 2e 32 66 20 00 Nd %4.2f . 0000a1d0 : a1d0: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 a1e0: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 0000a1eb : a1eb: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a1fb: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 0000a20a : a20a: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a21a: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a22a: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 0000a237 : a237: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a247: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a257: 25 2d 37 2e 37 53 58 20 25 2d 33 64 20 20 59 20 %-7.7SX %-3d Y a267: 25 2d 33 64 00 %-3d. 0000a26c : a26c: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 0000a276 : a276: 0a 20 49 52 20 3a 20 20 20 20 20 20 20 25 33 2e . IR : %3. a286: 31 66 56 00 1fV. 0000a28a : a28a: 20 50 57 52 3a 20 20 20 20 20 20 25 34 2e 31 66 PWR: %4.1f a29a: 56 0a 20 42 45 44 3a 20 20 20 20 20 20 25 34 2e V. BED: %4. a2aa: 31 66 56 00 1fV. 0000a2ae : a2ae: 25 53 0a 20 58 20 25 64 0a 20 59 20 25 64 00 %S. X %d. Y %d. 0000a2bd : a2bd: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 0000a2c9 <_ZZL16lcd_support_menuvE3__c__16_>: a2c9: 20 00 . 0000a2cb <_ZZL16lcd_support_menuvE3__c__15_>: a2cb: 20 00 . 0000a2cd <_ZZL16lcd_support_menuvE3__c__14_>: a2cd: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr a2dd: 3a 00 :. 0000a2df <_ZZL16lcd_support_menuvE3__c__13_>: a2df: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 0000a2ee <_ZZL16lcd_support_menuvE3__c__12_>: a2ee: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000a2f7 <_ZZL16lcd_support_menuvE3__c__11_>: a2f7: 20 46 57 3a 00 FW:. 0000a2fc <_ZZL16lcd_support_menuvE3__c__10_>: a2fc: 46 69 6c 2e 20 73 65 6e 73 6f 72 20 76 2e 3a 00 Fil. sensor v.:. 0000a30c : a30c: 31 39 37 30 2d 30 31 2d 30 31 00 1970-01-01. 0000a317 : a317: 45 33 44 52 45 56 4f 5f 48 46 5f 36 30 57 00 E3DREVO_HF_60W. 0000a326 : a326: 45 49 4e 53 79 5f 31 30 61 00 EINSy_10a. 0000a330 : a330: 31 5f 37 35 6d 6d 5f 4d 4b 33 53 00 1_75mm_MK3S. 0000a33c : a33c: 20 48 61 73 68 3a 30 30 30 30 30 30 30 30 30 00 Hash:000000000. 0000a34c : a34c: 20 52 65 70 6f 3a 55 6e 6b 6e 6f 77 6e 00 Repo:Unknown. 0000a35a : a35a: 20 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 0000a367 : a367: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 0000a371 <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: a371: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 0000a380 <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: a380: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 0000a38c <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: a38c: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 0000a39c <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: a39c: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 0000a3a8 <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: a3a8: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 0000a3b8 <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: a3b8: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 0000a3c4 <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: a3c4: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 0000a3d4 <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: a3d4: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 0000a3e0 <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: a3e0: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 0000a3ef <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: a3ef: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 0000a3fb <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: a3fb: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 0000a40a : a40a: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 0000a416 : a416: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 31 30 00 PC - 275/110. 0000a426 : a426: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 0000a432 : a432: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 0000a442 : a442: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 0000a44e : a44e: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 0000a45d : a45d: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 0000a469 : a469: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 0000a478 : a478: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 0000a484 : a484: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 0000a493 : a493: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 0000a49d : a49d: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 0000a4a8 : a4a8: 58 3a 00 X:. 0000a4ab : a4ab: 59 3a 00 Y:. 0000a4ae : a4ae: 5a 3a 00 Z:. 0000a4b1 : a4b1: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 0000a4c2 : a4c2: 25 33 75 00 %3u. 0000a4c6 : a4c6: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a4d6: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin a4e6: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing a4f6: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 0000a501 : a501: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a511: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue a521: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t a531: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 0000a53a : a53a: 47 38 30 00 G80. 0000a53e : a53e: 4d 34 35 00 M45. 0000a542 : a542: 4d 34 35 20 5a 00 M45 Z. 0000a548 : a548: 47 37 36 00 G76. 0000a54c : a54c: 4d 37 30 31 20 50 30 00 M701 P0. 0000a554 : a554: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d a564: 0a 00 .. 0000a566 : a566: 4d 39 31 34 00 M914. 0000a56b : a56b: 4d 39 31 35 00 M915. 0000a570 : a570: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 0000a57d : a57d: 46 73 65 6e 73 6f 72 20 44 65 74 65 63 74 69 6f Fsensor Detectio a58d: 6e 00 n. 0000a58f : a58f: 30 2e 38 30 00 0.80. 0000a594 : a594: 30 2e 36 30 00 0.60. 0000a599 : a599: 30 2e 34 30 00 0.40. 0000a59e : a59e: 30 2e 32 35 00 0.25. 0000a5a3 : a5a3: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 0000a5ad : a5ad: 4d 4d 55 00 MMU. 0000a5b1 : a5b1: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c a5c1: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a5d1: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a5e1: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a5e9 <_ZL4endl.lto_priv.390>: a5e9: 0a 00 .. 0000a5eb : a5eb: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 0000a5fa : a5fa: 25 64 0a 00 %d.. 0000a5fe : a5fe: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 0000a60f : a60f: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ a61f: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f a62f: 25 25 0a 00 %%.. 0000a633 : a633: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi a643: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 0000a64f : a64f: 74 6d 63 32 31 33 30 5f 67 6f 74 6f 5f 73 74 65 tmc2130_goto_ste a65f: 70 20 25 64 20 25 64 20 25 64 20 25 64 20 0a 00 p %d %d %d %d .. 0000a66f <_ZL16ramming_sequence.lto_priv.393>: a66f: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A a67f: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A a68f: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B a69f: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB a6af: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B a6bf: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B a6cf: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A a6df: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ a6ef: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 0000a6ff <_ZZN4MMU213ProtocolLogic18ResetRetryAttemptsEvE3__c.lto_priv.391>: a6ff: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp a70f: 74 73 00 ts. 0000a712 : a712: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st a722: 6f 70 70 65 64 00 opped. 0000a728 : a728: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 0000a738 : a738: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout a748: 73 74 61 72 74 65 64 00 started. 0000a750 : a750: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki a760: 6e 67 00 ng. 0000a763 : a763: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown a773: 70 65 6e 64 69 6e 67 00 pending. 0000a77b : a77b: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 0000a788 : a788: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 0000a792 <_ZL9mmu2Magic.lto_priv.374>: a792: 4d 4d 55 32 3a 00 MMU2:. 0000a798 : a798: 47 31 20 58 25 64 20 59 25 2d 2e 32 66 20 45 25 G1 X%d Y%-.2f E% a7a8: 2d 2e 33 66 00 -.3f. 0000a7ad : a7ad: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: a7bd: 20 00 . 0000a7bf : a7bf: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope a7cf: 6e 65 64 00 ned. 0000a7d3 : a7d3: a5 5a 94 5a 80 5a 6b 5a 55 5a 42 5a 2c 5a 18 5a .Z.Z.ZkZUZBZ,Z.Z a7e3: 07 5a f1 59 80 5a 94 5a dd 59 ce 59 ba 59 a9 59 .Z.Y.Z.Z.Y.Y.Y.Y a7f3: 94 59 38 5d 7e 59 6c 59 59 59 48 59 33 59 20 59 .Y8]~YlYYYHY3Y Y a803: 0c 59 f7 58 ee 58 dc 58 c7 58 .Y.X.X.X.X 0000a80d : a80d: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 0000a817 : a817: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r a827: 75 6e 6f 75 74 21 00 unout!. 0000a82e : a82e: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti a83e: 6d 65 6f 75 74 00 meout. 0000a844 : a844: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 0000a853 : a853: 03 00 03 ... 0000a856 : a856: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 0000a867 : a867: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 0000a875 : a875: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 0000a886 : a886: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe a896: 64 00 d. 0000a898 : a898: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress a8a8: 65 64 00 ed. 0000a8ab <_ZN4MMU2L11errorTitlesE.lto_priv.509>: a8ab: 02 5d ed 5c d6 5c c1 5c ac 5c 98 5c 88 5c 71 5c .].\.\.\.\.\.\q\ a8bb: 5a 5c 43 5c 2f 5c 1b 5c 05 5c 05 5c 05 5c f0 5b Z\C\/\.\.\.\.\.[ a8cb: f0 5b f0 5b dd 5b dd 5b dd 5b ca 5b ca 5b ca 5b .[.[.[.[.[.[.[.[ a8db: b3 5b b3 5b b3 5b 9e 5b 9e 5b 9e 5b 88 5b 88 5b .[.[.[.[.[.[.[.[ a8eb: 88 5b 78 5b 63 5b 4d 5b 37 5b 28 5b 1b 5b 04 5b .[x[c[M[7[([.[.[ a8fb: f1 5a df 5a cc 5a ba 5a aa 5a .Z.Z.Z.Z.Z 0000a905 : a905: 42 75 74 74 6f 6e 00 Button. 0000a90c : a90c: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b a91c: 74 6e 4c 4d 52 20 00 tnLMR . 0000a923 <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.508>: a923: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . a933: 20 20 20 81 00 .. 0000a938 : a938: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu a948: 72 65 20 72 65 61 63 68 65 64 00 re reached. 0000a953 : a953: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 0000a961 : a961: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl a971: 65 61 72 65 64 00 eared. 0000a977 : a977: 20 57 3a 00 W:. 0000a97b : a97b: 20 45 3a 00 E:. 0000a97f : a97f: 54 3a 00 T:. 0000a982 : a982: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 0000a993 : a993: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 0000a9a0 : a9a0: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 0000a9ae : a9ae: 20 53 69 7a 65 3a 20 00 Size: . 0000a9b6 : a9b6: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 0000a9c4 : a9c4: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 0000a9d5 : a9d5: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 0000a9e6 : a9e6: 22 20 70 6f 73 00 " pos. 0000a9ec : a9ec: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 0000a9f7 : a9f7: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL aa07: 74 61 72 67 65 74 3a 22 00 target:". 0000aa10 : aa10: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s aa20: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w aa30: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev aa40: 65 6c 73 2e 00 els.. 0000aa45 : aa45: 20 22 25 73 22 00 "%s". 0000aa4b : aa4b: 20 25 23 6c 78 00 %#lx. 0000aa51 : aa51: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 0000aa5a : aa5a: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% aa6a: 73 22 0a 00 s".. 0000aa6e : aa6e: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 0000aa77 : aa77: 04 1a .. 0000aa79 : aa79: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt aa89: 74 65 6d 70 74 73 00 tempts. 0000aa90 : aa90: 08 1b 1c ... 0000aa93 : aa93: 0b 14 .. 0000aa95 <_ZZN4MMU213ProtocolLogic33ResetCommunicationTimeoutAttemptsEvE3__c.lto_priv.392>: aa95: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 0000aaa4 : aaa4: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 0000aab3 <_ZL10bufferFull.lto_priv.571>: aab3: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer aac3: 20 66 75 6c 6c 21 00 full!. 0000aaca : aaca: 45 72 72 6f 72 3a 00 Error:. 0000aad1 : aad1: 22 00 ". 0000aad3 : aad3: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the aae3: 66 72 6f 6e 74 3a 20 22 00 front: ". 0000aaec <_ZL9mmu2Magic.lto_priv.375>: aaec: 4d 4d 55 32 3a 00 MMU2:. 0000aaf2 : aaf2: 65 63 68 6f 3a 00 echo:. 0000aaf8 : aaf8: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 0000ab00 : ab00: 4d 4d 55 20 69 73 20 00 MMU is . 0000ab08 : ab08: 25 2e 31 30 53 20 00 %.10S . 0000ab0f : ab0f: 25 34 64 00 %4d. 0000ab13 : ab13: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t ab23: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 0000ab30 : ab30: 25 64 2f 39 00 %d/9. 0000ab35 : ab35: 4d 4d 55 32 3a 00 MMU2:. 0000ab3b : ab3b: 25 33 64 00 %3d. 0000ab3f : ab3f: 18 01 04 19 02 0a ...... 0000ab45 : ab45: ed 64 77 64 fd 63 90 63 47 63 b5 62 3d 62 d5 61 .dwd.c.cGc.b=b.a ab55: 86 61 66 61 1a 61 66 61 03 61 03 61 03 61 03 61 .afa.afa.a.a.a.a ab65: 03 61 03 61 03 61 03 61 03 61 03 61 03 61 03 61 .a.a.a.a.a.a.a.a ab75: 03 61 03 61 03 61 03 61 03 61 03 61 03 61 03 61 .a.a.a.a.a.a.a.a ab85: 03 61 03 61 cc 60 8b 60 41 60 ce 5f 99 5f 4f 5f .a.a.`.`A`._._O_ ab95: 05 5f a7 5e 6e 5e 2c 5e 0f 5e ._.^n^,^.^ 0000ab9f : ab9f: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. abaf: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ abbf: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 0000abcc : abcc: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. abdc: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... abec: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. abfc: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. ac0c: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. ac1c: f9 01 fa 01 fb 01 fc 01 84 03 .......... 0000ac26 : ac26: 7a 65 e3 65 6f 65 66 65 5f 65 a2 4c b5 3c 58 65 ze.eoefe_e.L.: ac38: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 ac48: 34 25 68 75 00 4%hu. 0000ac4d : ac4d: 20 55 70 67 72 61 64 69 6e 67 20 78 66 6c 61 73 Upgrading xflas ac5d: 68 0a 20 44 6f 20 6e 6f 74 20 64 69 73 63 6f 6e h. Do not discon ac6d: 6e 65 63 74 21 00 nect!. 0000ac73 : ac73: 77 32 35 78 32 30 63 6c 5f 63 66 6d 0a 00 w25x20cl_cfm.. 0000ac81 : ac81: 77 32 35 78 32 30 63 6c 5f 65 6e 74 65 72 0a 00 w25x20cl_enter.. 0000ac91 : ac91: 73 74 61 72 74 0a 00 start.. 0000ac98 : ac98: 72 65 63 6f 76 65 72 5f 6d 61 63 68 69 6e 65 5f recover_machine_ aca8: 73 74 61 74 65 5f 61 66 74 65 72 5f 70 6f 77 65 state_after_powe acb8: 72 5f 70 61 6e 69 63 2c 20 69 6e 69 74 69 61 6c r_panic, initial acc8: 20 00 . 0000acca <_ZZL25restore_print_from_eeprombE3__c__12_>: acca: 50 52 55 53 41 20 75 76 6c 6f 00 PRUSA uvlo. 0000acd5 <_ZZL25restore_print_from_eeprombE3__c__11_>: acd5: 47 34 20 53 30 00 G4 S0. 0000acdb <_ZZL25restore_print_from_eeprombE3__c__10_>: acdb: 4d 31 31 30 20 4e 25 6c 75 00 M110 N%lu. 0000ace5 : ace5: 4d 32 36 20 53 25 6c 75 00 M26 S%lu. 0000acee : acee: 4d 31 30 36 20 53 25 75 00 M106 S%u. 0000acf7 : acf7: 47 31 20 46 25 64 00 G1 F%d. 0000acfe : acfe: 4d 38 32 00 M82. 0000ad02 : ad02: 47 39 32 20 45 25 2d 2e 33 66 00 G92 E%-.3f. 0000ad0d : ad0d: 4d 32 30 34 20 50 25 2d 2e 31 66 20 52 25 2d 2e M204 P%-.1f R%-. ad1d: 31 66 20 54 25 2d 2e 31 66 00 1f T%-.1f. 0000ad27 : ad27: 47 31 20 5a 25 2d 2e 33 66 00 G1 Z%-.3f. 0000ad31 : ad31: 50 52 55 53 41 20 4d 42 4c 20 56 31 00 PRUSA MBL V1. 0000ad3e : ad3e: 47 31 20 58 25 2d 2e 33 66 20 59 25 2d 2e 33 66 G1 X%-.3f Y%-.3f ad4e: 20 46 33 30 30 30 00 F3000. 0000ad55 : ad55: 2c 20 66 65 65 64 6d 75 6c 74 69 70 6c 79 3a 00 , feedmultiply:. 0000ad65 : ad65: 46 65 65 64 72 61 74 65 3a 00 Feedrate:. 0000ad6f : ad6f: 47 31 20 45 35 20 46 31 32 30 00 G1 E5 F120. 0000ad7a : ad7a: 4d 31 30 39 20 53 25 64 00 M109 S%d. 0000ad83 : ad83: 4d 31 34 30 20 53 25 64 00 M140 S%d. 0000ad8c : ad8c: 4d 31 30 34 20 53 25 64 00 M104 S%d. 0000ad95 : ad95: 47 32 38 20 58 20 59 00 G28 X Y. 0000ad9d : ad9d: 47 31 20 5a 25 2e 33 66 20 46 38 30 30 00 G1 Z%.3f F800. 0000adab : adab: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p adbb: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... adcb: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b addb: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... adeb: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T adfb: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... ae0b: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F ae1b: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... ae2b: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 ae3b: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. ae4b: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* ae5b: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... ae6b: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. ae7b: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. ae8b: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. ae9b: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. aeab: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. aebb: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` aecb: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. aedb: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr aeeb: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... aefb: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D af0b: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. af1b: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V af2b: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... af3b: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( af4b: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... af5b: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: af6b: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... af7b: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... af8b: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... af9b: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 0000afab : afab: 7c 3c 3e 3f 2f 2a 22 5c 00 |<>?/*"\. 0000afb4 <__ctors_start>: afb4: 1c 3b cpi r17, 0xBC ; 188 0000afb6 <__ctors_end>: afb6: aa 65 ori r26, 0x5A ; 90 0000afb8 <__dtors_end>: afb8: 11 24 eor r1, r1 afba: 1f be out 0x3f, r1 ; 63 afbc: cf ef ldi r28, 0xFF ; 255 afbe: d1 e2 ldi r29, 0x21 ; 33 afc0: de bf out 0x3e, r29 ; 62 afc2: cd bf out 0x3d, r28 ; 61 afc4: 00 e0 ldi r16, 0x00 ; 0 afc6: 0c bf out 0x3c, r16 ; 60 0000afc8 <__do_copy_data>: afc8: 13 e0 ldi r17, 0x03 ; 3 afca: a0 e0 ldi r26, 0x00 ; 0 afcc: b2 e0 ldi r27, 0x02 ; 2 afce: ee e4 ldi r30, 0x4E ; 78 afd0: f8 ec ldi r31, 0xC8 ; 200 afd2: 03 e0 ldi r16, 0x03 ; 3 afd4: 0b bf out 0x3b, r16 ; 59 afd6: 02 c0 rjmp .+4 ; 0xafdc <__do_copy_data+0x14> afd8: 07 90 elpm r0, Z+ afda: 0d 92 st X+, r0 afdc: a6 32 cpi r26, 0x26 ; 38 afde: b1 07 cpc r27, r17 afe0: d9 f7 brne .-10 ; 0xafd8 <__do_copy_data+0x10> 0000afe2 <__do_clear_bss>: afe2: 28 e1 ldi r18, 0x18 ; 24 afe4: a6 e2 ldi r26, 0x26 ; 38 afe6: b3 e0 ldi r27, 0x03 ; 3 afe8: 01 c0 rjmp .+2 ; 0xafec <.do_clear_bss_start> 0000afea <.do_clear_bss_loop>: afea: 1d 92 st X+, r1 0000afec <.do_clear_bss_start>: afec: a9 31 cpi r26, 0x19 ; 25 afee: b2 07 cpc r27, r18 aff0: e1 f7 brne .-8 ; 0xafea <.do_clear_bss_loop> 0000aff2 <__do_global_ctors>: aff2: 17 e5 ldi r17, 0x57 ; 87 aff4: cb ed ldi r28, 0xDB ; 219 aff6: d7 e5 ldi r29, 0x57 ; 87 aff8: 00 e0 ldi r16, 0x00 ; 0 affa: 06 c0 rjmp .+12 ; 0xb008 <__do_global_ctors+0x16> affc: 21 97 sbiw r28, 0x01 ; 1 affe: 01 09 sbc r16, r1 b000: 80 2f mov r24, r16 b002: fe 01 movw r30, r28 b004: 0f 94 6b de call 0x3bcd6 ; 0x3bcd6 <__tablejump2__> b008: ca 3d cpi r28, 0xDA ; 218 b00a: d1 07 cpc r29, r17 b00c: 80 e0 ldi r24, 0x00 ; 0 b00e: 08 07 cpc r16, r24 b010: a9 f7 brne .-22 ; 0xaffc <__do_global_ctors+0xa> b012: 0e 94 08 f9 call 0x1f210 ; 0x1f210
b016: 0d 94 15 e4 jmp 0x3c82a ; 0x3c82a <__do_global_dtors> 0000b01a <__bad_interrupt>: b01a: 0c 94 a0 68 jmp 0xd140 ; 0xd140 <__vector_default> 0000b01e : b01e: 2f 92 push r2 b020: 3f 92 push r3 b022: 4f 92 push r4 b024: 5f 92 push r5 b026: 6f 92 push r6 b028: 7f 92 push r7 b02a: 8f 92 push r8 b02c: 9f 92 push r9 b02e: af 92 push r10 b030: bf 92 push r11 b032: cf 92 push r12 b034: df 92 push r13 b036: ef 92 push r14 b038: ff 92 push r15 b03a: 0f 93 push r16 b03c: 1f 93 push r17 b03e: cf 93 push r28 b040: df 93 push r29 b042: cd b7 in r28, 0x3d ; 61 b044: de b7 in r29, 0x3e ; 62 b046: 2f 97 sbiw r28, 0x0f ; 15 b048: 0f b6 in r0, 0x3f ; 63 b04a: f8 94 cli b04c: de bf out 0x3e, r29 ; 62 b04e: 0f be out 0x3f, r0 ; 63 b050: cd bf out 0x3d, r28 ; 61 b052: 6c 01 movw r12, r24 b054: 1b 01 movw r2, r22 b056: 5a 01 movw r10, r20 b058: fc 01 movw r30, r24 b05a: 17 82 std Z+7, r1 ; 0x07 b05c: 16 82 std Z+6, r1 ; 0x06 b05e: 83 81 ldd r24, Z+3 ; 0x03 b060: 9e 01 movw r18, r28 b062: 2f 5f subi r18, 0xFF ; 255 b064: 3f 4f sbci r19, 0xFF ; 255 b066: 49 01 movw r8, r18 b068: 81 fd sbrc r24, 1 b06a: d2 c0 rjmp .+420 ; 0xb210 b06c: 8f ef ldi r24, 0xFF ; 255 b06e: 9f ef ldi r25, 0xFF ; 255 b070: ee c2 rjmp .+1500 ; 0xb64e b072: f1 2c mov r15, r1 b074: 51 2c mov r5, r1 b076: 00 e0 ldi r16, 0x00 ; 0 b078: 00 32 cpi r16, 0x20 ; 32 b07a: 38 f4 brcc .+14 ; 0xb08a b07c: 8b 32 cpi r24, 0x2B ; 43 b07e: 09 f1 breq .+66 ; 0xb0c2 b080: 90 f4 brcc .+36 ; 0xb0a6 b082: 80 32 cpi r24, 0x20 ; 32 b084: f9 f0 breq .+62 ; 0xb0c4 b086: 83 32 cpi r24, 0x23 ; 35 b088: 09 f1 breq .+66 ; 0xb0cc b08a: 07 fd sbrc r16, 7 b08c: 34 c0 rjmp .+104 ; 0xb0f6 b08e: 20 ed ldi r18, 0xD0 ; 208 b090: 28 0f add r18, r24 b092: 2a 30 cpi r18, 0x0A ; 10 b094: 20 f5 brcc .+72 ; 0xb0de b096: 06 ff sbrs r16, 6 b098: 1b c0 rjmp .+54 ; 0xb0d0 b09a: fa e0 ldi r31, 0x0A ; 10 b09c: ff 9e mul r15, r31 b09e: 20 0d add r18, r0 b0a0: 11 24 eor r1, r1 b0a2: f2 2e mov r15, r18 b0a4: 05 c0 rjmp .+10 ; 0xb0b0 b0a6: 8d 32 cpi r24, 0x2D ; 45 b0a8: 79 f0 breq .+30 ; 0xb0c8 b0aa: 80 33 cpi r24, 0x30 ; 48 b0ac: 71 f7 brne .-36 ; 0xb08a b0ae: 01 60 ori r16, 0x01 ; 1 b0b0: f1 01 movw r30, r2 b0b2: 93 fd sbrc r25, 3 b0b4: 85 91 lpm r24, Z+ b0b6: 93 ff sbrs r25, 3 b0b8: 81 91 ld r24, Z+ b0ba: 1f 01 movw r2, r30 b0bc: 81 11 cpse r24, r1 b0be: dc cf rjmp .-72 ; 0xb078 b0c0: 1a c0 rjmp .+52 ; 0xb0f6 b0c2: 02 60 ori r16, 0x02 ; 2 b0c4: 04 60 ori r16, 0x04 ; 4 b0c6: f4 cf rjmp .-24 ; 0xb0b0 b0c8: 08 60 ori r16, 0x08 ; 8 b0ca: f2 cf rjmp .-28 ; 0xb0b0 b0cc: 00 61 ori r16, 0x10 ; 16 b0ce: f0 cf rjmp .-32 ; 0xb0b0 b0d0: 3a e0 ldi r19, 0x0A ; 10 b0d2: 53 9e mul r5, r19 b0d4: 20 0d add r18, r0 b0d6: 11 24 eor r1, r1 b0d8: 52 2e mov r5, r18 b0da: 00 62 ori r16, 0x20 ; 32 b0dc: e9 cf rjmp .-46 ; 0xb0b0 b0de: 8e 32 cpi r24, 0x2E ; 46 b0e0: 21 f4 brne .+8 ; 0xb0ea b0e2: 06 fd sbrc r16, 6 b0e4: b1 c2 rjmp .+1378 ; 0xb648 b0e6: 00 64 ori r16, 0x40 ; 64 b0e8: e3 cf rjmp .-58 ; 0xb0b0 b0ea: 8c 36 cpi r24, 0x6C ; 108 b0ec: 11 f4 brne .+4 ; 0xb0f2 b0ee: 00 68 ori r16, 0x80 ; 128 b0f0: df cf rjmp .-66 ; 0xb0b0 b0f2: 88 36 cpi r24, 0x68 ; 104 b0f4: e9 f2 breq .-70 ; 0xb0b0 b0f6: 9b eb ldi r25, 0xBB ; 187 b0f8: 98 0f add r25, r24 b0fa: 93 30 cpi r25, 0x03 ; 3 b0fc: 08 f0 brcs .+2 ; 0xb100 b0fe: 5f c0 rjmp .+190 ; 0xb1be b100: 00 61 ori r16, 0x10 ; 16 b102: 80 5e subi r24, 0xE0 ; 224 b104: 06 fd sbrc r16, 6 b106: 02 c0 rjmp .+4 ; 0xb10c b108: 46 e0 ldi r20, 0x06 ; 6 b10a: f4 2e mov r15, r20 b10c: 10 2f mov r17, r16 b10e: 1f 73 andi r17, 0x3F ; 63 b110: 85 36 cpi r24, 0x65 ; 101 b112: 09 f0 breq .+2 ; 0xb116 b114: 5b c0 rjmp .+182 ; 0xb1cc b116: 10 64 ori r17, 0x40 ; 64 b118: 17 ff sbrs r17, 7 b11a: 61 c0 rjmp .+194 ; 0xb1de b11c: 8f 2d mov r24, r15 b11e: 9b e3 ldi r25, 0x3B ; 59 b120: 9f 15 cp r25, r15 b122: 08 f4 brcc .+2 ; 0xb126 b124: 8b e3 ldi r24, 0x3B ; 59 b126: 44 24 eor r4, r4 b128: 43 94 inc r4 b12a: 48 0e add r4, r24 b12c: 27 e0 ldi r18, 0x07 ; 7 b12e: 35 01 movw r6, r10 b130: f4 e0 ldi r31, 0x04 ; 4 b132: 6f 0e add r6, r31 b134: 71 1c adc r7, r1 b136: f5 01 movw r30, r10 b138: 60 81 ld r22, Z b13a: 71 81 ldd r23, Z+1 ; 0x01 b13c: 82 81 ldd r24, Z+2 ; 0x02 b13e: 93 81 ldd r25, Z+3 ; 0x03 b140: 04 2d mov r16, r4 b142: a4 01 movw r20, r8 b144: 0f 94 14 da call 0x3b428 ; 0x3b428 <__ftoa_engine> b148: 5c 01 movw r10, r24 b14a: f9 81 ldd r31, Y+1 ; 0x01 b14c: fc 87 std Y+12, r31 ; 0x0c b14e: f0 ff sbrs r31, 0 b150: 03 c0 rjmp .+6 ; 0xb158 b152: 0d e2 ldi r16, 0x2D ; 45 b154: f3 ff sbrs r31, 3 b156: 07 c0 rjmp .+14 ; 0xb166 b158: 0b e2 ldi r16, 0x2B ; 43 b15a: 11 fd sbrc r17, 1 b15c: 04 c0 rjmp .+8 ; 0xb166 b15e: 01 2f mov r16, r17 b160: 04 70 andi r16, 0x04 ; 4 b162: 12 fd sbrc r17, 2 b164: 00 e2 ldi r16, 0x20 ; 32 b166: 2c 85 ldd r18, Y+12 ; 0x0c b168: 2c 70 andi r18, 0x0C ; 12 b16a: e2 2e mov r14, r18 b16c: 09 f4 brne .+2 ; 0xb170 b16e: 6b c0 rjmp .+214 ; 0xb246 b170: 01 11 cpse r16, r1 b172: d8 c2 rjmp .+1456 ; 0xb724 b174: f3 e0 ldi r31, 0x03 ; 3 b176: e1 2c mov r14, r1 b178: f5 15 cp r31, r5 b17a: a0 f4 brcc .+40 ; 0xb1a4 b17c: 83 e0 ldi r24, 0x03 ; 3 b17e: e5 2c mov r14, r5 b180: e8 1a sub r14, r24 b182: 13 fd sbrc r17, 3 b184: 08 c0 rjmp .+16 ; 0xb196 b186: b6 01 movw r22, r12 b188: 80 e2 ldi r24, 0x20 ; 32 b18a: 90 e0 ldi r25, 0x00 ; 0 b18c: 0f 94 c3 db call 0x3b786 ; 0x3b786 b190: ea 94 dec r14 b192: e1 10 cpse r14, r1 b194: f8 cf rjmp .-16 ; 0xb186 b196: 00 23 and r16, r16 b198: 29 f0 breq .+10 ; 0xb1a4 b19a: b6 01 movw r22, r12 b19c: 80 2f mov r24, r16 b19e: 90 e0 ldi r25, 0x00 ; 0 b1a0: 0f 94 c3 db call 0x3b786 ; 0x3b786 b1a4: 3c 85 ldd r19, Y+12 ; 0x0c b1a6: 28 e9 ldi r18, 0x98 ; 152 b1a8: a2 2e mov r10, r18 b1aa: 27 e7 ldi r18, 0x77 ; 119 b1ac: b2 2e mov r11, r18 b1ae: 33 fd sbrc r19, 3 b1b0: 04 c0 rjmp .+8 ; 0xb1ba b1b2: 9c e9 ldi r25, 0x9C ; 156 b1b4: a9 2e mov r10, r25 b1b6: 97 e7 ldi r25, 0x77 ; 119 b1b8: b9 2e mov r11, r25 b1ba: 10 71 andi r17, 0x10 ; 16 b1bc: 22 c0 rjmp .+68 ; 0xb202 b1be: 9b e9 ldi r25, 0x9B ; 155 b1c0: 98 0f add r25, r24 b1c2: 93 30 cpi r25, 0x03 ; 3 b1c4: 08 f0 brcs .+2 ; 0xb1c8 b1c6: 47 c1 rjmp .+654 ; 0xb456 b1c8: 0f 7e andi r16, 0xEF ; 239 b1ca: 9c cf rjmp .-200 ; 0xb104 b1cc: 86 36 cpi r24, 0x66 ; 102 b1ce: 11 f4 brne .+4 ; 0xb1d4 b1d0: 10 68 ori r17, 0x80 ; 128 b1d2: a2 cf rjmp .-188 ; 0xb118 b1d4: ff 20 and r15, r15 b1d6: 09 f4 brne .+2 ; 0xb1da b1d8: 9f cf rjmp .-194 ; 0xb118 b1da: fa 94 dec r15 b1dc: 9d cf rjmp .-198 ; 0xb118 b1de: e7 e0 ldi r30, 0x07 ; 7 b1e0: 2f 2d mov r18, r15 b1e2: ef 15 cp r30, r15 b1e4: 18 f4 brcc .+6 ; 0xb1ec b1e6: 27 e0 ldi r18, 0x07 ; 7 b1e8: 37 e0 ldi r19, 0x07 ; 7 b1ea: f3 2e mov r15, r19 b1ec: 41 2c mov r4, r1 b1ee: 9f cf rjmp .-194 ; 0xb12e b1f0: 11 11 cpse r17, r1 b1f2: 80 52 subi r24, 0x20 ; 32 b1f4: b6 01 movw r22, r12 b1f6: 90 e0 ldi r25, 0x00 ; 0 b1f8: 0f 94 c3 db call 0x3b786 ; 0x3b786 b1fc: 8f ef ldi r24, 0xFF ; 255 b1fe: a8 1a sub r10, r24 b200: b8 0a sbc r11, r24 b202: f5 01 movw r30, r10 b204: 84 91 lpm r24, Z b206: 81 11 cpse r24, r1 b208: f3 cf rjmp .-26 ; 0xb1f0 b20a: e1 10 cpse r14, r1 b20c: 84 c2 rjmp .+1288 ; 0xb716 b20e: 53 01 movw r10, r6 b210: f6 01 movw r30, r12 b212: 93 81 ldd r25, Z+3 ; 0x03 b214: f1 01 movw r30, r2 b216: 93 fd sbrc r25, 3 b218: 85 91 lpm r24, Z+ b21a: 93 ff sbrs r25, 3 b21c: 81 91 ld r24, Z+ b21e: 1f 01 movw r2, r30 b220: 88 23 and r24, r24 b222: 09 f4 brne .+2 ; 0xb226 b224: 11 c2 rjmp .+1058 ; 0xb648 b226: 85 32 cpi r24, 0x25 ; 37 b228: 41 f4 brne .+16 ; 0xb23a b22a: 93 fd sbrc r25, 3 b22c: 85 91 lpm r24, Z+ b22e: 93 ff sbrs r25, 3 b230: 81 91 ld r24, Z+ b232: 1f 01 movw r2, r30 b234: 85 32 cpi r24, 0x25 ; 37 b236: 09 f0 breq .+2 ; 0xb23a b238: 1c cf rjmp .-456 ; 0xb072 b23a: b6 01 movw r22, r12 b23c: 90 e0 ldi r25, 0x00 ; 0 b23e: 0f 94 c3 db call 0x3b786 ; 0x3b786 b242: 35 01 movw r6, r10 b244: e4 cf rjmp .-56 ; 0xb20e b246: 17 ff sbrs r17, 7 b248: 6f c0 rjmp .+222 ; 0xb328 b24a: 4a 0c add r4, r10 b24c: fc 85 ldd r31, Y+12 ; 0x0c b24e: f4 ff sbrs r31, 4 b250: 04 c0 rjmp .+8 ; 0xb25a b252: 8a 81 ldd r24, Y+2 ; 0x02 b254: 81 33 cpi r24, 0x31 ; 49 b256: 09 f4 brne .+2 ; 0xb25a b258: 4a 94 dec r4 b25a: 14 14 cp r1, r4 b25c: 0c f0 brlt .+2 ; 0xb260 b25e: 86 c0 rjmp .+268 ; 0xb36c b260: 28 e0 ldi r18, 0x08 ; 8 b262: 24 15 cp r18, r4 b264: 10 f4 brcc .+4 ; 0xb26a b266: 88 e0 ldi r24, 0x08 ; 8 b268: 48 2e mov r4, r24 b26a: 85 e0 ldi r24, 0x05 ; 5 b26c: 90 e0 ldi r25, 0x00 ; 0 b26e: 17 ff sbrs r17, 7 b270: 06 c0 rjmp .+12 ; 0xb27e b272: c5 01 movw r24, r10 b274: b7 fe sbrs r11, 7 b276: 02 c0 rjmp .+4 ; 0xb27c b278: 90 e0 ldi r25, 0x00 ; 0 b27a: 80 e0 ldi r24, 0x00 ; 0 b27c: 01 96 adiw r24, 0x01 ; 1 b27e: 01 11 cpse r16, r1 b280: 01 96 adiw r24, 0x01 ; 1 b282: ff 20 and r15, r15 b284: 31 f0 breq .+12 ; 0xb292 b286: 2f 2d mov r18, r15 b288: 30 e0 ldi r19, 0x00 ; 0 b28a: 2f 5f subi r18, 0xFF ; 255 b28c: 3f 4f sbci r19, 0xFF ; 255 b28e: 82 0f add r24, r18 b290: 93 1f adc r25, r19 b292: 58 16 cp r5, r24 b294: 19 06 cpc r1, r25 b296: 19 f0 breq .+6 ; 0xb29e b298: 14 f0 brlt .+4 ; 0xb29e b29a: e5 2c mov r14, r5 b29c: e8 1a sub r14, r24 b29e: 81 2f mov r24, r17 b2a0: 89 70 andi r24, 0x09 ; 9 b2a2: 11 f4 brne .+4 ; 0xb2a8 b2a4: e1 10 cpse r14, r1 b2a6: 67 c0 rjmp .+206 ; 0xb376 b2a8: 00 23 and r16, r16 b2aa: 29 f0 breq .+10 ; 0xb2b6 b2ac: b6 01 movw r22, r12 b2ae: 80 2f mov r24, r16 b2b0: 90 e0 ldi r25, 0x00 ; 0 b2b2: 0f 94 c3 db call 0x3b786 ; 0x3b786 b2b6: 13 fd sbrc r17, 3 b2b8: 02 c0 rjmp .+4 ; 0xb2be b2ba: e1 10 cpse r14, r1 b2bc: 63 c0 rjmp .+198 ; 0xb384 b2be: 17 ff sbrs r17, 7 b2c0: 7c c0 rjmp .+248 ; 0xb3ba b2c2: 85 01 movw r16, r10 b2c4: b7 fe sbrs r11, 7 b2c6: 02 c0 rjmp .+4 ; 0xb2cc b2c8: 10 e0 ldi r17, 0x00 ; 0 b2ca: 00 e0 ldi r16, 0x00 ; 0 b2cc: c5 01 movw r24, r10 b2ce: 84 19 sub r24, r4 b2d0: 91 09 sbc r25, r1 b2d2: 2c 01 movw r4, r24 b2d4: 6f 2d mov r22, r15 b2d6: 70 e0 ldi r23, 0x00 ; 0 b2d8: ee 27 eor r30, r30 b2da: ff 27 eor r31, r31 b2dc: e6 1b sub r30, r22 b2de: f7 0b sbc r31, r23 b2e0: ff 87 std Y+15, r31 ; 0x0f b2e2: ee 87 std Y+14, r30 ; 0x0e b2e4: 0f 3f cpi r16, 0xFF ; 255 b2e6: 10 07 cpc r17, r16 b2e8: 29 f4 brne .+10 ; 0xb2f4 b2ea: b6 01 movw r22, r12 b2ec: 8e e2 ldi r24, 0x2E ; 46 b2ee: 90 e0 ldi r25, 0x00 ; 0 b2f0: 0f 94 c3 db call 0x3b786 ; 0x3b786 b2f4: a0 16 cp r10, r16 b2f6: b1 06 cpc r11, r17 b2f8: 0c f4 brge .+2 ; 0xb2fc b2fa: 4b c0 rjmp .+150 ; 0xb392 b2fc: 40 16 cp r4, r16 b2fe: 51 06 cpc r5, r17 b300: 0c f0 brlt .+2 ; 0xb304 b302: 47 c0 rjmp .+142 ; 0xb392 b304: f5 01 movw r30, r10 b306: e0 1b sub r30, r16 b308: f1 0b sbc r31, r17 b30a: e8 0d add r30, r8 b30c: f9 1d adc r31, r9 b30e: 81 81 ldd r24, Z+1 ; 0x01 b310: 01 50 subi r16, 0x01 ; 1 b312: 11 09 sbc r17, r1 b314: 2e 85 ldd r18, Y+14 ; 0x0e b316: 3f 85 ldd r19, Y+15 ; 0x0f b318: 02 17 cp r16, r18 b31a: 13 07 cpc r17, r19 b31c: e4 f1 brlt .+120 ; 0xb396 b31e: b6 01 movw r22, r12 b320: 90 e0 ldi r25, 0x00 ; 0 b322: 0f 94 c3 db call 0x3b786 ; 0x3b786 b326: de cf rjmp .-68 ; 0xb2e4 b328: 16 fd sbrc r17, 6 b32a: 9f cf rjmp .-194 ; 0xb26a b32c: ef 2d mov r30, r15 b32e: f0 e0 ldi r31, 0x00 ; 0 b330: ea 15 cp r30, r10 b332: fb 05 cpc r31, r11 b334: 34 f0 brlt .+12 ; 0xb342 b336: 3c ef ldi r19, 0xFC ; 252 b338: a3 16 cp r10, r19 b33a: 3f ef ldi r19, 0xFF ; 255 b33c: b3 06 cpc r11, r19 b33e: 0c f0 brlt .+2 ; 0xb342 b340: 10 68 ori r17, 0x80 ; 128 b342: 32 96 adiw r30, 0x02 ; 2 b344: e8 0d add r30, r8 b346: f9 1d adc r31, r9 b348: 01 c0 rjmp .+2 ; 0xb34c b34a: fa 94 dec r15 b34c: ff 20 and r15, r15 b34e: 19 f0 breq .+6 ; 0xb356 b350: 82 91 ld r24, -Z b352: 80 33 cpi r24, 0x30 ; 48 b354: d1 f3 breq .-12 ; 0xb34a b356: 17 ff sbrs r17, 7 b358: 88 cf rjmp .-240 ; 0xb26a b35a: 44 24 eor r4, r4 b35c: 43 94 inc r4 b35e: 4f 0c add r4, r15 b360: fa 14 cp r15, r10 b362: 1b 04 cpc r1, r11 b364: 31 f0 breq .+12 ; 0xb372 b366: 2c f0 brlt .+10 ; 0xb372 b368: fa 18 sub r15, r10 b36a: 7f cf rjmp .-258 ; 0xb26a b36c: 44 24 eor r4, r4 b36e: 43 94 inc r4 b370: 7c cf rjmp .-264 ; 0xb26a b372: f1 2c mov r15, r1 b374: 7a cf rjmp .-268 ; 0xb26a b376: b6 01 movw r22, r12 b378: 80 e2 ldi r24, 0x20 ; 32 b37a: 90 e0 ldi r25, 0x00 ; 0 b37c: 0f 94 c3 db call 0x3b786 ; 0x3b786 b380: ea 94 dec r14 b382: 90 cf rjmp .-224 ; 0xb2a4 b384: b6 01 movw r22, r12 b386: 80 e3 ldi r24, 0x30 ; 48 b388: 90 e0 ldi r25, 0x00 ; 0 b38a: 0f 94 c3 db call 0x3b786 ; 0x3b786 b38e: ea 94 dec r14 b390: 94 cf rjmp .-216 ; 0xb2ba b392: 80 e3 ldi r24, 0x30 ; 48 b394: bd cf rjmp .-134 ; 0xb310 b396: a0 16 cp r10, r16 b398: b1 06 cpc r11, r17 b39a: 41 f4 brne .+16 ; 0xb3ac b39c: 9a 81 ldd r25, Y+2 ; 0x02 b39e: 96 33 cpi r25, 0x36 ; 54 b3a0: 50 f4 brcc .+20 ; 0xb3b6 b3a2: 95 33 cpi r25, 0x35 ; 53 b3a4: 19 f4 brne .+6 ; 0xb3ac b3a6: 3c 85 ldd r19, Y+12 ; 0x0c b3a8: 34 ff sbrs r19, 4 b3aa: 05 c0 rjmp .+10 ; 0xb3b6 b3ac: b6 01 movw r22, r12 b3ae: 90 e0 ldi r25, 0x00 ; 0 b3b0: 0f 94 c3 db call 0x3b786 ; 0x3b786 b3b4: 2a cf rjmp .-428 ; 0xb20a b3b6: 81 e3 ldi r24, 0x31 ; 49 b3b8: f9 cf rjmp .-14 ; 0xb3ac b3ba: 8a 81 ldd r24, Y+2 ; 0x02 b3bc: 81 33 cpi r24, 0x31 ; 49 b3be: 19 f0 breq .+6 ; 0xb3c6 b3c0: 9c 85 ldd r25, Y+12 ; 0x0c b3c2: 9f 7e andi r25, 0xEF ; 239 b3c4: 9c 87 std Y+12, r25 ; 0x0c b3c6: b6 01 movw r22, r12 b3c8: 90 e0 ldi r25, 0x00 ; 0 b3ca: 0f 94 c3 db call 0x3b786 ; 0x3b786 b3ce: ff 20 and r15, r15 b3d0: a9 f0 breq .+42 ; 0xb3fc b3d2: b6 01 movw r22, r12 b3d4: 8e e2 ldi r24, 0x2E ; 46 b3d6: 90 e0 ldi r25, 0x00 ; 0 b3d8: 0f 94 c3 db call 0x3b786 ; 0x3b786 b3dc: f3 94 inc r15 b3de: f3 94 inc r15 b3e0: e2 e0 ldi r30, 0x02 ; 2 b3e2: 01 e0 ldi r16, 0x01 ; 1 b3e4: 0e 0f add r16, r30 b3e6: e8 0d add r30, r8 b3e8: f9 2d mov r31, r9 b3ea: f1 1d adc r31, r1 b3ec: 80 81 ld r24, Z b3ee: b6 01 movw r22, r12 b3f0: 90 e0 ldi r25, 0x00 ; 0 b3f2: 0f 94 c3 db call 0x3b786 ; 0x3b786 b3f6: e0 2f mov r30, r16 b3f8: 0f 11 cpse r16, r15 b3fa: f3 cf rjmp .-26 ; 0xb3e2 b3fc: 85 e6 ldi r24, 0x65 ; 101 b3fe: 90 e0 ldi r25, 0x00 ; 0 b400: 14 ff sbrs r17, 4 b402: 02 c0 rjmp .+4 ; 0xb408 b404: 85 e4 ldi r24, 0x45 ; 69 b406: 90 e0 ldi r25, 0x00 ; 0 b408: b6 01 movw r22, r12 b40a: 0f 94 c3 db call 0x3b786 ; 0x3b786 b40e: b7 fc sbrc r11, 7 b410: 06 c0 rjmp .+12 ; 0xb41e b412: a1 14 cp r10, r1 b414: b1 04 cpc r11, r1 b416: c1 f4 brne .+48 ; 0xb448 b418: ec 85 ldd r30, Y+12 ; 0x0c b41a: e4 ff sbrs r30, 4 b41c: 15 c0 rjmp .+42 ; 0xb448 b41e: b1 94 neg r11 b420: a1 94 neg r10 b422: b1 08 sbc r11, r1 b424: 8d e2 ldi r24, 0x2D ; 45 b426: b6 01 movw r22, r12 b428: 90 e0 ldi r25, 0x00 ; 0 b42a: 0f 94 c3 db call 0x3b786 ; 0x3b786 b42e: 80 e3 ldi r24, 0x30 ; 48 b430: 2a e0 ldi r18, 0x0A ; 10 b432: a2 16 cp r10, r18 b434: b1 04 cpc r11, r1 b436: 54 f4 brge .+20 ; 0xb44c b438: b6 01 movw r22, r12 b43a: 90 e0 ldi r25, 0x00 ; 0 b43c: 0f 94 c3 db call 0x3b786 ; 0x3b786 b440: b6 01 movw r22, r12 b442: c5 01 movw r24, r10 b444: c0 96 adiw r24, 0x30 ; 48 b446: b4 cf rjmp .-152 ; 0xb3b0 b448: 8b e2 ldi r24, 0x2B ; 43 b44a: ed cf rjmp .-38 ; 0xb426 b44c: 8f 5f subi r24, 0xFF ; 255 b44e: fa e0 ldi r31, 0x0A ; 10 b450: af 1a sub r10, r31 b452: b1 08 sbc r11, r1 b454: ed cf rjmp .-38 ; 0xb430 b456: 83 36 cpi r24, 0x63 ; 99 b458: c9 f0 breq .+50 ; 0xb48c b45a: 83 37 cpi r24, 0x73 ; 115 b45c: 71 f1 breq .+92 ; 0xb4ba b45e: 83 35 cpi r24, 0x53 ; 83 b460: 09 f0 breq .+2 ; 0xb464 b462: 5b c0 rjmp .+182 ; 0xb51a b464: 35 01 movw r6, r10 b466: f2 e0 ldi r31, 0x02 ; 2 b468: 6f 0e add r6, r31 b46a: 71 1c adc r7, r1 b46c: f5 01 movw r30, r10 b46e: a0 80 ld r10, Z b470: b1 80 ldd r11, Z+1 ; 0x01 b472: 6f 2d mov r22, r15 b474: 70 e0 ldi r23, 0x00 ; 0 b476: 06 fd sbrc r16, 6 b478: 02 c0 rjmp .+4 ; 0xb47e b47a: 6f ef ldi r22, 0xFF ; 255 b47c: 7f ef ldi r23, 0xFF ; 255 b47e: c5 01 movw r24, r10 b480: 0f 94 57 db call 0x3b6ae ; 0x3b6ae b484: 9d 87 std Y+13, r25 ; 0x0d b486: 8c 87 std Y+12, r24 ; 0x0c b488: 00 68 ori r16, 0x80 ; 128 b48a: 0d c0 rjmp .+26 ; 0xb4a6 b48c: 35 01 movw r6, r10 b48e: 32 e0 ldi r19, 0x02 ; 2 b490: 63 0e add r6, r19 b492: 71 1c adc r7, r1 b494: f5 01 movw r30, r10 b496: 80 81 ld r24, Z b498: 89 83 std Y+1, r24 ; 0x01 b49a: 21 e0 ldi r18, 0x01 ; 1 b49c: 30 e0 ldi r19, 0x00 ; 0 b49e: 3d 87 std Y+13, r19 ; 0x0d b4a0: 2c 87 std Y+12, r18 ; 0x0c b4a2: 54 01 movw r10, r8 b4a4: 0f 77 andi r16, 0x7F ; 127 b4a6: 03 fd sbrc r16, 3 b4a8: 06 c0 rjmp .+12 ; 0xb4b6 b4aa: 2c 85 ldd r18, Y+12 ; 0x0c b4ac: 3d 85 ldd r19, Y+13 ; 0x0d b4ae: 52 16 cp r5, r18 b4b0: 13 06 cpc r1, r19 b4b2: 09 f0 breq .+2 ; 0xb4b6 b4b4: a8 f4 brcc .+42 ; 0xb4e0 b4b6: e5 2c mov r14, r5 b4b8: 2b c0 rjmp .+86 ; 0xb510 b4ba: 35 01 movw r6, r10 b4bc: 32 e0 ldi r19, 0x02 ; 2 b4be: 63 0e add r6, r19 b4c0: 71 1c adc r7, r1 b4c2: f5 01 movw r30, r10 b4c4: a0 80 ld r10, Z b4c6: b1 80 ldd r11, Z+1 ; 0x01 b4c8: 6f 2d mov r22, r15 b4ca: 70 e0 ldi r23, 0x00 ; 0 b4cc: 06 fd sbrc r16, 6 b4ce: 02 c0 rjmp .+4 ; 0xb4d4 b4d0: 6f ef ldi r22, 0xFF ; 255 b4d2: 7f ef ldi r23, 0xFF ; 255 b4d4: c5 01 movw r24, r10 b4d6: 0f 94 7c db call 0x3b6f8 ; 0x3b6f8 b4da: 9d 87 std Y+13, r25 ; 0x0d b4dc: 8c 87 std Y+12, r24 ; 0x0c b4de: e2 cf rjmp .-60 ; 0xb4a4 b4e0: b6 01 movw r22, r12 b4e2: 80 e2 ldi r24, 0x20 ; 32 b4e4: 90 e0 ldi r25, 0x00 ; 0 b4e6: 0f 94 c3 db call 0x3b786 ; 0x3b786 b4ea: 5a 94 dec r5 b4ec: de cf rjmp .-68 ; 0xb4aa b4ee: f5 01 movw r30, r10 b4f0: 07 fd sbrc r16, 7 b4f2: 85 91 lpm r24, Z+ b4f4: 07 ff sbrs r16, 7 b4f6: 81 91 ld r24, Z+ b4f8: 5f 01 movw r10, r30 b4fa: b6 01 movw r22, r12 b4fc: 90 e0 ldi r25, 0x00 ; 0 b4fe: 0f 94 c3 db call 0x3b786 ; 0x3b786 b502: e1 10 cpse r14, r1 b504: ea 94 dec r14 b506: 8c 85 ldd r24, Y+12 ; 0x0c b508: 9d 85 ldd r25, Y+13 ; 0x0d b50a: 01 97 sbiw r24, 0x01 ; 1 b50c: 9d 87 std Y+13, r25 ; 0x0d b50e: 8c 87 std Y+12, r24 ; 0x0c b510: ec 85 ldd r30, Y+12 ; 0x0c b512: fd 85 ldd r31, Y+13 ; 0x0d b514: ef 2b or r30, r31 b516: 59 f7 brne .-42 ; 0xb4ee b518: 78 ce rjmp .-784 ; 0xb20a b51a: 84 36 cpi r24, 0x64 ; 100 b51c: 19 f0 breq .+6 ; 0xb524 b51e: 89 36 cpi r24, 0x69 ; 105 b520: 09 f0 breq .+2 ; 0xb524 b522: 74 c0 rjmp .+232 ; 0xb60c b524: 35 01 movw r6, r10 b526: 07 ff sbrs r16, 7 b528: 66 c0 rjmp .+204 ; 0xb5f6 b52a: f4 e0 ldi r31, 0x04 ; 4 b52c: 6f 0e add r6, r31 b52e: 71 1c adc r7, r1 b530: f5 01 movw r30, r10 b532: 60 81 ld r22, Z b534: 71 81 ldd r23, Z+1 ; 0x01 b536: 82 81 ldd r24, Z+2 ; 0x02 b538: 93 81 ldd r25, Z+3 ; 0x03 b53a: 10 2f mov r17, r16 b53c: 1f 76 andi r17, 0x6F ; 111 b53e: 97 ff sbrs r25, 7 b540: 08 c0 rjmp .+16 ; 0xb552 b542: 90 95 com r25 b544: 80 95 com r24 b546: 70 95 com r23 b548: 61 95 neg r22 b54a: 7f 4f sbci r23, 0xFF ; 255 b54c: 8f 4f sbci r24, 0xFF ; 255 b54e: 9f 4f sbci r25, 0xFF ; 255 b550: 10 68 ori r17, 0x80 ; 128 b552: 2a e0 ldi r18, 0x0A ; 10 b554: 30 e0 ldi r19, 0x00 ; 0 b556: a4 01 movw r20, r8 b558: 0f 94 ea dc call 0x3b9d4 ; 0x3b9d4 <__ultoa_invert> b55c: a8 2e mov r10, r24 b55e: a8 18 sub r10, r8 b560: ba 2c mov r11, r10 b562: 01 2f mov r16, r17 b564: 16 ff sbrs r17, 6 b566: 0a c0 rjmp .+20 ; 0xb57c b568: 0e 7f andi r16, 0xFE ; 254 b56a: af 14 cp r10, r15 b56c: 38 f4 brcc .+14 ; 0xb57c b56e: 14 ff sbrs r17, 4 b570: 04 c0 rjmp .+8 ; 0xb57a b572: 12 fd sbrc r17, 2 b574: 02 c0 rjmp .+4 ; 0xb57a b576: 01 2f mov r16, r17 b578: 0e 7e andi r16, 0xEE ; 238 b57a: bf 2c mov r11, r15 b57c: 04 ff sbrs r16, 4 b57e: a3 c0 rjmp .+326 ; 0xb6c6 b580: fe 01 movw r30, r28 b582: ea 0d add r30, r10 b584: f1 1d adc r31, r1 b586: 80 81 ld r24, Z b588: 80 33 cpi r24, 0x30 ; 48 b58a: 09 f0 breq .+2 ; 0xb58e b58c: 95 c0 rjmp .+298 ; 0xb6b8 b58e: 09 7e andi r16, 0xE9 ; 233 b590: f0 2f mov r31, r16 b592: f8 70 andi r31, 0x08 ; 8 b594: ef 2e mov r14, r31 b596: 03 fd sbrc r16, 3 b598: a5 c0 rjmp .+330 ; 0xb6e4 b59a: 00 ff sbrs r16, 0 b59c: 9f c0 rjmp .+318 ; 0xb6dc b59e: fa 2c mov r15, r10 b5a0: b5 14 cp r11, r5 b5a2: 10 f4 brcc .+4 ; 0xb5a8 b5a4: f5 0c add r15, r5 b5a6: fb 18 sub r15, r11 b5a8: 04 ff sbrs r16, 4 b5aa: a2 c0 rjmp .+324 ; 0xb6f0 b5ac: b6 01 movw r22, r12 b5ae: 80 e3 ldi r24, 0x30 ; 48 b5b0: 90 e0 ldi r25, 0x00 ; 0 b5b2: 0f 94 c3 db call 0x3b786 ; 0x3b786 b5b6: 02 ff sbrs r16, 2 b5b8: 09 c0 rjmp .+18 ; 0xb5cc b5ba: 88 e7 ldi r24, 0x78 ; 120 b5bc: 90 e0 ldi r25, 0x00 ; 0 b5be: 01 ff sbrs r16, 1 b5c0: 02 c0 rjmp .+4 ; 0xb5c6 b5c2: 88 e5 ldi r24, 0x58 ; 88 b5c4: 90 e0 ldi r25, 0x00 ; 0 b5c6: b6 01 movw r22, r12 b5c8: 0f 94 c3 db call 0x3b786 ; 0x3b786 b5cc: af 14 cp r10, r15 b5ce: 08 f4 brcc .+2 ; 0xb5d2 b5d0: 9b c0 rjmp .+310 ; 0xb708 b5d2: aa 94 dec r10 b5d4: 0a 2d mov r16, r10 b5d6: 10 e0 ldi r17, 0x00 ; 0 b5d8: 0f 5f subi r16, 0xFF ; 255 b5da: 1f 4f sbci r17, 0xFF ; 255 b5dc: 08 0d add r16, r8 b5de: 19 1d adc r17, r9 b5e0: f8 01 movw r30, r16 b5e2: 82 91 ld r24, -Z b5e4: 8f 01 movw r16, r30 b5e6: b6 01 movw r22, r12 b5e8: 90 e0 ldi r25, 0x00 ; 0 b5ea: 0f 94 c3 db call 0x3b786 ; 0x3b786 b5ee: 80 16 cp r8, r16 b5f0: 91 06 cpc r9, r17 b5f2: b1 f7 brne .-20 ; 0xb5e0 b5f4: 0a ce rjmp .-1004 ; 0xb20a b5f6: f2 e0 ldi r31, 0x02 ; 2 b5f8: 6f 0e add r6, r31 b5fa: 71 1c adc r7, r1 b5fc: f5 01 movw r30, r10 b5fe: 60 81 ld r22, Z b600: 71 81 ldd r23, Z+1 ; 0x01 b602: 07 2e mov r0, r23 b604: 00 0c add r0, r0 b606: 88 0b sbc r24, r24 b608: 99 0b sbc r25, r25 b60a: 97 cf rjmp .-210 ; 0xb53a b60c: 10 2f mov r17, r16 b60e: 85 37 cpi r24, 0x75 ; 117 b610: a9 f4 brne .+42 ; 0xb63c b612: 1f 7e andi r17, 0xEF ; 239 b614: 2a e0 ldi r18, 0x0A ; 10 b616: 30 e0 ldi r19, 0x00 ; 0 b618: 35 01 movw r6, r10 b61a: 17 ff sbrs r17, 7 b61c: 44 c0 rjmp .+136 ; 0xb6a6 b61e: f4 e0 ldi r31, 0x04 ; 4 b620: 6f 0e add r6, r31 b622: 71 1c adc r7, r1 b624: f5 01 movw r30, r10 b626: 60 81 ld r22, Z b628: 71 81 ldd r23, Z+1 ; 0x01 b62a: 82 81 ldd r24, Z+2 ; 0x02 b62c: 93 81 ldd r25, Z+3 ; 0x03 b62e: a4 01 movw r20, r8 b630: 0f 94 ea dc call 0x3b9d4 ; 0x3b9d4 <__ultoa_invert> b634: a8 2e mov r10, r24 b636: a8 18 sub r10, r8 b638: 1f 77 andi r17, 0x7F ; 127 b63a: 92 cf rjmp .-220 ; 0xb560 b63c: 19 7f andi r17, 0xF9 ; 249 b63e: 8f 36 cpi r24, 0x6F ; 111 b640: 79 f1 breq .+94 ; 0xb6a0 b642: f0 f4 brcc .+60 ; 0xb680 b644: 88 35 cpi r24, 0x58 ; 88 b646: 39 f1 breq .+78 ; 0xb696 b648: f6 01 movw r30, r12 b64a: 86 81 ldd r24, Z+6 ; 0x06 b64c: 97 81 ldd r25, Z+7 ; 0x07 b64e: 2f 96 adiw r28, 0x0f ; 15 b650: 0f b6 in r0, 0x3f ; 63 b652: f8 94 cli b654: de bf out 0x3e, r29 ; 62 b656: 0f be out 0x3f, r0 ; 63 b658: cd bf out 0x3d, r28 ; 61 b65a: df 91 pop r29 b65c: cf 91 pop r28 b65e: 1f 91 pop r17 b660: 0f 91 pop r16 b662: ff 90 pop r15 b664: ef 90 pop r14 b666: df 90 pop r13 b668: cf 90 pop r12 b66a: bf 90 pop r11 b66c: af 90 pop r10 b66e: 9f 90 pop r9 b670: 8f 90 pop r8 b672: 7f 90 pop r7 b674: 6f 90 pop r6 b676: 5f 90 pop r5 b678: 4f 90 pop r4 b67a: 3f 90 pop r3 b67c: 2f 90 pop r2 b67e: 08 95 ret b680: 80 37 cpi r24, 0x70 ; 112 b682: 39 f0 breq .+14 ; 0xb692 b684: 88 37 cpi r24, 0x78 ; 120 b686: 01 f7 brne .-64 ; 0xb648 b688: 14 fd sbrc r17, 4 b68a: 14 60 ori r17, 0x04 ; 4 b68c: 20 e1 ldi r18, 0x10 ; 16 b68e: 30 e0 ldi r19, 0x00 ; 0 b690: c3 cf rjmp .-122 ; 0xb618 b692: 10 61 ori r17, 0x10 ; 16 b694: f9 cf rjmp .-14 ; 0xb688 b696: 04 fd sbrc r16, 4 b698: 16 60 ori r17, 0x06 ; 6 b69a: 20 e1 ldi r18, 0x10 ; 16 b69c: 32 e0 ldi r19, 0x02 ; 2 b69e: bc cf rjmp .-136 ; 0xb618 b6a0: 28 e0 ldi r18, 0x08 ; 8 b6a2: 30 e0 ldi r19, 0x00 ; 0 b6a4: b9 cf rjmp .-142 ; 0xb618 b6a6: f2 e0 ldi r31, 0x02 ; 2 b6a8: 6f 0e add r6, r31 b6aa: 71 1c adc r7, r1 b6ac: f5 01 movw r30, r10 b6ae: 60 81 ld r22, Z b6b0: 71 81 ldd r23, Z+1 ; 0x01 b6b2: 90 e0 ldi r25, 0x00 ; 0 b6b4: 80 e0 ldi r24, 0x00 ; 0 b6b6: bb cf rjmp .-138 ; 0xb62e b6b8: 02 fd sbrc r16, 2 b6ba: 02 c0 rjmp .+4 ; 0xb6c0 b6bc: b3 94 inc r11 b6be: 68 cf rjmp .-304 ; 0xb590 b6c0: b3 94 inc r11 b6c2: b3 94 inc r11 b6c4: 65 cf rjmp .-310 ; 0xb590 b6c6: 80 2f mov r24, r16 b6c8: 86 78 andi r24, 0x86 ; 134 b6ca: 09 f4 brne .+2 ; 0xb6ce b6cc: 61 cf rjmp .-318 ; 0xb590 b6ce: f6 cf rjmp .-20 ; 0xb6bc b6d0: b6 01 movw r22, r12 b6d2: 80 e2 ldi r24, 0x20 ; 32 b6d4: 90 e0 ldi r25, 0x00 ; 0 b6d6: 0f 94 c3 db call 0x3b786 ; 0x3b786 b6da: b3 94 inc r11 b6dc: b5 14 cp r11, r5 b6de: c0 f3 brcs .-16 ; 0xb6d0 b6e0: e1 2c mov r14, r1 b6e2: 62 cf rjmp .-316 ; 0xb5a8 b6e4: e5 2c mov r14, r5 b6e6: eb 18 sub r14, r11 b6e8: b5 14 cp r11, r5 b6ea: 08 f4 brcc .+2 ; 0xb6ee b6ec: 5d cf rjmp .-326 ; 0xb5a8 b6ee: f8 cf rjmp .-16 ; 0xb6e0 b6f0: 80 2f mov r24, r16 b6f2: 86 78 andi r24, 0x86 ; 134 b6f4: 09 f4 brne .+2 ; 0xb6f8 b6f6: 6a cf rjmp .-300 ; 0xb5cc b6f8: 8b e2 ldi r24, 0x2B ; 43 b6fa: 01 ff sbrs r16, 1 b6fc: 80 e2 ldi r24, 0x20 ; 32 b6fe: 07 fd sbrc r16, 7 b700: 8d e2 ldi r24, 0x2D ; 45 b702: b6 01 movw r22, r12 b704: 90 e0 ldi r25, 0x00 ; 0 b706: 60 cf rjmp .-320 ; 0xb5c8 b708: b6 01 movw r22, r12 b70a: 80 e3 ldi r24, 0x30 ; 48 b70c: 90 e0 ldi r25, 0x00 ; 0 b70e: 0f 94 c3 db call 0x3b786 ; 0x3b786 b712: fa 94 dec r15 b714: 5b cf rjmp .-330 ; 0xb5cc b716: b6 01 movw r22, r12 b718: 80 e2 ldi r24, 0x20 ; 32 b71a: 90 e0 ldi r25, 0x00 ; 0 b71c: 0f 94 c3 db call 0x3b786 ; 0x3b786 b720: ea 94 dec r14 b722: 73 cd rjmp .-1306 ; 0xb20a b724: 24 e0 ldi r18, 0x04 ; 4 b726: e1 2c mov r14, r1 b728: 25 15 cp r18, r5 b72a: 08 f0 brcs .+2 ; 0xb72e b72c: 36 cd rjmp .-1428 ; 0xb19a b72e: 84 e0 ldi r24, 0x04 ; 4 b730: 26 cd rjmp .-1460 ; 0xb17e 0000b732 : 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 ( b732: 20 e0 ldi r18, 0x00 ; 0 b734: 30 e0 ldi r19, 0x00 ; 0 b736: 40 e8 ldi r20, 0x80 ; 128 b738: 5f eb ldi r21, 0xBF ; 191 b73a: 60 91 ab 02 lds r22, 0x02AB ; 0x8002ab b73e: 70 91 ac 02 lds r23, 0x02AC ; 0x8002ac b742: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad b746: 90 91 ae 02 lds r25, 0x02AE ; 0x8002ae b74a: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> b74e: 88 23 and r24, r24 b750: 21 f1 breq .+72 ; 0xb79a (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || b752: e0 91 70 12 lds r30, 0x1270 ; 0x801270 b756: f0 91 71 12 lds r31, 0x1271 ; 0x801271 b75a: ed 57 subi r30, 0x7D ; 125 b75c: 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) && ( b75e: 80 81 ld r24, Z b760: 8b 7f andi r24, 0xFB ; 251 b762: 82 30 cpi r24, 0x02 ; 2 b764: d1 f4 brne .+52 ; 0xb79a (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)); b766: 80 e1 ldi r24, 0x10 ; 16 b768: eb ea ldi r30, 0xAB ; 171 b76a: f2 e0 ldi r31, 0x02 ; 2 b76c: a3 e4 ldi r26, 0x43 ; 67 b76e: b7 e0 ldi r27, 0x07 ; 7 b770: 01 90 ld r0, Z+ b772: 0d 92 st X+, r0 b774: 8a 95 dec r24 b776: e1 f7 brne .-8 ; 0xb770 saved_start_position[0] = SAVED_START_POSITION_UNSET; b778: 80 e0 ldi r24, 0x00 ; 0 b77a: 90 e0 ldi r25, 0x00 ; 0 b77c: a0 e8 ldi r26, 0x80 ; 128 b77e: bf eb ldi r27, 0xBF ; 191 b780: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab b784: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac b788: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad b78c: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae return saved_segment_idx; b790: 80 91 0b 18 lds r24, 0x180B ; 0x80180b b794: 90 91 0c 18 lds r25, 0x180C ; 0x80180c b798: 08 95 ret } else return 1; //begin with the first segment b79a: 81 e0 ldi r24, 0x01 ; 1 b79c: 90 e0 ldi r25, 0x00 ; 0 } b79e: 08 95 ret 0000b7a0 : 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) { b7a0: cf 92 push r12 b7a2: df 92 push r13 b7a4: ef 92 push r14 b7a6: ff 92 push r15 b7a8: 0f 93 push r16 b7aa: 1f 93 push r17 b7ac: cf 93 push r28 b7ae: 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); b7b0: 90 e0 ldi r25, 0x00 ; 0 b7b2: ec 01 movw r28, r24 b7b4: cc 0f add r28, r28 b7b6: dd 1f adc r29, r29 b7b8: cc 0f add r28, r28 b7ba: dd 1f adc r29, r29 b7bc: fe 01 movw r30, r28 b7be: e6 5b subi r30, 0xB6 ; 182 b7c0: f2 48 sbci r31, 0x82 ; 130 #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); b7c2: 25 91 lpm r18, Z+ b7c4: 35 91 lpm r19, Z+ b7c6: 45 91 lpm r20, Z+ b7c8: 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]; b7ca: fe 01 movw r30, r28 b7cc: ea 53 subi r30, 0x3A ; 58 b7ce: f9 4f sbci r31, 0xF9 ; 249 b7d0: c0 80 ld r12, Z b7d2: d1 80 ldd r13, Z+1 ; 0x01 b7d4: e2 80 ldd r14, Z+2 ; 0x02 b7d6: f3 80 ldd r15, Z+3 ; 0x03 b7d8: 8e 01 movw r16, r28 b7da: 0d 5b subi r16, 0xBD ; 189 b7dc: 18 4f sbci r17, 0xF8 ; 248 b7de: c7 01 movw r24, r14 b7e0: b6 01 movw r22, r12 b7e2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> b7e6: f8 01 movw r30, r16 b7e8: 60 83 st Z, r22 b7ea: 71 83 std Z+1, r23 ; 0x01 b7ec: 82 83 std Z+2, r24 ; 0x02 b7ee: 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); b7f0: fe 01 movw r30, r28 b7f2: e2 5c subi r30, 0xC2 ; 194 b7f4: f2 48 sbci r31, 0x82 ; 130 #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); b7f6: 25 91 lpm r18, Z+ b7f8: 35 91 lpm r19, Z+ b7fa: 45 91 lpm r20, Z+ b7fc: 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]; b7fe: 8e 01 movw r16, r28 b800: 0f 5d subi r16, 0xDF ; 223 b802: 1d 4f sbci r17, 0xFD ; 253 b804: c7 01 movw r24, r14 b806: b6 01 movw r22, r12 b808: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> b80c: f8 01 movw r30, r16 b80e: 60 83 st Z, r22 b810: 71 83 std Z+1, r23 ; 0x01 b812: 82 83 std Z+2, r24 ; 0x02 b814: 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); b816: fe 01 movw r30, r28 b818: ee 5c subi r30, 0xCE ; 206 b81a: f2 48 sbci r31, 0x82 ; 130 #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); b81c: 25 91 lpm r18, Z+ b81e: 35 91 lpm r19, Z+ b820: 45 91 lpm r20, Z+ b822: 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]; b824: cb 5e subi r28, 0xEB ; 235 b826: dd 4f sbci r29, 0xFD ; 253 b828: c7 01 movw r24, r14 b82a: b6 01 movw r22, r12 b82c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> b830: 68 83 st Y, r22 b832: 79 83 std Y+1, r23 ; 0x01 b834: 8a 83 std Y+2, r24 ; 0x02 b836: 9b 83 std Y+3, r25 ; 0x03 } b838: df 91 pop r29 b83a: cf 91 pop r28 b83c: 1f 91 pop r17 b83e: 0f 91 pop r16 b840: ff 90 pop r15 b842: ef 90 pop r14 b844: df 90 pop r13 b846: cf 90 pop r12 b848: 08 95 ret 0000b84a : 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)); } b84a: 80 e1 ldi r24, 0x10 ; 16 b84c: e4 e5 ldi r30, 0x54 ; 84 b84e: f5 e0 ldi r31, 0x05 ; 5 b850: a3 e4 ldi r26, 0x43 ; 67 b852: b7 e0 ldi r27, 0x07 ; 7 b854: 01 90 ld r0, Z+ b856: 0d 92 st X+, r0 b858: 8a 95 dec r24 b85a: e1 f7 brne .-8 ; 0xb854 b85c: 08 95 ret 0000b85e : /// @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)); b85e: ed eb ldi r30, 0xBD ; 189 b860: fc e7 ldi r31, 0x7C ; 124 b862: 83 30 cpi r24, 0x03 ; 3 b864: 21 f0 breq .+8 ; 0xb86e b866: e8 2f mov r30, r24 b868: f0 e0 ldi r31, 0x00 ; 0 b86a: e6 54 subi r30, 0x46 ; 70 b86c: f3 48 sbci r31, 0x83 ; 131 b86e: 84 91 lpm r24, Z } b870: 08 95 ret 0000b872 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b872: 40 91 81 10 lds r20, 0x1081 ; 0x801081 b876: 50 91 82 10 lds r21, 0x1082 ; 0x801082 return 0; b87a: 90 e0 ldi r25, 0x00 ; 0 b87c: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b87e: 41 15 cp r20, r1 b880: 51 05 cpc r21, r1 b882: b1 f1 breq .+108 ; 0xb8f0 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { b884: 20 91 70 12 lds r18, 0x1270 ; 0x801270 b888: 30 91 71 12 lds r19, 0x1271 ; 0x801271 char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; b88c: 90 e0 ldi r25, 0x00 ; 0 b88e: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { b890: f9 01 movw r30, r18 b892: ed 57 subi r30, 0x7D ; 125 b894: ff 4e sbci r31, 0xEF ; 239 b896: a0 81 ld r26, Z b898: a2 30 cpi r26, 0x02 ; 2 b89a: 21 f4 brne .+8 ; 0xb8a4 sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; b89c: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; b89e: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; b8a0: 86 0f add r24, r22 b8a2: 97 1f adc r25, r23 } if (-- _buflen == 0) b8a4: 41 50 subi r20, 0x01 ; 1 b8a6: 51 09 sbc r21, r1 b8a8: 19 f1 breq .+70 ; 0xb8f0 b8aa: f9 01 movw r30, r18 b8ac: ea 57 subi r30, 0x7A ; 122 b8ae: 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) ; b8b0: a1 91 ld r26, Z+ b8b2: 9f 01 movw r18, r30 b8b4: 23 58 subi r18, 0x83 ; 131 b8b6: 30 41 sbci r19, 0x10 ; 16 b8b8: a1 11 cpse r26, r1 b8ba: fa cf rjmp .-12 ; 0xb8b0 b8bc: f9 01 movw r30, r18 b8be: ed 57 subi r30, 0x7D ; 125 b8c0: 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) ; b8c2: 2d 3e cpi r18, 0xED ; 237 b8c4: a1 e0 ldi r26, 0x01 ; 1 b8c6: 3a 07 cpc r19, r26 b8c8: 30 f4 brcc .+12 ; 0xb8d6 b8ca: a1 91 ld r26, Z+ b8cc: a1 11 cpse r26, r1 b8ce: e0 cf rjmp .-64 ; 0xb890 b8d0: 2f 5f subi r18, 0xFF ; 255 b8d2: 3f 4f sbci r19, 0xFF ; 255 b8d4: f6 cf rjmp .-20 ; 0xb8c2 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { b8d6: 2d 3e cpi r18, 0xED ; 237 b8d8: e1 e0 ldi r30, 0x01 ; 1 b8da: 3e 07 cpc r19, r30 b8dc: c9 f6 brne .-78 ; 0xb890 b8de: e3 e8 ldi r30, 0x83 ; 131 b8e0: f0 e1 ldi r31, 0x10 ; 16 b8e2: 9f 01 movw r18, r30 b8e4: 23 58 subi r18, 0x83 ; 131 b8e6: 30 41 sbci r19, 0x10 ; 16 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; b8e8: a1 91 ld r26, Z+ b8ea: aa 23 and r26, r26 b8ec: d1 f3 breq .-12 ; 0xb8e2 b8ee: d0 cf rjmp .-96 ; 0xb890 } } return sdlen; } b8f0: 08 95 ret 0000b8f2 : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; b8f2: 98 2f mov r25, r24 b8f4: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); b8f6: 83 ff sbrs r24, 3 b8f8: 0d c0 rjmp .+26 ; 0xb914 b8fa: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b8fe: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); b900: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); b904: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> b908: 88 7f andi r24, 0xF8 ; 248 b90a: 97 70 andi r25, 0x07 ; 7 b90c: 89 2b or r24, r25 b90e: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } b912: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); b914: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b918: 87 7f andi r24, 0xF7 ; 247 b91a: f2 cf rjmp .-28 ; 0xb900 0000b91c : 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)); }; b91c: 80 91 97 03 lds r24, 0x0397 ; 0x800397 b920: 90 91 98 03 lds r25, 0x0398 ; 0x800398 b924: 4a e0 ldi r20, 0x0A ; 10 b926: 50 e0 ldi r21, 0x00 ; 0 b928: 70 e0 ldi r23, 0x00 ; 0 b92a: 60 e0 ldi r22, 0x00 ; 0 b92c: 01 96 adiw r24, 0x01 ; 1 b92e: 0f 94 e6 d8 call 0x3b1cc ; 0x3b1cc b932: 86 2f mov r24, r22 b934: 08 95 ret 0000b936 : // 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)); }; b936: 80 91 97 03 lds r24, 0x0397 ; 0x800397 b93a: 90 91 98 03 lds r25, 0x0398 ; 0x800398 b93e: 4a e0 ldi r20, 0x0A ; 10 b940: 50 e0 ldi r21, 0x00 ; 0 b942: 70 e0 ldi r23, 0x00 ; 0 b944: 60 e0 ldi r22, 0x00 ; 0 b946: 01 96 adiw r24, 0x01 ; 1 b948: 0f 94 e6 d8 call 0x3b1cc ; 0x3b1cc b94c: cb 01 movw r24, r22 b94e: 08 95 ret 0000b950 : // 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); } b950: 80 91 97 03 lds r24, 0x0397 ; 0x800397 b954: 90 91 98 03 lds r25, 0x0398 ; 0x800398 b958: 4a e0 ldi r20, 0x0A ; 10 b95a: 50 e0 ldi r21, 0x00 ; 0 b95c: 70 e0 ldi r23, 0x00 ; 0 b95e: 60 e0 ldi r22, 0x00 ; 0 b960: 01 96 adiw r24, 0x01 ; 1 b962: 0d 94 e6 d8 jmp 0x3b1cc ; 0x3b1cc 0000b966 : // 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; b966: 80 91 95 04 lds r24, 0x0495 ; 0x800495 b96a: 90 91 96 04 lds r25, 0x0496 ; 0x800496 b96e: 90 93 94 04 sts 0x0494, r25 ; 0x800494 b972: 80 93 93 04 sts 0x0493, r24 ; 0x800493 void FlushSerialRequestResend() { //char cmdbuffer[bufindr][100]="Resend:"; MYSERIAL.flush(); printf_P(_N("%S: %ld\n%S\n"), _n("Resend"), gcode_LastN + 1, MSG_OK); b976: 8e ea ldi r24, 0xAE ; 174 b978: 9e e6 ldi r25, 0x6E ; 110 b97a: 9f 93 push r25 b97c: 8f 93 push r24 b97e: 80 91 7c 03 lds r24, 0x037C ; 0x80037c b982: 90 91 7d 03 lds r25, 0x037D ; 0x80037d b986: a0 91 7e 03 lds r26, 0x037E ; 0x80037e b98a: b0 91 7f 03 lds r27, 0x037F ; 0x80037f b98e: 01 96 adiw r24, 0x01 ; 1 b990: a1 1d adc r26, r1 b992: b1 1d adc r27, r1 b994: bf 93 push r27 b996: af 93 push r26 b998: 9f 93 push r25 b99a: 8f 93 push r24 b99c: 8b ea ldi r24, 0xAB ; 171 b99e: 97 e6 ldi r25, 0x67 ; 103 b9a0: 9f 93 push r25 b9a2: 8f 93 push r24 b9a4: 82 eb ldi r24, 0xB2 ; 178 b9a6: 97 e6 ldi r25, 0x67 ; 103 b9a8: 9f 93 push r25 b9aa: 8f 93 push r24 b9ac: 0f 94 1d dc call 0x3b83a ; 0x3b83a b9b0: 8d b7 in r24, 0x3d ; 61 b9b2: 9e b7 in r25, 0x3e ; 62 b9b4: 0a 96 adiw r24, 0x0a ; 10 b9b6: 0f b6 in r0, 0x3f ; 63 b9b8: f8 94 cli b9ba: 9e bf out 0x3e, r25 ; 62 b9bc: 0f be out 0x3f, r0 ; 63 b9be: 8d bf out 0x3d, r24 ; 61 } b9c0: 08 95 ret 0000b9c2 : 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) { b9c2: 0f 93 push r16 b9c4: 1f 93 push r17 b9c6: cf 93 push r28 b9c8: df 93 push r29 b9ca: ec 01 movw r28, r24 b9cc: c6 0f add r28, r22 b9ce: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { b9d0: 8c 17 cp r24, r28 b9d2: 9d 07 cpc r25, r29 b9d4: 79 f0 breq .+30 ; 0xb9f4 if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) b9d6: 8c 01 movw r16, r24 b9d8: 0f 5f subi r16, 0xFF ; 255 b9da: 1f 4f sbci r17, 0xFF ; 255 b9dc: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 b9e0: 8f 3f cpi r24, 0xFF ; 255 b9e2: 31 f0 breq .+12 ; 0xb9f0 return true; b9e4: 81 e0 ldi r24, 0x01 ; 1 } return false; } b9e6: df 91 pop r29 b9e8: cf 91 pop r28 b9ea: 1f 91 pop r17 b9ec: 0f 91 pop r16 b9ee: 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) b9f0: c8 01 movw r24, r16 b9f2: ee cf rjmp .-36 ; 0xb9d0 return true; } return false; b9f4: 80 e0 ldi r24, 0x00 ; 0 b9f6: f7 cf rjmp .-18 ; 0xb9e6 0000b9f8 : #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; } b9f8: 68 2f mov r22, r24 b9fa: 88 0f add r24, r24 b9fc: 77 0b sbc r23, r23 b9fe: 80 91 70 12 lds r24, 0x1270 ; 0x801270 ba02: 90 91 71 12 lds r25, 0x1271 ; 0x801271 ba06: 8a 57 subi r24, 0x7A ; 122 ba08: 9f 4e sbci r25, 0xEF ; 239 ba0a: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 ba0e: 9c 01 movw r18, r24 ba10: 90 93 98 03 sts 0x0398, r25 ; 0x800398 ba14: 80 93 97 03 sts 0x0397, r24 ; 0x800397 ba18: 81 e0 ldi r24, 0x01 ; 1 ba1a: 23 2b or r18, r19 ba1c: 09 f4 brne .+2 ; 0xba20 ba1e: 80 e0 ldi r24, 0x00 ; 0 ba20: 08 95 ret 0000ba22 : #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 { ba22: 0f 93 push r16 ba24: 1f 93 push r17 ba26: cf 93 push r28 ba28: df 93 push r29 ba2a: 8c 01 movw r16, r24 ba2c: 86 2f mov r24, r22 ba2e: ea 01 movw r28, r20 if (code_seen(code)) { ba30: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 ba34: 88 23 and r24, r24 ba36: 19 f1 breq .+70 ; 0xba7e // Verify value is within allowed range int16_t temp = code_value_short(); ba38: 0e 94 9b 5c call 0xb936 ; 0xb936 if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { ba3c: 9c 01 movw r18, r24 ba3e: 97 ff sbrs r25, 7 ba40: 03 c0 rjmp .+6 ; 0xba48 ba42: 31 95 neg r19 ba44: 21 95 neg r18 ba46: 31 09 sbc r19, r1 ba48: 25 36 cpi r18, 0x65 ; 101 ba4a: 31 05 cpc r19, r1 ba4c: 9c f0 brlt .+38 ; 0xba74 printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); ba4e: 9f 93 push r25 ba50: 8f 93 push r24 ba52: 8a ec ldi r24, 0xCA ; 202 ba54: 9a ea ldi r25, 0xAA ; 170 ba56: 9f 93 push r25 ba58: 8f 93 push r24 ba5a: 8f ea ldi r24, 0xAF ; 175 ba5c: 9d e7 ldi r25, 0x7D ; 125 ba5e: 9f 93 push r25 ba60: 8f 93 push r24 ba62: 0f 94 1d dc call 0x3b83a ; 0x3b83a ba66: 0f 90 pop r0 ba68: 0f 90 pop r0 ba6a: 0f 90 pop r0 ba6c: 0f 90 pop r0 ba6e: 0f 90 pop r0 ba70: 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; ba72: 80 e0 ldi r24, 0x00 ; 0 }; ba74: df 91 pop r29 ba76: cf 91 pop r28 ba78: 1f 91 pop r17 ba7a: 0f 91 pop r16 ba7c: 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) { ba7e: f8 01 movw r30, r16 ba80: 80 81 ld r24, Z ba82: 88 23 and r24, r24 ba84: b1 f3 breq .-20 ; 0xba72 return (int8_t)eeprom_read_byte(eep_address); ba86: ce 01 movw r24, r28 } return 0; }; ba88: df 91 pop r29 ba8a: cf 91 pop r28 ba8c: 1f 91 pop r17 ba8e: 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); ba90: 0d 94 5b dd jmp 0x3bab6 ; 0x3bab6 0000ba94 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ba94: 60 e0 ldi r22, 0x00 ; 0 ba96: 86 e6 ldi r24, 0x66 ; 102 ba98: 9f e0 ldi r25, 0x0F ; 15 ba9a: 0f 94 7f dd call 0x3bafe ; 0x3bafe ba9e: 60 e0 ldi r22, 0x00 ; 0 baa0: 88 e6 ldi r24, 0x68 ; 104 baa2: 9f e0 ldi r25, 0x0F ; 15 baa4: 0f 94 7f dd call 0x3bafe ; 0x3bafe baa8: 60 e0 ldi r22, 0x00 ; 0 baaa: 85 e6 ldi r24, 0x65 ; 101 baac: 9f e0 ldi r25, 0x0F ; 15 baae: 0f 94 7f dd call 0x3bafe ; 0x3bafe bab2: 60 e0 ldi r22, 0x00 ; 0 bab4: 84 e6 ldi r24, 0x64 ; 100 bab6: 9f e0 ldi r25, 0x0F ; 15 bab8: 0f 94 7f dd call 0x3bafe ; 0x3bafe babc: 60 e0 ldi r22, 0x00 ; 0 babe: 82 ed ldi r24, 0xD2 ; 210 bac0: 9e e0 ldi r25, 0x0E ; 14 bac2: 0f 94 7f dd call 0x3bafe ; 0x3bafe bac6: 60 e0 ldi r22, 0x00 ; 0 bac8: 8f ec ldi r24, 0xCF ; 207 baca: 9e e0 ldi r25, 0x0E ; 14 bacc: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0000bad0 : return altfanStatus.isAltfan; } void altfanOverride_toggle() { altfanStatus.altfanOverride = !altfanStatus.altfanOverride; bad0: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> bad4: 81 fb bst r24, 1 bad6: 66 27 eor r22, r22 bad8: 60 f9 bld r22, 0 bada: 91 e0 ldi r25, 0x01 ; 1 badc: 69 27 eor r22, r25 bade: 60 fb bst r22, 0 bae0: 81 f9 bld r24, 1 bae2: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> bae6: 8b e2 ldi r24, 0x2B ; 43 bae8: 9d e0 ldi r25, 0x0D ; 13 baea: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0000baee : // 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) baee: 80 36 cpi r24, 0x60 ; 96 baf0: 91 05 cpc r25, r1 baf2: f8 f4 brcc .+62 ; 0xbb32 return false; if (bufindr == bufindw && buflen > 0) baf4: 40 91 70 12 lds r20, 0x1270 ; 0x801270 baf8: 50 91 71 12 lds r21, 0x1271 ; 0x801271 bafc: 20 91 7e 10 lds r18, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.569> bb00: 30 91 7f 10 lds r19, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> bb04: 42 17 cp r20, r18 bb06: 53 07 cpc r21, r19 bb08: 39 f4 brne .+14 ; 0xbb18 bb0a: 60 91 81 10 lds r22, 0x1081 ; 0x801081 bb0e: 70 91 82 10 lds r23, 0x1082 ; 0x801082 bb12: 16 16 cp r1, r22 bb14: 17 06 cpc r1, r23 bb16: 6c f0 brlt .+26 ; 0xbb32 // 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); bb18: b9 01 movw r22, r18 bb1a: 68 0f add r22, r24 bb1c: 79 1f adc r23, r25 bb1e: fb 01 movw r30, r22 bb20: e3 59 subi r30, 0x93 ; 147 bb22: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) bb24: 24 17 cp r18, r20 bb26: 35 07 cpc r19, r21 bb28: 30 f4 brcc .+12 ; 0xbb36 // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; bb2a: 81 e0 ldi r24, 0x01 ; 1 bb2c: 4e 17 cp r20, r30 bb2e: 5f 07 cpc r21, r31 bb30: 08 f4 brcc .+2 ; 0xbb34 // 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; bb32: 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; } bb34: 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? bb36: ee 3e cpi r30, 0xEE ; 238 bb38: f1 40 sbci r31, 0x01 ; 1 bb3a: f8 f0 brcs .+62 ; 0xbb7a // 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); bb3c: 6c 5f subi r22, 0xFC ; 252 bb3e: 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) || bb40: 6e 3e cpi r22, 0xEE ; 238 bb42: 71 40 sbci r23, 0x01 ; 1 bb44: 18 f4 brcc .+6 ; 0xbb4c // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) bb46: 49 36 cpi r20, 0x69 ; 105 bb48: 51 05 cpc r21, r1 bb4a: b8 f4 brcc .+46 ; 0xbb7a return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { bb4c: 83 59 subi r24, 0x93 ; 147 bb4e: 9f 4f sbci r25, 0xFF ; 255 bb50: 48 17 cp r20, r24 bb52: 59 07 cpc r21, r25 bb54: 70 f3 brcs .-36 ; 0xbb32 // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); bb56: 4d ee ldi r20, 0xED ; 237 bb58: 51 e0 ldi r21, 0x01 ; 1 bb5a: 42 1b sub r20, r18 bb5c: 53 0b sbc r21, r19 bb5e: 70 e0 ldi r23, 0x00 ; 0 bb60: 60 e0 ldi r22, 0x00 ; 0 bb62: c9 01 movw r24, r18 bb64: 8d 57 subi r24, 0x7D ; 125 bb66: 9f 4e sbci r25, 0xEF ; 239 bb68: 0f 94 8d e3 call 0x3c71a ; 0x3c71a // 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; } bb6c: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); bb6e: f8 94 cli bb70: 10 92 7f 10 sts 0x107F, r1 ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> bb74: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e <_ZL7bufindw.lto_priv.569> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; bb78: 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; bb7a: 81 e0 ldi r24, 0x01 ; 1 bb7c: 08 95 ret 0000bb7e : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { bb7e: 2f 92 push r2 bb80: 3f 92 push r3 bb82: 4f 92 push r4 bb84: 5f 92 push r5 bb86: 6f 92 push r6 bb88: 7f 92 push r7 bb8a: 8f 92 push r8 bb8c: 9f 92 push r9 bb8e: af 92 push r10 bb90: bf 92 push r11 bb92: cf 92 push r12 bb94: df 92 push r13 bb96: ef 92 push r14 bb98: ff 92 push r15 bb9a: 0f 93 push r16 bb9c: 1f 93 push r17 bb9e: cf 93 push r28 bba0: df 93 push r29 bba2: cd b7 in r28, 0x3d ; 61 bba4: de b7 in r29, 0x3e ; 62 bba6: cc 58 subi r28, 0x8C ; 140 bba8: d2 40 sbci r29, 0x02 ; 2 bbaa: 0f b6 in r0, 0x3f ; 63 bbac: f8 94 cli bbae: de bf out 0x3e, r29 ; 62 bbb0: 0f be out 0x3f, r0 ; 63 bbb2: cd bf out 0x3d, r28 ; 61 bbb4: cb 58 subi r28, 0x8B ; 139 bbb6: dd 4f sbci r29, 0xFD ; 253 bbb8: 68 83 st Y, r22 bbba: 79 83 std Y+1, r23 ; 0x01 bbbc: 8a 83 std Y+2, r24 ; 0x02 bbbe: 9b 83 std Y+3, r25 ; 0x03 bbc0: c5 57 subi r28, 0x75 ; 117 bbc2: 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; bbc4: fe 01 movw r30, r28 bbc6: e7 54 subi r30, 0x47 ; 71 bbc8: fe 4f sbci r31, 0xFE ; 254 bbca: 88 e2 ldi r24, 0x28 ; 40 bbcc: df 01 movw r26, r30 bbce: 1d 92 st X+, r1 bbd0: 8a 95 dec r24 bbd2: e9 f7 brne .-6 ; 0xbbce bbd4: e8 5b subi r30, 0xB8 ; 184 bbd6: f1 40 sbci r31, 0x01 ; 1 bbd8: 1f 01 movw r2, r30 bbda: 80 e9 ldi r24, 0x90 ; 144 bbdc: 91 e0 ldi r25, 0x01 ; 1 bbde: df 01 movw r26, r30 bbe0: fc 01 movw r30, r24 bbe2: 1d 92 st X+, r1 bbe4: 31 97 sbiw r30, 0x01 ; 1 bbe6: e9 f7 brne .-6 ; 0xbbe2 int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; bbe8: c7 5a subi r28, 0xA7 ; 167 bbea: dd 4f sbci r29, 0xFD ; 253 bbec: 19 82 std Y+1, r1 ; 0x01 bbee: 18 82 st Y, r1 bbf0: c9 55 subi r28, 0x59 ; 89 bbf2: d2 40 sbci r29, 0x02 ; 2 bbf4: 9e 01 movw r18, r28 bbf6: 2f 51 subi r18, 0x1F ; 31 bbf8: 3e 4f sbci r19, 0xFE ; 254 bbfa: c1 59 subi r28, 0x91 ; 145 bbfc: dd 4f sbci r29, 0xFD ; 253 bbfe: 39 83 std Y+1, r19 ; 0x01 bc00: 28 83 st Y, r18 bc02: cf 56 subi r28, 0x6F ; 111 bc04: d2 40 sbci r29, 0x02 ; 2 bc06: 8e 01 movw r16, r28 bc08: 07 5a subi r16, 0xA7 ; 167 bc0a: 1d 4f sbci r17, 0xFD ; 253 bc0c: ce 01 movw r24, r28 bc0e: 8f 5c subi r24, 0xCF ; 207 bc10: 9d 4f sbci r25, 0xFD ; 253 bc12: c3 59 subi r28, 0x93 ; 147 bc14: dd 4f sbci r29, 0xFD ; 253 bc16: 99 83 std Y+1, r25 ; 0x01 bc18: 88 83 st Y, r24 bc1a: cd 56 subi r28, 0x6D ; 109 bc1c: d2 40 sbci r29, 0x02 ; 2 bc1e: 3c 01 movw r6, r24 bc20: 49 01 movw r8, r18 bc22: 40 eb ldi r20, 0xB0 ; 176 bc24: a4 2e mov r10, r20 bc26: 4f e0 ldi r20, 0x0F ; 15 bc28: b4 2e mov r11, r20 bc2a: 53 e2 ldi r21, 0x23 ; 35 bc2c: c5 2e mov r12, r21 bc2e: d1 2c mov r13, r1 for (i = 0; i < n; i++) { bc30: f1 2c mov r15, r1 bc32: 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]; bc34: b6 01 movw r22, r12 bc36: 0d 2c mov r0, r13 bc38: 00 0c add r0, r0 bc3a: 88 0b sbc r24, r24 bc3c: 99 0b sbc r25, r25 bc3e: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> bc42: d4 01 movw r26, r8 bc44: 6d 93 st X+, r22 bc46: 7d 93 st X+, r23 bc48: 8d 93 st X+, r24 bc4a: 9d 93 st X+, r25 bc4c: 4d 01 movw r8, r26 f[i] = (float)shift[i]; bc4e: f8 01 movw r30, r16 bc50: 61 91 ld r22, Z+ bc52: 71 91 ld r23, Z+ bc54: 8f 01 movw r16, r30 bc56: 07 2e mov r0, r23 bc58: 00 0c add r0, r0 bc5a: 88 0b sbc r24, r24 bc5c: 99 0b sbc r25, r25 bc5e: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> bc62: d3 01 movw r26, r6 bc64: 6d 93 st X+, r22 bc66: 7d 93 st X+, r23 bc68: 8d 93 st X+, r24 bc6a: 9d 93 st X+, r25 bc6c: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { bc6e: bf ef ldi r27, 0xFF ; 255 bc70: eb 1a sub r14, r27 bc72: fb 0a sbc r15, r27 bc74: e6 e0 ldi r30, 0x06 ; 6 bc76: ee 16 cp r14, r30 bc78: f1 04 cpc r15, r1 bc7a: 09 f0 breq .+2 ; 0xbc7e bc7c: 38 c3 rjmp .+1648 ; 0xc2ee 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; bc7e: cb 58 subi r28, 0x8B ; 139 bc80: dd 4f sbci r29, 0xFD ; 253 bc82: 28 81 ld r18, Y bc84: 39 81 ldd r19, Y+1 ; 0x01 bc86: 4a 81 ldd r20, Y+2 ; 0x02 bc88: 5b 81 ldd r21, Y+3 ; 0x03 bc8a: c5 57 subi r28, 0x75 ; 117 bc8c: d2 40 sbci r29, 0x02 ; 2 bc8e: c1 59 subi r28, 0x91 ; 145 bc90: dd 4f sbci r29, 0xFD ; 253 bc92: a8 81 ld r26, Y bc94: b9 81 ldd r27, Y+1 ; 0x01 bc96: cf 56 subi r28, 0x6F ; 111 bc98: d2 40 sbci r29, 0x02 ; 2 bc9a: 6d 91 ld r22, X+ bc9c: 7d 91 ld r23, X+ bc9e: 8d 91 ld r24, X+ bca0: 9c 91 ld r25, X bca2: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> bca6: 41 2c mov r4, r1 bca8: 51 2c mov r5, r1 bcaa: 32 01 movw r6, r4 bcac: 18 16 cp r1, r24 bcae: 0c f4 brge .+2 ; 0xbcb2 bcb0: 02 c3 rjmp .+1540 ; 0xc2b6 bcb2: c3 59 subi r28, 0x93 ; 147 bcb4: dd 4f sbci r29, 0xFD ; 253 bcb6: 08 81 ld r16, Y bcb8: 19 81 ldd r17, Y+1 ; 0x01 bcba: cd 56 subi r28, 0x6D ; 109 bcbc: d2 40 sbci r29, 0x02 ; 2 bcbe: 0c 5e subi r16, 0xEC ; 236 bcc0: 1f 4f sbci r17, 0xFF ; 255 bcc2: c1 59 subi r28, 0x91 ; 145 bcc4: dd 4f sbci r29, 0xFD ; 253 bcc6: e8 80 ld r14, Y bcc8: f9 80 ldd r15, Y+1 ; 0x01 bcca: cf 56 subi r28, 0x6F ; 111 bccc: d2 40 sbci r29, 0x02 ; 2 bcce: b4 e1 ldi r27, 0x14 ; 20 bcd0: eb 0e add r14, r27 bcd2: f1 1c adc r15, r1 bcd4: 6e 01 movw r12, r28 bcd6: ef ed ldi r30, 0xDF ; 223 bcd8: ce 1a sub r12, r30 bcda: ed ef ldi r30, 0xFD ; 253 bcdc: de 0a sbc r13, r30 bcde: 9e 01 movw r18, r28 bce0: 2b 55 subi r18, 0x5B ; 91 bce2: 3e 4f sbci r19, 0xFE ; 254 bce4: cf 58 subi r28, 0x8F ; 143 bce6: dd 4f sbci r29, 0xFD ; 253 bce8: 39 83 std Y+1, r19 ; 0x01 bcea: 28 83 st Y, r18 bcec: c1 57 subi r28, 0x71 ; 113 bcee: 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]); bcf0: d8 01 movw r26, r16 bcf2: 4d 90 ld r4, X+ bcf4: 5d 90 ld r5, X+ bcf6: 6d 90 ld r6, X+ bcf8: 7c 90 ld r7, X bcfa: f7 01 movw r30, r14 bcfc: 60 81 ld r22, Z bcfe: 71 81 ldd r23, Z+1 ; 0x01 bd00: 82 81 ldd r24, Z+2 ; 0x02 bd02: 93 81 ldd r25, Z+3 ; 0x03 bd04: d7 01 movw r26, r14 bd06: 5e 91 ld r21, -X bd08: 4e 91 ld r20, -X bd0a: 3e 91 ld r19, -X bd0c: 2e 91 ld r18, -X bd0e: 7d 01 movw r14, r26 bd10: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> bd14: 4b 01 movw r8, r22 bd16: 5c 01 movw r10, r24 bd18: f8 01 movw r30, r16 bd1a: 52 91 ld r21, -Z bd1c: 42 91 ld r20, -Z bd1e: 32 91 ld r19, -Z bd20: 22 91 ld r18, -Z bd22: 8f 01 movw r16, r30 bd24: c3 01 movw r24, r6 bd26: b2 01 movw r22, r4 bd28: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> bd2c: a5 01 movw r20, r10 bd2e: 94 01 movw r18, r8 bd30: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> bd34: d6 01 movw r26, r12 bd36: 9e 93 st -X, r25 bd38: 8e 93 st -X, r24 bd3a: 7e 93 st -X, r23 bd3c: 6e 93 st -X, r22 bd3e: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; bd40: cf 58 subi r28, 0x8F ; 143 bd42: dd 4f sbci r29, 0xFD ; 253 bd44: e8 81 ld r30, Y bd46: f9 81 ldd r31, Y+1 ; 0x01 bd48: c1 57 subi r28, 0x71 ; 113 bd4a: d2 40 sbci r29, 0x02 ; 2 bd4c: b2 92 st -Z, r11 bd4e: a2 92 st -Z, r10 bd50: 92 92 st -Z, r9 bd52: 82 92 st -Z, r8 bd54: cf 58 subi r28, 0x8F ; 143 bd56: dd 4f sbci r29, 0xFD ; 253 bd58: f9 83 std Y+1, r31 ; 0x01 bd5a: e8 83 st Y, r30 bd5c: c1 57 subi r28, 0x71 ; 113 bd5e: 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--) { bd60: c3 59 subi r28, 0x93 ; 147 bd62: dd 4f sbci r29, 0xFD ; 253 bd64: 28 81 ld r18, Y bd66: 39 81 ldd r19, Y+1 ; 0x01 bd68: cd 56 subi r28, 0x6D ; 109 bd6a: d2 40 sbci r29, 0x02 ; 2 bd6c: 02 17 cp r16, r18 bd6e: 13 07 cpc r17, r19 bd70: 09 f0 breq .+2 ; 0xbd74 bd72: be cf rjmp .-132 ; 0xbcf0 bd74: 4e 01 movw r8, r28 bd76: 3f e6 ldi r19, 0x6F ; 111 bd78: 83 1a sub r8, r19 bd7a: 3e ef ldi r19, 0xFE ; 254 bd7c: 93 0a sbc r9, r19 bd7e: 5e 01 movw r10, r28 bd80: 83 ef ldi r24, 0xF3 ; 243 bd82: a8 1a sub r10, r24 bd84: 8d ef ldi r24, 0xFD ; 253 bd86: b8 0a sbc r11, r24 bd88: 61 01 movw r12, r2 bd8a: 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 bdae: 9b 01 movw r18, r22 bdb0: ac 01 movw r20, r24 bdb2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> bdb6: f8 01 movw r30, r16 bdb8: 64 a7 std Z+44, r22 ; 0x2c bdba: 75 a7 std Z+45, r23 ; 0x2d bdbc: 86 a7 std Z+46, r24 ; 0x2e bdbe: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { bdc0: f1 e0 ldi r31, 0x01 ; 1 bdc2: ef 16 cp r14, r31 bdc4: f1 04 cpc r15, r1 bdc6: 61 f0 breq .+24 ; 0xbde0 m[i][i - 1] = h[i - 1]; bdc8: d8 01 movw r26, r16 bdca: 98 96 adiw r26, 0x28 ; 40 bdcc: 4d 92 st X+, r4 bdce: 5d 92 st X+, r5 bdd0: 6d 92 st X+, r6 bdd2: 7c 92 st X, r7 bdd4: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; bdd6: f8 01 movw r30, r16 bdd8: 44 82 std Z+4, r4 ; 0x04 bdda: 55 82 std Z+5, r5 ; 0x05 bddc: 66 82 std Z+6, r6 ; 0x06 bdde: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); bde0: ff ef ldi r31, 0xFF ; 255 bde2: ef 1a sub r14, r31 bde4: ff 0a sbc r15, r31 bde6: f5 01 movw r30, r10 bde8: 20 81 ld r18, Z bdea: 31 81 ldd r19, Z+1 ; 0x01 bdec: 42 81 ldd r20, Z+2 ; 0x02 bdee: 53 81 ldd r21, Z+3 ; 0x03 bdf0: 84 e0 ldi r24, 0x04 ; 4 bdf2: a8 0e add r10, r24 bdf4: b1 1c adc r11, r1 bdf6: 64 81 ldd r22, Z+4 ; 0x04 bdf8: 75 81 ldd r23, Z+5 ; 0x05 bdfa: 86 81 ldd r24, Z+6 ; 0x06 bdfc: 97 81 ldd r25, Z+7 ; 0x07 bdfe: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> be02: 20 e0 ldi r18, 0x00 ; 0 be04: 30 e0 ldi r19, 0x00 ; 0 be06: 40 ec ldi r20, 0xC0 ; 192 be08: 50 e4 ldi r21, 0x40 ; 64 be0a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> be0e: d6 01 movw r26, r12 be10: dc 96 adiw r26, 0x3c ; 60 be12: 6d 93 st X+, r22 be14: 7d 93 st X+, r23 be16: 8d 93 st X+, r24 be18: 9c 93 st X, r25 be1a: df 97 sbiw r26, 0x3f ; 63 be1c: 04 5d subi r16, 0xD4 ; 212 be1e: 1f 4f sbci r17, 0xFF ; 255 be20: b8 e2 ldi r27, 0x28 ; 40 be22: cb 0e add r12, r27 be24: 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 be2e: b1 cf rjmp .-158 ; 0xbd92 be30: 7e 01 movw r14, r28 be32: fd e2 ldi r31, 0x2D ; 45 be34: ef 0e add r14, r31 be36: f1 1c adc r15, r1 be38: 28 e2 ldi r18, 0x28 ; 40 be3a: a2 2e mov r10, r18 be3c: b1 2c mov r11, r1 be3e: 00 eb ldi r16, 0xB0 ; 176 be40: 1f ef ldi r17, 0xFF ; 255 be42: 24 e0 ldi r18, 0x04 ; 4 be44: 22 0e add r2, r18 be46: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i be64: 2b 01 movw r4, r22 be66: 3c 01 movw r6, r24 be68: 61 01 movw r12, r2 be6a: c0 1a sub r12, r16 be6c: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) be6e: 88 24 eor r8, r8 be70: 83 94 inc r8 be72: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; be74: f6 01 movw r30, r12 be76: e0 0f add r30, r16 be78: f1 1f adc r31, r17 be7a: ea 0d add r30, r10 be7c: fb 1d adc r31, r11 be7e: 20 81 ld r18, Z be80: 31 81 ldd r19, Z+1 ; 0x01 be82: 42 81 ldd r20, Z+2 ; 0x02 be84: 53 81 ldd r21, Z+3 ; 0x03 be86: c3 01 movw r24, r6 be88: b2 01 movw r22, r4 be8a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> be8e: 9b 01 movw r18, r22 be90: ac 01 movw r20, r24 be92: f6 01 movw r30, r12 be94: 60 81 ld r22, Z be96: 71 81 ldd r23, Z+1 ; 0x01 be98: 82 81 ldd r24, Z+2 ; 0x02 be9a: 93 81 ldd r25, Z+3 ; 0x03 be9c: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> bea0: d6 01 movw r26, r12 bea2: 6d 93 st X+, r22 bea4: 7d 93 st X+, r23 bea6: 8d 93 st X+, r24 bea8: 9d 93 st X+, r25 beaa: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i beba: 3c e2 ldi r19, 0x2C ; 44 bebc: e3 0e add r14, r19 bebe: f1 1c adc r15, r1 bec0: 08 52 subi r16, 0x28 ; 40 bec2: 11 09 sbc r17, r1 bec4: 88 e2 ldi r24, 0x28 ; 40 bec6: a8 0e add r10, r24 bec8: 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 bed2: ba cf rjmp .-140 ; 0xbe48 bed4: 1e 01 movw r2, r28 bed6: f5 eb ldi r31, 0xB5 ; 181 bed8: 2f 0e add r2, r31 beda: 31 1c adc r3, r1 bedc: 6e 01 movw r12, r28 bede: 21 eb ldi r18, 0xB1 ; 177 bee0: c2 0e add r12, r18 bee2: d1 1c adc r13, r1 bee4: 7e 01 movw r14, r28 bee6: 37 e3 ldi r19, 0x37 ; 55 bee8: e3 1a sub r14, r19 beea: 3e ef ldi r19, 0xFE ; 254 beec: 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--) { beee: 04 e0 ldi r16, 0x04 ; 4 bef0: 10 e0 ldi r17, 0x00 ; 0 bef2: 48 01 movw r8, r16 bef4: b1 2c mov r11, r1 bef6: a1 2c mov r10, r1 sum = 0; bef8: 41 2c mov r4, r1 befa: 51 2c mov r5, r1 befc: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; befe: f6 01 movw r30, r12 bf00: ea 0d add r30, r10 bf02: fb 1d adc r31, r11 bf04: d7 01 movw r26, r14 bf06: aa 0d add r26, r10 bf08: bb 1d adc r27, r11 bf0a: 2d 91 ld r18, X+ bf0c: 3d 91 ld r19, X+ bf0e: 4d 91 ld r20, X+ bf10: 5c 91 ld r21, X bf12: 60 81 ld r22, Z bf14: 71 81 ldd r23, Z+1 ; 0x01 bf16: 82 81 ldd r24, Z+2 ; 0x02 bf18: 93 81 ldd r25, Z+3 ; 0x03 bf1a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> bf1e: 9b 01 movw r18, r22 bf20: ac 01 movw r20, r24 bf22: c3 01 movw r24, r6 bf24: b2 01 movw r22, r4 bf26: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> bf2a: 2b 01 movw r4, r22 bf2c: 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++) bf2e: 8f ef ldi r24, 0xFF ; 255 bf30: 88 1a sub r8, r24 bf32: 98 0a sbc r9, r24 bf34: 94 e0 ldi r25, 0x04 ; 4 bf36: a9 0e add r10, r25 bf38: b1 1c adc r11, r1 bf3a: a5 e0 ldi r26, 0x05 ; 5 bf3c: 8a 16 cp r8, r26 bf3e: 91 04 cpc r9, r1 bf40: f1 f6 brne .-68 ; 0xbefe sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; bf42: a3 01 movw r20, r6 bf44: 92 01 movw r18, r4 bf46: f1 01 movw r30, r2 bf48: 60 81 ld r22, Z bf4a: 71 81 ldd r23, Z+1 ; 0x01 bf4c: 82 81 ldd r24, Z+2 ; 0x02 bf4e: 93 81 ldd r25, Z+3 ; 0x03 bf50: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> bf54: d6 01 movw r26, r12 bf56: 2d 91 ld r18, X+ bf58: 3d 91 ld r19, X+ bf5a: 4d 91 ld r20, X+ bf5c: 5c 91 ld r21, X bf5e: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> bf62: f7 01 movw r30, r14 bf64: 60 83 st Z, r22 bf66: 71 83 std Z+1, r23 ; 0x01 bf68: 82 83 std Z+2, r24 ; 0x02 bf6a: 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--) { bf6c: 01 50 subi r16, 0x01 ; 1 bf6e: 11 09 sbc r17, r1 bf70: f8 e2 ldi r31, 0x28 ; 40 bf72: 2f 1a sub r2, r31 bf74: 31 08 sbc r3, r1 bf76: 2c e2 ldi r18, 0x2C ; 44 bf78: c2 1a sub r12, r18 bf7a: d1 08 sbc r13, r1 bf7c: 34 e0 ldi r19, 0x04 ; 4 bf7e: e3 1a sub r14, r19 bf80: f1 08 sbc r15, r1 bf82: 01 15 cp r16, r1 bf84: 11 05 cpc r17, r1 bf86: 09 f0 breq .+2 ; 0xbf8a bf88: b4 cf rjmp .-152 ; 0xbef2 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { bf8a: cb 50 subi r28, 0x0B ; 11 bf8c: de 4f sbci r29, 0xFE ; 254 bf8e: 88 81 ld r24, Y bf90: 99 81 ldd r25, Y+1 ; 0x01 bf92: aa 81 ldd r26, Y+2 ; 0x02 bf94: bb 81 ldd r27, Y+3 ; 0x03 bf96: c5 5f subi r28, 0xF5 ; 245 bf98: d1 40 sbci r29, 0x01 ; 1 bf9a: cf 57 subi r28, 0x7F ; 127 bf9c: dd 4f sbci r29, 0xFD ; 253 bf9e: 88 83 st Y, r24 bfa0: 99 83 std Y+1, r25 ; 0x01 bfa2: aa 83 std Y+2, r26 ; 0x02 bfa4: bb 83 std Y+3, r27 ; 0x03 bfa6: c1 58 subi r28, 0x81 ; 129 bfa8: d2 40 sbci r29, 0x02 ; 2 bfaa: 1e 01 movw r2, r28 bfac: 97 e4 ldi r25, 0x47 ; 71 bfae: 29 1a sub r2, r25 bfb0: 9e ef ldi r25, 0xFE ; 254 bfb2: 39 0a sbc r3, r25 bfb4: 10 e0 ldi r17, 0x00 ; 0 bfb6: 00 e0 ldi r16, 0x00 ; 0 bfb8: c1 59 subi r28, 0x91 ; 145 bfba: dd 4f sbci r29, 0xFD ; 253 bfbc: a8 81 ld r26, Y bfbe: b9 81 ldd r27, Y+1 ; 0x01 bfc0: cf 56 subi r28, 0x6F ; 111 bfc2: d2 40 sbci r29, 0x02 ; 2 bfc4: cd 90 ld r12, X+ bfc6: dd 90 ld r13, X+ bfc8: ed 90 ld r14, X+ bfca: fd 90 ld r15, X+ bfcc: c1 59 subi r28, 0x91 ; 145 bfce: dd 4f sbci r29, 0xFD ; 253 bfd0: b9 83 std Y+1, r27 ; 0x01 bfd2: a8 83 st Y, r26 bfd4: cf 56 subi r28, 0x6F ; 111 bfd6: d2 40 sbci r29, 0x02 ; 2 bfd8: cb 58 subi r28, 0x8B ; 139 bfda: dd 4f sbci r29, 0xFD ; 253 bfdc: 28 81 ld r18, Y bfde: 39 81 ldd r19, Y+1 ; 0x01 bfe0: 4a 81 ldd r20, Y+2 ; 0x02 bfe2: 5b 81 ldd r21, Y+3 ; 0x03 bfe4: c5 57 subi r28, 0x75 ; 117 bfe6: d2 40 sbci r29, 0x02 ; 2 bfe8: c7 01 movw r24, r14 bfea: b6 01 movw r22, r12 bfec: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> bff0: 18 16 cp r1, r24 bff2: b4 f0 brlt .+44 ; 0xc020 bff4: cb 58 subi r28, 0x8B ; 139 bff6: dd 4f sbci r29, 0xFD ; 253 bff8: 28 81 ld r18, Y bffa: 39 81 ldd r19, Y+1 ; 0x01 bffc: 4a 81 ldd r20, Y+2 ; 0x02 bffe: 5b 81 ldd r21, Y+3 ; 0x03 c000: c5 57 subi r28, 0x75 ; 117 c002: d2 40 sbci r29, 0x02 ; 2 c004: c1 59 subi r28, 0x91 ; 145 c006: dd 4f sbci r29, 0xFD ; 253 c008: e8 81 ld r30, Y c00a: f9 81 ldd r31, Y+1 ; 0x01 c00c: cf 56 subi r28, 0x6F ; 111 c00e: d2 40 sbci r29, 0x02 ; 2 c010: 60 81 ld r22, Z c012: 71 81 ldd r23, Z+1 ; 0x01 c014: 82 81 ldd r24, Z+2 ; 0x02 c016: 93 81 ldd r25, Z+3 ; 0x03 c018: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> c01c: 87 ff sbrs r24, 7 c01e: 18 c0 rjmp .+48 ; 0xc050 c020: 04 30 cpi r16, 0x04 ; 4 c022: 11 05 cpc r17, r1 c024: 09 f0 breq .+2 ; 0xc028 c026: 30 c1 rjmp .+608 ; 0xc288 c028: cb 58 subi r28, 0x8B ; 139 c02a: dd 4f sbci r29, 0xFD ; 253 c02c: 28 81 ld r18, Y c02e: 39 81 ldd r19, Y+1 ; 0x01 c030: 4a 81 ldd r20, Y+2 ; 0x02 c032: 5b 81 ldd r21, Y+3 ; 0x03 c034: c5 57 subi r28, 0x75 ; 117 c036: d2 40 sbci r29, 0x02 ; 2 c038: cf 57 subi r28, 0x7F ; 127 c03a: dd 4f sbci r29, 0xFD ; 253 c03c: 68 81 ld r22, Y c03e: 79 81 ldd r23, Y+1 ; 0x01 c040: 8a 81 ldd r24, Y+2 ; 0x02 c042: 9b 81 ldd r25, Y+3 ; 0x03 c044: c1 58 subi r28, 0x81 ; 129 c046: d2 40 sbci r29, 0x02 ; 2 c048: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> c04c: 87 ff sbrs r24, 7 c04e: 1c c1 rjmp .+568 ; 0xc288 a = (s[i + 1] - s[i]) / (6 * h[i]); c050: d1 01 movw r26, r2 c052: 14 96 adiw r26, 0x04 ; 4 c054: 8d 90 ld r8, X+ c056: 9d 90 ld r9, X+ c058: ad 90 ld r10, X+ c05a: bc 90 ld r11, X c05c: 17 97 sbiw r26, 0x07 ; 7 c05e: 8d 91 ld r24, X+ c060: 9d 91 ld r25, X+ c062: 0d 90 ld r0, X+ c064: bc 91 ld r27, X c066: a0 2d mov r26, r0 c068: cf 58 subi r28, 0x8F ; 143 c06a: dd 4f sbci r29, 0xFD ; 253 c06c: 88 83 st Y, r24 c06e: 99 83 std Y+1, r25 ; 0x01 c070: aa 83 std Y+2, r26 ; 0x02 c072: bb 83 std Y+3, r27 ; 0x03 c074: c1 57 subi r28, 0x71 ; 113 c076: d2 40 sbci r29, 0x02 ; 2 c078: f8 01 movw r30, r16 c07a: ee 0f add r30, r30 c07c: ff 1f adc r31, r31 c07e: ee 0f add r30, r30 c080: ff 1f adc r31, r31 c082: 21 e9 ldi r18, 0x91 ; 145 c084: 31 e0 ldi r19, 0x01 ; 1 c086: 2c 0f add r18, r28 c088: 3d 1f adc r19, r29 c08a: e2 0f add r30, r18 c08c: f3 1f adc r31, r19 c08e: 40 80 ld r4, Z c090: 51 80 ldd r5, Z+1 ; 0x01 c092: 62 80 ldd r6, Z+2 ; 0x02 c094: 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; c096: c3 59 subi r28, 0x93 ; 147 c098: dd 4f sbci r29, 0xFD ; 253 c09a: a8 81 ld r26, Y c09c: b9 81 ldd r27, Y+1 ; 0x01 c09e: cd 56 subi r28, 0x6D ; 109 c0a0: d2 40 sbci r29, 0x02 ; 2 c0a2: 8d 91 ld r24, X+ c0a4: 9d 91 ld r25, X+ c0a6: 0d 90 ld r0, X+ c0a8: bc 91 ld r27, X c0aa: a0 2d mov r26, r0 c0ac: c3 58 subi r28, 0x83 ; 131 c0ae: dd 4f sbci r29, 0xFD ; 253 c0b0: 88 83 st Y, r24 c0b2: 99 83 std Y+1, r25 ; 0x01 c0b4: aa 83 std Y+2, r26 ; 0x02 c0b6: bb 83 std Y+3, r27 ; 0x03 c0b8: cd 57 subi r28, 0x7D ; 125 c0ba: 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; c0bc: a7 01 movw r20, r14 c0be: 96 01 movw r18, r12 c0c0: cb 58 subi r28, 0x8B ; 139 c0c2: dd 4f sbci r29, 0xFD ; 253 c0c4: 68 81 ld r22, Y c0c6: 79 81 ldd r23, Y+1 ; 0x01 c0c8: 8a 81 ldd r24, Y+2 ; 0x02 c0ca: 9b 81 ldd r25, Y+3 ; 0x03 c0cc: c5 57 subi r28, 0x75 ; 117 c0ce: d2 40 sbci r29, 0x02 ; 2 c0d0: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> c0d4: 6b 01 movw r12, r22 c0d6: 7c 01 movw r14, r24 c0d8: 20 e0 ldi r18, 0x00 ; 0 c0da: 30 e0 ldi r19, 0x00 ; 0 c0dc: 40 e4 ldi r20, 0x40 ; 64 c0de: 50 e4 ldi r21, 0x40 ; 64 c0e0: 0f 94 f3 e1 call 0x3c3e6 ; 0x3c3e6 c0e4: cb 57 subi r28, 0x7B ; 123 c0e6: dd 4f sbci r29, 0xFD ; 253 c0e8: 68 83 st Y, r22 c0ea: 79 83 std Y+1, r23 ; 0x01 c0ec: 8a 83 std Y+2, r24 ; 0x02 c0ee: 9b 83 std Y+3, r25 ; 0x03 c0f0: c5 58 subi r28, 0x85 ; 133 c0f2: 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; c0f4: c3 58 subi r28, 0x83 ; 131 c0f6: dd 4f sbci r29, 0xFD ; 253 c0f8: 28 81 ld r18, Y c0fa: 39 81 ldd r19, Y+1 ; 0x01 c0fc: 4a 81 ldd r20, Y+2 ; 0x02 c0fe: 5b 81 ldd r21, Y+3 ; 0x03 c100: cd 57 subi r28, 0x7D ; 125 c102: d2 40 sbci r29, 0x02 ; 2 c104: c3 59 subi r28, 0x93 ; 147 c106: dd 4f sbci r29, 0xFD ; 253 c108: e8 81 ld r30, Y c10a: f9 81 ldd r31, Y+1 ; 0x01 c10c: cd 56 subi r28, 0x6D ; 109 c10e: d2 40 sbci r29, 0x02 ; 2 c110: 64 81 ldd r22, Z+4 ; 0x04 c112: 75 81 ldd r23, Z+5 ; 0x05 c114: 86 81 ldd r24, Z+6 ; 0x06 c116: 97 81 ldd r25, Z+7 ; 0x07 c118: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> c11c: a3 01 movw r20, r6 c11e: 92 01 movw r18, r4 c120: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> c124: c7 58 subi r28, 0x87 ; 135 c126: dd 4f sbci r29, 0xFD ; 253 c128: 68 83 st Y, r22 c12a: 79 83 std Y+1, r23 ; 0x01 c12c: 8a 83 std Y+2, r24 ; 0x02 c12e: 9b 83 std Y+3, r25 ; 0x03 c130: c9 57 subi r28, 0x79 ; 121 c132: d2 40 sbci r29, 0x02 ; 2 c134: a3 01 movw r20, r6 c136: 92 01 movw r18, r4 c138: c3 01 movw r24, r6 c13a: b2 01 movw r22, r4 c13c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> c140: cf 58 subi r28, 0x8F ; 143 c142: dd 4f sbci r29, 0xFD ; 253 c144: 28 81 ld r18, Y c146: 39 81 ldd r19, Y+1 ; 0x01 c148: 4a 81 ldd r20, Y+2 ; 0x02 c14a: 5b 81 ldd r21, Y+3 ; 0x03 c14c: c1 57 subi r28, 0x71 ; 113 c14e: d2 40 sbci r29, 0x02 ; 2 c150: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> c154: c7 57 subi r28, 0x77 ; 119 c156: dd 4f sbci r29, 0xFD ; 253 c158: 68 83 st Y, r22 c15a: 79 83 std Y+1, r23 ; 0x01 c15c: 8a 83 std Y+2, r24 ; 0x02 c15e: 9b 83 std Y+3, r25 ; 0x03 c160: c9 58 subi r28, 0x89 ; 137 c162: d2 40 sbci r29, 0x02 ; 2 c164: a3 01 movw r20, r6 c166: 92 01 movw r18, r4 c168: c5 01 movw r24, r10 c16a: b4 01 movw r22, r8 c16c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> c170: 9b 01 movw r18, r22 c172: ac 01 movw r20, r24 c174: c7 57 subi r28, 0x77 ; 119 c176: dd 4f sbci r29, 0xFD ; 253 c178: 68 81 ld r22, Y c17a: 79 81 ldd r23, Y+1 ; 0x01 c17c: 8a 81 ldd r24, Y+2 ; 0x02 c17e: 9b 81 ldd r25, Y+3 ; 0x03 c180: c9 58 subi r28, 0x89 ; 137 c182: d2 40 sbci r29, 0x02 ; 2 c184: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> c188: 20 e0 ldi r18, 0x00 ; 0 c18a: 30 e0 ldi r19, 0x00 ; 0 c18c: 40 ec ldi r20, 0xC0 ; 192 c18e: 50 e4 ldi r21, 0x40 ; 64 c190: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> c194: 9b 01 movw r18, r22 c196: ac 01 movw r20, r24 c198: c7 58 subi r28, 0x87 ; 135 c19a: dd 4f sbci r29, 0xFD ; 253 c19c: 68 81 ld r22, Y c19e: 79 81 ldd r23, Y+1 ; 0x01 c1a0: 8a 81 ldd r24, Y+2 ; 0x02 c1a2: 9b 81 ldd r25, Y+3 ; 0x03 c1a4: c9 57 subi r28, 0x79 ; 121 c1a6: d2 40 sbci r29, 0x02 ; 2 c1a8: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__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; c1ac: a7 01 movw r20, r14 c1ae: 96 01 movw r18, r12 c1b0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> c1b4: c7 58 subi r28, 0x87 ; 135 c1b6: dd 4f sbci r29, 0xFD ; 253 c1b8: 68 83 st Y, r22 c1ba: 79 83 std Y+1, r23 ; 0x01 c1bc: 8a 83 std Y+2, r24 ; 0x02 c1be: 9b 83 std Y+3, r25 ; 0x03 c1c0: c9 57 subi r28, 0x79 ; 121 c1c2: 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]); c1c4: cf 58 subi r28, 0x8F ; 143 c1c6: dd 4f sbci r29, 0xFD ; 253 c1c8: 28 81 ld r18, Y c1ca: 39 81 ldd r19, Y+1 ; 0x01 c1cc: 4a 81 ldd r20, Y+2 ; 0x02 c1ce: 5b 81 ldd r21, Y+3 ; 0x03 c1d0: c1 57 subi r28, 0x71 ; 113 c1d2: d2 40 sbci r29, 0x02 ; 2 c1d4: c5 01 movw r24, r10 c1d6: b4 01 movw r22, r8 c1d8: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> c1dc: 4b 01 movw r8, r22 c1de: 5c 01 movw r10, r24 c1e0: 20 e0 ldi r18, 0x00 ; 0 c1e2: 30 e0 ldi r19, 0x00 ; 0 c1e4: 40 ec ldi r20, 0xC0 ; 192 c1e6: 50 e4 ldi r21, 0x40 ; 64 c1e8: c3 01 movw r24, r6 c1ea: b2 01 movw r22, r4 c1ec: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> c1f0: 9b 01 movw r18, r22 c1f2: ac 01 movw r20, r24 c1f4: c5 01 movw r24, r10 c1f6: b4 01 movw r22, r8 c1f8: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__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; c1fc: cb 57 subi r28, 0x7B ; 123 c1fe: dd 4f sbci r29, 0xFD ; 253 c200: 28 81 ld r18, Y c202: 39 81 ldd r19, Y+1 ; 0x01 c204: 4a 81 ldd r20, Y+2 ; 0x02 c206: 5b 81 ldd r21, Y+3 ; 0x03 c208: c5 58 subi r28, 0x85 ; 133 c20a: d2 40 sbci r29, 0x02 ; 2 c20c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> c210: 4b 01 movw r8, r22 c212: 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; c214: 20 e0 ldi r18, 0x00 ; 0 c216: 30 e0 ldi r19, 0x00 ; 0 c218: 40 e0 ldi r20, 0x00 ; 0 c21a: 5f e3 ldi r21, 0x3F ; 63 c21c: cf 58 subi r28, 0x8F ; 143 c21e: dd 4f sbci r29, 0xFD ; 253 c220: 68 81 ld r22, Y c222: 79 81 ldd r23, Y+1 ; 0x01 c224: 8a 81 ldd r24, Y+2 ; 0x02 c226: 9b 81 ldd r25, Y+3 ; 0x03 c228: c1 57 subi r28, 0x71 ; 113 c22a: d2 40 sbci r29, 0x02 ; 2 c22c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> c230: 2b 01 movw r4, r22 c232: 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; c234: a7 01 movw r20, r14 c236: 96 01 movw r18, r12 c238: c7 01 movw r24, r14 c23a: b6 01 movw r22, r12 c23c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> c240: 9b 01 movw r18, r22 c242: ac 01 movw r20, r24 c244: c3 01 movw r24, r6 c246: b2 01 movw r22, r4 c248: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> c24c: 9b 01 movw r18, r22 c24e: ac 01 movw r20, r24 c250: c5 01 movw r24, r10 c252: b4 01 movw r22, r8 c254: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> c258: 9b 01 movw r18, r22 c25a: ac 01 movw r20, r24 c25c: c7 58 subi r28, 0x87 ; 135 c25e: dd 4f sbci r29, 0xFD ; 253 c260: 68 81 ld r22, Y c262: 79 81 ldd r23, Y+1 ; 0x01 c264: 8a 81 ldd r24, Y+2 ; 0x02 c266: 9b 81 ldd r25, Y+3 ; 0x03 c268: c9 57 subi r28, 0x79 ; 121 c26a: d2 40 sbci r29, 0x02 ; 2 c26c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> c270: c3 58 subi r28, 0x83 ; 131 c272: dd 4f sbci r29, 0xFD ; 253 c274: 28 81 ld r18, Y c276: 39 81 ldd r19, Y+1 ; 0x01 c278: 4a 81 ldd r20, Y+2 ; 0x02 c27a: 5b 81 ldd r21, Y+3 ; 0x03 c27c: cd 57 subi r28, 0x7D ; 125 c27e: d2 40 sbci r29, 0x02 ; 2 c280: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> c284: 2b 01 movw r4, r22 c286: 3c 01 movw r6, r24 c288: 0f 5f subi r16, 0xFF ; 255 c28a: 1f 4f sbci r17, 0xFF ; 255 c28c: f4 e0 ldi r31, 0x04 ; 4 c28e: 2f 0e add r2, r31 c290: 31 1c adc r3, r1 c292: c3 59 subi r28, 0x93 ; 147 c294: dd 4f sbci r29, 0xFD ; 253 c296: 28 81 ld r18, Y c298: 39 81 ldd r19, Y+1 ; 0x01 c29a: cd 56 subi r28, 0x6D ; 109 c29c: d2 40 sbci r29, 0x02 ; 2 c29e: 2c 5f subi r18, 0xFC ; 252 c2a0: 3f 4f sbci r19, 0xFF ; 255 c2a2: c3 59 subi r28, 0x93 ; 147 c2a4: dd 4f sbci r29, 0xFD ; 253 c2a6: 39 83 std Y+1, r19 ; 0x01 c2a8: 28 83 st Y, r18 c2aa: cd 56 subi r28, 0x6D ; 109 c2ac: 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 c2b4: 81 ce rjmp .-766 ; 0xbfb8 sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } c2b6: c3 01 movw r24, r6 c2b8: b2 01 movw r22, r4 c2ba: c4 57 subi r28, 0x74 ; 116 c2bc: dd 4f sbci r29, 0xFD ; 253 c2be: 0f b6 in r0, 0x3f ; 63 c2c0: f8 94 cli c2c2: de bf out 0x3e, r29 ; 62 c2c4: 0f be out 0x3f, r0 ; 63 c2c6: cd bf out 0x3d, r28 ; 61 c2c8: df 91 pop r29 c2ca: cf 91 pop r28 c2cc: 1f 91 pop r17 c2ce: 0f 91 pop r16 c2d0: ff 90 pop r15 c2d2: ef 90 pop r14 c2d4: df 90 pop r13 c2d6: cf 90 pop r12 c2d8: bf 90 pop r11 c2da: af 90 pop r10 c2dc: 9f 90 pop r9 c2de: 8f 90 pop r8 c2e0: 7f 90 pop r7 c2e2: 6f 90 pop r6 c2e4: 5f 90 pop r5 c2e6: 4f 90 pop r4 c2e8: 3f 90 pop r3 c2ea: 2f 90 pop r2 c2ec: 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)); c2ee: c5 01 movw r24, r10 c2f0: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 c2f4: d8 01 movw r26, r16 c2f6: 8d 93 st X+, r24 c2f8: 9c 93 st X, r25 c2fa: b5 e0 ldi r27, 0x05 ; 5 c2fc: cb 0e add r12, r27 c2fe: d1 1c adc r13, r1 c300: e2 e0 ldi r30, 0x02 ; 2 c302: ae 0e add r10, r30 c304: b1 1c adc r11, r1 c306: 96 cc rjmp .-1748 ; 0xbc34 0000c308 : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { c308: 0f 93 push r16 c30a: 1f 93 push r17 c30c: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) c30e: 20 91 98 13 lds r18, 0x1398 ; 0x801398 c312: 21 30 cpi r18, 0x01 ; 1 c314: 79 f5 brne .+94 ; 0xc374 c316: 8c 01 movw r16, r24 c318: 80 e5 ldi r24, 0x50 ; 80 c31a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 c31e: 88 23 and r24, r24 c320: 49 f1 breq .+82 ; 0xc374 { mmuSlotIndex = code_value_uint8(); c322: 0e 94 8e 5c call 0xb91c ; 0xb91c c326: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { c328: 85 30 cpi r24, 0x05 ; 5 c32a: 20 f5 brcc .+72 ; 0xc374 switch (gcode) c32c: 01 3c cpi r16, 0xC1 ; 193 c32e: 82 e0 ldi r24, 0x02 ; 2 c330: 18 07 cpc r17, r24 c332: 49 f0 breq .+18 ; 0xc346 c334: 02 3c cpi r16, 0xC2 ; 194 c336: 12 40 sbci r17, 0x02 ; 2 c338: 69 f0 breq .+26 ; 0xc354 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c33a: 8c 2f mov r24, r28 default: break; } } } } c33c: cf 91 pop r28 c33e: 1f 91 pop r17 c340: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c342: 0d 94 4f a0 jmp 0x3409e ; 0x3409e break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c346: 60 e0 ldi r22, 0x00 ; 0 c348: 8c 2f mov r24, r28 default: break; } } } } c34a: cf 91 pop r28 c34c: 1f 91 pop r17 c34e: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c350: 0d 94 92 a0 jmp 0x34124 ; 0x34124 break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ c354: 8e ec ldi r24, 0xCE ; 206 c356: 9e e0 ldi r25, 0x0E ; 14 c358: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 c35c: 88 23 and r24, r24 c35e: 51 f0 breq .+20 ; 0xc374 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { c360: 0f 94 20 88 call 0x31040 ; 0x31040 c364: 88 23 and r24, r24 c366: 31 f0 breq .+12 ; 0xc374 c368: 8c 2f mov r24, r28 default: break; } } } } c36a: cf 91 pop r28 c36c: 1f 91 pop r17 c36e: 0f 91 pop r16 c370: 0d 94 0f a1 jmp 0x3421e ; 0x3421e c374: cf 91 pop r28 c376: 1f 91 pop r17 c378: 0f 91 pop r16 c37a: 08 95 ret 0000c37c : #ifdef TMC2130 void change_power_mode_live(uint8_t mode) { c37c: cf 93 push r28 c37e: 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(); c380: 0f 94 27 58 call 0x2b04e ; 0x2b04e cli(); c384: f8 94 cli tmc2130_mode = mode; c386: c0 93 6c 06 sts 0x066C, r28 ; 0x80066c update_mode_profile(); c38a: 0f 94 91 aa call 0x35522 ; 0x35522 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(); c38e: 0e 94 f8 f8 call 0x1f1f0 ; 0x1f1f0 1 #else 0 #endif ) , enableECool(enableECool) { } c392: 88 0f add r24, r24 tmc2130_init(TMCInitParams(FarmOrUserECool())); c394: 82 70 andi r24, 0x02 ; 2 c396: 0f 94 1c 3b call 0x27638 ; 0x27638 // 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(); c39a: 0f 94 81 58 call 0x2b102 ; 0x2b102 sei(); c39e: 78 94 sei } c3a0: cf 91 pop r28 c3a2: 08 95 ret 0000c3a4 : 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);} c3a4: 8f 92 push r8 c3a6: 9f 92 push r9 c3a8: af 92 push r10 c3aa: bf 92 push r11 c3ac: cf 92 push r12 c3ae: df 92 push r13 c3b0: ef 92 push r14 c3b2: ff 92 push r15 c3b4: 0f 93 push r16 c3b6: 1f 93 push r17 c3b8: cf 93 push r28 c3ba: df 93 push r29 c3bc: 00 91 97 03 lds r16, 0x0397 ; 0x800397 c3c0: 10 91 98 03 lds r17, 0x0398 ; 0x800398 c3c4: 0f 5f subi r16, 0xFF ; 255 c3c6: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c3c8: 68 01 movw r12, r16 c3ca: 8f ef ldi r24, 0xFF ; 255 c3cc: c8 1a sub r12, r24 c3ce: d8 0a sbc r13, r24 c3d0: d8 01 movw r26, r16 c3d2: dc 91 ld r29, X } while (isspace(c)); c3d4: 8d 2f mov r24, r29 c3d6: 90 e0 ldi r25, 0x00 ; 0 c3d8: 0f 94 ec da call 0x3b5d8 ; 0x3b5d8 c3dc: 7c 01 movw r14, r24 c3de: 89 2b or r24, r25 c3e0: 01 f5 brne .+64 ; 0xc422 flag = 0; if (c == '-') { c3e2: dd 32 cpi r29, 0x2D ; 45 c3e4: 01 f5 brne .+64 ; 0xc426 flag = FL_MINUS; c = *nptr++; c3e6: 68 01 movw r12, r16 c3e8: b2 e0 ldi r27, 0x02 ; 2 c3ea: cb 0e add r12, r27 c3ec: d1 1c adc r13, r1 c3ee: f8 01 movw r30, r16 c3f0: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; c3f2: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { c3f4: 86 01 movw r16, r12 c3f6: 01 50 subi r16, 0x01 ; 1 c3f8: 11 09 sbc r17, r1 c3fa: 43 e0 ldi r20, 0x03 ; 3 c3fc: 50 e0 ldi r21, 0x00 ; 0 c3fe: 61 ef ldi r22, 0xF1 ; 241 c400: 7c e7 ldi r23, 0x7C ; 124 c402: c8 01 movw r24, r16 c404: 0f 94 22 db call 0x3b644 ; 0x3b644 c408: 89 2b or r24, r25 c40a: c1 f4 brne .+48 ; 0xc43c nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; c40c: 60 e0 ldi r22, 0x00 ; 0 c40e: 70 e0 ldi r23, 0x00 ; 0 c410: 80 e8 ldi r24, 0x80 ; 128 c412: 9f ef ldi r25, 0xFF ; 255 c414: c1 11 cpse r28, r1 c416: db c0 rjmp .+438 ; 0xc5ce c418: 60 e0 ldi r22, 0x00 ; 0 c41a: 70 e0 ldi r23, 0x00 ; 0 c41c: 80 e8 ldi r24, 0x80 ; 128 c41e: 9f e7 ldi r25, 0x7F ; 127 c420: d6 c0 rjmp .+428 ; 0xc5ce if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c422: 86 01 movw r16, r12 c424: d1 cf rjmp .-94 ; 0xc3c8 flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { c426: db 32 cpi r29, 0x2B ; 43 c428: 39 f4 brne .+14 ; 0xc438 c = *nptr++; c42a: 68 01 movw r12, r16 c42c: f2 e0 ldi r31, 0x02 ; 2 c42e: cf 0e add r12, r31 c430: d1 1c adc r13, r1 c432: d8 01 movw r26, r16 c434: 11 96 adiw r26, 0x01 ; 1 c436: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; c438: c0 e0 ldi r28, 0x00 ; 0 c43a: dc cf rjmp .-72 ; 0xc3f4 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)) { c43c: 43 e0 ldi r20, 0x03 ; 3 c43e: 50 e0 ldi r21, 0x00 ; 0 c440: 6e ee ldi r22, 0xEE ; 238 c442: 7c e7 ldi r23, 0x7C ; 124 c444: c8 01 movw r24, r16 c446: 0f 94 22 db call 0x3b644 ; 0x3b644 c44a: 89 2b or r24, r25 c44c: 09 f4 brne .+2 ; 0xc450 c44e: cc c0 rjmp .+408 ; 0xc5e8 c450: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; c452: 10 e0 ldi r17, 0x00 ; 0 c454: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; c456: 20 e0 ldi r18, 0x00 ; 0 c458: 30 e0 ldi r19, 0x00 ; 0 c45a: a9 01 movw r20, r18 c45c: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; c45e: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { c460: da 30 cpi r29, 0x0A ; 10 c462: 60 f5 brcc .+88 ; 0xc4bc flag |= FL_ANY; c464: bc 2e mov r11, r28 c466: 68 94 set c468: b1 f8 bld r11, 1 c46a: 8c 2f mov r24, r28 c46c: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { c46e: c2 ff sbrs r28, 2 c470: 09 c0 rjmp .+18 ; 0xc484 if (!(flag & FL_DOT)) c472: 81 11 cpse r24, r1 c474: 02 c0 rjmp .+4 ; 0xc47a exp += 1; c476: 0f 5f subi r16, 0xFF ; 255 c478: 1f 4f sbci r17, 0xFF ; 255 c47a: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; c47c: d6 01 movw r26, r12 c47e: dc 91 ld r29, X c480: cb 2d mov r28, r11 c482: ec cf rjmp .-40 ; 0xc45c if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) c484: 88 23 and r24, r24 c486: 11 f0 breq .+4 ; 0xc48c exp -= 1; c488: 01 50 subi r16, 0x01 ; 1 c48a: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; c48c: a5 e0 ldi r26, 0x05 ; 5 c48e: b0 e0 ldi r27, 0x00 ; 0 c490: 0f 94 f0 dd call 0x3bbe0 ; 0x3bbe0 <__muluhisi3> c494: 9b 01 movw r18, r22 c496: ac 01 movw r20, r24 c498: 22 0f add r18, r18 c49a: 33 1f adc r19, r19 c49c: 44 1f adc r20, r20 c49e: 55 1f adc r21, r21 c4a0: 2d 0f add r18, r29 c4a2: 31 1d adc r19, r1 c4a4: 41 1d adc r20, r1 c4a6: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) c4a8: 28 39 cpi r18, 0x98 ; 152 c4aa: b9 e9 ldi r27, 0x99 ; 153 c4ac: 3b 07 cpc r19, r27 c4ae: 4b 07 cpc r20, r27 c4b0: b9 e1 ldi r27, 0x19 ; 25 c4b2: 5b 07 cpc r21, r27 c4b4: 10 f3 brcs .-60 ; 0xc47a flag |= FL_OVFL; c4b6: c6 60 ori r28, 0x06 ; 6 c4b8: bc 2e mov r11, r28 c4ba: df cf rjmp .-66 ; 0xc47a } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { c4bc: de 3f cpi r29, 0xFE ; 254 c4be: 31 f4 brne .+12 ; 0xc4cc c4c0: c3 fd sbrc r28, 3 c4c2: 33 c0 rjmp .+102 ; 0xc52a flag |= FL_DOT; c4c4: bc 2e mov r11, r28 c4c6: 68 94 set c4c8: b3 f8 bld r11, 3 c4ca: d7 cf rjmp .-82 ; 0xc47a } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) c4cc: d5 33 cpi r29, 0x35 ; 53 c4ce: 69 f5 brne .+90 ; 0xc52a { int i; c = *nptr++; c4d0: 80 81 ld r24, Z i = 2; if (c == '-') { c4d2: 8d 32 cpi r24, 0x2D ; 45 c4d4: 31 f4 brne .+12 ; 0xc4e2 flag |= FL_MEXP; c4d6: c0 61 ori r28, 0x10 ; 16 c = *nptr++; c4d8: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; c4da: 6e 5f subi r22, 0xFE ; 254 c4dc: 7f 4f sbci r23, 0xFF ; 255 c4de: 81 81 ldd r24, Z+1 ; 0x01 c4e0: 05 c0 rjmp .+10 ; 0xc4ec c4e2: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { c4e4: 8b 32 cpi r24, 0x2B ; 43 c4e6: c9 f3 breq .-14 ; 0xc4da // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; c4e8: 6f 5f subi r22, 0xFF ; 255 c4ea: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; c4ec: 80 53 subi r24, 0x30 ; 48 if (c > 9) { c4ee: 8a 30 cpi r24, 0x0A ; 10 c4f0: e0 f4 brcc .+56 ; 0xc52a c4f2: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) c4f4: b0 e8 ldi r27, 0x80 ; 128 c4f6: eb 16 cp r14, r27 c4f8: bc e0 ldi r27, 0x0C ; 12 c4fa: fb 06 cpc r15, r27 c4fc: 5c f4 brge .+22 ; 0xc514 i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ c4fe: b7 01 movw r22, r14 c500: 66 0f add r22, r22 c502: 77 1f adc r23, r23 c504: 66 0f add r22, r22 c506: 77 1f adc r23, r23 c508: e6 0e add r14, r22 c50a: f7 1e adc r15, r23 c50c: ee 0c add r14, r14 c50e: ff 1c adc r15, r15 c510: e8 0e add r14, r24 c512: f1 1c adc r15, r1 c = *nptr++ - '0'; c514: 81 91 ld r24, Z+ c516: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); c518: 8a 30 cpi r24, 0x0A ; 10 c51a: 60 f3 brcs .-40 ; 0xc4f4 if (flag & FL_MEXP) c51c: c4 ff sbrs r28, 4 c51e: 03 c0 rjmp .+6 ; 0xc526 i = -i; c520: f1 94 neg r15 c522: e1 94 neg r14 c524: f1 08 sbc r15, r1 exp += i; c526: 0e 0d add r16, r14 c528: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ c52a: ca 01 movw r24, r20 c52c: b9 01 movw r22, r18 c52e: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) c532: c3 70 andi r28, 0x03 ; 3 c534: c3 30 cpi r28, 0x03 ; 3 c536: 09 f4 brne .+2 ; 0xc53a x.flt = -x.flt; c538: 90 58 subi r25, 0x80 ; 128 c53a: 4b 01 movw r8, r22 c53c: 5c 01 movw r10, r24 if (x.flt != 0) { c53e: 20 e0 ldi r18, 0x00 ; 0 c540: 30 e0 ldi r19, 0x00 ; 0 c542: a9 01 movw r20, r18 c544: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> c548: 88 23 and r24, r24 c54a: 09 f4 brne .+2 ; 0xc54e c54c: 3e c0 rjmp .+124 ; 0xc5ca if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c54e: ca ee ldi r28, 0xEA ; 234 c550: dc e7 ldi r29, 0x7C ; 124 if ((flag & FL_MINUS) && (flag & FL_ANY)) x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { c552: 17 ff sbrs r17, 7 c554: 05 c0 rjmp .+10 ; 0xc560 nptr = (void*)(pwr_m10 + 5); exp = -exp; c556: 11 95 neg r17 c558: 01 95 neg r16 c55a: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); c55c: c2 ed ldi r28, 0xD2 ; 210 c55e: dc e7 ldi r29, 0x7C ; 124 c560: 6e 01 movw r12, r28 c562: e8 e1 ldi r30, 0x18 ; 24 c564: ce 1a sub r12, r30 c566: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c568: 80 e2 ldi r24, 0x20 ; 32 c56a: e8 2e mov r14, r24 c56c: f1 2c mov r15, r1 c56e: 0d c0 rjmp .+26 ; 0xc58a for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); c570: fe 01 movw r30, r28 c572: 25 91 lpm r18, Z+ c574: 35 91 lpm r19, Z+ c576: 45 91 lpm r20, Z+ c578: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c57a: 0e 19 sub r16, r14 c57c: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; c57e: c5 01 movw r24, r10 c580: b4 01 movw r22, r8 c582: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> c586: 4b 01 movw r8, r22 c588: 5c 01 movw r10, r24 c58a: d5 01 movw r26, r10 c58c: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c58e: 0e 15 cp r16, r14 c590: 1f 05 cpc r17, r15 c592: 74 f7 brge .-36 ; 0xc570 float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); c594: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { c596: f5 94 asr r15 c598: e7 94 ror r14 c59a: cc 16 cp r12, r28 c59c: dd 06 cpc r13, r29 c59e: a9 f7 brne .-22 ; 0xc58a not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( c5a0: 8a 2f mov r24, r26 c5a2: 88 0f add r24, r24 c5a4: 8b 2f mov r24, r27 c5a6: 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) c5a8: 8f 3f cpi r24, 0xFF ; 255 c5aa: 49 f0 breq .+18 ; 0xc5be c5ac: 20 e0 ldi r18, 0x00 ; 0 c5ae: 30 e0 ldi r19, 0x00 ; 0 c5b0: a9 01 movw r20, r18 c5b2: c5 01 movw r24, r10 c5b4: b4 01 movw r22, r8 c5b6: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> c5ba: 81 11 cpse r24, r1 c5bc: 06 c0 rjmp .+12 ; 0xc5ca errno = ERANGE; c5be: 82 e2 ldi r24, 0x22 ; 34 c5c0: 90 e0 ldi r25, 0x00 ; 0 c5c2: 90 93 0e 18 sts 0x180E, r25 ; 0x80180e c5c6: 80 93 0d 18 sts 0x180D, r24 ; 0x80180d } return x.flt; c5ca: c5 01 movw r24, r10 c5cc: b4 01 movw r22, r8 c5ce: df 91 pop r29 c5d0: cf 91 pop r28 c5d2: 1f 91 pop r17 c5d4: 0f 91 pop r16 c5d6: ff 90 pop r15 c5d8: ef 90 pop r14 c5da: df 90 pop r13 c5dc: cf 90 pop r12 c5de: bf 90 pop r11 c5e0: af 90 pop r10 c5e2: 9f 90 pop r9 c5e4: 8f 90 pop r8 c5e6: 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; c5e8: 60 e0 ldi r22, 0x00 ; 0 c5ea: 70 e0 ldi r23, 0x00 ; 0 c5ec: 80 ec ldi r24, 0xC0 ; 192 c5ee: 9f e7 ldi r25, 0x7F ; 127 c5f0: ee cf rjmp .-36 ; 0xc5ce 0000c5f2 : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { c5f2: 2f 92 push r2 c5f4: 3f 92 push r3 c5f6: 4f 92 push r4 c5f8: 5f 92 push r5 c5fa: 6f 92 push r6 c5fc: 7f 92 push r7 c5fe: 8f 92 push r8 c600: 9f 92 push r9 c602: af 92 push r10 c604: bf 92 push r11 c606: cf 92 push r12 c608: df 92 push r13 c60a: ef 92 push r14 c60c: ff 92 push r15 c60e: 0f 93 push r16 c610: 1f 93 push r17 c612: cf 93 push r28 c614: df 93 push r29 c616: 00 d0 rcall .+0 ; 0xc618 c618: cd b7 in r28, 0x3d ; 61 c61a: de b7 in r29, 0x3e ; 62 c61c: 8d ed ldi r24, 0xDD ; 221 c61e: c8 2e mov r12, r24 c620: 82 e0 ldi r24, 0x02 ; 2 c622: d8 2e mov r13, r24 c624: 84 e5 ldi r24, 0x54 ; 84 c626: 95 e0 ldi r25, 0x05 ; 5 c628: 9b 83 std Y+3, r25 ; 0x03 c62a: 8a 83 std Y+2, r24 ; 0x02 c62c: 93 e4 ldi r25, 0x43 ; 67 c62e: e9 2e mov r14, r25 c630: 97 e0 ldi r25, 0x07 ; 7 c632: f9 2e mov r15, r25 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { c634: 33 24 eor r3, r3 c636: 33 94 inc r3 c638: 00 e0 ldi r16, 0x00 ; 0 if(code_seen(axis_codes[i])) c63a: f6 01 movw r30, r12 c63c: 81 91 ld r24, Z+ c63e: 6f 01 movw r12, r30 c640: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 c644: 28 2e mov r2, r24 c646: 88 23 and r24, r24 c648: 09 f4 brne .+2 ; 0xc64c c64a: a6 c0 rjmp .+332 ; 0xc798 { bool relative = axis_relative_modes & mask; c64c: 10 91 e1 03 lds r17, 0x03E1 ; 0x8003e1 c650: 13 21 and r17, r3 destination[i] = code_value(); c652: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 c656: 2b 01 movw r4, r22 c658: 3c 01 movw r6, r24 c65a: ea 81 ldd r30, Y+2 ; 0x02 c65c: fb 81 ldd r31, Y+3 ; 0x03 c65e: 40 82 st Z, r4 c660: 51 82 std Z+1, r5 ; 0x01 c662: 62 82 std Z+2, r6 ; 0x02 c664: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { c666: 03 30 cpi r16, 0x03 ; 3 c668: 09 f0 breq .+2 ; 0xc66c c66a: 46 c0 rjmp .+140 ; 0xc6f8 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; c66c: f1 e0 ldi r31, 0x01 ; 1 c66e: f9 83 std Y+1, r31 ; 0x01 c670: 11 11 cpse r17, r1 c672: 01 c0 rjmp .+2 ; 0xc676 c674: 19 82 std Y+1, r1 ; 0x01 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; c676: 80 90 bb 02 lds r8, 0x02BB ; 0x8002bb c67a: 90 90 bc 02 lds r9, 0x02BC ; 0x8002bc c67e: a0 90 bd 02 lds r10, 0x02BD ; 0x8002bd c682: b0 90 be 02 lds r11, 0x02BE ; 0x8002be if (emult != 1.) { c686: 20 e0 ldi r18, 0x00 ; 0 c688: 30 e0 ldi r19, 0x00 ; 0 c68a: 40 e8 ldi r20, 0x80 ; 128 c68c: 5f e3 ldi r21, 0x3F ; 63 c68e: c5 01 movw r24, r10 c690: b4 01 movw r22, r8 c692: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> c696: 88 23 and r24, r24 c698: 59 f1 breq .+86 ; 0xc6f0 if (! relative) { c69a: 11 11 cpse r17, r1 c69c: 15 c0 rjmp .+42 ; 0xc6c8 destination[i] -= current_position[i]; c69e: 20 91 4f 07 lds r18, 0x074F ; 0x80074f c6a2: 30 91 50 07 lds r19, 0x0750 ; 0x800750 c6a6: 40 91 51 07 lds r20, 0x0751 ; 0x800751 c6aa: 50 91 52 07 lds r21, 0x0752 ; 0x800752 c6ae: c3 01 movw r24, r6 c6b0: b2 01 movw r22, r4 c6b2: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> c6b6: 60 93 60 05 sts 0x0560, r22 ; 0x800560 c6ba: 70 93 61 05 sts 0x0561, r23 ; 0x800561 c6be: 80 93 62 05 sts 0x0562, r24 ; 0x800562 c6c2: 90 93 63 05 sts 0x0563, r25 ; 0x800563 relative = true; c6c6: 29 82 std Y+1, r2 ; 0x01 } destination[i] *= emult; c6c8: a5 01 movw r20, r10 c6ca: 94 01 movw r18, r8 c6cc: 60 91 60 05 lds r22, 0x0560 ; 0x800560 c6d0: 70 91 61 05 lds r23, 0x0561 ; 0x800561 c6d4: 80 91 62 05 lds r24, 0x0562 ; 0x800562 c6d8: 90 91 63 05 lds r25, 0x0563 ; 0x800563 c6dc: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> c6e0: 60 93 60 05 sts 0x0560, r22 ; 0x800560 c6e4: 70 93 61 05 sts 0x0561, r23 ; 0x800561 c6e8: 80 93 62 05 sts 0x0562, r24 ; 0x800562 c6ec: 90 93 63 05 sts 0x0563, r25 ; 0x800563 } } if (relative) c6f0: e9 81 ldd r30, Y+1 ; 0x01 c6f2: e1 11 cpse r30, r1 c6f4: 03 c0 rjmp .+6 ; 0xc6fc c6f6: 22 c0 rjmp .+68 ; 0xc73c c6f8: 11 23 and r17, r17 c6fa: 99 f0 breq .+38 ; 0xc722 destination[i] += current_position[i]; c6fc: f7 01 movw r30, r14 c6fe: 20 81 ld r18, Z c700: 31 81 ldd r19, Z+1 ; 0x01 c702: 42 81 ldd r20, Z+2 ; 0x02 c704: 53 81 ldd r21, Z+3 ; 0x03 c706: ea 81 ldd r30, Y+2 ; 0x02 c708: fb 81 ldd r31, Y+3 ; 0x03 c70a: 60 81 ld r22, Z c70c: 71 81 ldd r23, Z+1 ; 0x01 c70e: 82 81 ldd r24, Z+2 ; 0x02 c710: 93 81 ldd r25, Z+3 ; 0x03 c712: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> c716: ea 81 ldd r30, Y+2 ; 0x02 c718: fb 81 ldd r31, Y+3 ; 0x03 c71a: 60 83 st Z, r22 c71c: 71 83 std Z+1, r23 ; 0x01 c71e: 82 83 std Z+2, r24 ; 0x02 c720: 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) { c722: 0f 5f subi r16, 0xFF ; 255 c724: 33 0c add r3, r3 c726: 8a 81 ldd r24, Y+2 ; 0x02 c728: 9b 81 ldd r25, Y+3 ; 0x03 c72a: 04 96 adiw r24, 0x04 ; 4 c72c: 9b 83 std Y+3, r25 ; 0x03 c72e: 8a 83 std Y+2, r24 ; 0x02 c730: 94 e0 ldi r25, 0x04 ; 4 c732: e9 0e add r14, r25 c734: f1 1c adc r15, r1 c736: 04 30 cpi r16, 0x04 ; 4 c738: 09 f0 breq .+2 ; 0xc73c c73a: 7f cf rjmp .-258 ; 0xc63a 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')) { c73c: 86 e4 ldi r24, 0x46 ; 70 c73e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 c742: 88 23 and r24, r24 c744: 99 f0 breq .+38 ; 0xc76c const float next_feedrate = code_value(); c746: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 c74a: 6b 01 movw r12, r22 c74c: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; c74e: 20 e0 ldi r18, 0x00 ; 0 c750: 30 e0 ldi r19, 0x00 ; 0 c752: a9 01 movw r20, r18 c754: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> c758: 18 16 cp r1, r24 c75a: 44 f4 brge .+16 ; 0xc76c c75c: c0 92 90 02 sts 0x0290, r12 ; 0x800290 c760: d0 92 91 02 sts 0x0291, r13 ; 0x800291 c764: e0 92 92 02 sts 0x0292, r14 ; 0x800292 c768: f0 92 93 02 sts 0x0293, r15 ; 0x800293 } } c76c: 0f 90 pop r0 c76e: 0f 90 pop r0 c770: 0f 90 pop r0 c772: df 91 pop r29 c774: cf 91 pop r28 c776: 1f 91 pop r17 c778: 0f 91 pop r16 c77a: ff 90 pop r15 c77c: ef 90 pop r14 c77e: df 90 pop r13 c780: cf 90 pop r12 c782: bf 90 pop r11 c784: af 90 pop r10 c786: 9f 90 pop r9 c788: 8f 90 pop r8 c78a: 7f 90 pop r7 c78c: 6f 90 pop r6 c78e: 5f 90 pop r5 c790: 4f 90 pop r4 c792: 3f 90 pop r3 c794: 2f 90 pop r2 c796: 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? c798: f7 01 movw r30, r14 c79a: 80 81 ld r24, Z c79c: 91 81 ldd r25, Z+1 ; 0x01 c79e: a2 81 ldd r26, Z+2 ; 0x02 c7a0: b3 81 ldd r27, Z+3 ; 0x03 c7a2: ea 81 ldd r30, Y+2 ; 0x02 c7a4: fb 81 ldd r31, Y+3 ; 0x03 c7a6: 80 83 st Z, r24 c7a8: 91 83 std Z+1, r25 ; 0x01 c7aa: a2 83 std Z+2, r26 ; 0x02 c7ac: b3 83 std Z+3, r27 ; 0x03 c7ae: b9 cf rjmp .-142 ; 0xc722 0000c7b0 : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { c7b0: 2f 92 push r2 c7b2: 3f 92 push r3 c7b4: 4f 92 push r4 c7b6: 5f 92 push r5 c7b8: 6f 92 push r6 c7ba: 7f 92 push r7 c7bc: 8f 92 push r8 c7be: 9f 92 push r9 c7c0: af 92 push r10 c7c2: bf 92 push r11 c7c4: cf 92 push r12 c7c6: df 92 push r13 c7c8: ef 92 push r14 c7ca: ff 92 push r15 c7cc: 0f 93 push r16 c7ce: 1f 93 push r17 c7d0: cf 93 push r28 c7d2: df 93 push r29 c7d4: cd b7 in r28, 0x3d ; 61 c7d6: de b7 in r29, 0x3e ; 62 c7d8: 65 97 sbiw r28, 0x15 ; 21 c7da: 0f b6 in r0, 0x3f ; 63 c7dc: f8 94 cli c7de: de bf out 0x3e, r29 ; 62 c7e0: 0f be out 0x3f, r0 ; 63 c7e2: cd bf out 0x3d, r28 ; 61 c7e4: 69 8b std Y+17, r22 ; 0x11 c7e6: 7a 8b std Y+18, r23 ; 0x12 c7e8: 8b 8b std Y+19, r24 ; 0x13 c7ea: 9c 8b std Y+20, r25 ; 0x14 c7ec: 49 01 movw r8, r18 c7ee: 5a 01 movw r10, r20 c7f0: 30 2e mov r3, r16 c7f2: cd 8a std Y+21, r12 ; 0x15 c7f4: 2d 2c mov r2, r13 KEEPALIVE_STATE(NOT_BUSY); c7f6: 81 e0 ldi r24, 0x01 ; 1 c7f8: 80 93 96 02 sts 0x0296, r24 ; 0x800296 DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); c7fc: df 92 push r13 c7fe: 2d 89 ldd r18, Y+21 ; 0x15 c800: 2f 93 push r18 c802: 1f 92 push r1 c804: ef 92 push r14 c806: 8d ee ldi r24, 0xED ; 237 c808: 96 e6 ldi r25, 0x66 ; 102 c80a: 9f 93 push r25 c80c: 8f 93 push r24 c80e: 0f 94 1d dc call 0x3b83a ; 0x3b83a daddr_t count = -1; // RW the entire space by default if (code_seen('A')) c812: 81 e4 ldi r24, 0x41 ; 65 c814: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 c818: 0f 90 pop r0 c81a: 0f 90 pop r0 c81c: 0f 90 pop r0 c81e: 0f 90 pop r0 c820: 0f 90 pop r0 c822: 0f 90 pop r0 c824: 88 23 and r24, r24 c826: a1 f0 breq .+40 ; 0xc850 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); c828: 80 91 97 03 lds r24, 0x0397 ; 0x800397 c82c: 90 91 98 03 lds r25, 0x0398 ; 0x800398 c830: fc 01 movw r30, r24 c832: 21 81 ldd r18, Z+1 ; 0x01 c834: 28 37 cpi r18, 0x78 ; 120 c836: 09 f0 breq .+2 ; 0xc83a c838: 69 c0 rjmp .+210 ; 0xc90c c83a: 40 e1 ldi r20, 0x10 ; 16 c83c: 50 e0 ldi r21, 0x00 ; 0 c83e: 70 e0 ldi r23, 0x00 ; 0 c840: 60 e0 ldi r22, 0x00 ; 0 c842: 02 96 adiw r24, 0x02 ; 2 c844: 0f 94 e6 d8 call 0x3b1cc ; 0x3b1cc c848: 69 8b std Y+17, r22 ; 0x11 c84a: 7a 8b std Y+18, r23 ; 0x12 c84c: 8b 8b std Y+19, r24 ; 0x13 c84e: 9c 8b std Y+20, r25 ; 0x14 if (code_seen('C')) c850: 83 e4 ldi r24, 0x43 ; 67 c852: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 c856: 88 23 and r24, r24 c858: 09 f4 brne .+2 ; 0xc85c c85a: 65 c0 rjmp .+202 ; 0xc926 count = code_value_long(); c85c: 0e 94 a8 5c call 0xb950 ; 0xb950 c860: 2b 01 movw r4, r22 c862: 3c 01 movw r6, r24 c864: c9 88 ldd r12, Y+17 ; 0x11 c866: da 88 ldd r13, Y+18 ; 0x12 c868: eb 88 ldd r14, Y+19 ; 0x13 c86a: fc 88 ldd r15, Y+20 ; 0x14 c86c: 8c 14 cp r8, r12 c86e: 9d 04 cpc r9, r13 c870: ae 04 cpc r10, r14 c872: bf 04 cpc r11, r15 c874: 10 f4 brcc .+4 ; 0xc87a c876: 75 01 movw r14, r10 c878: 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) c87a: d3 01 movw r26, r6 c87c: c2 01 movw r24, r4 c87e: 8c 0d add r24, r12 c880: 9d 1d adc r25, r13 c882: ae 1d adc r26, r14 c884: bf 1d adc r27, r15 c886: 88 16 cp r8, r24 c888: 99 06 cpc r9, r25 c88a: aa 06 cpc r10, r26 c88c: bb 06 cpc r11, r27 c88e: 28 f0 brcs .+10 ; 0xc89a c890: 8c 15 cp r24, r12 c892: 9d 05 cpc r25, r13 c894: ae 05 cpc r26, r14 c896: bf 05 cpc r27, r15 c898: 30 f4 brcc .+12 ; 0xc8a6 count = addr_end - addr_start; c89a: 24 01 movw r4, r8 c89c: 35 01 movw r6, r10 c89e: 4c 18 sub r4, r12 c8a0: 5d 08 sbc r5, r13 c8a2: 6e 08 sbc r6, r14 c8a4: 7f 08 sbc r7, r15 if (code_seen('X')) c8a6: 88 e5 ldi r24, 0x58 ; 88 c8a8: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 c8ac: 88 23 and r24, r24 c8ae: 09 f4 brne .+2 ; 0xc8b2 c8b0: 91 c0 rjmp .+290 ; 0xc9d4 { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); c8b2: 20 91 97 03 lds r18, 0x0397 ; 0x800397 c8b6: 30 91 98 03 lds r19, 0x0398 ; 0x800398 c8ba: 2f 5f subi r18, 0xFF ; 255 c8bc: 3f 4f sbci r19, 0xFF ; 255 c8be: fe 01 movw r30, r28 c8c0: 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; c8c2: 10 e0 ldi r17, 0x00 ; 0 c8c4: 00 e0 ldi r16, 0x00 ; 0 c8c6: 4f 01 movw r8, r30 c8c8: d9 01 movw r26, r18 while (*hex) c8ca: 8c 91 ld r24, X c8cc: 2f 5f subi r18, 0xFF ; 255 c8ce: 3f 4f sbci r19, 0xFF ; 255 c8d0: 88 23 and r24, r24 c8d2: 09 f4 brne .+2 ; 0xc8d6 c8d4: 3f c0 rjmp .+126 ; 0xc954 { if (count && (parsed >= count)) break; c8d6: 00 31 cpi r16, 0x10 ; 16 c8d8: 11 05 cpc r17, r1 c8da: e1 f1 breq .+120 ; 0xc954 char c = *(hex++); if (c == ' ') continue; c8dc: 80 32 cpi r24, 0x20 ; 32 c8de: a1 f3 breq .-24 ; 0xc8c8 if (c == '\n') break; c8e0: 8a 30 cpi r24, 0x0A ; 10 c8e2: c1 f1 breq .+112 ; 0xc954 uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); c8e4: 90 ed ldi r25, 0xD0 ; 208 c8e6: 98 0f add r25, r24 c8e8: 9a 30 cpi r25, 0x0A ; 10 c8ea: 10 f5 brcc .+68 ; 0xc930 c8ec: 82 95 swap r24 c8ee: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); c8f0: 9d 01 movw r18, r26 c8f2: 2e 5f subi r18, 0xFE ; 254 c8f4: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); c8f6: 11 96 adiw r26, 0x01 ; 1 c8f8: 9c 91 ld r25, X c8fa: 40 ed ldi r20, 0xD0 ; 208 c8fc: 49 0f add r20, r25 c8fe: 4a 30 cpi r20, 0x0A ; 10 c900: f8 f4 brcc .+62 ; 0xc940 c902: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; c904: 81 93 st Z+, r24 parsed++; c906: 0f 5f subi r16, 0xFF ; 255 c908: 1f 4f sbci r17, 0xFF ; 255 c90a: de cf rjmp .-68 ; 0xc8c8 { 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(); c90c: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 c910: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> c914: 9b 01 movw r18, r22 c916: 77 0f add r23, r23 c918: 44 0b sbc r20, r20 c91a: 55 0b sbc r21, r21 c91c: 29 8b std Y+17, r18 ; 0x11 c91e: 3a 8b std Y+18, r19 ; 0x12 c920: 4b 8b std Y+19, r20 ; 0x13 c922: 5c 8b std Y+20, r21 ; 0x14 c924: 95 cf rjmp .-214 ; 0xc850 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 c926: 44 24 eor r4, r4 c928: 4a 94 dec r4 c92a: 54 2c mov r5, r4 c92c: 32 01 movw r6, r4 c92e: 9a cf rjmp .-204 ; 0xc864 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); c930: 9f e9 ldi r25, 0x9F ; 159 c932: 98 0f add r25, r24 c934: 96 30 cpi r25, 0x06 ; 6 c936: 58 f4 brcc .+22 ; 0xc94e c938: 82 95 swap r24 c93a: 80 7f andi r24, 0xF0 ; 240 c93c: 80 57 subi r24, 0x70 ; 112 c93e: d8 cf rjmp .-80 ; 0xc8f0 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); c940: 4f e9 ldi r20, 0x9F ; 159 c942: 49 0f add r20, r25 c944: 46 30 cpi r20, 0x06 ; 6 c946: 18 f4 brcc .+6 ; 0xc94e c948: 97 55 subi r25, 0x57 ; 87 c94a: 89 2b or r24, r25 c94c: db cf rjmp .-74 ; 0xc904 else return -parsed; c94e: 11 95 neg r17 c950: 01 95 neg r16 c952: 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); c954: 28 01 movw r4, r16 c956: 01 2e mov r0, r17 c958: 00 0c add r0, r0 c95a: 66 08 sbc r6, r6 c95c: 77 08 sbc r7, r7 write_mem(addr_start, count, data, type); c95e: da 8a std Y+18, r13 ; 0x12 c960: 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++) c962: b1 2c mov r11, r1 c964: a1 2c mov r10, r1 c966: 0a 15 cp r16, r10 c968: 1b 05 cpc r17, r11 c96a: f1 f0 breq .+60 ; 0xc9a8 { switch (type) c96c: 33 20 and r3, r3 c96e: 39 f0 breq .+14 ; 0xc97e c970: 31 e0 ldi r19, 0x01 ; 1 c972: 33 16 cp r3, r19 c974: 71 f0 breq .+28 ; 0xc992 } // 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++) c976: 4f ef ldi r20, 0xFF ; 255 c978: a4 1a sub r10, r20 c97a: b4 0a sbc r11, r20 c97c: f4 cf rjmp .-24 ; 0xc966 { switch (type) { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; c97e: f4 01 movw r30, r8 c980: ea 0d add r30, r10 c982: fb 1d adc r31, r11 c984: 80 81 ld r24, Z c986: e9 89 ldd r30, Y+17 ; 0x11 c988: fa 89 ldd r31, Y+18 ; 0x12 c98a: ea 0d add r30, r10 c98c: fb 1d adc r31, r11 c98e: 80 83 st Z, r24 c990: f2 cf rjmp .-28 ; 0xc976 case dcode_mem_t::eeprom: eeprom_write_byte_notify((uint8_t*)address, data[i]); break; c992: f4 01 movw r30, r8 c994: ea 0d add r30, r10 c996: 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); c998: 60 81 ld r22, Z c99a: 89 89 ldd r24, Y+17 ; 0x11 c99c: 9a 89 ldd r25, Y+18 ; 0x12 c99e: 8a 0d add r24, r10 c9a0: 9b 1d adc r25, r11 c9a2: 0f 94 a3 dd call 0x3bb46 ; 0x3bb46 c9a6: e7 cf rjmp .-50 ; 0xc976 { 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); c9a8: ff 92 push r15 c9aa: ef 92 push r14 c9ac: df 92 push r13 c9ae: cf 92 push r12 c9b0: 2f 92 push r2 c9b2: 5d 89 ldd r21, Y+21 ; 0x15 c9b4: 5f 93 push r21 c9b6: 7f 92 push r7 c9b8: 6f 92 push r6 c9ba: 5f 92 push r5 c9bc: 4f 92 push r4 c9be: 81 ec ldi r24, 0xC1 ; 193 c9c0: 96 e6 ldi r25, 0x66 ; 102 c9c2: 9f 93 push r25 c9c4: 8f 93 push r24 c9c6: 0f 94 1d dc call 0x3b83a ; 0x3b83a c9ca: 0f b6 in r0, 0x3f ; 63 c9cc: f8 94 cli c9ce: de bf out 0x3e, r29 ; 62 c9d0: 0f be out 0x3f, r0 ; 63 c9d2: 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); c9d4: 03 2d mov r16, r3 c9d6: a3 01 movw r20, r6 c9d8: 92 01 movw r18, r4 c9da: c7 01 movw r24, r14 c9dc: b6 01 movw r22, r12 c9de: 0f 94 a6 85 call 0x30b4c ; 0x30b4c } c9e2: 65 96 adiw r28, 0x15 ; 21 c9e4: 0f b6 in r0, 0x3f ; 63 c9e6: f8 94 cli c9e8: de bf out 0x3e, r29 ; 62 c9ea: 0f be out 0x3f, r0 ; 63 c9ec: cd bf out 0x3d, r28 ; 61 c9ee: df 91 pop r29 c9f0: cf 91 pop r28 c9f2: 1f 91 pop r17 c9f4: 0f 91 pop r16 c9f6: ff 90 pop r15 c9f8: ef 90 pop r14 c9fa: df 90 pop r13 c9fc: cf 90 pop r12 c9fe: bf 90 pop r11 ca00: af 90 pop r10 ca02: 9f 90 pop r9 ca04: 8f 90 pop r8 ca06: 7f 90 pop r7 ca08: 6f 90 pop r6 ca0a: 5f 90 pop r5 ca0c: 4f 90 pop r4 ca0e: 3f 90 pop r3 ca10: 2f 90 pop r2 ca12: 08 95 ret 0000ca14 : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); ca14: 60 91 15 18 lds r22, 0x1815 ; 0x801815 <__iob+0x2> ca18: 70 91 16 18 lds r23, 0x1816 ; 0x801816 <__iob+0x3> ca1c: 90 e0 ldi r25, 0x00 ; 0 ca1e: 8a 30 cpi r24, 0x0A ; 10 ca20: 20 f0 brcs .+8 ; 0xca2a ca22: 89 5a subi r24, 0xA9 ; 169 ca24: 9f 4f sbci r25, 0xFF ; 255 ca26: 0d 94 c3 db jmp 0x3b786 ; 0x3b786 ca2a: c0 96 adiw r24, 0x30 ; 48 ca2c: fc cf rjmp .-8 ; 0xca26 0000ca2e : 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); ca2e: 84 ff sbrs r24, 4 ca30: 18 c0 rjmp .+48 ; 0xca62 ca32: 8d 9a sbi 0x11, 5 ; 17 WRITE(LCD_PINS_D5, value & 0x20); ca34: 85 ff sbrs r24, 5 ca36: 17 c0 rjmp .+46 ; 0xca66 ca38: a4 9a sbi 0x14, 4 ; 20 WRITE(LCD_PINS_D6, value & 0x40); ca3a: 2f b7 in r18, 0x3f ; 63 ca3c: 86 ff sbrs r24, 6 ca3e: 15 c0 rjmp .+42 ; 0xca6a ca40: f8 94 cli ca42: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ca46: 90 68 ori r25, 0x80 ; 128 ca48: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ca4c: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D7, value & 0x80); ca4e: 87 ff sbrs r24, 7 ca50: 11 c0 rjmp .+34 ; 0xca74 ca52: 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); ca54: 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); ca56: 85 e0 ldi r24, 0x05 ; 5 ca58: 8a 95 dec r24 ca5a: f1 f7 brne .-4 ; 0xca58 ca5c: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); ca5e: 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(); } ca60: 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); ca62: 8d 98 cbi 0x11, 5 ; 17 ca64: e7 cf rjmp .-50 ; 0xca34 WRITE(LCD_PINS_D5, value & 0x20); ca66: a4 98 cbi 0x14, 4 ; 20 ca68: e8 cf rjmp .-48 ; 0xca3a WRITE(LCD_PINS_D6, value & 0x40); ca6a: f8 94 cli ca6c: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ca70: 9f 77 andi r25, 0x7F ; 127 ca72: ea cf rjmp .-44 ; 0xca48 WRITE(LCD_PINS_D7, value & 0x80); ca74: a3 98 cbi 0x14, 3 ; 20 ca76: ee cf rjmp .-36 ; 0xca54 0000ca78 : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { ca78: 0f 93 push r16 ca7a: 1f 93 push r17 ca7c: cf 93 push r28 ca7e: df 93 push r29 ca80: c8 2f mov r28, r24 ca82: d6 2f mov r29, r22 ca84: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); ca86: 60 ff sbrs r22, 0 ca88: 15 c0 rjmp .+42 ; 0xcab4 ca8a: 5d 9a sbi 0x0b, 5 ; 11 ca8c: 8a e1 ldi r24, 0x1A ; 26 ca8e: 8a 95 dec r24 ca90: f1 f7 brne .-4 ; 0xca8e ca92: 00 c0 rjmp .+0 ; 0xca94 _delay_us(5); lcd_writebits(data); ca94: 8c 2f mov r24, r28 ca96: 0e 94 17 65 call 0xca2e ; 0xca2e #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { ca9a: d1 fd sbrc r29, 1 ca9c: 04 c0 rjmp .+8 ; 0xcaa6 // _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 ca9e: 8c 2f mov r24, r28 caa0: 82 95 swap r24 caa2: 0e 94 17 65 call 0xca2e ; 0xca2e } #endif delayMicroseconds(duration); caa6: c8 01 movw r24, r16 } caa8: df 91 pop r29 caaa: cf 91 pop r28 caac: 1f 91 pop r17 caae: 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); cab0: 0c 94 25 de jmp 0x1bc4a ; 0x1bc4a 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); cab4: 5d 98 cbi 0x0b, 5 ; 11 cab6: ea cf rjmp .-44 ; 0xca8c 0000cab8 : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { cab8: cf 92 push r12 caba: df 92 push r13 cabc: ef 92 push r14 cabe: ff 92 push r15 cac0: cf 93 push r28 cac2: df 93 push r29 cac4: ec 01 movw r28, r24 cac6: 6a 01 movw r12, r20 cac8: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) caca: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 cace: 6f 3f cpi r22, 0xFF ; 255 cad0: 7f 4f sbci r23, 0xFF ; 255 cad2: 8f 4f sbci r24, 0xFF ; 255 cad4: 9f 4f sbci r25, 0xFF ; 255 cad6: 59 f4 brne .+22 ; 0xcaee 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); cad8: b7 01 movw r22, r14 cada: a6 01 movw r20, r12 cadc: 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); } cade: df 91 pop r29 cae0: cf 91 pop r28 cae2: ff 90 pop r15 cae4: ef 90 pop r14 cae6: df 90 pop r13 cae8: 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); caea: 0d 94 b1 dd jmp 0x3bb62 ; 0x3bb62 } 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); } caee: df 91 pop r29 caf0: cf 91 pop r28 caf2: ff 90 pop r15 caf4: ef 90 pop r14 caf6: df 90 pop r13 caf8: cf 90 pop r12 cafa: 08 95 ret 0000cafc : /// 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)); cafc: 80 e1 ldi r24, 0x10 ; 16 cafe: e3 e4 ldi r30, 0x43 ; 67 cb00: f7 e0 ldi r31, 0x07 ; 7 cb02: ab e9 ldi r26, 0x9B ; 155 cb04: b2 e0 ldi r27, 0x02 ; 2 cb06: 01 90 ld r0, Z+ cb08: 0d 92 st X+, r0 cb0a: 8a 95 dec r24 cb0c: e1 f7 brne .-8 ; 0xcb06 saved_feedmultiply2 = feedmultiply; //save feedmultiply cb0e: 80 91 39 02 lds r24, 0x0239 ; 0x800239 cb12: 90 91 3a 02 lds r25, 0x023A ; 0x80023a cb16: 90 93 74 03 sts 0x0374, r25 ; 0x800374 cb1a: 80 93 73 03 sts 0x0373, r24 ; 0x800373 saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); cb1e: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d cb22: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e cb26: 90 93 ae 05 sts 0x05AE, r25 ; 0x8005ae cb2a: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_bed_temperature = (uint8_t)degTargetBed(); cb2e: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b cb32: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; cb36: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 cb3a: 83 fb bst r24, 3 cb3c: 88 27 eor r24, r24 cb3e: 80 f9 bld r24, 0 cb40: 80 93 06 18 sts 0x1806, r24 ; 0x801806 saved_fan_speed = fanSpeed; cb44: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 cb48: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac isPartialBackupAvailable = true; cb4c: 81 e0 ldi r24, 0x01 ; 1 cb4e: 80 93 53 07 sts 0x0753, r24 ; 0x800753 } cb52: 08 95 ret 0000cb54 <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } cb54: cf 93 push r28 cb56: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { cb58: 8e ef ldi r24, 0xFE ; 254 cb5a: 96 e1 ldi r25, 0x16 ; 22 cb5c: 0e 94 3c 79 call 0xf278 ; 0xf278 #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader cb60: 8c e3 ldi r24, 0x3C ; 60 cb62: 95 e1 ldi r25, 0x15 ; 21 cb64: 89 2b or r24, r25 cb66: 51 f0 breq .+20 ; 0xcb7c <_GLOBAL__sub_D_card+0x28> cb68: ce e0 ldi r28, 0x0E ; 14 cb6a: d6 e1 ldi r29, 0x16 ; 22 cb6c: a3 97 sbiw r28, 0x23 ; 35 cb6e: ce 01 movw r24, r28 cb70: 0e 94 3c 79 call 0xf278 ; 0xf278 cb74: 85 e1 ldi r24, 0x15 ; 21 cb76: cc 33 cpi r28, 0x3C ; 60 cb78: d8 07 cpc r29, r24 cb7a: c1 f7 brne .-16 ; 0xcb6c <_GLOBAL__sub_D_card+0x18> cb7c: 89 e1 ldi r24, 0x19 ; 25 cb7e: 95 e1 ldi r25, 0x15 ; 21 cb80: 0e 94 3c 79 call 0xf278 ; 0xf278 cb84: 84 ef ldi r24, 0xF4 ; 244 cb86: 94 e1 ldi r25, 0x14 ; 20 cb88: df 91 pop r29 cb8a: cf 91 pop r28 cb8c: 0c 94 3c 79 jmp 0xf278 ; 0xf278 0000cb90 : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { cb90: cf 93 push r28 cb92: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; cb94: c3 e4 ldi r28, 0x43 ; 67 cb96: d7 e0 ldi r29, 0x07 ; 7 cb98: 20 e0 ldi r18, 0x00 ; 0 cb9a: 30 e0 ldi r19, 0x00 ; 0 cb9c: 48 ec ldi r20, 0xC8 ; 200 cb9e: 51 e4 ldi r21, 0x41 ; 65 cba0: 6c 85 ldd r22, Y+12 ; 0x0c cba2: 7d 85 ldd r23, Y+13 ; 0x0d cba4: 8e 85 ldd r24, Y+14 ; 0x0e cba6: 9f 85 ldd r25, Y+15 ; 0x0f cba8: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> cbac: 6c 87 std Y+12, r22 ; 0x0c cbae: 7d 87 std Y+13, r23 ; 0x0d cbb0: 8e 87 std Y+14, r24 ; 0x0e cbb2: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); cbb4: 63 e3 ldi r22, 0x33 ; 51 cbb6: 73 e3 ldi r23, 0x33 ; 51 cbb8: 83 e5 ldi r24, 0x53 ; 83 cbba: 90 e4 ldi r25, 0x40 ; 64 } cbbc: df 91 pop r29 cbbe: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); cbc0: 0d 94 5d ba jmp 0x374ba ; 0x374ba 0000cbc4 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); cbc4: 60 e0 ldi r22, 0x00 ; 0 cbc6: 85 ea ldi r24, 0xA5 ; 165 cbc8: 9f e0 ldi r25, 0x0F ; 15 cbca: 0f 94 7f dd call 0x3bafe ; 0x3bafe cbce: 60 e0 ldi r22, 0x00 ; 0 cbd0: 8f e7 ldi r24, 0x7F ; 127 cbd2: 9c e0 ldi r25, 0x0C ; 12 cbd4: 0f 94 7f dd call 0x3bafe ; 0x3bafe // 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; cbd8: 80 e0 ldi r24, 0x00 ; 0 cbda: 90 e0 ldi r25, 0x00 ; 0 cbdc: a0 e8 ldi r26, 0x80 ; 128 cbde: bf eb ldi r27, 0xBF ; 191 cbe0: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab cbe4: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac cbe8: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad cbec: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae saved_printing_type = PowerPanic::PRINT_TYPE_NONE; cbf0: 82 e0 ldi r24, 0x02 ; 2 cbf2: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; cbf6: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a } cbfa: 08 95 ret 0000cbfc : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) cbfc: 80 91 ad 05 lds r24, 0x05AD ; 0x8005ad cc00: 90 91 ae 05 lds r25, 0x05AE ; 0x8005ae cc04: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d cc08: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e cc0c: 28 17 cp r18, r24 cc0e: 39 07 cpc r19, r25 cc10: 71 f0 breq .+28 ; 0xcc2e return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; cc12: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e cc16: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; cc1a: 81 e0 ldi r24, 0x01 ; 1 cc1c: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df wait_for_heater(_millis(), active_extruder); cc20: 0f 94 86 3e call 0x27d0c ; 0x27d0c cc24: 0f 94 5e 81 call 0x302bc ; 0x302bc heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; cc28: 82 e0 ldi r24, 0x02 ; 2 cc2a: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df } } cc2e: 08 95 ret 0000cc30 : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { cc30: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a cc34: 88 23 and r24, r24 cc36: 41 f0 breq .+16 ; 0xcc48 // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; cc38: 80 91 39 02 lds r24, 0x0239 ; 0x800239 cc3c: 90 91 3a 02 lds r25, 0x023A ; 0x80023a cc40: 90 93 74 03 sts 0x0374, r25 ; 0x800374 cc44: 80 93 73 03 sts 0x0373, r24 ; 0x800373 } cc48: 08 95 ret 0000cc4a : //not sd printing nor usb printing } } void save_planner_global_state() { if (current_block && !(mesh_bed_leveling_flag || homing_flag)) cc4a: 80 91 a2 05 lds r24, 0x05A2 ; 0x8005a2 cc4e: 90 91 a3 05 lds r25, 0x05A3 ; 0x8005a3 cc52: 00 97 sbiw r24, 0x00 ; 0 cc54: 29 f1 breq .+74 ; 0xcca0 cc56: 20 91 59 0e lds r18, 0x0E59 ; 0x800e59 cc5a: 21 11 cpse r18, r1 cc5c: 21 c0 rjmp .+66 ; 0xcca0 cc5e: 20 91 58 0e lds r18, 0x0E58 ; 0x800e58 cc62: 21 11 cpse r18, r1 cc64: 1d c0 rjmp .+58 ; 0xcca0 { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); cc66: fc 01 movw r30, r24 cc68: e8 5a subi r30, 0xA8 ; 168 cc6a: ff 4f sbci r31, 0xFF ; 255 cc6c: 20 e1 ldi r18, 0x10 ; 16 cc6e: ab ea ldi r26, 0xAB ; 171 cc70: b2 e0 ldi r27, 0x02 ; 2 cc72: 01 90 ld r0, Z+ cc74: 0d 92 st X+, r0 cc76: 2a 95 dec r18 cc78: e1 f7 brne .-8 ; 0xcc72 saved_feedrate2 = current_block->gcode_feedrate; cc7a: fc 01 movw r30, r24 cc7c: e6 59 subi r30, 0x96 ; 150 cc7e: ff 4f sbci r31, 0xFF ; 255 cc80: 20 81 ld r18, Z cc82: 31 81 ldd r19, Z+1 ; 0x01 cc84: 30 93 01 18 sts 0x1801, r19 ; 0x801801 cc88: 20 93 00 18 sts 0x1800, r18 ; 0x801800 saved_segment_idx = current_block->segment_idx; cc8c: 88 59 subi r24, 0x98 ; 152 cc8e: 9f 4f sbci r25, 0xFF ; 255 cc90: fc 01 movw r30, r24 cc92: 80 81 ld r24, Z cc94: 91 81 ldd r25, Z+1 ; 0x01 cc96: 90 93 0c 18 sts 0x180C, r25 ; 0x80180c cc9a: 80 93 0b 18 sts 0x180B, r24 ; 0x80180b cc9e: 08 95 ret } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; cca0: 80 e0 ldi r24, 0x00 ; 0 cca2: 90 e0 ldi r25, 0x00 ; 0 cca4: a0 e8 ldi r26, 0x80 ; 128 cca6: bf eb ldi r27, 0xBF ; 191 cca8: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab ccac: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac ccb0: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad ccb4: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae saved_feedrate2 = feedrate; ccb8: 60 91 90 02 lds r22, 0x0290 ; 0x800290 ccbc: 70 91 91 02 lds r23, 0x0291 ; 0x800291 ccc0: 80 91 92 02 lds r24, 0x0292 ; 0x800292 ccc4: 90 91 93 02 lds r25, 0x0293 ; 0x800293 ccc8: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> cccc: 70 93 01 18 sts 0x1801, r23 ; 0x801801 ccd0: 60 93 00 18 sts 0x1800, r22 ; 0x801800 saved_segment_idx = 0; ccd4: 10 92 0c 18 sts 0x180C, r1 ; 0x80180c ccd8: 10 92 0b 18 sts 0x180B, r1 ; 0x80180b } } ccdc: 08 95 ret 0000ccde : SERIAL_PROTOCOLPGM(" E:0 B:"); SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } void save_print_file_state() { ccde: cf 92 push r12 cce0: df 92 push r13 cce2: ef 92 push r14 cce4: ff 92 push r15 uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { cce6: 80 91 6e 14 lds r24, 0x146E ; 0x80146e ccea: 88 23 and r24, r24 ccec: d9 f1 breq .+118 ; 0xcd64 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue ccee: 80 91 84 03 lds r24, 0x0384 ; 0x800384 ccf2: 90 91 85 03 lds r25, 0x0385 ; 0x800385 ccf6: a0 91 86 03 lds r26, 0x0386 ; 0x800386 ccfa: b0 91 87 03 lds r27, 0x0387 ; 0x800387 ccfe: 80 93 02 18 sts 0x1802, r24 ; 0x801802 cd02: 90 93 03 18 sts 0x1803, r25 ; 0x801803 cd06: a0 93 04 18 sts 0x1804, r26 ; 0x801804 cd0a: b0 93 05 18 sts 0x1805, r27 ; 0x801805 sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner cd0e: 0f 94 1f aa call 0x3543e ; 0x3543e saved_sdpos -= sdlen_planner; cd12: c0 90 02 18 lds r12, 0x1802 ; 0x801802 cd16: d0 90 03 18 lds r13, 0x1803 ; 0x801803 cd1a: e0 90 04 18 lds r14, 0x1804 ; 0x801804 cd1e: f0 90 05 18 lds r15, 0x1805 ; 0x801805 cd22: c8 1a sub r12, r24 cd24: d9 0a sbc r13, r25 cd26: e1 08 sbc r14, r1 cd28: f1 08 sbc r15, r1 cd2a: c0 92 02 18 sts 0x1802, r12 ; 0x801802 cd2e: d0 92 03 18 sts 0x1803, r13 ; 0x801803 cd32: e0 92 04 18 sts 0x1804, r14 ; 0x801804 cd36: f0 92 05 18 sts 0x1805, r15 ; 0x801805 sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue cd3a: 0e 94 39 5c call 0xb872 ; 0xb872 saved_sdpos -= sdlen_cmdqueue; cd3e: c8 1a sub r12, r24 cd40: d9 0a sbc r13, r25 cd42: e1 08 sbc r14, r1 cd44: f1 08 sbc r15, r1 cd46: c0 92 02 18 sts 0x1802, r12 ; 0x801802 cd4a: d0 92 03 18 sts 0x1803, r13 ; 0x801803 cd4e: e0 92 04 18 sts 0x1804, r14 ; 0x801804 cd52: f0 92 05 18 sts 0x1805, r15 ; 0x801805 saved_printing_type = PowerPanic::PRINT_TYPE_SD; cd56: 10 92 6a 02 sts 0x026A, r1 ; 0x80026a } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; //not sd printing nor usb printing } } cd5a: ff 90 pop r15 cd5c: ef 90 pop r14 cd5e: df 90 pop r13 cd60: cf 90 pop r12 cd62: 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 cd64: 80 91 11 05 lds r24, 0x0511 ; 0x800511 cd68: 88 23 and r24, r24 cd6a: b1 f1 breq .+108 ; 0xcdd8 saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue cd6c: 80 91 7c 03 lds r24, 0x037C ; 0x80037c cd70: 90 91 7d 03 lds r25, 0x037D ; 0x80037d cd74: a0 91 7e 03 lds r26, 0x037E ; 0x80037e cd78: b0 91 7f 03 lds r27, 0x037F ; 0x80037f cd7c: 80 93 02 18 sts 0x1802, r24 ; 0x801802 cd80: 90 93 03 18 sts 0x1803, r25 ; 0x801803 cd84: a0 93 04 18 sts 0x1804, r26 ; 0x801804 cd88: b0 93 05 18 sts 0x1805, r27 ; 0x801805 //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 cd8c: 0f 94 1f aa call 0x3543e ; 0x3543e saved_sdpos -= nlines; cd90: 40 91 02 18 lds r20, 0x1802 ; 0x801802 cd94: 50 91 03 18 lds r21, 0x1803 ; 0x801803 cd98: 60 91 04 18 lds r22, 0x1804 ; 0x801804 cd9c: 70 91 05 18 lds r23, 0x1805 ; 0x801805 cda0: 48 1b sub r20, r24 cda2: 51 09 sbc r21, r1 cda4: 61 09 sbc r22, r1 cda6: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer cda8: 80 91 81 10 lds r24, 0x1081 ; 0x801081 cdac: 90 91 82 10 lds r25, 0x1082 ; 0x801082 cdb0: 09 2e mov r0, r25 cdb2: 00 0c add r0, r0 cdb4: aa 0b sbc r26, r26 cdb6: bb 0b sbc r27, r27 cdb8: 48 1b sub r20, r24 cdba: 59 0b sbc r21, r25 cdbc: 6a 0b sbc r22, r26 cdbe: 7b 0b sbc r23, r27 cdc0: 40 93 02 18 sts 0x1802, r20 ; 0x801802 cdc4: 50 93 03 18 sts 0x1803, r21 ; 0x801803 cdc8: 60 93 04 18 sts 0x1804, r22 ; 0x801804 cdcc: 70 93 05 18 sts 0x1805, r23 ; 0x801805 saved_printing_type = PowerPanic::PRINT_TYPE_HOST; cdd0: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; cdd2: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a cdd6: c1 cf rjmp .-126 ; 0xcd5a cdd8: 82 e0 ldi r24, 0x02 ; 2 cdda: fb cf rjmp .-10 ; 0xcdd2 0000cddc : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { cddc: cf 92 push r12 cdde: df 92 push r13 cde0: ef 92 push r14 cde2: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cde4: c0 90 06 07 lds r12, 0x0706 ; 0x800706 cde8: d0 90 07 07 lds r13, 0x0707 ; 0x800707 cdec: e0 90 08 07 lds r14, 0x0708 ; 0x800708 cdf0: f0 90 09 07 lds r15, 0x0709 ; 0x800709 } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; if (cs.volumetric_enabled && diameter > 0.f) { cdf4: 80 91 05 07 lds r24, 0x0705 ; 0x800705 cdf8: 88 23 and r24, r24 cdfa: 09 f4 brne .+2 ; 0xcdfe cdfc: 4e c0 rjmp .+156 ; 0xce9a cdfe: 20 e0 ldi r18, 0x00 ; 0 ce00: 30 e0 ldi r19, 0x00 ; 0 ce02: a9 01 movw r20, r18 ce04: c7 01 movw r24, r14 ce06: b6 01 movw r22, r12 ce08: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> ce0c: 18 16 cp r1, r24 ce0e: 0c f0 brlt .+2 ; 0xce12 ce10: 44 c0 rjmp .+136 ; 0xce9a float area = M_PI * diameter * diameter * 0.25; ce12: 2b ed ldi r18, 0xDB ; 219 ce14: 3f e0 ldi r19, 0x0F ; 15 ce16: 49 e4 ldi r20, 0x49 ; 73 ce18: 50 e4 ldi r21, 0x40 ; 64 ce1a: c7 01 movw r24, r14 ce1c: b6 01 movw r22, r12 ce1e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> ce22: a7 01 movw r20, r14 ce24: 96 01 movw r18, r12 ce26: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> ce2a: 20 e0 ldi r18, 0x00 ; 0 ce2c: 30 e0 ldi r19, 0x00 ; 0 ce2e: 40 e8 ldi r20, 0x80 ; 128 ce30: 5e e3 ldi r21, 0x3E ; 62 ce32: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> ce36: 9b 01 movw r18, r22 ce38: ac 01 movw r20, r24 out = 1.f / area; ce3a: 60 e0 ldi r22, 0x00 ; 0 ce3c: 70 e0 ldi r23, 0x00 ; 0 ce3e: 80 e8 ldi r24, 0x80 ; 128 ce40: 9f e3 ldi r25, 0x3F ; 63 ce42: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> ce46: 6b 01 movw r12, r22 ce48: 7c 01 movw r14, r24 } if (extrudemultiply != 100) ce4a: 60 91 94 02 lds r22, 0x0294 ; 0x800294 ce4e: 70 91 95 02 lds r23, 0x0295 ; 0x800295 ce52: 64 36 cpi r22, 0x64 ; 100 ce54: 71 05 cpc r23, r1 ce56: a1 f0 breq .+40 ; 0xce80 out *= float(extrudemultiply) * 0.01f; ce58: 07 2e mov r0, r23 ce5a: 00 0c add r0, r0 ce5c: 88 0b sbc r24, r24 ce5e: 99 0b sbc r25, r25 ce60: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> ce64: 2a e0 ldi r18, 0x0A ; 10 ce66: 37 ed ldi r19, 0xD7 ; 215 ce68: 43 e2 ldi r20, 0x23 ; 35 ce6a: 5c e3 ldi r21, 0x3C ; 60 ce6c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> ce70: 9b 01 movw r18, r22 ce72: ac 01 movw r20, r24 ce74: c7 01 movw r24, r14 ce76: b6 01 movw r22, r12 ce78: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> ce7c: 6b 01 movw r12, r22 ce7e: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); ce80: c0 92 bb 02 sts 0x02BB, r12 ; 0x8002bb ce84: d0 92 bc 02 sts 0x02BC, r13 ; 0x8002bc ce88: e0 92 bd 02 sts 0x02BD, r14 ; 0x8002bd ce8c: f0 92 be 02 sts 0x02BE, r15 ; 0x8002be 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 } ce90: ff 90 pop r15 ce92: ef 90 pop r14 ce94: df 90 pop r13 ce96: cf 90 pop r12 ce98: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; ce9a: c1 2c mov r12, r1 ce9c: d1 2c mov r13, r1 ce9e: 80 e8 ldi r24, 0x80 ; 128 cea0: e8 2e mov r14, r24 cea2: 8f e3 ldi r24, 0x3F ; 63 cea4: f8 2e mov r15, r24 cea6: d1 cf rjmp .-94 ; 0xce4a 0000cea8 : } } #endif //FAST_PWM_FAN void save_statistics() { cea8: 8f 92 push r8 ceaa: 9f 92 push r9 ceac: af 92 push r10 ceae: bf 92 push r11 ceb0: cf 92 push r12 ceb2: df 92 push r13 ceb4: ef 92 push r14 ceb6: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: meter ceb8: 81 ef ldi r24, 0xF1 ; 241 ceba: 9f e0 ldi r25, 0x0F ; 15 cebc: 0f 94 48 7b call 0x2f690 ; 0x2f690 cec0: 6b 01 movw r12, r22 cec2: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min cec4: 8d ee ldi r24, 0xED ; 237 cec6: 9f e0 ldi r25, 0x0F ; 15 cec8: 0f 94 48 7b call 0x2f690 ; 0x2f690 cecc: 4b 01 movw r8, r22 cece: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; ced0: 0f 94 e2 53 call 0x2a7c4 ; 0x2a7c4 ced4: 2c e3 ldi r18, 0x3C ; 60 ced6: 30 e0 ldi r19, 0x00 ; 0 ced8: 40 e0 ldi r20, 0x00 ; 0 ceda: 50 e0 ldi r21, 0x00 ; 0 cedc: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min cee0: ba 01 movw r22, r20 cee2: a9 01 movw r20, r18 cee4: 48 0d add r20, r8 cee6: 59 1d adc r21, r9 cee8: 6a 1d adc r22, r10 ceea: 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); ceec: 8d ee ldi r24, 0xED ; 237 ceee: 9f e0 ldi r25, 0x0F ; 15 cef0: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); cef4: 60 91 62 06 lds r22, 0x0662 ; 0x800662 cef8: 70 91 63 06 lds r23, 0x0663 ; 0x800663 cefc: 80 91 64 06 lds r24, 0x0664 ; 0x800664 cf00: 90 91 65 06 lds r25, 0x0665 ; 0x800665 cf04: 28 ee ldi r18, 0xE8 ; 232 cf06: 33 e0 ldi r19, 0x03 ; 3 cf08: 40 e0 ldi r20, 0x00 ; 0 cf0a: 50 e0 ldi r21, 0x00 ; 0 cf0c: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> cf10: ba 01 movw r22, r20 cf12: a9 01 movw r20, r18 cf14: 4c 0d add r20, r12 cf16: 5d 1d adc r21, r13 cf18: 6e 1d adc r22, r14 cf1a: 7f 1d adc r23, r15 cf1c: 81 ef ldi r24, 0xF1 ; 241 cf1e: 9f e0 ldi r25, 0x0F ; 15 cf20: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 print_job_timer.reset(); cf24: 0f 94 b1 57 call 0x2af62 ; 0x2af62 total_filament_used = 0; cf28: 10 92 62 06 sts 0x0662, r1 ; 0x800662 cf2c: 10 92 63 06 sts 0x0663, r1 ; 0x800663 cf30: 10 92 64 06 sts 0x0664, r1 ; 0x800664 cf34: 10 92 65 06 sts 0x0665, r1 ; 0x800665 if (MMU2::mmu2.Enabled()) { cf38: 80 91 98 13 lds r24, 0x1398 ; 0x801398 cf3c: 81 30 cpi r24, 0x01 ; 1 cf3e: 81 f4 brne .+32 ; 0xcf60 eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); cf40: 60 91 9c 13 lds r22, 0x139C ; 0x80139c cf44: 70 91 9d 13 lds r23, 0x139D ; 0x80139d cf48: 90 e0 ldi r25, 0x00 ; 0 cf4a: 80 e0 ldi r24, 0x00 ; 0 cf4c: 0f 94 30 7b call 0x2f660 ; 0x2f660 /// @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; }; cf50: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d cf54: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } cf58: 10 92 9f 13 sts 0x139F, r1 ; 0x80139f cf5c: 10 92 9e 13 sts 0x139E, r1 ; 0x80139e // @@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 } } cf60: ff 90 pop r15 cf62: ef 90 pop r14 cf64: df 90 pop r13 cf66: cf 90 pop r12 cf68: bf 90 pop r11 cf6a: af 90 pop r10 cf6c: 9f 90 pop r9 cf6e: 8f 90 pop r8 cf70: 08 95 ret 0000cf72 : } #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); cf72: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 cf76: 1f 92 push r1 cf78: 8f 93 push r24 cf7a: 80 91 6d 03 lds r24, 0x036D ; 0x80036d cf7e: 1f 92 push r1 cf80: 8f 93 push r24 cf82: e1 eb ldi r30, 0xB1 ; 177 cf84: f4 e0 ldi r31, 0x04 ; 4 cf86: 42 81 ldd r20, Z+2 ; 0x02 cf88: 53 81 ldd r21, Z+3 ; 0x03 cf8a: 2c e3 ldi r18, 0x3C ; 60 cf8c: 24 9f mul r18, r20 cf8e: c0 01 movw r24, r0 cf90: 25 9f mul r18, r21 cf92: 90 0d add r25, r0 cf94: 11 24 eor r1, r1 cf96: 9f 93 push r25 cf98: 8f 93 push r24 cf9a: 40 81 ld r20, Z cf9c: 51 81 ldd r21, Z+1 ; 0x01 cf9e: 24 9f mul r18, r20 cfa0: c0 01 movw r24, r0 cfa2: 25 9f mul r18, r21 cfa4: 90 0d add r25, r0 cfa6: 11 24 eor r1, r1 cfa8: 9f 93 push r25 cfaa: 8f 93 push r24 cfac: 84 e8 ldi r24, 0x84 ; 132 cfae: 97 e6 ldi r25, 0x67 ; 103 cfb0: 9f 93 push r25 cfb2: 8f 93 push r24 cfb4: 0f 94 1d dc call 0x3b83a ; 0x3b83a cfb8: 8d b7 in r24, 0x3d ; 61 cfba: 9e b7 in r25, 0x3e ; 62 cfbc: 0a 96 adiw r24, 0x0a ; 10 cfbe: 0f b6 in r0, 0x3f ; 63 cfc0: f8 94 cli cfc2: 9e bf out 0x3e, r25 ; 62 cfc4: 0f be out 0x3f, r0 ; 63 cfc6: 8d bf out 0x3d, r24 ; 61 } cfc8: 08 95 ret 0000cfca : // 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) { cfca: cf 93 push r28 cfcc: 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); cfce: 8f ef ldi r24, 0xFF ; 255 cfd0: 9f e0 ldi r25, 0x0F ; 15 cfd2: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 if (silent == 1 || tmc2130_mode == TMC2130_MODE_SILENT) { cfd6: 81 30 cpi r24, 0x01 ; 1 cfd8: 21 f0 breq .+8 ; 0xcfe2 cfda: 80 91 6c 06 lds r24, 0x066C ; 0x80066c cfde: 81 30 cpi r24, 0x01 ; 1 cfe0: 29 f4 brne .+10 ; 0xcfec //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); cfe2: 81 e0 ldi r24, 0x01 ; 1 cfe4: 8c 27 eor r24, r28 } } cfe6: 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); cfe8: 0c 94 be 61 jmp 0xc37c ; 0xc37c } } cfec: cf 91 pop r28 cfee: 08 95 ret 0000cff0 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); cff0: 88 e8 ldi r24, 0x88 ; 136 cff2: 93 e0 ldi r25, 0x03 ; 3 cff4: 0d 94 29 41 jmp 0x28252 ; 0x28252 ::start()> 0000cff8 : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; cff8: 20 e0 ldi r18, 0x00 ; 0 cffa: 30 e0 ldi r19, 0x00 ; 0 cffc: 40 e7 ldi r20, 0x70 ; 112 cffe: 52 e4 ldi r21, 0x42 ; 66 d000: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> } d004: 08 95 ret 0000d006 : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; d006: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> //! @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; d00a: 40 91 68 03 lds r20, 0x0368 ; 0x800368 d00e: 50 91 69 03 lds r21, 0x0369 ; 0x800369 d012: 60 91 6a 03 lds r22, 0x036A ; 0x80036a d016: 70 91 6b 03 lds r23, 0x036B ; 0x80036b d01a: 40 93 90 02 sts 0x0290, r20 ; 0x800290 d01e: 50 93 91 02 sts 0x0291, r21 ; 0x800291 d022: 60 93 92 02 sts 0x0292, r22 ; 0x800292 d026: 70 93 93 02 sts 0x0293, r23 ; 0x800293 feedmultiply = original_feedmultiply; d02a: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d02e: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); d032: 88 e8 ldi r24, 0x88 ; 136 d034: 93 e0 ldi r25, 0x03 ; 3 d036: 0d 94 29 41 jmp 0x28252 ; 0x28252 ::start()> 0000d03a : 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) { d03a: 1f 93 push r17 d03c: cf 93 push r28 d03e: df 93 push r29 d040: 18 2f mov r17, r24 saved_feedrate = feedrate; d042: 80 91 90 02 lds r24, 0x0290 ; 0x800290 d046: 90 91 91 02 lds r25, 0x0291 ; 0x800291 d04a: a0 91 92 02 lds r26, 0x0292 ; 0x800292 d04e: b0 91 93 02 lds r27, 0x0293 ; 0x800293 d052: 80 93 68 03 sts 0x0368, r24 ; 0x800368 d056: 90 93 69 03 sts 0x0369, r25 ; 0x800369 d05a: a0 93 6a 03 sts 0x036A, r26 ; 0x80036a d05e: b0 93 6b 03 sts 0x036B, r27 ; 0x80036b int l_feedmultiply = feedmultiply; d062: c0 91 39 02 lds r28, 0x0239 ; 0x800239 d066: d0 91 3a 02 lds r29, 0x023A ; 0x80023a feedmultiply = 100; d06a: 84 e6 ldi r24, 0x64 ; 100 d06c: 90 e0 ldi r25, 0x00 ; 0 d06e: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d072: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); d076: 88 e8 ldi r24, 0x88 ; 136 d078: 93 e0 ldi r25, 0x03 ; 3 d07a: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> d07e: 10 93 8f 02 sts 0x028F, r17 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(enable_endstops_now); return l_feedmultiply; } d082: ce 01 movw r24, r28 d084: df 91 pop r29 d086: cf 91 pop r28 d088: 1f 91 pop r17 d08a: 08 95 ret 0000d08c : d08c: 40 e0 ldi r20, 0x00 ; 0 d08e: 50 e0 ldi r21, 0x00 ; 0 d090: ba 01 movw r22, r20 d092: 8d ee ldi r24, 0xED ; 237 d094: 9f e0 ldi r25, 0x0F ; 15 d096: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 d09a: 40 e0 ldi r20, 0x00 ; 0 d09c: 50 e0 ldi r21, 0x00 ; 0 d09e: ba 01 movw r22, r20 d0a0: 81 ef ldi r24, 0xF1 ; 241 d0a2: 9f e0 ldi r25, 0x0F ; 15 d0a4: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 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(); d0a8: 0e 94 4a 5d call 0xba94 ; 0xba94 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); d0ac: 70 e0 ldi r23, 0x00 ; 0 d0ae: 60 e0 ldi r22, 0x00 ; 0 d0b0: 85 e0 ldi r24, 0x05 ; 5 d0b2: 9f e0 ldi r25, 0x0F ; 15 d0b4: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a d0b8: 70 e0 ldi r23, 0x00 ; 0 d0ba: 60 e0 ldi r22, 0x00 ; 0 d0bc: 83 e0 ldi r24, 0x03 ; 3 d0be: 9f e0 ldi r25, 0x0F ; 15 d0c0: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a d0c4: 70 e0 ldi r23, 0x00 ; 0 d0c6: 60 e0 ldi r22, 0x00 ; 0 d0c8: 81 e0 ldi r24, 0x01 ; 1 d0ca: 9f e0 ldi r25, 0x0F ; 15 d0cc: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a d0d0: 70 e0 ldi r23, 0x00 ; 0 d0d2: 60 e0 ldi r22, 0x00 ; 0 d0d4: 8f ef ldi r24, 0xFF ; 255 d0d6: 9e e0 ldi r25, 0x0E ; 14 d0d8: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a d0dc: 70 e0 ldi r23, 0x00 ; 0 d0de: 60 e0 ldi r22, 0x00 ; 0 d0e0: 83 ed ldi r24, 0xD3 ; 211 d0e2: 9e e0 ldi r25, 0x0E ; 14 d0e4: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a d0e8: 70 e0 ldi r23, 0x00 ; 0 d0ea: 60 e0 ldi r22, 0x00 ; 0 d0ec: 80 ed ldi r24, 0xD0 ; 208 d0ee: 9e e0 ldi r25, 0x0E ; 14 d0f0: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); d0f4: 40 e0 ldi r20, 0x00 ; 0 d0f6: 50 e0 ldi r21, 0x00 ; 0 d0f8: ba 01 movw r22, r20 d0fa: 88 ea ldi r24, 0xA8 ; 168 d0fc: 9c e0 ldi r25, 0x0C ; 12 d0fe: 0d 94 91 dd jmp 0x3bb22 ; 0x3bb22 0000d102 : wdt_disable(); } } void softReset(void) { cli(); d102: 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" ); d104: 88 e1 ldi r24, 0x18 ; 24 d106: 98 e0 ldi r25, 0x08 ; 8 d108: 0f b6 in r0, 0x3f ; 63 d10a: f8 94 cli d10c: a8 95 wdr d10e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> d112: 0f be out 0x3f, r0 ; 63 d114: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> d118: ff cf rjmp .-2 ; 0xd118 0000d11a : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { d11a: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); d11c: 9f b7 in r25, 0x3f ; 63 d11e: f8 94 cli d120: e2 e0 ldi r30, 0x02 ; 2 d122: f1 e0 ldi r31, 0x01 ; 1 d124: 80 81 ld r24, Z d126: 84 60 ori r24, 0x04 ; 4 d128: 80 83 st Z, r24 d12a: 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); d12c: 6c 2f mov r22, r28 d12e: 83 e0 ldi r24, 0x03 ; 3 d130: 9d e0 ldi r25, 0x0D ; 13 d132: 0f 94 7f dd call 0x3bafe ; 0x3bafe eeprom_update_byte_notify((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)reason); #ifdef EMERGENCY_DUMP xfdump_full_dump_and_reset(reason); d136: 8c 2f mov r24, r28 d138: 0e 94 5e e3 call 0x1c6bc ; 0x1c6bc #elif defined(EMERGENCY_SERIAL_DUMP) if(emergency_serial_dump) serial_dump_and_reset(reason); #endif softReset(); d13c: 0e 94 81 68 call 0xd102 ; 0xd102 0000d140 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { d140: 1f 92 push r1 d142: 0f 92 push r0 d144: 0f b6 in r0, 0x3f ; 63 d146: 0f 92 push r0 d148: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); d14a: 83 e0 ldi r24, 0x03 ; 3 d14c: 0e 94 8d 68 call 0xd11a ; 0xd11a 0000d150 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { d150: 1f 92 push r1 d152: 0f 92 push r0 d154: 0f b6 in r0, 0x3f ; 63 d156: 0f 92 push r0 d158: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); d15a: 82 e0 ldi r24, 0x02 ; 2 d15c: 0e 94 8d 68 call 0xd11a ; 0xd11a 0000d160 : } #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); d160: 85 ea ldi r24, 0xA5 ; 165 d162: 9f e0 ldi r25, 0x0F ; 15 d164: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 d168: 91 e0 ldi r25, 0x01 ; 1 d16a: 81 11 cpse r24, r1 d16c: 01 c0 rjmp .+2 ; 0xd170 d16e: 90 e0 ldi r25, 0x00 ; 0 } d170: 89 2f mov r24, r25 d172: 08 95 ret 0000d174 : 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(); d174: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 d178: 81 11 cpse r24, r1 d17a: 06 c0 rjmp .+12 ; 0xd188 d17c: 81 e0 ldi r24, 0x01 ; 1 d17e: 90 91 9d 03 lds r25, 0x039D ; 0x80039d d182: 92 30 cpi r25, 0x02 ; 2 d184: 09 f0 breq .+2 ; 0xd188 d186: 80 e0 ldi r24, 0x00 ; 0 } d188: 08 95 ret 0000d18a : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); d18a: 80 91 6e 14 lds r24, 0x146E ; 0x80146e d18e: 81 11 cpse r24, r1 d190: 0a c0 rjmp .+20 ; 0xd1a6 d192: 80 91 11 05 lds r24, 0x0511 ; 0x800511 d196: 81 11 cpse r24, r1 d198: 06 c0 rjmp .+12 ; 0xd1a6 d19a: 81 e0 ldi r24, 0x01 ; 1 d19c: 90 91 9d 03 lds r25, 0x039D ; 0x80039d d1a0: 91 30 cpi r25, 0x01 ; 1 d1a2: 09 f0 breq .+2 ; 0xd1a6 d1a4: 80 e0 ldi r24, 0x00 ; 0 } d1a6: 08 95 ret 0000d1a8 : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { d1a8: cf 93 push r28 d1aa: df 93 push r29 return ( !homing_flag d1ac: c0 91 58 0e lds r28, 0x0E58 ; 0x800e58 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d1b0: c1 11 cpse r28, r1 d1b2: 1f c0 rjmp .+62 ; 0xd1f2 && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag d1b4: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 d1b8: 81 11 cpse r24, r1 d1ba: 1c c0 rjmp .+56 ; 0xd1f4 && !printingIsPaused() d1bc: 0e 94 ba 68 call 0xd174 ; 0xd174 d1c0: 81 11 cpse r24, r1 d1c2: 18 c0 rjmp .+48 ; 0xd1f4 && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d1c4: d0 91 65 0e lds r29, 0x0E65 ; 0x800e65 d1c8: d4 30 cpi r29, 0x04 ; 4 d1ca: 61 f4 brne .+24 ; 0xd1e4 d1cc: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d d1d0: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e d1d4: 89 2b or r24, r25 d1d6: 91 f4 brne .+36 ; 0xd1fc d1d8: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b d1dc: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c d1e0: 89 2b or r24, r25 d1e2: 61 f4 brne .+24 ; 0xd1fc || printJobOngoing() d1e4: 0e 94 c5 68 call 0xd18a ; 0xd18a d1e8: c8 2f mov r28, r24 d1ea: 81 11 cpse r24, r1 d1ec: 03 c0 rjmp .+6 ; 0xd1f4 || lcd_commands_type == LcdCommands::Idle d1ee: c1 e0 ldi r28, 0x01 ; 1 d1f0: 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) d1f2: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } d1f4: 8c 2f mov r24, r28 d1f6: df 91 pop r29 d1f8: cf 91 pop r28 d1fa: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d1fc: c1 e0 ldi r28, 0x01 ; 1 d1fe: fa cf rjmp .-12 ; 0xd1f4 0000d200 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); d200: 0e 94 d4 68 call 0xd1a8 ; 0xd1a8 d204: 88 23 and r24, r24 d206: 89 f0 breq .+34 ; 0xd22a d208: 20 e0 ldi r18, 0x00 ; 0 d20a: 30 e0 ldi r19, 0x00 ; 0 d20c: 40 e0 ldi r20, 0x00 ; 0 d20e: 50 e4 ldi r21, 0x40 ; 64 d210: 60 91 4b 07 lds r22, 0x074B ; 0x80074b d214: 70 91 4c 07 lds r23, 0x074C ; 0x80074c d218: 80 91 4d 07 lds r24, 0x074D ; 0x80074d d21c: 90 91 4e 07 lds r25, 0x074E ; 0x80074e d220: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> d224: 88 1f adc r24, r24 d226: 88 27 eor r24, r24 d228: 88 1f adc r24, r24 } d22a: 08 95 ret 0000d22c : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() d22c: 0e 94 c5 68 call 0xd18a ; 0xd18a || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; d230: 81 11 cpse r24, r1 d232: 18 c0 rjmp .+48 ; 0xd264 return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() d234: 0e 94 ba 68 call 0xd174 ; 0xd174 d238: 81 11 cpse r24, r1 d23a: 14 c0 rjmp .+40 ; 0xd264 || saved_printing d23c: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a d240: 81 11 cpse r24, r1 d242: 10 c0 rjmp .+32 ; 0xd264 || (lcd_commands_type != LcdCommands::Idle) d244: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 d248: 81 11 cpse r24, r1 d24a: 0b c0 rjmp .+22 ; 0xd262 || MMU2::mmu2.MMU_PRINT_SAVED() d24c: 80 91 99 13 lds r24, 0x1399 ; 0x801399 d250: 81 11 cpse r24, r1 d252: 07 c0 rjmp .+14 ; 0xd262 || homing_flag d254: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 d258: 81 11 cpse r24, r1 d25a: 04 c0 rjmp .+8 ; 0xd264 || mesh_bed_leveling_flag; d25c: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 d260: 08 95 ret d262: 81 e0 ldi r24, 0x01 ; 1 } d264: 08 95 ret 0000d266 : // accordingly refreshCurrentScaling(); } void __attribute__((noinline)) setiHold(uint8_t ih) { iHold = vSense ? ih : ih >> 1; d266: fc 01 movw r30, r24 d268: 20 81 ld r18, Z d26a: 21 11 cpse r18, r1 d26c: 01 c0 rjmp .+2 ; 0xd270 d26e: 66 95 lsr r22 d270: fc 01 movw r30, r24 d272: 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() } d274: 08 95 ret 0000d276 : 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) { d276: fc 01 movw r30, r24 iRun = ir; d278: 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); d27a: 21 e0 ldi r18, 0x01 ; 1 d27c: 60 32 cpi r22, 0x20 ; 32 d27e: 08 f0 brcs .+2 ; 0xd282 d280: 20 e0 ldi r18, 0x00 ; 0 if (vSense != newvSense) { d282: 90 81 ld r25, Z d284: 29 17 cp r18, r25 d286: 81 f0 breq .+32 ; 0xd2a8 d288: 82 81 ldd r24, Z+2 ; 0x02 // Update currents to match current scaling if (vSense) { d28a: 99 23 and r25, r25 d28c: 51 f0 breq .+20 ; 0xd2a2 // 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; d28e: 90 e0 ldi r25, 0x00 ; 0 d290: 95 95 asr r25 d292: 87 95 ror r24 d294: 82 83 std Z+2, r24 ; 0x02 iRun >>= 1; d296: 70 e0 ldi r23, 0x00 ; 0 d298: 75 95 asr r23 d29a: 67 95 ror r22 d29c: 61 83 std Z+1, r22 ; 0x01 // Keep in mind, only a change in iRun can change vSense. iHold <<= 1; } // Update vSense vSense = newvSense; d29e: 20 83 st Z, r18 d2a0: 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; d2a2: 88 0f add r24, r24 d2a4: 82 83 std Z+2, r24 ; 0x02 d2a6: fb cf rjmp .-10 ; 0xd29e } // Update vSense vSense = newvSense; } else if (!vSense) { d2a8: 21 11 cpse r18, r1 d2aa: 04 c0 rjmp .+8 ; 0xd2b4 // 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; d2ac: 70 e0 ldi r23, 0x00 ; 0 d2ae: 75 95 asr r23 d2b0: 67 95 ror r22 d2b2: 61 83 std Z+1, r22 ; 0x01 iRun = ir; // Refresh the vSense bit and take care of updating Hold/Run currents // accordingly refreshCurrentScaling(); } d2b4: 08 95 ret 0000d2b6 : } #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; } d2b6: 20 91 70 12 lds r18, 0x1270 ; 0x801270 d2ba: 30 91 71 12 lds r19, 0x1271 ; 0x801271 d2be: bc 01 movw r22, r24 d2c0: c9 01 movw r24, r18 d2c2: 8a 57 subi r24, 0x7A ; 122 d2c4: 9f 4e sbci r25, 0xEF ; 239 d2c6: 0f 94 62 db call 0x3b6c4 ; 0x3b6c4 d2ca: 9c 01 movw r18, r24 d2cc: 90 93 98 03 sts 0x0398, r25 ; 0x800398 d2d0: 80 93 97 03 sts 0x0397, r24 ; 0x800397 d2d4: 81 e0 ldi r24, 0x01 ; 1 d2d6: 23 2b or r18, r19 d2d8: 09 f4 brne .+2 ; 0xd2dc d2da: 80 e0 ldi r24, 0x00 ; 0 d2dc: 08 95 ret 0000d2de : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } d2de: 80 e1 ldi r24, 0x10 ; 16 d2e0: e3 e4 ldi r30, 0x43 ; 67 d2e2: f7 e0 ldi r31, 0x07 ; 7 d2e4: a4 e5 ldi r26, 0x54 ; 84 d2e6: b5 e0 ldi r27, 0x05 ; 5 d2e8: 01 90 ld r0, Z+ d2ea: 0d 92 st X+, r0 d2ec: 8a 95 dec r24 d2ee: e1 f7 brne .-8 ; 0xd2e8 d2f0: 08 95 ret 0000d2f2 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { d2f2: 4f 92 push r4 d2f4: 5f 92 push r5 d2f6: 6f 92 push r6 d2f8: 7f 92 push r7 d2fa: 8f 92 push r8 d2fc: 9f 92 push r9 d2fe: af 92 push r10 d300: bf 92 push r11 d302: cf 92 push r12 d304: df 92 push r13 d306: ef 92 push r14 d308: ff 92 push r15 d30a: 0f 93 push r16 d30c: 1f 93 push r17 d30e: cf 93 push r28 d310: df 93 push r29 d312: 00 d0 rcall .+0 ; 0xd314 d314: 00 d0 rcall .+0 ; 0xd316 d316: 1f 92 push r1 d318: 1f 92 push r1 d31a: cd b7 in r28, 0x3d ; 61 d31c: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; d31e: 20 91 5a 0e lds r18, 0x0E5A ; 0x800e5a d322: 22 23 and r18, r18 d324: 09 f4 brne .+2 ; 0xd328 d326: 73 c1 rjmp .+742 ; 0xd60e #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; d328: 20 91 e2 03 lds r18, 0x03E2 ; 0x8003e2 d32c: 22 30 cpi r18, 0x02 ; 2 d32e: 09 f4 brne .+2 ; 0xd332 d330: 6e c1 rjmp .+732 ; 0xd60e if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb d332: 20 91 e2 03 lds r18, 0x03E2 ; 0x8003e2 d336: 21 30 cpi r18, 0x01 ; 1 d338: 11 f4 brne .+4 ; 0xd33e d33a: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 d33e: 2b 01 movw r4, r22 d340: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; d342: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 // restore bed temperature (bed can be disabled during a thermal warning) if ((uint8_t)degBed() != saved_bed_temperature) d346: 10 91 af 05 lds r17, 0x05AF ; 0x8005af d34a: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 d34e: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 d352: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 d356: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 d35a: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> d35e: 61 17 cp r22, r17 d360: 31 f0 breq .+12 ; 0xd36e resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; d362: 81 2f mov r24, r17 d364: 90 e0 ldi r25, 0x00 ; 0 d366: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c d36a: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); d36e: 0e 94 fe 65 call 0xcbfc ; 0xcbfc // Restore saved fan speed fanSpeed = saved_fan_speed; d372: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac d376: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; d37a: 90 91 e1 03 lds r25, 0x03E1 ; 0x8003e1 d37e: 80 91 06 18 lds r24, 0x1806 ; 0x801806 d382: 81 95 neg r24 d384: 89 27 eor r24, r25 d386: 88 70 andi r24, 0x08 ; 8 d388: 89 27 eor r24, r25 d38a: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 float e = saved_pos[E_AXIS] - e_move; d38e: a3 01 movw r20, r6 d390: 92 01 movw r18, r4 d392: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d396: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d39a: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d39e: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d3a2: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> d3a6: 6d 83 std Y+5, r22 ; 0x05 d3a8: 7e 83 std Y+6, r23 ; 0x06 d3aa: 8f 83 std Y+7, r24 ; 0x07 d3ac: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); d3ae: ce 01 movw r24, r28 d3b0: 05 96 adiw r24, 0x05 ; 5 d3b2: 0f 94 ae aa call 0x3555c ; 0x3555c #ifdef FANCHECK fans_check_enabled = false; d3b6: 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) d3ba: 20 e0 ldi r18, 0x00 ; 0 d3bc: 30 e0 ldi r19, 0x00 ; 0 d3be: 40 e8 ldi r20, 0x80 ; 128 d3c0: 5f eb ldi r21, 0xBF ; 191 d3c2: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d3c6: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d3ca: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d3ce: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d3d2: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> d3d6: 81 11 cpse r24, r1 d3d8: 20 c0 rjmp .+64 ; 0xd41a { saved_pos[X_AXIS] = current_position[X_AXIS]; d3da: 80 91 43 07 lds r24, 0x0743 ; 0x800743 d3de: 90 91 44 07 lds r25, 0x0744 ; 0x800744 d3e2: a0 91 45 07 lds r26, 0x0745 ; 0x800745 d3e6: b0 91 46 07 lds r27, 0x0746 ; 0x800746 d3ea: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b d3ee: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c d3f2: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d d3f6: b0 93 9e 02 sts 0x029E, r27 ; 0x80029e saved_pos[Y_AXIS] = current_position[Y_AXIS]; d3fa: 80 91 47 07 lds r24, 0x0747 ; 0x800747 d3fe: 90 91 48 07 lds r25, 0x0748 ; 0x800748 d402: a0 91 49 07 lds r26, 0x0749 ; 0x800749 d406: b0 91 4a 07 lds r27, 0x074A ; 0x80074a d40a: 80 93 9f 02 sts 0x029F, r24 ; 0x80029f d40e: 90 93 a0 02 sts 0x02A0, r25 ; 0x8002a0 d412: a0 93 a1 02 sts 0x02A1, r26 ; 0x8002a1 d416: b0 93 a2 02 sts 0x02A2, r27 ; 0x8002a2 } //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); d41a: a3 01 movw r20, r6 d41c: 92 01 movw r18, r4 d41e: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d422: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d426: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d42a: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d42e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> d432: 69 83 std Y+1, r22 ; 0x01 d434: 7a 83 std Y+2, r23 ; 0x02 d436: 8b 83 std Y+3, r24 ; 0x03 d438: 9c 83 std Y+4, r25 ; 0x04 d43a: e0 90 4b 07 lds r14, 0x074B ; 0x80074b d43e: f0 90 4c 07 lds r15, 0x074C ; 0x80074c d442: 00 91 4d 07 lds r16, 0x074D ; 0x80074d d446: 10 91 4e 07 lds r17, 0x074E ; 0x80074e d44a: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d44e: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d452: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d456: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d45a: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d45e: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d462: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d466: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d46a: 1f 92 push r1 d46c: 1f 92 push r1 d46e: 1f 92 push r1 d470: 1f 92 push r1 d472: e2 e6 ldi r30, 0x62 ; 98 d474: 8e 2e mov r8, r30 d476: e7 e2 ldi r30, 0x27 ; 39 d478: 9e 2e mov r9, r30 d47a: e6 e7 ldi r30, 0x76 ; 118 d47c: ae 2e mov r10, r30 d47e: e2 e4 ldi r30, 0x42 ; 66 d480: be 2e mov r11, r30 d482: fe 01 movw r30, r28 d484: 31 96 adiw r30, 0x01 ; 1 d486: 6f 01 movw r12, r30 d488: 0f 94 08 ab call 0x35610 ; 0x35610 //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); d48c: a3 01 movw r20, r6 d48e: 92 01 movw r18, r4 d490: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d494: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d498: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d49c: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d4a0: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> d4a4: 69 83 std Y+1, r22 ; 0x01 d4a6: 7a 83 std Y+2, r23 ; 0x02 d4a8: 8b 83 std Y+3, r24 ; 0x03 d4aa: 9c 83 std Y+4, r25 ; 0x04 d4ac: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 d4b0: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 d4b4: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 d4b8: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 d4bc: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d4c0: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d4c4: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d4c8: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d4cc: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d4d0: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d4d4: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d4d8: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d4dc: 1f 92 push r1 d4de: 1f 92 push r1 d4e0: 1f 92 push r1 d4e2: 1f 92 push r1 d4e4: 0f 94 08 ab call 0x35610 ; 0x35610 //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); d4e8: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 d4ec: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 d4f0: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 d4f4: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 d4f8: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d4fc: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d500: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d504: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d508: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d50c: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d510: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d514: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d518: 1f 92 push r1 d51a: 1f 92 push r1 d51c: 1f 92 push r1 d51e: 1f 92 push r1 d520: 81 2c mov r8, r1 d522: 91 2c mov r9, r1 d524: f8 ee ldi r31, 0xE8 ; 232 d526: af 2e mov r10, r31 d528: f2 e4 ldi r31, 0x42 ; 66 d52a: bf 2e mov r11, r31 d52c: a7 ea ldi r26, 0xA7 ; 167 d52e: ca 2e mov r12, r26 d530: a2 e0 ldi r26, 0x02 ; 2 d532: da 2e mov r13, r26 d534: 0f 94 08 ab call 0x35610 ; 0x35610 st_synchronize(); d538: 0f 94 27 58 call 0x2b04e ; 0x2b04e #ifdef FANCHECK fans_check_enabled = true; d53c: 11 e0 ldi r17, 0x01 ; 1 d53e: 10 93 38 02 sts 0x0238, r17 ; 0x800238 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; d542: 60 91 00 18 lds r22, 0x1800 ; 0x801800 d546: 70 91 01 18 lds r23, 0x1801 ; 0x801801 d54a: 90 e0 ldi r25, 0x00 ; 0 d54c: 80 e0 ldi r24, 0x00 ; 0 d54e: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> d552: 60 93 90 02 sts 0x0290, r22 ; 0x800290 d556: 70 93 91 02 sts 0x0291, r23 ; 0x800291 d55a: 80 93 92 02 sts 0x0292, r24 ; 0x800292 d55e: 90 93 93 02 sts 0x0293, r25 ; 0x800293 feedmultiply = saved_feedmultiply2; d562: 80 91 73 03 lds r24, 0x0373 ; 0x800373 d566: 90 91 74 03 lds r25, 0x0374 ; 0x800374 d56a: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d56e: 80 93 39 02 sts 0x0239, r24 ; 0x800239 memcpy(current_position, saved_pos, sizeof(saved_pos)); d572: 80 e1 ldi r24, 0x10 ; 16 d574: eb e9 ldi r30, 0x9B ; 155 d576: f2 e0 ldi r31, 0x02 ; 2 d578: a3 e4 ldi r26, 0x43 ; 67 d57a: b7 e0 ldi r27, 0x07 ; 7 d57c: 01 90 ld r0, Z+ d57e: 0d 92 st X+, r0 d580: 8a 95 dec r24 d582: e1 f7 brne .-8 ; 0xd57c set_destination_to_current(); d584: 0e 94 6f 69 call 0xd2de ; 0xd2de //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing d588: 80 91 6a 02 lds r24, 0x026A ; 0x80026a d58c: 0f b6 in r0, 0x3f ; 63 d58e: f8 94 cli d590: de bf out 0x3e, r29 ; 62 d592: 0f be out 0x3f, r0 ; 63 d594: cd bf out 0x3d, r28 ; 61 d596: 81 11 cpse r24, r1 d598: 51 c0 rjmp .+162 ; 0xd63c card.setIndex(saved_sdpos); d59a: 60 91 02 18 lds r22, 0x1802 ; 0x801802 d59e: 70 91 03 18 lds r23, 0x1803 ; 0x801803 d5a2: 80 91 04 18 lds r24, 0x1804 ; 0x801804 d5a6: 90 91 05 18 lds r25, 0x1805 ; 0x801805 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; d5aa: 60 93 82 17 sts 0x1782, r22 ; 0x801782 d5ae: 70 93 83 17 sts 0x1783, r23 ; 0x801783 d5b2: 80 93 84 17 sts 0x1784, r24 ; 0x801784 d5b6: 90 93 85 17 sts 0x1785, r25 ; 0x801785 d5ba: 0f 94 87 76 call 0x2ed0e ; 0x2ed0e sdpos_atomic = saved_sdpos; d5be: 80 91 02 18 lds r24, 0x1802 ; 0x801802 d5c2: 90 91 03 18 lds r25, 0x1803 ; 0x801803 d5c6: a0 91 04 18 lds r26, 0x1804 ; 0x801804 d5ca: b0 91 05 18 lds r27, 0x1805 ; 0x801805 d5ce: 80 93 84 03 sts 0x0384, r24 ; 0x800384 d5d2: 90 93 85 03 sts 0x0385, r25 ; 0x800385 d5d6: a0 93 86 03 sts 0x0386, r26 ; 0x800386 d5da: b0 93 87 03 sts 0x0387, r27 ; 0x800387 card.sdprinting = true; d5de: 10 93 6e 14 sts 0x146E, r17 ; 0x80146e d5e2: 60 e0 ldi r22, 0x00 ; 0 d5e4: 85 ea ldi r24, 0xA5 ; 165 d5e6: 9f e0 ldi r25, 0x0F ; 15 d5e8: 0f 94 7f dd call 0x3bafe ; 0x3bafe d5ec: 60 e0 ldi r22, 0x00 ; 0 d5ee: 8f e7 ldi r24, 0x7F ; 127 d5f0: 9c e0 ldi r25, 0x0C ; 12 d5f2: 0f 94 7f dd call 0x3bafe ; 0x3bafe 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); d5f6: 8e e0 ldi r24, 0x0E ; 14 d5f8: 91 e7 ldi r25, 0x71 ; 113 d5fa: 0f 94 0c 0b call 0x21618 ; 0x21618 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; d5fe: 82 e0 ldi r24, 0x02 ; 2 d600: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; d604: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a planner_aborted = true; // unroll the stack d608: 81 e0 ldi r24, 0x01 ; 1 d60a: 80 93 5d 0e sts 0x0E5D, r24 ; 0x800e5d } d60e: 28 96 adiw r28, 0x08 ; 8 d610: 0f b6 in r0, 0x3f ; 63 d612: f8 94 cli d614: de bf out 0x3e, r29 ; 62 d616: 0f be out 0x3f, r0 ; 63 d618: cd bf out 0x3d, r28 ; 61 d61a: df 91 pop r29 d61c: cf 91 pop r28 d61e: 1f 91 pop r17 d620: 0f 91 pop r16 d622: ff 90 pop r15 d624: ef 90 pop r14 d626: df 90 pop r13 d628: cf 90 pop r12 d62a: bf 90 pop r11 d62c: af 90 pop r10 d62e: 9f 90 pop r9 d630: 8f 90 pop r8 d632: 7f 90 pop r7 d634: 6f 90 pop r6 d636: 5f 90 pop r5 d638: 4f 90 pop r4 d63a: 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 d63c: 81 30 cpi r24, 0x01 ; 1 d63e: 89 f6 brne .-94 ; 0xd5e2 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing d640: 80 91 02 18 lds r24, 0x1802 ; 0x801802 d644: 90 91 03 18 lds r25, 0x1803 ; 0x801803 d648: a0 91 04 18 lds r26, 0x1804 ; 0x801804 d64c: b0 91 05 18 lds r27, 0x1805 ; 0x801805 d650: 80 93 7c 03 sts 0x037C, r24 ; 0x80037c d654: 90 93 7d 03 sts 0x037D, r25 ; 0x80037d d658: a0 93 7e 03 sts 0x037E, r26 ; 0x80037e d65c: b0 93 7f 03 sts 0x037F, r27 ; 0x80037f serial_count = 0; d660: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d d664: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c FlushSerialRequestResend(); d668: 0e 94 b3 5c call 0xb966 ; 0xb966 d66c: ba cf rjmp .-140 ; 0xd5e2 0000d66e : 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) { d66e: 3f 92 push r3 d670: 4f 92 push r4 d672: 5f 92 push r5 d674: 6f 92 push r6 d676: 7f 92 push r7 d678: 8f 92 push r8 d67a: 9f 92 push r9 d67c: af 92 push r10 d67e: bf 92 push r11 d680: cf 92 push r12 d682: df 92 push r13 d684: ef 92 push r14 d686: ff 92 push r15 d688: 0f 93 push r16 d68a: 1f 93 push r17 d68c: cf 93 push r28 d68e: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { d690: 30 90 eb 17 lds r3, 0x17EB ; 0x8017eb d694: 33 20 and r3, r3 d696: 09 f4 brne .+2 ; 0xd69a d698: 80 c0 rjmp .+256 ; 0xd79a d69a: 8b 01 movw r16, r22 d69c: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d69e: 31 fe sbrs r3, 1 d6a0: 54 c0 rjmp .+168 ; 0xd74a // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; d6a2: 88 80 ld r8, Y d6a4: 99 80 ldd r9, Y+1 ; 0x01 d6a6: aa 80 ldd r10, Y+2 ; 0x02 d6a8: bb 80 ldd r11, Y+3 ; 0x03 d6aa: fb 01 movw r30, r22 d6ac: c0 80 ld r12, Z d6ae: d1 80 ldd r13, Z+1 ; 0x01 d6b0: e2 80 ldd r14, Z+2 ; 0x02 d6b2: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; d6b4: 20 91 c0 17 lds r18, 0x17C0 ; 0x8017c0 d6b8: 30 91 c1 17 lds r19, 0x17C1 ; 0x8017c1 d6bc: 40 91 c2 17 lds r20, 0x17C2 ; 0x8017c2 d6c0: 50 91 c3 17 lds r21, 0x17C3 ; 0x8017c3 d6c4: c5 01 movw r24, r10 d6c6: b4 01 movw r22, r8 d6c8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> d6cc: 2b 01 movw r4, r22 d6ce: 3c 01 movw r6, r24 d6d0: 20 91 c4 17 lds r18, 0x17C4 ; 0x8017c4 d6d4: 30 91 c5 17 lds r19, 0x17C5 ; 0x8017c5 d6d8: 40 91 c6 17 lds r20, 0x17C6 ; 0x8017c6 d6dc: 50 91 c7 17 lds r21, 0x17C7 ; 0x8017c7 d6e0: c7 01 movw r24, r14 d6e2: b6 01 movw r22, r12 d6e4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> d6e8: 9b 01 movw r18, r22 d6ea: ac 01 movw r20, r24 d6ec: c3 01 movw r24, r6 d6ee: b2 01 movw r22, r4 d6f0: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> d6f4: 2b 01 movw r4, r22 d6f6: 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; d6f8: 20 91 b8 17 lds r18, 0x17B8 ; 0x8017b8 d6fc: 30 91 b9 17 lds r19, 0x17B9 ; 0x8017b9 d700: 40 91 ba 17 lds r20, 0x17BA ; 0x8017ba d704: 50 91 bb 17 lds r21, 0x17BB ; 0x8017bb d708: c5 01 movw r24, r10 d70a: b4 01 movw r22, r8 d70c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> d710: 4b 01 movw r8, r22 d712: 5c 01 movw r10, r24 d714: 20 91 bc 17 lds r18, 0x17BC ; 0x8017bc d718: 30 91 bd 17 lds r19, 0x17BD ; 0x8017bd d71c: 40 91 be 17 lds r20, 0x17BE ; 0x8017be d720: 50 91 bf 17 lds r21, 0x17BF ; 0x8017bf d724: c7 01 movw r24, r14 d726: b6 01 movw r22, r12 d728: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> d72c: 9b 01 movw r18, r22 d72e: ac 01 movw r20, r24 d730: c5 01 movw r24, r10 d732: b4 01 movw r22, r8 d734: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; d738: 68 83 st Y, r22 d73a: 79 83 std Y+1, r23 ; 0x01 d73c: 8a 83 std Y+2, r24 ; 0x02 d73e: 9b 83 std Y+3, r25 ; 0x03 y = out_y; d740: f8 01 movw r30, r16 d742: 40 82 st Z, r4 d744: 51 82 std Z+1, r5 ; 0x01 d746: 62 82 std Z+2, r6 ; 0x02 d748: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { d74a: 30 fe sbrs r3, 0 d74c: 26 c0 rjmp .+76 ; 0xd79a // Then add the offset. x += world2machine_shift[0]; d74e: 20 91 e3 17 lds r18, 0x17E3 ; 0x8017e3 d752: 30 91 e4 17 lds r19, 0x17E4 ; 0x8017e4 d756: 40 91 e5 17 lds r20, 0x17E5 ; 0x8017e5 d75a: 50 91 e6 17 lds r21, 0x17E6 ; 0x8017e6 d75e: 68 81 ld r22, Y d760: 79 81 ldd r23, Y+1 ; 0x01 d762: 8a 81 ldd r24, Y+2 ; 0x02 d764: 9b 81 ldd r25, Y+3 ; 0x03 d766: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> d76a: 68 83 st Y, r22 d76c: 79 83 std Y+1, r23 ; 0x01 d76e: 8a 83 std Y+2, r24 ; 0x02 d770: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; d772: 20 91 e7 17 lds r18, 0x17E7 ; 0x8017e7 d776: 30 91 e8 17 lds r19, 0x17E8 ; 0x8017e8 d77a: 40 91 e9 17 lds r20, 0x17E9 ; 0x8017e9 d77e: 50 91 ea 17 lds r21, 0x17EA ; 0x8017ea d782: f8 01 movw r30, r16 d784: 60 81 ld r22, Z d786: 71 81 ldd r23, Z+1 ; 0x01 d788: 82 81 ldd r24, Z+2 ; 0x02 d78a: 93 81 ldd r25, Z+3 ; 0x03 d78c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> d790: f8 01 movw r30, r16 d792: 60 83 st Z, r22 d794: 71 83 std Z+1, r23 ; 0x01 d796: 82 83 std Z+2, r24 ; 0x02 d798: 93 83 std Z+3, r25 ; 0x03 } } } d79a: df 91 pop r29 d79c: cf 91 pop r28 d79e: 1f 91 pop r17 d7a0: 0f 91 pop r16 d7a2: ff 90 pop r15 d7a4: ef 90 pop r14 d7a6: df 90 pop r13 d7a8: cf 90 pop r12 d7aa: bf 90 pop r11 d7ac: af 90 pop r10 d7ae: 9f 90 pop r9 d7b0: 8f 90 pop r8 d7b2: 7f 90 pop r7 d7b4: 6f 90 pop r6 d7b6: 5f 90 pop r5 d7b8: 4f 90 pop r4 d7ba: 3f 90 pop r3 d7bc: 08 95 ret 0000d7be : } } } inline bool world2machine_clamp(float &x, float &y) { d7be: 2f 92 push r2 d7c0: 3f 92 push r3 d7c2: 4f 92 push r4 d7c4: 5f 92 push r5 d7c6: 6f 92 push r6 d7c8: 7f 92 push r7 d7ca: 8f 92 push r8 d7cc: 9f 92 push r9 d7ce: af 92 push r10 d7d0: bf 92 push r11 d7d2: cf 92 push r12 d7d4: df 92 push r13 d7d6: ef 92 push r14 d7d8: ff 92 push r15 d7da: 0f 93 push r16 d7dc: 1f 93 push r17 d7de: cf 93 push r28 d7e0: df 93 push r29 d7e2: 00 d0 rcall .+0 ; 0xd7e4 d7e4: 00 d0 rcall .+0 ; 0xd7e6 d7e6: 1f 92 push r1 d7e8: 1f 92 push r1 d7ea: cd b7 in r28, 0x3d ; 61 d7ec: de b7 in r29, 0x3e ; 62 d7ee: 8c 01 movw r16, r24 d7f0: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d7f2: fc 01 movw r30, r24 d7f4: 80 81 ld r24, Z d7f6: 91 81 ldd r25, Z+1 ; 0x01 d7f8: a2 81 ldd r26, Z+2 ; 0x02 d7fa: b3 81 ldd r27, Z+3 ; 0x03 d7fc: 89 83 std Y+1, r24 ; 0x01 d7fe: 9a 83 std Y+2, r25 ; 0x02 d800: ab 83 std Y+3, r26 ; 0x03 d802: bc 83 std Y+4, r27 ; 0x04 out_y = y; d804: fb 01 movw r30, r22 d806: 80 81 ld r24, Z d808: 91 81 ldd r25, Z+1 ; 0x01 d80a: a2 81 ldd r26, Z+2 ; 0x02 d80c: b3 81 ldd r27, Z+3 ; 0x03 d80e: 8d 83 std Y+5, r24 ; 0x05 d810: 9e 83 std Y+6, r25 ; 0x06 d812: af 83 std Y+7, r26 ; 0x07 d814: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); d816: be 01 movw r22, r28 d818: 6b 5f subi r22, 0xFB ; 251 d81a: 7f 4f sbci r23, 0xFF ; 255 d81c: ce 01 movw r24, r28 d81e: 01 96 adiw r24, 0x01 ; 1 d820: 0e 94 37 6b call 0xd66e ; 0xd66e inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { d824: c9 80 ldd r12, Y+1 ; 0x01 d826: da 80 ldd r13, Y+2 ; 0x02 d828: eb 80 ldd r14, Y+3 ; 0x03 d82a: fc 80 ldd r15, Y+4 ; 0x04 d82c: 20 e0 ldi r18, 0x00 ; 0 d82e: 30 e0 ldi r19, 0x00 ; 0 d830: a9 01 movw r20, r18 d832: c7 01 movw r24, r14 d834: b6 01 movw r22, r12 d836: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> d83a: 87 ff sbrs r24, 7 d83c: 35 c0 rjmp .+106 ; 0xd8a8 tmpx = X_MIN_POS; d83e: 19 82 std Y+1, r1 ; 0x01 d840: 1a 82 std Y+2, r1 ; 0x02 d842: 1b 82 std Y+3, r1 ; 0x03 d844: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; d846: ff 24 eor r15, r15 d848: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { d84a: 8d 80 ldd r8, Y+5 ; 0x05 d84c: 9e 80 ldd r9, Y+6 ; 0x06 d84e: af 80 ldd r10, Y+7 ; 0x07 d850: b8 84 ldd r11, Y+8 ; 0x08 d852: 20 e0 ldi r18, 0x00 ; 0 d854: 30 e0 ldi r19, 0x00 ; 0 d856: 40 e8 ldi r20, 0x80 ; 128 d858: 50 ec ldi r21, 0xC0 ; 192 d85a: c5 01 movw r24, r10 d85c: b4 01 movw r22, r8 d85e: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> d862: 87 ff sbrs r24, 7 d864: 35 c0 rjmp .+106 ; 0xd8d0 tmpy = Y_MIN_POS; d866: 80 e0 ldi r24, 0x00 ; 0 d868: 90 e0 ldi r25, 0x00 ; 0 d86a: a0 e8 ldi r26, 0x80 ; 128 d86c: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; d86e: 8d 83 std Y+5, r24 ; 0x05 d870: 9e 83 std Y+6, r25 ; 0x06 d872: af 83 std Y+7, r26 ; 0x07 d874: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); d876: cd 80 ldd r12, Y+5 ; 0x05 d878: de 80 ldd r13, Y+6 ; 0x06 d87a: ef 80 ldd r14, Y+7 ; 0x07 d87c: f8 84 ldd r15, Y+8 ; 0x08 d87e: 89 80 ldd r8, Y+1 ; 0x01 d880: 9a 80 ldd r9, Y+2 ; 0x02 d882: ab 80 ldd r10, Y+3 ; 0x03 d884: 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) { d886: 70 90 eb 17 lds r7, 0x17EB ; 0x8017eb d88a: 71 10 cpse r7, r1 d88c: 4c c0 rjmp .+152 ; 0xd926 // No correction. out_x = x; d88e: f8 01 movw r30, r16 d890: 80 82 st Z, r8 d892: 91 82 std Z+1, r9 ; 0x01 d894: a2 82 std Z+2, r10 ; 0x02 d896: b3 82 std Z+3, r11 ; 0x03 out_y = y; d898: f1 01 movw r30, r2 d89a: c0 82 st Z, r12 d89c: d1 82 std Z+1, r13 ; 0x01 d89e: e2 82 std Z+2, r14 ; 0x02 d8a0: 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) { d8a2: ff 24 eor r15, r15 d8a4: f3 94 inc r15 d8a6: 25 c0 rjmp .+74 ; 0xd8f2 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) { d8a8: 20 e0 ldi r18, 0x00 ; 0 d8aa: 30 e0 ldi r19, 0x00 ; 0 d8ac: 4f e7 ldi r20, 0x7F ; 127 d8ae: 53 e4 ldi r21, 0x43 ; 67 d8b0: c7 01 movw r24, r14 d8b2: b6 01 movw r22, r12 d8b4: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; d8b8: 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) { d8ba: 18 16 cp r1, r24 d8bc: 34 f6 brge .-116 ; 0xd84a tmpx = X_MAX_POS; d8be: 80 e0 ldi r24, 0x00 ; 0 d8c0: 90 e0 ldi r25, 0x00 ; 0 d8c2: af e7 ldi r26, 0x7F ; 127 d8c4: b3 e4 ldi r27, 0x43 ; 67 d8c6: 89 83 std Y+1, r24 ; 0x01 d8c8: 9a 83 std Y+2, r25 ; 0x02 d8ca: ab 83 std Y+3, r26 ; 0x03 d8cc: bc 83 std Y+4, r27 ; 0x04 d8ce: bb cf rjmp .-138 ; 0xd846 } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { d8d0: 20 e0 ldi r18, 0x00 ; 0 d8d2: 30 e8 ldi r19, 0x80 ; 128 d8d4: 44 e5 ldi r20, 0x54 ; 84 d8d6: 53 e4 ldi r21, 0x43 ; 67 d8d8: c5 01 movw r24, r10 d8da: b4 01 movw r22, r8 d8dc: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> d8e0: 18 16 cp r1, r24 d8e2: 2c f4 brge .+10 ; 0xd8ee tmpy = Y_MAX_POS; d8e4: 80 e0 ldi r24, 0x00 ; 0 d8e6: 90 e8 ldi r25, 0x80 ; 128 d8e8: a4 e5 ldi r26, 0x54 ; 84 d8ea: b3 e4 ldi r27, 0x43 ; 67 d8ec: c0 cf rjmp .-128 ; 0xd86e clamped = true; } if (clamped) d8ee: f1 10 cpse r15, r1 d8f0: c2 cf rjmp .-124 ; 0xd876 machine2world(tmpx, tmpy, x, y); return clamped; } d8f2: 8f 2d mov r24, r15 d8f4: 28 96 adiw r28, 0x08 ; 8 d8f6: 0f b6 in r0, 0x3f ; 63 d8f8: f8 94 cli d8fa: de bf out 0x3e, r29 ; 62 d8fc: 0f be out 0x3f, r0 ; 63 d8fe: cd bf out 0x3d, r28 ; 61 d900: df 91 pop r29 d902: cf 91 pop r28 d904: 1f 91 pop r17 d906: 0f 91 pop r16 d908: ff 90 pop r15 d90a: ef 90 pop r14 d90c: df 90 pop r13 d90e: cf 90 pop r12 d910: bf 90 pop r11 d912: af 90 pop r10 d914: 9f 90 pop r9 d916: 8f 90 pop r8 d918: 7f 90 pop r7 d91a: 6f 90 pop r6 d91c: 5f 90 pop r5 d91e: 4f 90 pop r4 d920: 3f 90 pop r3 d922: 2f 90 pop r2 d924: 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) { d926: 70 fe sbrs r7, 0 d928: 1c c0 rjmp .+56 ; 0xd962 // Then add the offset. x -= world2machine_shift[0]; d92a: 20 91 e3 17 lds r18, 0x17E3 ; 0x8017e3 d92e: 30 91 e4 17 lds r19, 0x17E4 ; 0x8017e4 d932: 40 91 e5 17 lds r20, 0x17E5 ; 0x8017e5 d936: 50 91 e6 17 lds r21, 0x17E6 ; 0x8017e6 d93a: c5 01 movw r24, r10 d93c: b4 01 movw r22, r8 d93e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> d942: 4b 01 movw r8, r22 d944: 5c 01 movw r10, r24 y -= world2machine_shift[1]; d946: 20 91 e7 17 lds r18, 0x17E7 ; 0x8017e7 d94a: 30 91 e8 17 lds r19, 0x17E8 ; 0x8017e8 d94e: 40 91 e9 17 lds r20, 0x17E9 ; 0x8017e9 d952: 50 91 ea 17 lds r21, 0x17EA ; 0x8017ea d956: c7 01 movw r24, r14 d958: b6 01 movw r22, r12 d95a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> d95e: 6b 01 movw r12, r22 d960: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d962: 71 fe sbrs r7, 1 d964: 9e cf rjmp .-196 ; 0xd8a2 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; d966: 20 91 d3 17 lds r18, 0x17D3 ; 0x8017d3 d96a: 30 91 d4 17 lds r19, 0x17D4 ; 0x8017d4 d96e: 40 91 d5 17 lds r20, 0x17D5 ; 0x8017d5 d972: 50 91 d6 17 lds r21, 0x17D6 ; 0x8017d6 d976: c5 01 movw r24, r10 d978: b4 01 movw r22, r8 d97a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> d97e: 2b 01 movw r4, r22 d980: 3c 01 movw r6, r24 d982: 20 91 d7 17 lds r18, 0x17D7 ; 0x8017d7 d986: 30 91 d8 17 lds r19, 0x17D8 ; 0x8017d8 d98a: 40 91 d9 17 lds r20, 0x17D9 ; 0x8017d9 d98e: 50 91 da 17 lds r21, 0x17DA ; 0x8017da d992: c7 01 movw r24, r14 d994: b6 01 movw r22, r12 d996: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> d99a: 9b 01 movw r18, r22 d99c: ac 01 movw r20, r24 d99e: c3 01 movw r24, r6 d9a0: b2 01 movw r22, r4 d9a2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> d9a6: f8 01 movw r30, r16 d9a8: 60 83 st Z, r22 d9aa: 71 83 std Z+1, r23 ; 0x01 d9ac: 82 83 std Z+2, r24 ; 0x02 d9ae: 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; d9b0: 20 91 db 17 lds r18, 0x17DB ; 0x8017db d9b4: 30 91 dc 17 lds r19, 0x17DC ; 0x8017dc d9b8: 40 91 dd 17 lds r20, 0x17DD ; 0x8017dd d9bc: 50 91 de 17 lds r21, 0x17DE ; 0x8017de d9c0: c5 01 movw r24, r10 d9c2: b4 01 movw r22, r8 d9c4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> d9c8: 4b 01 movw r8, r22 d9ca: 5c 01 movw r10, r24 d9cc: 20 91 df 17 lds r18, 0x17DF ; 0x8017df d9d0: 30 91 e0 17 lds r19, 0x17E0 ; 0x8017e0 d9d4: 40 91 e1 17 lds r20, 0x17E1 ; 0x8017e1 d9d8: 50 91 e2 17 lds r21, 0x17E2 ; 0x8017e2 d9dc: c7 01 movw r24, r14 d9de: b6 01 movw r22, r12 d9e0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> d9e4: 9b 01 movw r18, r22 d9e6: ac 01 movw r20, r24 d9e8: c5 01 movw r24, r10 d9ea: b4 01 movw r22, r8 d9ec: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> d9f0: f1 01 movw r30, r2 d9f2: 60 83 st Z, r22 d9f4: 71 83 std Z+1, r23 ; 0x01 d9f6: 82 83 std Z+2, r24 ; 0x02 d9f8: 93 83 std Z+3, r25 ; 0x03 d9fa: 53 cf rjmp .-346 ; 0xd8a2 0000d9fc : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { d9fc: cf 92 push r12 d9fe: df 92 push r13 da00: ef 92 push r14 da02: ff 92 push r15 da04: cf 93 push r28 da06: df 93 push r29 da08: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); da0a: bc 01 movw r22, r24 da0c: 6c 5f subi r22, 0xFC ; 252 da0e: 7f 4f sbci r23, 0xFF ; 255 da10: 0e 94 df 6b call 0xd7be ; 0xd7be // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; da14: c0 90 29 02 lds r12, 0x0229 ; 0x800229 da18: d0 90 2a 02 lds r13, 0x022A ; 0x80022a da1c: e0 90 2b 02 lds r14, 0x022B ; 0x80022b da20: f0 90 2c 02 lds r15, 0x022C ; 0x80022c da24: a7 01 movw r20, r14 da26: 96 01 movw r18, r12 da28: 68 85 ldd r22, Y+8 ; 0x08 da2a: 79 85 ldd r23, Y+9 ; 0x09 da2c: 8a 85 ldd r24, Y+10 ; 0x0a da2e: 9b 85 ldd r25, Y+11 ; 0x0b da30: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> da34: 87 ff sbrs r24, 7 da36: 04 c0 rjmp .+8 ; 0xda40 da38: c8 86 std Y+8, r12 ; 0x08 da3a: d9 86 std Y+9, r13 ; 0x09 da3c: ea 86 std Y+10, r14 ; 0x0a da3e: 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]; da40: c0 90 1d 02 lds r12, 0x021D ; 0x80021d da44: d0 90 1e 02 lds r13, 0x021E ; 0x80021e da48: e0 90 1f 02 lds r14, 0x021F ; 0x80021f da4c: f0 90 20 02 lds r15, 0x0220 ; 0x800220 da50: a7 01 movw r20, r14 da52: 96 01 movw r18, r12 da54: 68 85 ldd r22, Y+8 ; 0x08 da56: 79 85 ldd r23, Y+9 ; 0x09 da58: 8a 85 ldd r24, Y+10 ; 0x0a da5a: 9b 85 ldd r25, Y+11 ; 0x0b da5c: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> da60: 18 16 cp r1, r24 da62: 24 f4 brge .+8 ; 0xda6c da64: c8 86 std Y+8, r12 ; 0x08 da66: d9 86 std Y+9, r13 ; 0x09 da68: ea 86 std Y+10, r14 ; 0x0a da6a: fb 86 std Y+11, r15 ; 0x0b } } da6c: df 91 pop r29 da6e: cf 91 pop r28 da70: ff 90 pop r15 da72: ef 90 pop r14 da74: df 90 pop r13 da76: cf 90 pop r12 da78: 08 95 ret 0000da7a : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { da7a: 2f 92 push r2 da7c: 3f 92 push r3 da7e: 4f 92 push r4 da80: 5f 92 push r5 da82: 6f 92 push r6 da84: 7f 92 push r7 da86: 8f 92 push r8 da88: 9f 92 push r9 da8a: af 92 push r10 da8c: bf 92 push r11 da8e: cf 92 push r12 da90: df 92 push r13 da92: ef 92 push r14 da94: ff 92 push r15 da96: 0f 93 push r16 da98: 1f 93 push r17 da9a: cf 93 push r28 da9c: df 93 push r29 da9e: cd b7 in r28, 0x3d ; 61 daa0: de b7 in r29, 0x3e ; 62 daa2: a2 97 sbiw r28, 0x22 ; 34 daa4: 0f b6 in r0, 0x3f ; 63 daa6: f8 94 cli daa8: de bf out 0x3e, r29 ; 62 daaa: 0f be out 0x3f, r0 ; 63 daac: cd bf out 0x3d, r28 ; 61 daae: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); dab0: 84 e5 ldi r24, 0x54 ; 84 dab2: 95 e0 ldi r25, 0x05 ; 5 dab4: 0e 94 fe 6c call 0xd9fc ; 0xd9fc previous_millis_cmd.start(); dab8: 88 e8 ldi r24, 0x88 ; 136 daba: 93 e0 ldi r25, 0x03 ; 3 dabc: 0f 94 29 41 call 0x28252 ; 0x28252 ::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])) { dac0: 40 90 43 07 lds r4, 0x0743 ; 0x800743 dac4: 50 90 44 07 lds r5, 0x0744 ; 0x800744 dac8: 60 90 45 07 lds r6, 0x0745 ; 0x800745 dacc: 70 90 46 07 lds r7, 0x0746 ; 0x800746 dad0: c0 90 54 05 lds r12, 0x0554 ; 0x800554 dad4: d0 90 55 05 lds r13, 0x0555 ; 0x800555 dad8: e0 90 56 05 lds r14, 0x0556 ; 0x800556 dadc: f0 90 57 05 lds r15, 0x0557 ; 0x800557 dae0: a7 01 movw r20, r14 dae2: 96 01 movw r18, r12 dae4: c3 01 movw r24, r6 dae6: b2 01 movw r22, r4 dae8: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> daec: 81 11 cpse r24, r1 daee: 3f c0 rjmp .+126 ; 0xdb6e daf0: 20 91 58 05 lds r18, 0x0558 ; 0x800558 daf4: 30 91 59 05 lds r19, 0x0559 ; 0x800559 daf8: 40 91 5a 05 lds r20, 0x055A ; 0x80055a dafc: 50 91 5b 05 lds r21, 0x055B ; 0x80055b db00: 60 91 47 07 lds r22, 0x0747 ; 0x800747 db04: 70 91 48 07 lds r23, 0x0748 ; 0x800748 db08: 80 91 49 07 lds r24, 0x0749 ; 0x800749 db0c: 90 91 4a 07 lds r25, 0x074A ; 0x80074a db10: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> db14: 81 11 cpse r24, r1 db16: 2b c0 rjmp .+86 ; 0xdb6e plan_buffer_line_destinationXYZE(feedrate/60); db18: 20 e0 ldi r18, 0x00 ; 0 db1a: 30 e0 ldi r19, 0x00 ; 0 db1c: 40 e7 ldi r20, 0x70 ; 112 db1e: 52 e4 ldi r21, 0x42 ; 66 db20: 60 91 90 02 lds r22, 0x0290 ; 0x800290 db24: 70 91 91 02 lds r23, 0x0291 ; 0x800291 db28: 80 91 92 02 lds r24, 0x0292 ; 0x800292 db2c: 90 91 93 02 lds r25, 0x0293 ; 0x800293 db30: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> db34: 0f 94 2a ba call 0x37454 ; 0x37454 #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); db38: 0e 94 25 5c call 0xb84a ; 0xb84a } db3c: a2 96 adiw r28, 0x22 ; 34 db3e: 0f b6 in r0, 0x3f ; 63 db40: f8 94 cli db42: de bf out 0x3e, r29 ; 62 db44: 0f be out 0x3f, r0 ; 63 db46: cd bf out 0x3d, r28 ; 61 db48: df 91 pop r29 db4a: cf 91 pop r28 db4c: 1f 91 pop r17 db4e: 0f 91 pop r16 db50: ff 90 pop r15 db52: ef 90 pop r14 db54: df 90 pop r13 db56: cf 90 pop r12 db58: bf 90 pop r11 db5a: af 90 pop r10 db5c: 9f 90 pop r9 db5e: 8f 90 pop r8 db60: 7f 90 pop r7 db62: 6f 90 pop r6 db64: 5f 90 pop r5 db66: 4f 90 pop r4 db68: 3f 90 pop r3 db6a: 2f 90 pop r2 db6c: 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); db6e: 60 91 39 02 lds r22, 0x0239 ; 0x800239 db72: 70 91 3a 02 lds r23, 0x023A ; 0x80023a db76: 07 2e mov r0, r23 db78: 00 0c add r0, r0 db7a: 88 0b sbc r24, r24 db7c: 99 0b sbc r25, r25 db7e: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> db82: 20 91 90 02 lds r18, 0x0290 ; 0x800290 db86: 30 91 91 02 lds r19, 0x0291 ; 0x800291 db8a: 40 91 92 02 lds r20, 0x0292 ; 0x800292 db8e: 50 91 93 02 lds r21, 0x0293 ; 0x800293 db92: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> db96: 2e e3 ldi r18, 0x3E ; 62 db98: 33 ec ldi r19, 0xC3 ; 195 db9a: 4e e2 ldi r20, 0x2E ; 46 db9c: 59 e3 ldi r21, 0x39 ; 57 db9e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> dba2: 6f 83 std Y+7, r22 ; 0x07 dba4: 78 87 std Y+8, r23 ; 0x08 dba6: 89 87 std Y+9, r24 ; 0x09 dba8: 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) { dbaa: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 dbae: 88 23 and r24, r24 dbb0: 09 f4 brne .+2 ; 0xdbb4 dbb2: 0f c1 rjmp .+542 ; 0xddd2 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]; dbb4: a3 01 movw r20, r6 dbb6: 92 01 movw r18, r4 dbb8: c7 01 movw r24, r14 dbba: b6 01 movw r22, r12 dbbc: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> dbc0: 2b 01 movw r4, r22 dbc2: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; dbc4: 20 91 47 07 lds r18, 0x0747 ; 0x800747 dbc8: 30 91 48 07 lds r19, 0x0748 ; 0x800748 dbcc: 40 91 49 07 lds r20, 0x0749 ; 0x800749 dbd0: 50 91 4a 07 lds r21, 0x074A ; 0x80074a dbd4: 60 91 58 05 lds r22, 0x0558 ; 0x800558 dbd8: 70 91 59 05 lds r23, 0x0559 ; 0x800559 dbdc: 80 91 5a 05 lds r24, 0x055A ; 0x80055a dbe0: 90 91 5b 05 lds r25, 0x055B ; 0x80055b dbe4: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> dbe8: 6b 87 std Y+11, r22 ; 0x0b dbea: 7c 87 std Y+12, r23 ; 0x0c dbec: 8d 87 std Y+13, r24 ; 0x0d dbee: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); dbf0: c3 01 movw r24, r6 dbf2: b2 01 movw r22, r4 dbf4: 9f 77 andi r25, 0x7F ; 127 dbf6: 2b 85 ldd r18, Y+11 ; 0x0b dbf8: 3c 85 ldd r19, Y+12 ; 0x0c dbfa: 4d 85 ldd r20, Y+13 ; 0x0d dbfc: 5e 85 ldd r21, Y+14 ; 0x0e dbfe: 5f 77 andi r21, 0x7F ; 127 dc00: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> dc04: 6b 01 movw r12, r22 dc06: 7c 01 movw r14, r24 if (len > 0) dc08: 20 e0 ldi r18, 0x00 ; 0 dc0a: 30 e0 ldi r19, 0x00 ; 0 dc0c: a9 01 movw r20, r18 dc0e: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> dc12: 18 16 cp r1, r24 dc14: 0c f0 brlt .+2 ; 0xdc18 dc16: dd c0 rjmp .+442 ; 0xddd2 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); dc18: 20 e0 ldi r18, 0x00 ; 0 dc1a: 30 e0 ldi r19, 0x00 ; 0 dc1c: 40 ef ldi r20, 0xF0 ; 240 dc1e: 51 e4 ldi r21, 0x41 ; 65 dc20: c7 01 movw r24, r14 dc22: b6 01 movw r22, r12 dc24: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> dc28: 0f 94 61 df call 0x3bec2 ; 0x3bec2 dc2c: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> dc30: 7e 83 std Y+6, r23 ; 0x06 dc32: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { dc34: 62 30 cpi r22, 0x02 ; 2 dc36: 71 05 cpc r23, r1 dc38: 08 f4 brcc .+2 ; 0xdc3c dc3a: cb c0 rjmp .+406 ; 0xddd2 dc3c: 21 14 cp r2, r1 dc3e: 31 04 cpc r3, r1 dc40: 09 f4 brne .+2 ; 0xdc44 dc42: c7 c0 rjmp .+398 ; 0xddd2 float dz = z - current_position[Z_AXIS]; dc44: 20 91 4b 07 lds r18, 0x074B ; 0x80074b dc48: 30 91 4c 07 lds r19, 0x074C ; 0x80074c dc4c: 40 91 4d 07 lds r20, 0x074D ; 0x80074d dc50: 50 91 4e 07 lds r21, 0x074E ; 0x80074e dc54: 60 91 5c 05 lds r22, 0x055C ; 0x80055c dc58: 70 91 5d 05 lds r23, 0x055D ; 0x80055d dc5c: 80 91 5e 05 lds r24, 0x055E ; 0x80055e dc60: 90 91 5f 05 lds r25, 0x055F ; 0x80055f dc64: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> dc68: 6f 87 std Y+15, r22 ; 0x0f dc6a: 78 8b std Y+16, r23 ; 0x10 dc6c: 89 8b std Y+17, r24 ; 0x11 dc6e: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; dc70: 20 91 4f 07 lds r18, 0x074F ; 0x80074f dc74: 30 91 50 07 lds r19, 0x0750 ; 0x800750 dc78: 40 91 51 07 lds r20, 0x0751 ; 0x800751 dc7c: 50 91 52 07 lds r21, 0x0752 ; 0x800752 dc80: 60 91 60 05 lds r22, 0x0560 ; 0x800560 dc84: 70 91 61 05 lds r23, 0x0561 ; 0x800561 dc88: 80 91 62 05 lds r24, 0x0562 ; 0x800562 dc8c: 90 91 63 05 lds r25, 0x0563 ; 0x800563 dc90: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> dc94: 6b 8b std Y+19, r22 ; 0x13 dc96: 7c 8b std Y+20, r23 ; 0x14 dc98: 8d 8b std Y+21, r24 ; 0x15 dc9a: 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); dc9c: ad 81 ldd r26, Y+5 ; 0x05 dc9e: be 81 ldd r27, Y+6 ; 0x06 dca0: cd 01 movw r24, r26 dca2: b0 e0 ldi r27, 0x00 ; 0 dca4: a0 e0 ldi r26, 0x00 ; 0 dca6: 8f 8f std Y+31, r24 ; 0x1f dca8: 98 a3 std Y+32, r25 ; 0x20 dcaa: a9 a3 std Y+33, r26 ; 0x21 dcac: 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) { dcae: 2d 81 ldd r18, Y+5 ; 0x05 dcb0: 3e 81 ldd r19, Y+6 ; 0x06 dcb2: 22 16 cp r2, r18 dcb4: 33 06 cpc r3, r19 dcb6: 08 f0 brcs .+2 ; 0xdcba dcb8: 8c c0 rjmp .+280 ; 0xddd2 float t = float(i) / float(n_segments); dcba: b1 01 movw r22, r2 dcbc: 90 e0 ldi r25, 0x00 ; 0 dcbe: 80 e0 ldi r24, 0x00 ; 0 dcc0: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> dcc4: 6b 01 movw r12, r22 dcc6: 7c 01 movw r14, r24 dcc8: 6f 8d ldd r22, Y+31 ; 0x1f dcca: 78 a1 ldd r23, Y+32 ; 0x20 dccc: 89 a1 ldd r24, Y+33 ; 0x21 dcce: 9a a1 ldd r25, Y+34 ; 0x22 dcd0: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> dcd4: 9b 01 movw r18, r22 dcd6: ac 01 movw r20, r24 dcd8: c7 01 movw r24, r14 dcda: b6 01 movw r22, r12 dcdc: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> dce0: 6b 01 movw r12, r22 dce2: 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, dce4: ac 01 movw r20, r24 dce6: 9b 01 movw r18, r22 dce8: 6b 89 ldd r22, Y+19 ; 0x13 dcea: 7c 89 ldd r23, Y+20 ; 0x14 dcec: 8d 89 ldd r24, Y+21 ; 0x15 dcee: 9e 89 ldd r25, Y+22 ; 0x16 dcf0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> dcf4: 9b 01 movw r18, r22 dcf6: ac 01 movw r20, r24 dcf8: 60 91 4f 07 lds r22, 0x074F ; 0x80074f dcfc: 70 91 50 07 lds r23, 0x0750 ; 0x800750 dd00: 80 91 51 07 lds r24, 0x0751 ; 0x800751 dd04: 90 91 52 07 lds r25, 0x0752 ; 0x800752 dd08: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> dd0c: 69 83 std Y+1, r22 ; 0x01 dd0e: 7a 83 std Y+2, r23 ; 0x02 dd10: 8b 83 std Y+3, r24 ; 0x03 dd12: 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, dd14: a7 01 movw r20, r14 dd16: 96 01 movw r18, r12 dd18: 6f 85 ldd r22, Y+15 ; 0x0f dd1a: 78 89 ldd r23, Y+16 ; 0x10 dd1c: 89 89 ldd r24, Y+17 ; 0x11 dd1e: 9a 89 ldd r25, Y+18 ; 0x12 dd20: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__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, dd24: 20 91 4b 07 lds r18, 0x074B ; 0x80074b dd28: 30 91 4c 07 lds r19, 0x074C ; 0x80074c dd2c: 40 91 4d 07 lds r20, 0x074D ; 0x80074d dd30: 50 91 4e 07 lds r21, 0x074E ; 0x80074e dd34: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> dd38: 6f 8b std Y+23, r22 ; 0x17 dd3a: 78 8f std Y+24, r23 ; 0x18 dd3c: 89 8f std Y+25, r24 ; 0x19 dd3e: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, dd40: a7 01 movw r20, r14 dd42: 96 01 movw r18, r12 dd44: 6b 85 ldd r22, Y+11 ; 0x0b dd46: 7c 85 ldd r23, Y+12 ; 0x0c dd48: 8d 85 ldd r24, Y+13 ; 0x0d dd4a: 9e 85 ldd r25, Y+14 ; 0x0e dd4c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__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, dd50: 20 91 47 07 lds r18, 0x0747 ; 0x800747 dd54: 30 91 48 07 lds r19, 0x0748 ; 0x800748 dd58: 40 91 49 07 lds r20, 0x0749 ; 0x800749 dd5c: 50 91 4a 07 lds r21, 0x074A ; 0x80074a dd60: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> dd64: 6b 8f std Y+27, r22 ; 0x1b dd66: 7c 8f std Y+28, r23 ; 0x1c dd68: 8d 8f std Y+29, r24 ; 0x1d dd6a: 9e 8f std Y+30, r25 ; 0x1e dd6c: a7 01 movw r20, r14 dd6e: 96 01 movw r18, r12 dd70: c3 01 movw r24, r6 dd72: b2 01 movw r22, r4 dd74: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> dd78: 20 91 43 07 lds r18, 0x0743 ; 0x800743 dd7c: 30 91 44 07 lds r19, 0x0744 ; 0x800744 dd80: 40 91 45 07 lds r20, 0x0745 ; 0x800745 dd84: 50 91 46 07 lds r21, 0x0746 ; 0x800746 dd88: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> dd8c: 3f 92 push r3 dd8e: 2f 92 push r2 dd90: a3 e4 ldi r26, 0x43 ; 67 dd92: b7 e0 ldi r27, 0x07 ; 7 dd94: bf 93 push r27 dd96: af 93 push r26 dd98: 8f 80 ldd r8, Y+7 ; 0x07 dd9a: 98 84 ldd r9, Y+8 ; 0x08 dd9c: a9 84 ldd r10, Y+9 ; 0x09 dd9e: ba 84 ldd r11, Y+10 ; 0x0a dda0: de 01 movw r26, r28 dda2: 11 96 adiw r26, 0x01 ; 1 dda4: 6d 01 movw r12, r26 dda6: ef 88 ldd r14, Y+23 ; 0x17 dda8: f8 8c ldd r15, Y+24 ; 0x18 ddaa: 09 8d ldd r16, Y+25 ; 0x19 ddac: 1a 8d ldd r17, Y+26 ; 0x1a ddae: 2b 8d ldd r18, Y+27 ; 0x1b ddb0: 3c 8d ldd r19, Y+28 ; 0x1c ddb2: 4d 8d ldd r20, Y+29 ; 0x1d ddb4: 5e 8d ldd r21, Y+30 ; 0x1e ddb6: 0f 94 08 ab call 0x35610 ; 0x35610 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) ddba: 0f 90 pop r0 ddbc: 0f 90 pop r0 ddbe: 0f 90 pop r0 ddc0: 0f 90 pop r0 ddc2: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d ddc6: 81 11 cpse r24, r1 ddc8: b7 ce rjmp .-658 ; 0xdb38 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) { ddca: bf ef ldi r27, 0xFF ; 255 ddcc: 2b 1a sub r2, r27 ddce: 3b 0a sbc r3, r27 ddd0: 6e cf rjmp .-292 ; 0xdcae if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); ddd2: e0 90 5c 05 lds r14, 0x055C ; 0x80055c ddd6: f0 90 5d 05 lds r15, 0x055D ; 0x80055d ddda: 00 91 5e 05 lds r16, 0x055E ; 0x80055e ddde: 10 91 5f 05 lds r17, 0x055F ; 0x80055f dde2: 20 91 58 05 lds r18, 0x0558 ; 0x800558 dde6: 30 91 59 05 lds r19, 0x0559 ; 0x800559 ddea: 40 91 5a 05 lds r20, 0x055A ; 0x80055a ddee: 50 91 5b 05 lds r21, 0x055B ; 0x80055b ddf2: 60 91 54 05 lds r22, 0x0554 ; 0x800554 ddf6: 70 91 55 05 lds r23, 0x0555 ; 0x800555 ddfa: 80 91 56 05 lds r24, 0x0556 ; 0x800556 ddfe: 90 91 57 05 lds r25, 0x0557 ; 0x800557 de02: 1f 92 push r1 de04: 1f 92 push r1 de06: e3 e4 ldi r30, 0x43 ; 67 de08: f7 e0 ldi r31, 0x07 ; 7 de0a: ff 93 push r31 de0c: ef 93 push r30 de0e: 8f 80 ldd r8, Y+7 ; 0x07 de10: 98 84 ldd r9, Y+8 ; 0x08 de12: a9 84 ldd r10, Y+9 ; 0x09 de14: ba 84 ldd r11, Y+10 ; 0x0a de16: e0 e6 ldi r30, 0x60 ; 96 de18: ce 2e mov r12, r30 de1a: e5 e0 ldi r30, 0x05 ; 5 de1c: de 2e mov r13, r30 de1e: 0f 94 08 ab call 0x35610 ; 0x35610 de22: 0f 90 pop r0 de24: 0f 90 pop r0 de26: 0f 90 pop r0 de28: 0f 90 pop r0 de2a: 86 ce rjmp .-756 ; 0xdb38 0000de2c : /// @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) { de2c: cf 92 push r12 de2e: df 92 push r13 de30: ef 92 push r14 de32: ff 92 push r15 de34: cf 93 push r28 de36: 9b 01 movw r18, r22 de38: ac 01 movw r20, r24 float travel_z = current_position[Z_AXIS]; de3a: c0 90 4b 07 lds r12, 0x074B ; 0x80074b de3e: d0 90 4c 07 lds r13, 0x074C ; 0x80074c de42: e0 90 4d 07 lds r14, 0x074D ; 0x80074d de46: f0 90 4e 07 lds r15, 0x074E ; 0x80074e // Prepare to move Z axis current_position[Z_AXIS] += delta; de4a: c7 01 movw r24, r14 de4c: b6 01 movw r22, r12 de4e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> de52: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b de56: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c de5a: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d de5e: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e #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); de62: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) de64: 90 91 42 07 lds r25, 0x0742 ; 0x800742 de68: 91 11 cpse r25, r1 de6a: 02 c0 rjmp .+4 ; 0xde70 de6c: 84 ff sbrs r24, 4 de6e: 26 c0 rjmp .+76 ; 0xdebc { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); de70: 83 e4 ldi r24, 0x43 ; 67 de72: 97 e0 ldi r25, 0x07 ; 7 de74: 0e 94 fe 6c call 0xd9fc ; 0xd9fc plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); de78: e0 91 99 02 lds r30, 0x0299 ; 0x800299 de7c: f0 91 9a 02 lds r31, 0x029A ; 0x80029a de80: 60 85 ldd r22, Z+8 ; 0x08 de82: 71 85 ldd r23, Z+9 ; 0x09 de84: 82 85 ldd r24, Z+10 ; 0x0a de86: 93 85 ldd r25, Z+11 ; 0x0b de88: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); de8c: 0f 94 27 58 call 0x2b04e ; 0x2b04e // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; de90: a7 01 movw r20, r14 de92: 96 01 movw r18, r12 de94: 60 91 4b 07 lds r22, 0x074B ; 0x80074b de98: 70 91 4c 07 lds r23, 0x074C ; 0x80074c de9c: 80 91 4d 07 lds r24, 0x074D ; 0x80074d dea0: 90 91 4e 07 lds r25, 0x074E ; 0x80074e dea4: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> dea8: 6b 01 movw r12, r22 deaa: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } deac: c7 01 movw r24, r14 deae: b6 01 movw r22, r12 deb0: cf 91 pop r28 deb2: ff 90 pop r15 deb4: ef 90 pop r14 deb6: df 90 pop r13 deb8: cf 90 pop r12 deba: 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(); debc: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); debe: 0f 94 27 58 call 0x2b04e ; 0x2b04e // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); dec2: 81 e0 ldi r24, 0x01 ; 1 dec4: 0f 94 55 63 call 0x2c6aa ; 0x2c6aa dec8: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); deca: 84 e0 ldi r24, 0x04 ; 4 decc: 0f 94 8e 3a call 0x2751c ; 0x2751c #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); ded0: 65 e5 ldi r22, 0x55 ; 85 ded2: 75 e5 ldi r23, 0x55 ; 85 ded4: 85 e5 ldi r24, 0x55 ; 85 ded6: 91 e4 ldi r25, 0x41 ; 65 ded8: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); dedc: 0f 94 27 58 call 0x2b04e ; 0x2b04e // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; dee0: 82 e0 ldi r24, 0x02 ; 2 dee2: 0f 94 13 58 call 0x2b026 ; 0x2b026 dee6: a7 01 movw r20, r14 dee8: 96 01 movw r18, r12 deea: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> deee: 6b 01 movw r12, r22 def0: 7c 01 movw r14, r24 #ifdef TMC2130 if (endstop_z_hit_on_purpose()) def2: 0f 94 63 63 call 0x2c6c6 ; 0x2c6c6 def6: 88 23 and r24, r24 def8: 91 f0 breq .+36 ; 0xdf1e { // not necessarily exact, but will avoid further vertical moves current_position[Z_AXIS] = max_pos[Z_AXIS]; defa: 80 91 1d 02 lds r24, 0x021D ; 0x80021d defe: 90 91 1e 02 lds r25, 0x021E ; 0x80021e df02: a0 91 1f 02 lds r26, 0x021F ; 0x80021f df06: b0 91 20 02 lds r27, 0x0220 ; 0x800220 df0a: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b df0e: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c df12: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d df16: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_set_position_curposXYZE(); df1a: 0f 94 1d b9 call 0x3723a ; 0x3723a } tmc2130_home_exit(); df1e: 0f 94 5f 3a call 0x274be ; 0x274be #endif //TMC2130 enable_z_endstop(z_endstop_enabled); df22: 8c 2f mov r24, r28 df24: 0f 94 55 63 call 0x2c6aa ; 0x2c6aa df28: c1 cf rjmp .-126 ; 0xdeac 0000df2a : // // 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) { df2a: 8f 92 push r8 df2c: 9f 92 push r9 df2e: af 92 push r10 df30: bf 92 push r11 df32: cf 92 push r12 df34: df 92 push r13 df36: ef 92 push r14 df38: ff 92 push r15 df3a: 4b 01 movw r8, r22 df3c: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) df3e: c0 90 4b 07 lds r12, 0x074B ; 0x80074b df42: d0 90 4c 07 lds r13, 0x074C ; 0x80074c df46: e0 90 4d 07 lds r14, 0x074D ; 0x80074d df4a: f0 90 4e 07 lds r15, 0x074E ; 0x80074e df4e: ac 01 movw r20, r24 df50: 9b 01 movw r18, r22 df52: c7 01 movw r24, r14 df54: b6 01 movw r22, r12 df56: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> df5a: 87 ff sbrs r24, 7 df5c: 11 c0 rjmp .+34 ; 0xdf80 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); df5e: a5 01 movw r20, r10 df60: 94 01 movw r18, r8 df62: c7 01 movw r24, r14 df64: b6 01 movw r22, r12 df66: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> df6a: 9f 77 andi r25, 0x7F ; 127 } df6c: ff 90 pop r15 df6e: ef 90 pop r14 df70: df 90 pop r13 df72: cf 90 pop r12 df74: bf 90 pop r11 df76: af 90 pop r10 df78: 9f 90 pop r9 df7a: 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)); df7c: 0c 94 16 6f jmp 0xde2c ; 0xde2c } df80: ff 90 pop r15 df82: ef 90 pop r14 df84: df 90 pop r13 df86: cf 90 pop r12 df88: bf 90 pop r11 df8a: af 90 pop r10 df8c: 9f 90 pop r9 df8e: 8f 90 pop r8 df90: 08 95 ret 0000df92 : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { df92: e0 e6 ldi r30, 0x60 ; 96 df94: 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; df96: 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]; df98: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty df9a: 8f 37 cpi r24, 0x7F ; 127 df9c: 31 f0 breq .+12 ; 0xdfaa df9e: df 01 movw r26, r30 dfa0: 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 dfa2: 87 ff sbrs r24, 7 dfa4: 07 c0 rjmp .+14 ; 0xdfb4 lcd_custom_characters[i] = c & 0x7F; dfa6: 8f 77 andi r24, 0x7F ; 127 dfa8: 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++) { dfaa: 83 e0 ldi r24, 0x03 ; 3 dfac: e8 36 cpi r30, 0x68 ; 104 dfae: f8 07 cpc r31, r24 dfb0: 99 f7 brne .-26 ; 0xdf98 for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } dfb2: 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; dfb4: 9c 93 st X, r25 dfb6: f9 cf rjmp .-14 ; 0xdfaa 0000dfb8 : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) dfb8: 90 91 6d 02 lds r25, 0x026D ; 0x80026d dfbc: 98 17 cp r25, r24 dfbe: 10 f4 brcc .+4 ; 0xdfc4 lcd_draw_update = lcdDrawUpdateOverride; dfc0: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d if (!lcd_update_enabled) return; dfc4: 80 91 6e 02 lds r24, 0x026E ; 0x80026e dfc8: 88 23 and r24, r24 dfca: 39 f0 breq .+14 ; 0xdfda if (lcd_lcdupdate_func) dfcc: e0 91 0f 04 lds r30, 0x040F ; 0x80040f dfd0: f0 91 10 04 lds r31, 0x0410 ; 0x800410 dfd4: 30 97 sbiw r30, 0x00 ; 0 dfd6: 09 f0 breq .+2 ; 0xdfda lcd_lcdupdate_func(); dfd8: 19 94 eijmp } dfda: 08 95 ret 0000dfdc : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { dfdc: cf 93 push r28 dfde: df 93 push r29 dfe0: cd b7 in r28, 0x3d ; 61 dfe2: de b7 in r29, 0x3e ; 62 dfe4: ae 01 movw r20, r28 dfe6: 4a 5f subi r20, 0xFA ; 250 dfe8: 5f 4f sbci r21, 0xFF ; 255 dfea: fa 01 movw r30, r20 dfec: 61 91 ld r22, Z+ dfee: 71 91 ld r23, Z+ dff0: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); dff2: 8f ef ldi r24, 0xFF ; 255 dff4: 93 e0 ldi r25, 0x03 ; 3 dff6: 0f 94 a2 dc call 0x3b944 ; 0x3b944 va_end(args); return ret; } dffa: df 91 pop r29 dffc: cf 91 pop r28 dffe: 08 95 ret 0000e000 : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); e000: 6f ef ldi r22, 0xFF ; 255 e002: 73 e0 ldi r23, 0x03 ; 3 e004: 0d 94 f3 db jmp 0x3b7e6 ; 0x3b7e6 0000e008 : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); e008: 6f ef ldi r22, 0xFF ; 255 e00a: 73 e0 ldi r23, 0x03 ; 3 e00c: 08 2e mov r0, r24 e00e: 00 0c add r0, r0 e010: 99 0b sbc r25, r25 e012: 0d 94 c3 db jmp 0x3b786 ; 0x3b786 0000e016 : va_end(args); return ret; } void lcd_space(uint8_t n) { e016: cf 93 push r28 e018: c8 2f mov r28, r24 while (n--) lcd_putc(' '); e01a: c1 50 subi r28, 0x01 ; 1 e01c: 20 f0 brcs .+8 ; 0xe026 e01e: 80 e2 ldi r24, 0x20 ; 32 e020: 0e 94 04 70 call 0xe008 ; 0xe008 e024: fa cf rjmp .-12 ; 0xe01a } e026: cf 91 pop r28 e028: 08 95 ret 0000e02a : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { e02a: cf 93 push r28 e02c: c8 2f mov r28, r24 e02e: 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); e030: 64 30 cpi r22, 0x04 ; 4 e032: 08 f0 brcs .+2 ; 0xe036 e034: 83 e0 ldi r24, 0x03 ; 3 e036: 80 93 5f 03 sts 0x035F, r24 ; 0x80035f } 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); e03a: 0e 94 2f 5c call 0xb85e ; 0xb85e e03e: 8c 0f add r24, r28 lcd_ddram_address = addr; e040: 80 93 5e 03 sts 0x035E, r24 ; 0x80035e delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e044: 44 e6 ldi r20, 0x64 ; 100 e046: 50 e0 ldi r21, 0x00 ; 0 e048: 60 e0 ldi r22, 0x00 ; 0 e04a: 80 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); } e04c: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e04e: 0c 94 3c 65 jmp 0xca78 ; 0xca78 0000e052 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { e052: cf 93 push r28 e054: df 93 push r29 e056: ea 01 movw r28, r20 lcd_set_cursor(c, r); e058: 0e 94 15 70 call 0xe02a ; 0xe02a return fputs_P(str, lcdout); e05c: 6f ef ldi r22, 0xFF ; 255 e05e: 73 e0 ldi r23, 0x03 ; 3 e060: ce 01 movw r24, r28 } e062: df 91 pop r29 e064: 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); e066: 0d 94 f3 db jmp 0x3b7e6 ; 0x3b7e6 0000e06a : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { e06a: cf 93 push r28 e06c: c4 2f mov r28, r20 lcd_set_cursor(c, r); e06e: 0e 94 15 70 call 0xe02a ; 0xe02a return fputc(ch, lcdout); e072: 6f ef ldi r22, 0xFF ; 255 e074: 73 e0 ldi r23, 0x03 ; 3 e076: 8c 2f mov r24, r28 e078: cc 0f add r28, r28 e07a: 99 0b sbc r25, r25 } e07c: 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); e07e: 0d 94 c3 db jmp 0x3b786 ; 0x3b786 0000e082 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); e082: 60 e0 ldi r22, 0x00 ; 0 e084: 80 e0 ldi r24, 0x00 ; 0 e086: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_ddram_address = 0; e08a: 10 92 5e 03 sts 0x035E, r1 ; 0x80035e } e08e: 08 95 ret 0000e090 : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e090: 40 e4 ldi r20, 0x40 ; 64 e092: 56 e0 ldi r21, 0x06 ; 6 e094: 60 e0 ldi r22, 0x00 ; 0 e096: 81 e0 ldi r24, 0x01 ; 1 e098: 0e 94 3c 65 call 0xca78 ; 0xca78 // 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; e09c: 10 92 5f 03 sts 0x035F, r1 ; 0x80035f lcd_ddram_address = 0; e0a0: 10 92 5e 03 sts 0x035E, r1 ; 0x80035e 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)); e0a4: 48 e0 ldi r20, 0x08 ; 8 e0a6: 50 e0 ldi r21, 0x00 ; 0 e0a8: 6f e7 ldi r22, 0x7F ; 127 e0aa: 70 e0 ldi r23, 0x00 ; 0 e0ac: 80 e6 ldi r24, 0x60 ; 96 e0ae: 93 e0 ldi r25, 0x03 ; 3 e0b0: 0d 94 8d e3 jmp 0x3c71a ; 0x3c71a 0000e0b4 : } 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) e0b4: 90 91 6e 02 lds r25, 0x026E ; 0x80026e e0b8: 98 17 cp r25, r24 e0ba: 09 f1 breq .+66 ; 0xe0fe { lcd_update_enabled = enabled; e0bc: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e if (enabled) e0c0: 88 23 and r24, r24 e0c2: e9 f0 breq .+58 ; 0xe0fe { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; e0c4: 10 92 38 05 sts 0x0538, r1 ; 0x800538 e0c8: 10 92 37 05 sts 0x0537, r1 ; 0x800537 lcd_encoder_diff = 0; e0cc: 10 92 d2 05 sts 0x05D2, r1 ; 0x8005d2 <_ZL16lcd_encoder_diff.lto_priv.558> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); e0d0: 88 ed ldi r24, 0xD8 ; 216 e0d2: 93 e0 ldi r25, 0x03 ; 3 e0d4: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; e0d8: 0f 94 86 3e call 0x27d0c ; 0x27d0c e0dc: 61 50 subi r22, 0x01 ; 1 e0de: 71 09 sbc r23, r1 e0e0: 81 09 sbc r24, r1 e0e2: 91 09 sbc r25, r1 e0e4: 60 93 d4 03 sts 0x03D4, r22 ; 0x8003d4 e0e8: 70 93 d5 03 sts 0x03D5, r23 ; 0x8003d5 e0ec: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 e0f0: 90 93 d7 03 sts 0x03D7, r25 ; 0x8003d7 // Full update. lcd_clear(); e0f4: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_update(2); e0f8: 82 e0 ldi r24, 0x02 ; 2 e0fa: 0c 94 dc 6f jmp 0xdfb8 ; 0xdfb8 } else { // Clear the LCD always, or let it to the caller? } } } e0fe: 08 95 ret 0000e100 : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { e100: cf 93 push r28 e102: c8 2f mov r28, r24 lcd_currline = 0; e104: 10 92 5f 03 sts 0x035F, r1 ; 0x80035f lcd_ddram_address = 0; e108: 10 92 5e 03 sts 0x035E, r1 ; 0x80035e 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)); e10c: 48 e0 ldi r20, 0x08 ; 8 e10e: 50 e0 ldi r21, 0x00 ; 0 e110: 6f e7 ldi r22, 0x7F ; 127 e112: 70 e0 ldi r23, 0x00 ; 0 e114: 80 e6 ldi r24, 0x60 ; 96 e116: 93 e0 ldi r25, 0x03 ; 3 e118: 0f 94 8d e3 call 0x3c71a ; 0x3c71a 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 e11c: 44 e9 ldi r20, 0x94 ; 148 e11e: 51 e1 ldi r21, 0x11 ; 17 e120: 62 e0 ldi r22, 0x02 ; 2 e122: 80 e3 ldi r24, 0x30 ; 48 e124: 0e 94 3c 65 call 0xca78 ; 0xca78 // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e128: 46 e9 ldi r20, 0x96 ; 150 e12a: 50 e0 ldi r21, 0x00 ; 0 e12c: 62 e0 ldi r22, 0x02 ; 2 e12e: 80 e3 ldi r24, 0x30 ; 48 e130: 0e 94 3c 65 call 0xca78 ; 0xca78 // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e134: 46 e9 ldi r20, 0x96 ; 150 e136: 50 e0 ldi r21, 0x00 ; 0 e138: 62 e0 ldi r22, 0x02 ; 2 e13a: 80 e3 ldi r24, 0x30 ; 48 e13c: 0e 94 3c 65 call 0xca78 ; 0xca78 #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); e140: 46 e9 ldi r20, 0x96 ; 150 e142: 50 e0 ldi r21, 0x00 ; 0 e144: 62 e0 ldi r22, 0x02 ; 2 e146: 80 e2 ldi r24, 0x20 ; 32 e148: 0e 94 3c 65 call 0xca78 ; 0xca78 #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); e14c: 80 91 0d 04 lds r24, 0x040D ; 0x80040d <_ZL19lcd_displayfunction.lto_priv.568> delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e150: 44 e6 ldi r20, 0x64 ; 100 e152: 50 e0 ldi r21, 0x00 ; 0 e154: 60 e0 ldi r22, 0x00 ; 0 e156: 80 62 ori r24, 0x20 ; 32 e158: 0e 94 3c 65 call 0xca78 ; 0xca78 } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; e15c: 84 e0 ldi r24, 0x04 ; 4 e15e: 80 93 5d 03 sts 0x035D, r24 ; 0x80035d delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e162: 44 e6 ldi r20, 0x64 ; 100 e164: 50 e0 ldi r21, 0x00 ; 0 e166: 60 e0 ldi r22, 0x00 ; 0 e168: 8c e0 ldi r24, 0x0C ; 12 e16a: 0e 94 3c 65 call 0xca78 ; 0xca78 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(); e16e: c1 11 cpse r28, r1 e170: 0e 94 48 70 call 0xe090 ; 0xe090 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e174: 44 e6 ldi r20, 0x64 ; 100 e176: 50 e0 ldi r21, 0x00 ; 0 e178: 60 e0 ldi r22, 0x00 ; 0 e17a: 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); } e17c: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e17e: 0c 94 3c 65 jmp 0xca78 ; 0xca78 0000e182 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); e182: 81 e0 ldi r24, 0x01 ; 1 e184: 0c 94 80 70 jmp 0xe100 ; 0xe100 0000e188 : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { e188: cf 92 push r12 e18a: df 92 push r13 e18c: ff 92 push r15 e18e: 0f 93 push r16 e190: 1f 93 push r17 e192: cf 93 push r28 e194: df 93 push r29 e196: 00 d0 rcall .+0 ; 0xe198 e198: 00 d0 rcall .+0 ; 0xe19a e19a: 1f 92 push r1 e19c: 1f 92 push r1 e19e: cd b7 in r28, 0x3d ; 61 e1a0: de b7 in r29, 0x3e ; 62 if (value == '\n') { e1a2: 8a 30 cpi r24, 0x0A ; 10 e1a4: d9 f4 brne .+54 ; 0xe1dc if (lcd_currline > 3) lcd_currline = -1; e1a6: 80 91 5f 03 lds r24, 0x035F ; 0x80035f e1aa: 84 30 cpi r24, 0x04 ; 4 e1ac: 18 f0 brcs .+6 ; 0xe1b4 e1ae: 8f ef ldi r24, 0xFF ; 255 e1b0: 80 93 5f 03 sts 0x035F, r24 ; 0x80035f lcd_set_cursor(0, lcd_currline + 1); // LF e1b4: 60 91 5f 03 lds r22, 0x035F ; 0x80035f e1b8: 6f 5f subi r22, 0xFF ; 255 e1ba: 80 e0 ldi r24, 0x00 ; 0 e1bc: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } e1c0: 28 96 adiw r28, 0x08 ; 8 e1c2: 0f b6 in r0, 0x3f ; 63 e1c4: f8 94 cli e1c6: de bf out 0x3e, r29 ; 62 e1c8: 0f be out 0x3f, r0 ; 63 e1ca: cd bf out 0x3d, r28 ; 61 e1cc: df 91 pop r29 e1ce: cf 91 pop r28 e1d0: 1f 91 pop r17 e1d2: 0f 91 pop r16 e1d4: ff 90 pop r15 e1d6: df 90 pop r13 e1d8: cf 90 pop r12 e1da: 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))) { e1dc: 90 e8 ldi r25, 0x80 ; 128 e1de: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); e1e0: 44 e6 ldi r20, 0x64 ; 100 e1e2: 50 e0 ldi r21, 0x00 ; 0 e1e4: 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))) { e1e6: 9a 34 cpi r25, 0x4A ; 74 e1e8: 08 f5 brcc .+66 ; 0xe22c // 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. e1ea: 48 2f mov r20, r24 e1ec: 40 58 subi r20, 0x80 ; 128 e1ee: 55 0b sbc r21, r21 e1f0: 9a 01 movw r18, r20 e1f2: 96 e0 ldi r25, 0x06 ; 6 e1f4: 92 9f mul r25, r18 e1f6: a0 01 movw r20, r0 e1f8: 93 9f mul r25, r19 e1fa: 50 0d add r21, r0 e1fc: 11 24 eor r1, r1 e1fe: fa 01 movw r30, r20 e200: ed 5f subi r30, 0xFD ; 253 e202: f4 48 sbci r31, 0x84 ; 132 e204: f4 90 lpm r15, Z e206: e0 e6 ldi r30, 0x60 ; 96 e208: f3 e0 ldi r31, 0x03 ; 3 e20a: 30 e0 ldi r19, 0x00 ; 0 e20c: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; e20e: 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)) { e210: 61 91 ld r22, Z+ e212: 78 2f mov r23, r24 e214: 76 27 eor r23, r22 e216: 7f 77 andi r23, 0x7F ; 127 e218: 89 f4 brne .+34 ; 0xe23c lcd_custom_characters[i] = c; // mark the custom character as used e21a: f9 01 movw r30, r18 e21c: e0 5a subi r30, 0xA0 ; 160 e21e: fc 4f sbci r31, 0xFC ; 252 e220: 80 83 st Z, r24 e222: 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); e224: 44 e6 ldi r20, 0x64 ; 100 e226: 50 e0 ldi r21, 0x00 ; 0 e228: 61 e0 ldi r22, 0x01 ; 1 e22a: 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); e22c: 0e 94 3c 65 call 0xca78 ; 0xca78 lcd_ddram_address++; // no need for preventing ddram overflow e230: 80 91 5e 03 lds r24, 0x035E ; 0x80035e e234: 8f 5f subi r24, 0xFF ; 255 e236: 80 93 5e 03 sts 0x035E, r24 ; 0x80035e e23a: c2 cf rjmp .-124 ; 0xe1c0 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 e23c: 6f 37 cpi r22, 0x7F ; 127 e23e: 09 f0 breq .+2 ; 0xe242 e240: 3c c0 rjmp .+120 ; 0xe2ba lcd_custom_characters[i] = c; // mark the custom character as used e242: f9 01 movw r30, r18 e244: e0 5a subi r30, 0xA0 ; 160 e246: fc 4f sbci r31, 0xFC ; 252 e248: 80 83 st Z, r24 slotToUse = i; e24a: 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; e24c: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); e24e: fa 01 movw r30, r20 e250: e2 50 subi r30, 0x02 ; 2 e252: f5 48 sbci r31, 0x85 ; 133 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); e254: 8e 01 movw r16, r28 e256: 0f 5f subi r16, 0xFF ; 255 e258: 1f 4f sbci r17, 0xFF ; 255 e25a: d8 01 movw r26, r16 e25c: 95 91 lpm r25, Z+ e25e: 88 e0 ldi r24, 0x08 ; 8 e260: 18 2e mov r1, r24 0000e262 : e262: 10 fe sbrs r1, 0 e264: 05 90 lpm r0, Z+ e266: 02 94 swap r0 e268: 80 2d mov r24, r0 e26a: 97 95 ror r25 e26c: 88 1f adc r24, r24 e26e: 8d 93 st X+, r24 e270: 1a 94 dec r1 e272: b9 f7 brne .-18 ; 0xe262 lcd_command(LCD_SETCGRAMADDR | (location << 3)); e274: bf 2d mov r27, r15 e276: e8 e0 ldi r30, 0x08 ; 8 e278: be 02 muls r27, r30 e27a: c0 01 movw r24, r0 e27c: 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); e27e: 44 e6 ldi r20, 0x64 ; 100 e280: 50 e0 ldi r21, 0x00 ; 0 e282: 60 e0 ldi r22, 0x00 ; 0 e284: 80 64 ori r24, 0x40 ; 64 e286: 0e 94 3c 65 call 0xca78 ; 0xca78 e28a: 6e 01 movw r12, r28 e28c: f9 e0 ldi r31, 0x09 ; 9 e28e: cf 0e add r12, r31 e290: 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); e292: 44 e6 ldi r20, 0x64 ; 100 e294: 50 e0 ldi r21, 0x00 ; 0 e296: 61 e0 ldi r22, 0x01 ; 1 e298: d8 01 movw r26, r16 e29a: 8d 91 ld r24, X+ e29c: 8d 01 movw r16, r26 e29e: 0e 94 3c 65 call 0xca78 ; 0xca78 : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { e2a2: c0 16 cp r12, r16 e2a4: d1 06 cpc r13, r17 e2a6: a9 f7 brne .-22 ; 0xe292 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address e2a8: 80 91 5e 03 lds r24, 0x035E ; 0x80035e delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e2ac: 44 e6 ldi r20, 0x64 ; 100 e2ae: 50 e0 ldi r21, 0x00 ; 0 e2b0: 60 e0 ldi r22, 0x00 ; 0 e2b2: 80 68 ori r24, 0x80 ; 128 e2b4: 0e 94 3c 65 call 0xca78 ; 0xca78 e2b8: b5 cf rjmp .-150 ; 0xe224 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 e2ba: 67 ff sbrs r22, 7 slotToUse = i; e2bc: 92 2f mov r25, r18 e2be: 2f 5f subi r18, 0xFF ; 255 e2c0: 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++) { e2c2: 28 30 cpi r18, 0x08 ; 8 e2c4: 31 05 cpc r19, r1 e2c6: 09 f0 breq .+2 ; 0xe2ca e2c8: a3 cf rjmp .-186 ; 0xe210 } // 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) { e2ca: 9f 3f cpi r25, 0xFF ; 255 e2cc: 09 f0 breq .+2 ; 0xe2d0 e2ce: be cf rjmp .-132 ; 0xe24c e2d0: a9 cf rjmp .-174 ; 0xe224 0000e2d2 : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { e2d2: 8f 92 push r8 e2d4: 9f 92 push r9 e2d6: af 92 push r10 e2d8: bf 92 push r11 e2da: ef 92 push r14 e2dc: ff 92 push r15 e2de: 0f 93 push r16 e2e0: 1f 93 push r17 e2e2: cf 93 push r28 e2e4: df 93 push r29 e2e6: cd b7 in r28, 0x3d ; 61 e2e8: de b7 in r29, 0x3e ; 62 e2ea: a0 97 sbiw r28, 0x20 ; 32 e2ec: 0f b6 in r0, 0x3f ; 63 e2ee: f8 94 cli e2f0: de bf out 0x3e, r29 ; 62 e2f2: 0f be out 0x3f, r0 ; 63 e2f4: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) e2f6: 61 15 cp r22, r1 e2f8: 71 05 cpc r23, r1 e2fa: 81 05 cpc r24, r1 e2fc: 91 05 cpc r25, r1 e2fe: 99 f4 brne .+38 ; 0xe326 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e300: 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)); } e302: a0 96 adiw r28, 0x20 ; 32 e304: 0f b6 in r0, 0x3f ; 63 e306: f8 94 cli e308: de bf out 0x3e, r29 ; 62 e30a: 0f be out 0x3f, r0 ; 63 e30c: cd bf out 0x3d, r28 ; 61 e30e: df 91 pop r29 e310: cf 91 pop r28 e312: 1f 91 pop r17 e314: 0f 91 pop r16 e316: ff 90 pop r15 e318: ef 90 pop r14 e31a: bf 90 pop r11 e31c: af 90 pop r10 e31e: 9f 90 pop r9 e320: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e322: 0c 94 c4 70 jmp 0xe188 ; 0xe188 } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; e326: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e328: 84 2e mov r8, r20 e32a: 91 2c mov r9, r1 e32c: b1 2c mov r11, r1 e32e: a1 2c mov r10, r1 e330: 9e 01 movw r18, r28 e332: 2f 5f subi r18, 0xFF ; 255 e334: 3f 4f sbci r19, 0xFF ; 255 e336: 79 01 movw r14, r18 e338: a5 01 movw r20, r10 e33a: 94 01 movw r18, r8 e33c: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> e340: f7 01 movw r30, r14 e342: e0 0f add r30, r16 e344: f1 1d adc r31, r1 e346: 60 83 st Z, r22 n /= base; e348: b9 01 movw r22, r18 e34a: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e34c: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) e34e: 61 15 cp r22, r1 e350: 71 05 cpc r23, r1 e352: 81 05 cpc r24, r1 e354: 91 05 cpc r25, r1 e356: 81 f7 brne .-32 ; 0xe338 e358: 0e 0d add r16, r14 e35a: 1f 2d mov r17, r15 e35c: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) e35e: e0 16 cp r14, r16 e360: f1 06 cpc r15, r17 e362: 59 f0 breq .+22 ; 0xe37a lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); e364: f8 01 movw r30, r16 e366: 82 91 ld r24, -Z e368: 8f 01 movw r16, r30 e36a: 8a 30 cpi r24, 0x0A ; 10 e36c: 20 f4 brcc .+8 ; 0xe376 e36e: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e370: 0e 94 c4 70 call 0xe188 ; 0xe188 e374: f4 cf rjmp .-24 ; 0xe35e { 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)); e376: 89 5c subi r24, 0xC9 ; 201 e378: fb cf rjmp .-10 ; 0xe370 } e37a: a0 96 adiw r28, 0x20 ; 32 e37c: 0f b6 in r0, 0x3f ; 63 e37e: f8 94 cli e380: de bf out 0x3e, r29 ; 62 e382: 0f be out 0x3f, r0 ; 63 e384: cd bf out 0x3d, r28 ; 61 e386: df 91 pop r29 e388: cf 91 pop r28 e38a: 1f 91 pop r17 e38c: 0f 91 pop r16 e38e: ff 90 pop r15 e390: ef 90 pop r14 e392: bf 90 pop r11 e394: af 90 pop r10 e396: 9f 90 pop r9 e398: 8f 90 pop r8 e39a: 08 95 ret 0000e39c : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) e39c: cf 92 push r12 e39e: df 92 push r13 e3a0: ef 92 push r14 e3a2: ff 92 push r15 e3a4: 6b 01 movw r12, r22 e3a6: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) e3a8: f7 fe sbrs r15, 7 e3aa: 0b c0 rjmp .+22 ; 0xe3c2 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e3ac: 8d e2 ldi r24, 0x2D ; 45 e3ae: 0e 94 c4 70 call 0xe188 ; 0xe188 else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; e3b2: f0 94 com r15 e3b4: e0 94 com r14 e3b6: d0 94 com r13 e3b8: c0 94 com r12 e3ba: c1 1c adc r12, r1 e3bc: d1 1c adc r13, r1 e3be: e1 1c adc r14, r1 e3c0: f1 1c adc r15, r1 } lcd_printNumber(n, 10); e3c2: 4a e0 ldi r20, 0x0A ; 10 e3c4: c7 01 movw r24, r14 e3c6: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } e3c8: ff 90 pop r15 e3ca: ef 90 pop r14 e3cc: df 90 pop r13 e3ce: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); e3d0: 0c 94 69 71 jmp 0xe2d2 ; 0xe2d2 0000e3d4 : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { e3d4: 0f 93 push r16 e3d6: 1f 93 push r17 e3d8: cf 93 push r28 e3da: 8c 01 movw r16, r24 e3dc: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { e3de: cc 23 and r28, r28 e3e0: 59 f0 breq .+22 ; 0xe3f8 e3e2: f8 01 movw r30, r16 e3e4: 24 91 lpm r18, Z e3e6: 22 23 and r18, r18 e3e8: 39 f0 breq .+14 ; 0xe3f8 lcd_write(pgm_read_byte(s++)); e3ea: 0f 5f subi r16, 0xFF ; 255 e3ec: 1f 4f sbci r17, 0xFF ; 255 e3ee: 84 91 lpm r24, Z e3f0: 0e 94 c4 70 call 0xe188 ; 0xe188 --len; e3f4: c1 50 subi r28, 0x01 ; 1 e3f6: f3 cf rjmp .-26 ; 0xe3de } lcd_space(len); e3f8: 8c 2f mov r24, r28 e3fa: 0e 94 0b 70 call 0xe016 ; 0xe016 return len; } e3fe: 8c 2f mov r24, r28 e400: cf 91 pop r28 e402: 1f 91 pop r17 e404: 0f 91 pop r16 e406: 08 95 ret 0000e408 : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { e408: 0f 93 push r16 e40a: 1f 93 push r17 e40c: cf 93 push r28 e40e: 8c 01 movw r16, r24 e410: c6 2f mov r28, r22 while (len && *s) { e412: cc 23 and r28, r28 e414: 49 f0 breq .+18 ; 0xe428 e416: f8 01 movw r30, r16 e418: 81 91 ld r24, Z+ e41a: 8f 01 movw r16, r30 e41c: 88 23 and r24, r24 e41e: 21 f0 breq .+8 ; 0xe428 lcd_write(*(s++)); e420: 0e 94 c4 70 call 0xe188 ; 0xe188 --len; e424: c1 50 subi r28, 0x01 ; 1 e426: f5 cf rjmp .-22 ; 0xe412 } lcd_space(len); e428: 8c 2f mov r24, r28 e42a: 0e 94 0b 70 call 0xe016 ; 0xe016 return len; } e42e: 8c 2f mov r24, r28 e430: cf 91 pop r28 e432: 1f 91 pop r17 e434: 0f 91 pop r16 e436: 08 95 ret 0000e438 : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { e438: cf 93 push r28 e43a: df 93 push r29 e43c: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); e43e: 89 91 ld r24, Y+ e440: 88 23 and r24, r24 e442: 19 f0 breq .+6 ; 0xe44a e444: 0e 94 c4 70 call 0xe188 ; 0xe188 e448: fa cf rjmp .-12 ; 0xe43e } e44a: df 91 pop r29 e44c: cf 91 pop r28 e44e: 08 95 ret 0000e450 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); e450: 0e 94 c4 70 call 0xe188 ; 0xe188 return 0; } e454: 90 e0 ldi r25, 0x00 ; 0 e456: 80 e0 ldi r24, 0x00 ; 0 e458: 08 95 ret 0000e45a : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; e45a: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 lcd_longpress_trigger = 0; e45e: 10 92 d5 05 sts 0x05D5, r1 ; 0x8005d5 } e462: 08 95 ret 0000e464 : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { e464: cf 93 push r28 bool clicked = LCD_CLICKED; e466: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 e46a: c1 e0 ldi r28, 0x01 ; 1 e46c: 81 11 cpse r24, r1 e46e: 04 c0 rjmp .+8 ; 0xe478 e470: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } e472: 8c 2f mov r24, r28 e474: cf 91 pop r28 e476: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); e478: 0e 94 2d 72 call 0xe45a ; 0xe45a e47c: fa cf rjmp .-12 ; 0xe472 0000e47e : 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 e47e: e0 e0 ldi r30, 0x00 ; 0 e480: f1 e0 ldi r31, 0x01 ; 1 e482: 85 91 lpm r24, Z+ e484: 95 91 lpm r25, Z+ e486: a5 91 lpm r26, Z+ e488: b4 91 lpm r27, Z e48a: 85 3a cpi r24, 0xA5 ; 165 e48c: 9a 45 sbci r25, 0x5A ; 90 e48e: a4 4b sbci r26, 0xB4 ; 180 e490: bb 44 sbci r27, 0x4B ; 75 e492: 29 f4 brne .+10 ; 0xe49e return pgm_read_word(((uint32_t*)(ui + 10))); //return lang code from progmem e494: ea e0 ldi r30, 0x0A ; 10 e496: f1 e0 ldi r31, 0x01 ; 1 e498: 85 91 lpm r24, Z+ e49a: 94 91 lpm r25, Z e49c: 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 e49e: 8f e3 ldi r24, 0x3F ; 63 e4a0: 9f e3 ldi r25, 0x3F ; 63 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e4a2: 08 95 ret 0000e4a4 : 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); e4a4: 8e ef ldi r24, 0xFE ; 254 e4a6: 9f e0 ldi r25, 0x0F ; 15 e4a8: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); e4ac: 8e 3f cpi r24, 0xFE ; 254 e4ae: 39 f0 breq .+14 ; 0xe4be e4b0: 91 e0 ldi r25, 0x01 ; 1 e4b2: 20 91 5c 03 lds r18, 0x035C ; 0x80035c e4b6: 28 13 cpse r18, r24 e4b8: 90 e0 ldi r25, 0x00 ; 0 e4ba: 89 2f mov r24, r25 e4bc: 08 95 ret e4be: 80 e0 ldi r24, 0x00 ; 0 } e4c0: 08 95 ret 0000e4c2 : return _n("??"); } void lang_reset(void) { lang_selected = 0; e4c2: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); e4c6: 6e ef ldi r22, 0xFE ; 254 e4c8: 8e ef ldi r24, 0xFE ; 254 e4ca: 9f e0 ldi r25, 0x0F ; 15 e4cc: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0000e4d0 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e4d0: 85 37 cpi r24, 0x75 ; 117 e4d2: 28 e6 ldi r18, 0x68 ; 104 e4d4: 92 07 cpc r25, r18 e4d6: 09 f4 brne .+2 ; 0xe4da e4d8: 59 c0 rjmp .+178 ; 0xe58c e4da: f8 f4 brcc .+62 ; 0xe51a e4dc: 8e 36 cpi r24, 0x6E ; 110 e4de: 25 e6 ldi r18, 0x65 ; 101 e4e0: 92 07 cpc r25, r18 e4e2: 09 f4 brne .+2 ; 0xe4e6 e4e4: 59 c0 rjmp .+178 ; 0xe598 e4e6: 50 f4 brcc .+20 ; 0xe4fc e4e8: 83 37 cpi r24, 0x73 ; 115 e4ea: 23 e6 ldi r18, 0x63 ; 99 e4ec: 92 07 cpc r25, r18 e4ee: b1 f1 breq .+108 ; 0xe55c e4f0: 85 36 cpi r24, 0x65 ; 101 e4f2: 94 46 sbci r25, 0x64 ; 100 e4f4: b1 f1 breq .+108 ; 0xe562 //#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("??"); e4f6: 82 e0 ldi r24, 0x02 ; 2 e4f8: 97 e6 ldi r25, 0x67 ; 103 e4fa: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e4fc: 82 37 cpi r24, 0x72 ; 114 e4fe: 26 e6 ldi r18, 0x66 ; 102 e500: 92 07 cpc r25, r18 e502: 91 f1 breq .+100 ; 0xe568 e504: 82 37 cpi r24, 0x72 ; 114 e506: 28 e6 ldi r18, 0x68 ; 104 e508: 92 07 cpc r25, r18 e50a: 09 f4 brne .+2 ; 0xe50e e50c: 42 c0 rjmp .+132 ; 0xe592 e50e: 83 37 cpi r24, 0x73 ; 115 e510: 95 46 sbci r25, 0x65 ; 101 e512: 89 f7 brne .-30 ; 0xe4f6 { 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"); e514: 89 e5 ldi r24, 0x59 ; 89 e516: 97 e6 ldi r25, 0x67 ; 103 e518: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e51a: 8c 36 cpi r24, 0x6C ; 108 e51c: 20 e7 ldi r18, 0x70 ; 112 e51e: 92 07 cpc r25, r18 e520: 31 f1 breq .+76 ; 0xe56e e522: 70 f4 brcc .+28 ; 0xe540 e524: 8c 36 cpi r24, 0x6C ; 108 e526: 2e e6 ldi r18, 0x6E ; 110 e528: 92 07 cpc r25, r18 e52a: 21 f1 breq .+72 ; 0xe574 e52c: 8f 36 cpi r24, 0x6F ; 111 e52e: 2e e6 ldi r18, 0x6E ; 110 e530: 92 07 cpc r25, r18 e532: 31 f1 breq .+76 ; 0xe580 e534: 84 37 cpi r24, 0x74 ; 116 e536: 99 46 sbci r25, 0x69 ; 105 e538: f1 f6 brne .-68 ; 0xe4f6 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"); e53a: 87 e4 ldi r24, 0x47 ; 71 e53c: 97 e6 ldi r25, 0x67 ; 103 e53e: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e540: 8b 36 cpi r24, 0x6B ; 107 e542: 23 e7 ldi r18, 0x73 ; 115 e544: 92 07 cpc r25, r18 e546: f9 f0 breq .+62 ; 0xe586 e548: 86 37 cpi r24, 0x76 ; 118 e54a: 23 e7 ldi r18, 0x73 ; 115 e54c: 92 07 cpc r25, r18 e54e: a9 f0 breq .+42 ; 0xe57a e550: 8f 36 cpi r24, 0x6F ; 111 e552: 92 47 sbci r25, 0x72 ; 114 e554: 81 f6 brne .-96 ; 0xe4f6 #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 e556: 85 e0 ldi r24, 0x05 ; 5 e558: 97 e6 ldi r25, 0x67 ; 103 e55a: 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"); e55c: 89 e6 ldi r24, 0x69 ; 105 e55e: 97 e6 ldi r25, 0x67 ; 103 e560: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); e562: 81 e6 ldi r24, 0x61 ; 97 e564: 97 e6 ldi r25, 0x67 ; 103 e566: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); e568: 80 e5 ldi r24, 0x50 ; 80 e56a: 97 e6 ldi r25, 0x67 ; 103 e56c: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); e56e: 80 e4 ldi r24, 0x40 ; 64 e570: 97 e6 ldi r25, 0x67 ; 103 e572: 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 e574: 85 e3 ldi r24, 0x35 ; 53 e576: 97 e6 ldi r25, 0x67 ; 103 e578: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution e57a: 8d e2 ldi r24, 0x2D ; 45 e57c: 97 e6 ldi r25, 0x67 ; 103 e57e: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution e580: 87 e2 ldi r24, 0x27 ; 39 e582: 97 e6 ldi r25, 0x67 ; 103 e584: 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 e586: 8c e1 ldi r24, 0x1C ; 28 e588: 97 e6 ldi r25, 0x67 ; 103 e58a: 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 e58c: 85 e1 ldi r24, 0x15 ; 21 e58e: 97 e6 ldi r25, 0x67 ; 103 e590: 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 e592: 8c e0 ldi r24, 0x0C ; 12 e594: 97 e6 ldi r25, 0x67 ; 103 e596: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); e598: 81 e7 ldi r24, 0x71 ; 113 e59a: 97 e6 ldi r25, 0x67 ; 103 // case LANG_CODE_QR: return _n("New language"); //community contribution //#endif // COMMUNITY_LANG_GROUP1_QR #endif // COMMUNITY_LANGUAGE_SUPPORT } return _n("??"); } e59c: 08 95 ret 0000e59e : #endif //XFLASH return 0; } uint16_t lang_get_code(uint8_t lang) { e59e: cf 92 push r12 e5a0: df 92 push r13 e5a2: ef 92 push r14 e5a4: ff 92 push r15 e5a6: 1f 93 push r17 e5a8: cf 93 push r28 e5aa: df 93 push r29 e5ac: cd b7 in r28, 0x3d ; 61 e5ae: de b7 in r29, 0x3e ; 62 e5b0: 60 97 sbiw r28, 0x10 ; 16 e5b2: 0f b6 in r0, 0x3f ; 63 e5b4: f8 94 cli e5b6: de bf out 0x3e, r29 ; 62 e5b8: 0f be out 0x3f, r0 ; 63 e5ba: cd bf out 0x3d, r28 ; 61 if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e5bc: 88 23 and r24, r24 e5be: c1 f1 breq .+112 ; 0xe630 e5c0: 18 2f mov r17, r24 #ifdef XFLASH if (lang == LANG_ID_SEC) e5c2: 81 30 cpi r24, 0x01 ; 1 e5c4: 81 f4 brne .+32 ; 0xe5e6 e5c6: 0e 94 3f 72 call 0xe47e ; 0xe47e table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e5ca: 60 96 adiw r28, 0x10 ; 16 e5cc: 0f b6 in r0, 0x3f ; 63 e5ce: f8 94 cli e5d0: de bf out 0x3e, r29 ; 62 e5d2: 0f be out 0x3f, r0 ; 63 e5d4: cd bf out 0x3d, r28 ; 61 e5d6: df 91 pop r29 e5d8: cf 91 pop r28 e5da: 1f 91 pop r17 e5dc: ff 90 pop r15 e5de: ef 90 pop r14 e5e0: df 90 pop r13 e5e2: cf 90 pop r12 e5e4: 08 95 ret SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e5e6: 8c e5 ldi r24, 0x5C ; 92 e5e8: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e5ea: 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--; e5ec: 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; e5ee: c1 2c mov r12, r1 e5f0: d1 2c mov r13, r1 e5f2: 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 e5f4: 20 e1 ldi r18, 0x10 ; 16 e5f6: 30 e0 ldi r19, 0x00 ; 0 e5f8: ae 01 movw r20, r28 e5fa: 4f 5f subi r20, 0xFF ; 255 e5fc: 5f 4f sbci r21, 0xFF ; 255 e5fe: c7 01 movw r24, r14 e600: b6 01 movw r22, r12 e602: 0e 94 89 e2 call 0x1c512 ; 0x1c512 if (header.magic != LANG_MAGIC) break; //break if not valid e606: 89 81 ldd r24, Y+1 ; 0x01 e608: 9a 81 ldd r25, Y+2 ; 0x02 e60a: ab 81 ldd r26, Y+3 ; 0x03 e60c: bc 81 ldd r27, Y+4 ; 0x04 e60e: 85 3a cpi r24, 0xA5 ; 165 e610: 9a 45 sbci r25, 0x5A ; 90 e612: a4 4b sbci r26, 0xB4 ; 180 e614: bb 44 sbci r27, 0x4B ; 75 e616: 79 f4 brne .+30 ; 0xe636 if (--lang == 0) return header.code; e618: 11 50 subi r17, 0x01 ; 1 e61a: 19 f4 brne .+6 ; 0xe622 e61c: 8b 85 ldd r24, Y+11 ; 0x0b e61e: 9c 85 ldd r25, Y+12 ; 0x0c e620: d4 cf rjmp .-88 ; 0xe5ca addr += header.size; //calc address of next table e622: 8d 81 ldd r24, Y+5 ; 0x05 e624: 9e 81 ldd r25, Y+6 ; 0x06 e626: c8 0e add r12, r24 e628: d9 1e adc r13, r25 e62a: e1 1c adc r14, r1 e62c: f1 1c adc r15, r1 e62e: e2 cf rjmp .-60 ; 0xe5f4 return 0; } uint16_t lang_get_code(uint8_t lang) { if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e630: 8e e6 ldi r24, 0x6E ; 110 e632: 95 e6 ldi r25, 0x65 ; 101 e634: ca cf rjmp .-108 ; 0xe5ca 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; e636: 8f e3 ldi r24, 0x3F ; 63 e638: 9f e3 ldi r25, 0x3F ; 63 e63a: c7 cf rjmp .-114 ; 0xe5ca 0000e63c : sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes return (sum == lt_sum); } uint8_t lang_get_count() { e63c: cf 92 push r12 e63e: df 92 push r13 e640: ef 92 push r14 e642: ff 92 push r15 e644: 1f 93 push r17 e646: cf 93 push r28 e648: df 93 push r29 e64a: cd b7 in r28, 0x3d ; 61 e64c: de b7 in r29, 0x3e ; 62 e64e: 60 97 sbiw r28, 0x10 ; 16 e650: 0f b6 in r0, 0x3f ; 63 e652: f8 94 cli e654: de bf out 0x3e, r29 ; 62 e656: 0f be out 0x3f, r0 ; 63 e658: cd bf out 0x3d, r28 ; 61 if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) e65a: ea ef ldi r30, 0xFA ; 250 e65c: fa e7 ldi r31, 0x7A ; 122 e65e: 85 91 lpm r24, Z+ e660: 95 91 lpm r25, Z+ e662: a5 91 lpm r26, Z+ e664: b4 91 lpm r27, Z return 1; //signature not set - only primary language will be available e666: 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) e668: 8f 3f cpi r24, 0xFF ; 255 e66a: 9f 4f sbci r25, 0xFF ; 255 e66c: af 4f sbci r26, 0xFF ; 255 e66e: bf 4f sbci r27, 0xFF ; 255 e670: 09 f1 breq .+66 ; 0xe6b4 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e672: 8c e5 ldi r24, 0x5C ; 92 e674: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e676: 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; e678: c1 2c mov r12, r1 e67a: d1 2c mov r13, r1 e67c: 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) e67e: 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 e680: 20 e1 ldi r18, 0x10 ; 16 e682: 30 e0 ldi r19, 0x00 ; 0 e684: ae 01 movw r20, r28 e686: 4f 5f subi r20, 0xFF ; 255 e688: 5f 4f sbci r21, 0xFF ; 255 e68a: c7 01 movw r24, r14 e68c: b6 01 movw r22, r12 e68e: 0e 94 89 e2 call 0x1c512 ; 0x1c512 if (header.magic != LANG_MAGIC) break; //break if magic not valid e692: 89 81 ldd r24, Y+1 ; 0x01 e694: 9a 81 ldd r25, Y+2 ; 0x02 e696: ab 81 ldd r26, Y+3 ; 0x03 e698: bc 81 ldd r27, Y+4 ; 0x04 e69a: 85 3a cpi r24, 0xA5 ; 165 e69c: 9a 45 sbci r25, 0x5A ; 90 e69e: a4 4b sbci r26, 0xB4 ; 180 e6a0: bb 44 sbci r27, 0x4B ; 75 e6a2: 41 f4 brne .+16 ; 0xe6b4 addr += header.size; //calc address of next table e6a4: 8d 81 ldd r24, Y+5 ; 0x05 e6a6: 9e 81 ldd r25, Y+6 ; 0x06 e6a8: c8 0e add r12, r24 e6aa: d9 1e adc r13, r25 e6ac: e1 1c adc r14, r1 e6ae: f1 1c adc r15, r1 count++; //inc counter e6b0: 1f 5f subi r17, 0xFF ; 255 e6b2: e6 cf rjmp .-52 ; 0xe680 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } e6b4: 81 2f mov r24, r17 e6b6: 60 96 adiw r28, 0x10 ; 16 e6b8: 0f b6 in r0, 0x3f ; 63 e6ba: f8 94 cli e6bc: de bf out 0x3e, r29 ; 62 e6be: 0f be out 0x3f, r0 ; 63 e6c0: cd bf out 0x3d, r28 ; 61 e6c2: df 91 pop r29 e6c4: cf 91 pop r28 e6c6: 1f 91 pop r17 e6c8: ff 90 pop r15 e6ca: ef 90 pop r14 e6cc: df 90 pop r13 e6ce: cf 90 pop r12 e6d0: 08 95 ret 0000e6d2 : 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) { e6d2: 0f 93 push r16 e6d4: 1f 93 push r17 e6d6: cf 93 push r28 e6d8: c8 2f mov r28, r24 if (lang == LANG_ID_PRI) //primary language e6da: 81 11 cpse r24, r1 e6dc: 06 c0 rjmp .+12 ; 0xe6ea { lang_table = 0; e6de: 10 92 5b 03 sts 0x035B, r1 ; 0x80035b e6e2: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a lang_selected = lang; e6e6: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c } #ifdef XFLASH if (lang_get_code(lang) == lang_get_code(LANG_ID_SEC)) lang = LANG_ID_SEC; e6ea: 8c 2f mov r24, r28 e6ec: 0e 94 cf 72 call 0xe59e ; 0xe59e e6f0: 8c 01 movw r16, r24 e6f2: 0e 94 3f 72 call 0xe47e ; 0xe47e e6f6: 08 17 cp r16, r24 e6f8: 19 07 cpc r17, r25 e6fa: 19 f0 breq .+6 ; 0xe702 if (lang == LANG_ID_SEC) //current secondary language e6fc: c1 30 cpi r28, 0x01 ; 1 e6fe: 09 f0 breq .+2 ; 0xe702 e700: 3e c0 rjmp .+124 ; 0xe77e { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid e702: e0 e0 ldi r30, 0x00 ; 0 e704: f1 e0 ldi r31, 0x01 ; 1 e706: 85 91 lpm r24, Z+ e708: 95 91 lpm r25, Z+ e70a: a5 91 lpm r26, Z+ e70c: b4 91 lpm r27, Z e70e: 85 3a cpi r24, 0xA5 ; 165 e710: 9a 45 sbci r25, 0x5A ; 90 e712: a4 4b sbci r26, 0xB4 ; 180 e714: bb 44 sbci r27, 0x4B ; 75 e716: 09 f0 breq .+2 ; 0xe71a e718: 31 c0 rjmp .+98 ; 0xe77c } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); e71a: e4 e0 ldi r30, 0x04 ; 4 e71c: f1 e0 ldi r31, 0x01 ; 1 e71e: 65 91 lpm r22, Z+ e720: 74 91 lpm r23, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); e722: e8 e0 ldi r30, 0x08 ; 8 e724: f1 e0 ldi r31, 0x01 ; 1 e726: 45 91 lpm r20, Z+ e728: 54 91 lpm r21, Z uint16_t i; for (i = 0; i < size; i++) e72a: 30 e0 ldi r19, 0x00 ; 0 e72c: 20 e0 ldi r18, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; e72e: 90 e0 ldi r25, 0x00 ; 0 e730: 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++) e732: 62 17 cp r22, r18 e734: 73 07 cpc r23, r19 e736: 89 f5 brne .+98 ; 0xe79a sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum e738: 84 1b sub r24, r20 e73a: 95 0b sbc r25, r21 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes e73c: 98 27 eor r25, r24 e73e: 89 27 eor r24, r25 e740: 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)) e742: 48 17 cp r20, r24 e744: 59 07 cpc r21, r25 e746: d1 f4 brne .+52 ; 0xe77c if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e748: ec e0 ldi r30, 0x0C ; 12 e74a: f1 e0 ldi r31, 0x01 ; 1 e74c: 45 91 lpm r20, Z+ e74e: 55 91 lpm r21, Z+ e750: 65 91 lpm r22, Z+ e752: 74 91 lpm r23, Z e754: ea ef ldi r30, 0xFA ; 250 e756: fa e7 ldi r31, 0x7A ; 122 e758: 85 91 lpm r24, Z+ e75a: 95 91 lpm r25, Z+ e75c: a5 91 lpm r26, Z+ e75e: b4 91 lpm r27, Z e760: 48 17 cp r20, r24 e762: 59 07 cpc r21, r25 e764: 6a 07 cpc r22, r26 e766: 7b 07 cpc r23, r27 e768: 49 f4 brne .+18 ; 0xe77c { lang_table = (lang_table_t*)(_SEC_LANG_TABLE); // set table pointer e76a: 80 e0 ldi r24, 0x00 ; 0 e76c: 91 e0 ldi r25, 0x01 ; 1 e76e: 90 93 5b 03 sts 0x035B, r25 ; 0x80035b e772: 80 93 5a 03 sts 0x035A, r24 ; 0x80035a lang_selected = lang; // set language id e776: 81 e0 ldi r24, 0x01 ; 1 e778: 80 93 5c 03 sts 0x035C, r24 ; 0x80035c 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 e77c: c1 e0 ldi r28, 0x01 ; 1 lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) e77e: 80 91 5c 03 lds r24, 0x035C ; 0x80035c e782: 8c 13 cpse r24, r28 e784: 1c c0 rjmp .+56 ; 0xe7be { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); e786: 6c 2f mov r22, r28 e788: 8e ef ldi r24, 0xFE ; 254 e78a: 9f e0 ldi r25, 0x0F ; 15 e78c: 0f 94 7f dd call 0x3bafe ; 0x3bafe return 1; e790: 81 e0 ldi r24, 0x01 ; 1 } return 0; } e792: cf 91 pop r28 e794: 1f 91 pop r17 e796: 0f 91 pop r16 e798: 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); e79a: f9 01 movw r30, r18 e79c: e0 50 subi r30, 0x00 ; 0 e79e: ff 4f sbci r31, 0xFF ; 255 e7a0: e4 91 lpm r30, Z e7a2: f0 e0 ldi r31, 0x00 ; 0 e7a4: a8 e0 ldi r26, 0x08 ; 8 e7a6: 20 fd sbrc r18, 0 e7a8: a0 e0 ldi r26, 0x00 ; 0 e7aa: 02 c0 rjmp .+4 ; 0xe7b0 e7ac: ee 0f add r30, r30 e7ae: ff 1f adc r31, r31 e7b0: aa 95 dec r26 e7b2: e2 f7 brpl .-8 ; 0xe7ac e7b4: 8e 0f add r24, r30 e7b6: 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++) e7b8: 2f 5f subi r18, 0xFF ; 255 e7ba: 3f 4f sbci r19, 0xFF ; 255 e7bc: ba cf rjmp .-140 ; 0xe732 if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; e7be: 80 e0 ldi r24, 0x00 ; 0 e7c0: e8 cf rjmp .-48 ; 0xe792 0000e7c2 : //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. e7c2: 20 91 5c 03 lds r18, 0x035C ; 0x80035c e7c6: 21 11 cpse r18, r1 e7c8: 04 c0 rjmp .+8 ; 0xe7d2 e7ca: fc 01 movw r30, r24 e7cc: 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 } e7ce: cf 01 movw r24, r30 e7d0: 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. e7d2: 40 91 5a 03 lds r20, 0x035A ; 0x80035a e7d6: 50 91 5b 03 lds r21, 0x035B ; 0x80035b e7da: 41 15 cp r20, r1 e7dc: 51 05 cpc r21, r1 e7de: a9 f3 breq .-22 ; 0xe7ca uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id e7e0: fc 01 movw r30, r24 e7e2: 25 91 lpm r18, Z+ e7e4: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. e7e6: 2f 3f cpi r18, 0xFF ; 255 e7e8: 32 07 cpc r19, r18 e7ea: 79 f3 breq .-34 ; 0xe7ca ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset e7ec: f9 01 movw r30, r18 e7ee: 38 96 adiw r30, 0x08 ; 8 e7f0: ee 0f add r30, r30 e7f2: ff 1f adc r31, r31 e7f4: e4 0f add r30, r20 e7f6: f5 1f adc r31, r21 e7f8: 25 91 lpm r18, Z+ e7fa: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character e7fc: fa 01 movw r30, r20 e7fe: e2 0f add r30, r18 e800: f3 1f adc r31, r19 e802: 24 91 lpm r18, Z e804: 22 23 and r18, r18 e806: 09 f3 breq .-62 ; 0xe7ca e808: e2 cf rjmp .-60 ; 0xe7ce 0000e80a : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { e80a: cf 93 push r28 e80c: df 93 push r29 e80e: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; e810: 20 e0 ldi r18, 0x00 ; 0 e812: 30 e0 ldi r19, 0x00 ; 0 e814: 4c e8 ldi r20, 0x8C ; 140 e816: 52 e4 ldi r21, 0x42 ; 66 e818: 60 91 4f 07 lds r22, 0x074F ; 0x80074f e81c: 70 91 50 07 lds r23, 0x0750 ; 0x800750 e820: 80 91 51 07 lds r24, 0x0751 ; 0x800751 e824: 90 91 52 07 lds r25, 0x0752 ; 0x800752 e828: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> e82c: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f e830: 70 93 50 07 sts 0x0750, r23 ; 0x800750 e834: 80 93 51 07 sts 0x0751, r24 ; 0x800751 e838: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); e83c: 60 e0 ldi r22, 0x00 ; 0 e83e: 70 e0 ldi r23, 0x00 ; 0 e840: 80 ea ldi r24, 0xA0 ; 160 e842: 91 e4 ldi r25, 0x41 ; 65 e844: 0f 94 5d ba call 0x374ba ; 0x374ba load_filament_final_feed(); e848: 0e 94 c8 65 call 0xcb90 ; 0xcb90 } void lcd_loading_filament(const char* filament_name) { lcd_clear(); e84c: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); e850: 88 e3 ldi r24, 0x38 ; 56 e852: 9d e5 ldi r25, 0x5D ; 93 e854: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 e858: ac 01 movw r20, r24 e85a: 60 e0 ldi r22, 0x00 ; 0 e85c: 80 e0 ldi r24, 0x00 ; 0 e85e: 0e 94 29 70 call 0xe052 ; 0xe052 if (filament_name[0]) { e862: 88 81 ld r24, Y e864: 88 23 and r24, r24 e866: 39 f0 breq .+14 ; 0xe876 lcd_set_cursor(0, 1); e868: 61 e0 ldi r22, 0x01 ; 1 e86a: 80 e0 ldi r24, 0x00 ; 0 e86c: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print(filament_name); e870: ce 01 movw r24, r28 e872: 0e 94 1c 72 call 0xe438 ; 0xe438 } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); e876: 8a ee ldi r24, 0xEA ; 234 e878: 99 e3 ldi r25, 0x39 ; 57 e87a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 e87e: ac 01 movw r20, r24 e880: 62 e0 ldi r22, 0x02 ; 2 e882: 80 e0 ldi r24, 0x00 ; 0 e884: 0e 94 29 70 call 0xe052 ; 0xe052 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 e888: 83 e4 ldi r24, 0x43 ; 67 e88a: 9b e2 ldi r25, 0x2B ; 43 e88c: 0f 94 cb 35 call 0x26b96 ; 0x26b96 lcd_loading_filament(filament_name); st_synchronize(); } e890: df 91 pop r29 e892: 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(); e894: 0d 94 27 58 jmp 0x2b04e ; 0x2b04e 0000e898 : * 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; e898: 0f 94 a4 75 call 0x2eb48 ; 0x2eb48 e89c: 8f 3f cpi r24, 0xFF ; 255 e89e: 11 f1 breq .+68 ; 0xe8e4 lcd_update_enable(false); e8a0: 80 e0 ldi r24, 0x00 ; 0 e8a2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_clear(); e8a6: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); e8aa: 84 e9 ldi r24, 0x94 ; 148 e8ac: 99 e5 ldi r25, 0x59 ; 89 e8ae: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 e8b2: ac 01 movw r20, r24 e8b4: 61 e0 ldi r22, 0x01 ; 1 e8b6: 80 e0 ldi r24, 0x00 ; 0 e8b8: 0e 94 29 70 call 0xe052 ; 0xe052 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e8bc: 80 e2 ldi r24, 0x20 ; 32 e8be: 0e 94 c4 70 call 0xe188 ; 0xe188 lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); e8c2: 0f 94 a4 75 call 0x2eb48 ; 0x2eb48 e8c6: 68 2f mov r22, r24 e8c8: 70 e0 ldi r23, 0x00 ; 0 e8ca: 6f 5f subi r22, 0xFF ; 255 e8cc: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); e8ce: 07 2e mov r0, r23 e8d0: 00 0c add r0, r0 e8d2: 88 0b sbc r24, r24 e8d4: 99 0b sbc r25, r25 e8d6: 0e 94 ce 71 call 0xe39c ; 0xe39c // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); e8da: 0f 94 37 a0 call 0x3406e ; 0x3406e lcd_update_enable(true); e8de: 81 e0 ldi r24, 0x01 ; 1 e8e0: 0c 94 5a 70 jmp 0xe0b4 ; 0xe0b4 } e8e4: 08 95 ret 0000e8e6 : } #ifdef TMC2130 bool calibrate_z_auto() { e8e6: 4f 92 push r4 e8e8: 5f 92 push r5 e8ea: 6f 92 push r6 e8ec: 7f 92 push r7 e8ee: 8f 92 push r8 e8f0: 9f 92 push r9 e8f2: af 92 push r10 e8f4: bf 92 push r11 e8f6: ef 92 push r14 e8f8: ff 92 push r15 e8fa: 0f 93 push r16 e8fc: 1f 93 push r17 e8fe: cf 93 push r28 e900: df 93 push r29 //lcd_display_message_fullscreen_P(_T(MSG_CALIBRATE_Z_AUTO)); lcd_clear(); e902: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 1, _T(MSG_CALIBRATE_Z_AUTO)); e906: 8c e5 ldi r24, 0x5C ; 92 e908: 9a e4 ldi r25, 0x4A ; 74 e90a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 e90e: ac 01 movw r20, r24 e910: 61 e0 ldi r22, 0x01 ; 1 e912: 80 e0 ldi r24, 0x00 ; 0 e914: 0e 94 29 70 call 0xe052 ; 0xe052 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; e918: d0 91 8f 02 lds r29, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; e91c: 81 e0 ldi r24, 0x01 ; 1 e91e: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> #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); e922: e8 e8 ldi r30, 0x88 ; 136 e924: fd e7 ldi r31, 0x7D ; 125 e926: 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); e928: 84 e0 ldi r24, 0x04 ; 4 e92a: 0f 94 8e 3a call 0x2751c ; 0x2751c current_position[Z_AXIS] = 0; e92e: 83 e4 ldi r24, 0x43 ; 67 e930: e8 2e mov r14, r24 e932: 87 e0 ldi r24, 0x07 ; 7 e934: f8 2e mov r15, r24 e936: f7 01 movw r30, r14 e938: 10 86 std Z+8, r1 ; 0x08 e93a: 11 86 std Z+9, r1 ; 0x09 e93c: 12 86 std Z+10, r1 ; 0x0a e93e: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e940: 0f 94 1d b9 call 0x3723a ; 0x3723a set_destination_to_current(); e944: 0e 94 6f 69 call 0xd2de ; 0xd2de #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); e948: e2 e8 ldi r30, 0x82 ; 130 e94a: fd e7 ldi r31, 0x7D ; 125 e94c: 85 90 lpm r8, Z+ e94e: 95 90 lpm r9, Z+ e950: a5 90 lpm r10, Z+ e952: 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); e954: 04 e5 ldi r16, 0x54 ; 84 e956: 15 e0 ldi r17, 0x05 ; 5 { //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); e958: 8c 2f mov r24, r28 e95a: 99 27 eor r25, r25 e95c: 81 95 neg r24 e95e: 0c f4 brge .+2 ; 0xe962 e960: 90 95 com r25 e962: 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); e964: 07 2e mov r0, r23 e966: 00 0c add r0, r0 e968: 88 0b sbc r24, r24 e96a: 99 0b sbc r25, r25 e96c: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> e970: 2b 01 movw r4, r22 e972: 3c 01 movw r6, r24 e974: 2d ec ldi r18, 0xCD ; 205 e976: 3c ec ldi r19, 0xCC ; 204 e978: 4c e8 ldi r20, 0x8C ; 140 e97a: 5f e3 ldi r21, 0x3F ; 63 e97c: c5 01 movw r24, r10 e97e: b4 01 movw r22, r8 e980: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> e984: 9b 01 movw r18, r22 e986: ac 01 movw r20, r24 e988: c3 01 movw r24, r6 e98a: b2 01 movw r22, r4 e98c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> e990: f8 01 movw r30, r16 e992: 20 85 ldd r18, Z+8 ; 0x08 e994: 31 85 ldd r19, Z+9 ; 0x09 e996: 42 85 ldd r20, Z+10 ; 0x0a e998: 53 85 ldd r21, Z+11 ; 0x0b e99a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> e99e: f8 01 movw r30, r16 e9a0: 60 87 std Z+8, r22 ; 0x08 e9a2: 71 87 std Z+9, r23 ; 0x09 e9a4: 82 87 std Z+10, r24 ; 0x0a e9a6: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS]; e9a8: 80 e0 ldi r24, 0x00 ; 0 e9aa: 90 e0 ldi r25, 0x00 ; 0 e9ac: a8 e4 ldi r26, 0x48 ; 72 e9ae: b4 e4 ldi r27, 0x44 ; 68 e9b0: 80 93 90 02 sts 0x0290, r24 ; 0x800290 e9b4: 90 93 91 02 sts 0x0291, r25 ; 0x800291 e9b8: a0 93 92 02 sts 0x0292, r26 ; 0x800292 e9bc: b0 93 93 02 sts 0x0293, r27 ; 0x800293 plan_buffer_line_destinationXYZE(feedrate / 60); e9c0: 65 e5 ldi r22, 0x55 ; 85 e9c2: 75 e5 ldi r23, 0x55 ; 85 e9c4: 85 e5 ldi r24, 0x55 ; 85 e9c6: 91 e4 ldi r25, 0x41 ; 65 e9c8: 0f 94 2a ba call 0x37454 ; 0x37454 st_synchronize(); e9cc: 0f 94 27 58 call 0x2b04e ; 0x2b04e // current_position[axis] = 0; // plan_set_position_curposXYZE(); tmc2130_home_exit(); e9d0: 0f 94 5f 3a call 0x274be ; 0x274be e9d4: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[Z_AXIS] = 0; e9d8: f7 01 movw r30, r14 e9da: 10 86 std Z+8, r1 ; 0x08 e9dc: 11 86 std Z+9, r1 ; 0x09 e9de: 12 86 std Z+10, r1 ; 0x0a e9e0: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e9e2: 0f 94 1d b9 call 0x3723a ; 0x3723a set_destination_to_current(); e9e6: 0e 94 6f 69 call 0xd2de ; 0xd2de destination[Z_AXIS] += 10 * axis_up_dir; //10mm up e9ea: f6 ef ldi r31, 0xF6 ; 246 e9ec: cf 02 muls r28, r31 e9ee: b0 01 movw r22, r0 e9f0: 11 24 eor r1, r1 e9f2: 07 2e mov r0, r23 e9f4: 00 0c add r0, r0 e9f6: 88 0b sbc r24, r24 e9f8: 99 0b sbc r25, r25 e9fa: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> e9fe: 9b 01 movw r18, r22 ea00: ac 01 movw r20, r24 ea02: f8 01 movw r30, r16 ea04: 60 85 ldd r22, Z+8 ; 0x08 ea06: 71 85 ldd r23, Z+9 ; 0x09 ea08: 82 85 ldd r24, Z+10 ; 0x0a ea0a: 93 85 ldd r25, Z+11 ; 0x0b ea0c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> ea10: f8 01 movw r30, r16 ea12: 60 87 std Z+8, r22 ; 0x08 ea14: 71 87 std Z+9, r23 ; 0x09 ea16: 82 87 std Z+10, r24 ; 0x0a ea18: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS] / 2; ea1a: 80 e0 ldi r24, 0x00 ; 0 ea1c: 90 e0 ldi r25, 0x00 ; 0 ea1e: a8 ec ldi r26, 0xC8 ; 200 ea20: b3 e4 ldi r27, 0x43 ; 67 ea22: 80 93 90 02 sts 0x0290, r24 ; 0x800290 ea26: 90 93 91 02 sts 0x0291, r25 ; 0x800291 ea2a: a0 93 92 02 sts 0x0292, r26 ; 0x800292 ea2e: b0 93 93 02 sts 0x0293, r27 ; 0x800293 plan_buffer_line_destinationXYZE(feedrate / 60); ea32: 65 e5 ldi r22, 0x55 ; 85 ea34: 75 e5 ldi r23, 0x55 ; 85 ea36: 85 ed ldi r24, 0xD5 ; 213 ea38: 90 e4 ldi r25, 0x40 ; 64 ea3a: 0f 94 2a ba call 0x37454 ; 0x37454 st_synchronize(); ea3e: 0f 94 27 58 call 0x2b04e ; 0x2b04e ea42: d0 93 8f 02 sts 0x028F, r29 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(endstops_enabled); current_position[Z_AXIS] = Z_MAX_POS + Z_MAX_POS_XYZ_CALIBRATION_CORRECTION; ea46: 80 e0 ldi r24, 0x00 ; 0 ea48: 90 e0 ldi r25, 0x00 ; 0 ea4a: ab e5 ldi r26, 0x5B ; 91 ea4c: b3 e4 ldi r27, 0x43 ; 67 ea4e: f7 01 movw r30, r14 ea50: 80 87 std Z+8, r24 ; 0x08 ea52: 91 87 std Z+9, r25 ; 0x09 ea54: a2 87 std Z+10, r26 ; 0x0a ea56: b3 87 std Z+11, r27 ; 0x0b plan_set_position_curposXYZE(); ea58: 0f 94 1d b9 call 0x3723a ; 0x3723a return true; } ea5c: 81 e0 ldi r24, 0x01 ; 1 ea5e: df 91 pop r29 ea60: cf 91 pop r28 ea62: 1f 91 pop r17 ea64: 0f 91 pop r16 ea66: ff 90 pop r15 ea68: ef 90 pop r14 ea6a: bf 90 pop r11 ea6c: af 90 pop r10 ea6e: 9f 90 pop r9 ea70: 8f 90 pop r8 ea72: 7f 90 pop r7 ea74: 6f 90 pop r6 ea76: 5f 90 pop r5 ea78: 4f 90 pop r4 ea7a: 08 95 ret 0000ea7c : restore_print_from_ram_and_continue(default_retraction); //XYZ = orig, E +1mm unretract //babystep_apply(); } void crashdet_fmt_error(char* buf, uint8_t mask) { ea7c: cf 93 push r28 ea7e: df 93 push r29 ea80: ec 01 movw r28, r24 if(mask & X_AXIS_MASK) *buf++ = axis_codes[X_AXIS]; ea82: 60 ff sbrs r22, 0 ea84: 03 c0 rjmp .+6 ; 0xea8c ea86: 28 e5 ldi r18, 0x58 ; 88 ea88: 28 83 st Y, r18 ea8a: 21 96 adiw r28, 0x01 ; 1 if(mask & Y_AXIS_MASK) *buf++ = axis_codes[Y_AXIS]; ea8c: 61 ff sbrs r22, 1 ea8e: 03 c0 rjmp .+6 ; 0xea96 ea90: 29 e5 ldi r18, 0x59 ; 89 ea92: 28 83 st Y, r18 ea94: 21 96 adiw r28, 0x01 ; 1 *buf++ = ' '; ea96: 80 e2 ldi r24, 0x20 ; 32 ea98: 89 93 st Y+, r24 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); ea9a: 80 e0 ldi r24, 0x00 ; 0 ea9c: 96 e3 ldi r25, 0x36 ; 54 ea9e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 eaa2: bc 01 movw r22, r24 eaa4: ce 01 movw r24, r28 } eaa6: df 91 pop r29 eaa8: 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)); eaaa: 0d 94 12 db jmp 0x3b624 ; 0x3b624 0000eaae <__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 { eaae: 1f 92 push r1 eab0: 0f 92 push r0 eab2: 0f b6 in r0, 0x3f ; 63 eab4: 0f 92 push r0 eab6: 11 24 eor r1, r1 eab8: 0b b6 in r0, 0x3b ; 59 eaba: 0f 92 push r0 eabc: 2f 93 push r18 eabe: 8f 93 push r24 eac0: 9f 93 push r25 eac2: ef 93 push r30 eac4: ff 93 push r31 switch(state){ eac6: e0 91 55 03 lds r30, 0x0355 ; 0x800355 eaca: e8 30 cpi r30, 0x08 ; 8 eacc: e8 f4 brcc .+58 ; 0xeb08 <__vector_23+0x5a> eace: f0 e0 ldi r31, 0x00 ; 0 ead0: 88 27 eor r24, r24 ead2: e2 59 subi r30, 0x92 ; 146 ead4: fa 48 sbci r31, 0x8A ; 138 ead6: 8f 4f sbci r24, 0xFF ; 255 ead8: 0d 94 6b de jmp 0x3bcd6 ; 0x3bcd6 <__tablejump2__> eadc: 76 75 andi r23, 0x56 ; 86 eade: 90 75 andi r25, 0x50 ; 80 eae0: 9b 75 andi r25, 0x5B ; 91 eae2: a9 75 andi r26, 0x59 ; 89 eae4: bf 75 andi r27, 0x5F ; 95 eae6: c8 75 andi r28, 0x58 ; 88 eae8: eb 75 andi r30, 0x5B ; 91 eaea: fd 75 andi r31, 0x5D ; 93 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin eaec: 80 91 6d 06 lds r24, 0x066D ; 0x80066d eaf0: 81 11 cpse r24, r1 eaf2: 0a c0 rjmp .+20 ; 0xeb08 <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! eaf4: 80 91 1a 06 lds r24, 0x061A ; 0x80061a eaf8: 88 0f add r24, r24 eafa: 80 93 54 03 sts 0x0354, r24 ; 0x800354 if( pwm != 0 ){ eafe: 88 23 and r24, r24 eb00: 19 f0 breq .+6 ; 0xeb08 <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period eb02: 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 eb04: 80 93 55 03 sts 0x0355, r24 ; 0x800355 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } eb08: ff 91 pop r31 eb0a: ef 91 pop r30 eb0c: 9f 91 pop r25 eb0e: 8f 91 pop r24 eb10: 2f 91 pop r18 eb12: 0f 90 pop r0 eb14: 0b be out 0x3b, r0 ; 59 eb16: 0f 90 pop r0 eb18: 0f be out 0x3f, r0 ; 63 eb1a: 0f 90 pop r0 eb1c: 1f 90 pop r1 eb1e: 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) eb20: 80 91 53 03 lds r24, 0x0353 ; 0x800353 eb24: 8f 5f subi r24, 0xFF ; 255 eb26: 80 93 53 03 sts 0x0353, r24 ; 0x800353 if( slowCounter > pwm ){ eb2a: 90 91 54 03 lds r25, 0x0354 ; 0x800354 eb2e: 98 17 cp r25, r24 eb30: 58 f3 brcs .-42 ; 0xeb08 <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 eb32: 82 e0 ldi r24, 0x02 ; 2 eb34: e7 cf rjmp .-50 ; 0xeb04 <__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 eb36: 83 e0 ldi r24, 0x03 ; 3 eb38: 80 93 55 03 sts 0x0355, r24 ; 0x800355 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE eb3c: 8f e0 ldi r24, 0x0F ; 15 eb3e: 80 93 52 03 sts 0x0352, r24 ; 0x800352 TCNT0 = 255; // force overflow on the next clock cycle eb42: 8f ef ldi r24, 0xFF ; 255 eb44: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz eb46: 81 e0 ldi r24, 0x01 ; 1 eb48: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) eb4a: 84 b5 in r24, 0x24 ; 36 eb4c: 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 eb4e: 84 bd out 0x24, r24 ; 36 eb50: db cf rjmp .-74 ; 0xeb08 <__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; eb52: 80 91 52 03 lds r24, 0x0352 ; 0x800352 eb56: 82 95 swap r24 eb58: 80 7f andi r24, 0xF0 ; 240 eb5a: 81 95 neg r24 eb5c: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ eb5e: 80 91 52 03 lds r24, 0x0352 ; 0x800352 eb62: 88 23 and r24, r24 eb64: 21 f0 breq .+8 ; 0xeb6e <__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; eb66: 81 50 subi r24, 0x01 ; 1 eb68: 80 93 52 03 sts 0x0352, r24 ; 0x800352 eb6c: cd cf rjmp .-102 ; 0xeb08 <__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; eb6e: 84 e0 ldi r24, 0x04 ; 4 eb70: 80 93 55 03 sts 0x0355, r24 ; 0x800355 OCR0B = 255; // full duty eb74: 8f ef ldi r24, 0xFF ; 255 eb76: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle eb78: 8e ef ldi r24, 0xFE ; 254 eb7a: 86 bd out 0x26, r24 ; 38 eb7c: c5 cf rjmp .-118 ; 0xeb08 <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; eb7e: 85 e0 ldi r24, 0x05 ; 5 eb80: 80 93 55 03 sts 0x0355, r24 ; 0x800355 OCR0B = 255; // full duty eb84: 8f ef ldi r24, 0xFF ; 255 eb86: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle eb88: 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 eb8a: 82 e0 ldi r24, 0x02 ; 2 eb8c: 85 bd out 0x25, r24 ; 37 eb8e: bc cf rjmp .-136 ; 0xeb08 <__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; eb90: 2f ef ldi r18, 0xFF ; 255 eb92: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin eb94: 80 91 6d 06 lds r24, 0x066D ; 0x80066d eb98: 81 11 cpse r24, r1 eb9a: b6 cf rjmp .-148 ; 0xeb08 <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less eb9c: 80 91 53 03 lds r24, 0x0353 ; 0x800353 eba0: 8f 5f subi r24, 0xFF ; 255 eba2: 80 93 53 03 sts 0x0353, r24 ; 0x800353 if( slowCounter < pwm ){ eba6: 90 91 54 03 lds r25, 0x0354 ; 0x800354 ebaa: 89 17 cp r24, r25 ebac: 08 f4 brcc .+2 ; 0xebb0 <__vector_23+0x102> ebae: ac cf rjmp .-168 ; 0xeb08 <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain ebb0: 80 91 1a 06 lds r24, 0x061A ; 0x80061a ebb4: 90 e0 ldi r25, 0x00 ; 0 ebb6: 8f 37 cpi r24, 0x7F ; 127 ebb8: 91 05 cpc r25, r1 ebba: 0c f0 brlt .+2 ; 0xebbe <__vector_23+0x110> ebbc: a5 cf rjmp .-182 ; 0xeb08 <__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; ebbe: 86 e0 ldi r24, 0x06 ; 6 ebc0: 80 93 55 03 sts 0x0355, r24 ; 0x800355 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE ebc4: 8f e0 ldi r24, 0x0F ; 15 ebc6: 80 93 52 03 sts 0x0352, r24 ; 0x800352 TCNT0 = 255; // force overflow on the next clock cycle ebca: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz ebcc: 81 e0 ldi r24, 0x01 ; 1 ebce: 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 ebd0: 84 b5 in r24, 0x24 ; 36 ebd2: 80 61 ori r24, 0x10 ; 16 ebd4: bc cf rjmp .-136 ; 0xeb4e <__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 ebd6: 80 91 52 03 lds r24, 0x0352 ; 0x800352 ebda: 82 95 swap r24 ebdc: 80 7f andi r24, 0xF0 ; 240 ebde: 81 95 neg r24 ebe0: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ ebe2: 80 91 52 03 lds r24, 0x0352 ; 0x800352 ebe6: 81 11 cpse r24, r1 ebe8: be cf rjmp .-132 ; 0xeb66 <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; ebea: 87 e0 ldi r24, 0x07 ; 7 ebec: 80 93 55 03 sts 0x0355, r24 ; 0x800355 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes ebf0: 80 e8 ldi r24, 0x80 ; 128 ebf2: 86 bd out 0x26, r24 ; 38 OCR0B = 255; ebf4: 8f ef ldi r24, 0xFF ; 255 ebf6: 88 bd out 0x28, r24 ; 40 ebf8: 87 cf rjmp .-242 ; 0xeb08 <__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 ebfa: 10 92 55 03 sts 0x0355, r1 ; 0x800355 TCNT0 = 128; ebfe: 80 e8 ldi r24, 0x80 ; 128 ec00: 86 bd out 0x26, r24 ; 38 OCR0B = 255; ec02: 8f ef ldi r24, 0xFF ; 255 ec04: 88 bd out 0x28, r24 ; 40 ec06: c1 cf rjmp .-126 ; 0xeb8a <__vector_23+0xdc> 0000ec08 : if (updateEEPROM) { eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state); } } void Filament_sensor::settings_init_common() { ec08: cf 93 push r28 ec0a: df 93 push r29 ec0c: ec 01 movw r28, r24 bool enabled = eeprom_read_byte((uint8_t *)EEPROM_FSENSOR); ec0e: 87 e6 ldi r24, 0x67 ; 103 ec10: 9f e0 ldi r25, 0x0F ; 15 ec12: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 ec16: 91 e0 ldi r25, 0x01 ; 1 ec18: 81 11 cpse r24, r1 ec1a: 01 c0 rjmp .+2 ; 0xec1e ec1c: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { ec1e: 81 e0 ldi r24, 0x01 ; 1 ec20: 28 81 ld r18, Y ec22: 21 11 cpse r18, r1 ec24: 01 c0 rjmp .+2 ; 0xec28 ec26: 80 e0 ldi r24, 0x00 ; 0 ec28: 89 13 cpse r24, r25 state = enabled ? State::initializing : State::disabled; ec2a: 98 83 st Y, r25 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); ec2c: 87 e0 ldi r24, 0x07 ; 7 ec2e: 9f e0 ldi r25, 0x0F ; 15 ec30: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 ec34: 91 e0 ldi r25, 0x01 ; 1 ec36: 81 11 cpse r24, r1 ec38: 01 c0 rjmp .+2 ; 0xec3c ec3a: 90 e0 ldi r25, 0x00 ; 0 ec3c: 99 83 std Y+1, r25 ; 0x01 runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); ec3e: 85 ed ldi r24, 0xD5 ; 213 ec40: 9e e0 ldi r25, 0x0E ; 14 ec42: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 ec46: 91 e0 ldi r25, 0x01 ; 1 ec48: 81 11 cpse r24, r1 ec4a: 01 c0 rjmp .+2 ; 0xec4e ec4c: 90 e0 ldi r25, 0x00 ; 0 ec4e: 9a 83 std Y+2, r25 ; 0x02 sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); ec50: 87 e4 ldi r24, 0x47 ; 71 ec52: 9d e0 ldi r25, 0x0D ; 13 ec54: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 if (sensorActionOnError == SensorActionOnError::_Undef) { ec58: 8f 3f cpi r24, 0xFF ; 255 ec5a: 21 f0 breq .+8 ; 0xec64 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); ec5c: 88 87 std Y+8, r24 ; 0x08 if (sensorActionOnError == SensorActionOnError::_Undef) { sensorActionOnError = SensorActionOnError::_Continue; } } ec5e: df 91 pop r29 ec60: cf 91 pop r28 ec62: 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; ec64: 18 86 std Y+8, r1 ; 0x08 ec66: fb cf rjmp .-10 ; 0xec5e 0000ec68 : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { ec68: cf 93 push r28 ec6a: c8 2f mov r28, r24 ec6c: 68 2f mov r22, r24 ec6e: 87 e6 ldi r24, 0x67 ; 103 ec70: 9f e0 ldi r25, 0x0F ; 15 ec72: 0f 94 7f dd call 0x3bafe ; 0x3bafe eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { ec76: cc 23 and r28, r28 ec78: 19 f0 breq .+6 ; 0xec80 fsensor.init(); } else { fsensor.deinit(); } } ec7a: 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(); ec7c: 0d 94 3b 86 jmp 0x30c76 ; 0x30c76 } else { fsensor.deinit(); } } ec80: cf 91 pop r28 void Filament_sensor::setEnabled(bool enabled) { eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { fsensor.init(); } else { fsensor.deinit(); ec82: 0d 94 2b 86 jmp 0x30c56 ; 0x30c56 0000ec86 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; ec86: 10 92 36 05 sts 0x0536, r1 ; 0x800536 extruder_autofan_last_check = _millis(); ec8a: 0f 94 86 3e call 0x27d0c ; 0x27d0c ec8e: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c ec92: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d ec96: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e ec9a: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f } ec9e: 08 95 ret 0000eca0 <__vector_7>: EICRB ^= (1 << 6); //change edge } #endif //(defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) #ifdef EXTRUDER_ALTFAN_DETECT ISR(INT6_vect) { eca0: 1f 92 push r1 eca2: 0f 92 push r0 eca4: 0f b6 in r0, 0x3f ; 63 eca6: 0f 92 push r0 eca8: 11 24 eor r1, r1 ecaa: 0b b6 in r0, 0x3b ; 59 ecac: 0f 92 push r0 ecae: 8f 93 push r24 ecb0: 9f 93 push r25 ecb2: ef 93 push r30 ecb4: ff 93 push r31 fan_edge_counter[0]++; ecb6: e5 eb ldi r30, 0xB5 ; 181 ecb8: f4 e0 ldi r31, 0x04 ; 4 ecba: 80 81 ld r24, Z ecbc: 91 81 ldd r25, Z+1 ; 0x01 ecbe: 01 96 adiw r24, 0x01 ; 1 ecc0: 91 83 std Z+1, r25 ; 0x01 ecc2: 80 83 st Z, r24 } ecc4: ff 91 pop r31 ecc6: ef 91 pop r30 ecc8: 9f 91 pop r25 ecca: 8f 91 pop r24 eccc: 0f 90 pop r0 ecce: 0b be out 0x3b, r0 ; 59 ecd0: 0f 90 pop r0 ecd2: 0f be out 0x3f, r0 ; 63 ecd4: 0f 90 pop r0 ecd6: 1f 90 pop r1 ecd8: 18 95 reti 0000ecda <__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) { ecda: 1f 92 push r1 ecdc: 0f 92 push r0 ecde: 0f b6 in r0, 0x3f ; 63 ece0: 0f 92 push r0 ece2: 11 24 eor r1, r1 ece4: 2f 93 push r18 ece6: 4f 93 push r20 ece8: 5f 93 push r21 ecea: 6f 93 push r22 ecec: 7f 93 push r23 ecee: 8f 93 push r24 ecf0: 9f 93 push r25 ecf2: af 93 push r26 ecf4: 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; ecf6: 80 91 36 05 lds r24, 0x0536 ; 0x800536 ecfa: 88 23 and r24, r24 ecfc: f1 f0 breq .+60 ; 0xed3a <__vector_8+0x60> ecfe: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 ed02: 8b 34 cpi r24, 0x4B ; 75 ed04: d0 f0 brcs .+52 ; 0xed3a <__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 ed06: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ed0a: 86 ff sbrs r24, 6 ed0c: 24 c0 rjmp .+72 ; 0xed56 <__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; ed0e: 80 91 38 06 lds r24, 0x0638 ; 0x800638 ed12: 90 91 39 06 lds r25, 0x0639 ; 0x800639 ed16: a0 91 3a 06 lds r26, 0x063A ; 0x80063a ed1a: b0 91 3b 06 lds r27, 0x063B ; 0x80063b t_fan_rising_edge = millis_nc(); ed1e: 80 93 4b 03 sts 0x034B, r24 ; 0x80034b ed22: 90 93 4c 03 sts 0x034C, r25 ; 0x80034c ed26: a0 93 4d 03 sts 0x034D, r26 ; 0x80034d ed2a: b0 93 4e 03 sts 0x034E, r27 ; 0x80034e 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 ed2e: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ed32: 90 e4 ldi r25, 0x40 ; 64 ed34: 89 27 eor r24, r25 ed36: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> } ed3a: bf 91 pop r27 ed3c: af 91 pop r26 ed3e: 9f 91 pop r25 ed40: 8f 91 pop r24 ed42: 7f 91 pop r23 ed44: 6f 91 pop r22 ed46: 5f 91 pop r21 ed48: 4f 91 pop r20 ed4a: 2f 91 pop r18 ed4c: 0f 90 pop r0 ed4e: 0f be out 0x3f, r0 ; 63 ed50: 0f 90 pop r0 ed52: 1f 90 pop r1 ed54: 18 95 reti ed56: 80 91 38 06 lds r24, 0x0638 ; 0x800638 ed5a: 90 91 39 06 lds r25, 0x0639 ; 0x800639 ed5e: a0 91 3a 06 lds r26, 0x063A ; 0x80063a ed62: b0 91 3b 06 lds r27, 0x063B ; 0x80063b 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 ed66: 40 91 4b 03 lds r20, 0x034B ; 0x80034b ed6a: 50 91 4c 03 lds r21, 0x034C ; 0x80034c ed6e: 60 91 4d 03 lds r22, 0x034D ; 0x80034d ed72: 70 91 4e 03 lds r23, 0x034E ; 0x80034e ed76: 84 1b sub r24, r20 ed78: 95 0b sbc r25, r21 ed7a: a6 0b sbc r26, r22 ed7c: b7 0b sbc r27, r23 ed7e: 20 91 e3 03 lds r18, 0x03E3 ; 0x8003e3 ed82: 44 e0 ldi r20, 0x04 ; 4 ed84: 50 e0 ldi r21, 0x00 ; 0 ed86: 60 e0 ldi r22, 0x00 ; 0 ed88: 70 e0 ldi r23, 0x00 ; 0 ed8a: 25 36 cpi r18, 0x65 ; 101 ed8c: 20 f0 brcs .+8 ; 0xed96 <__vector_8+0xbc> ed8e: 43 e0 ldi r20, 0x03 ; 3 ed90: 50 e0 ldi r21, 0x00 ; 0 ed92: 60 e0 ldi r22, 0x00 ; 0 ed94: 70 e0 ldi r23, 0x00 ; 0 ed96: 84 17 cp r24, r20 ed98: 95 07 cpc r25, r21 ed9a: a6 07 cpc r26, r22 ed9c: b7 07 cpc r27, r23 ed9e: 38 f2 brcs .-114 ; 0xed2e <__vector_8+0x54> fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse eda0: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 eda4: 90 91 b8 04 lds r25, 0x04B8 ; 0x8004b8 eda8: 02 96 adiw r24, 0x02 ; 2 edaa: 90 93 b8 04 sts 0x04B8, r25 ; 0x8004b8 edae: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 edb2: bd cf rjmp .-134 ; 0xed2e <__vector_8+0x54> 0000edb4 : } #if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) void countFanSpeed() { edb4: 8f 92 push r8 edb6: 9f 92 push r9 edb8: af 92 push r10 edba: bf 92 push r11 edbc: cf 92 push r12 edbe: df 92 push r13 edc0: ef 92 push r14 edc2: ff 92 push r15 edc4: 0f 93 push r16 edc6: 1f 93 push r17 edc8: cf 93 push r28 edca: df 93 push r29 //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))); edcc: c5 eb ldi r28, 0xB5 ; 181 edce: d4 e0 ldi r29, 0x04 ; 4 edd0: 68 81 ld r22, Y edd2: 79 81 ldd r23, Y+1 ; 0x01 edd4: 07 2e mov r0, r23 edd6: 00 0c add r0, r0 edd8: 88 0b sbc r24, r24 edda: 99 0b sbc r25, r25 eddc: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> ede0: 6b 01 movw r12, r22 ede2: 7c 01 movw r14, r24 ede4: 0f 94 86 3e call 0x27d0c ; 0x27d0c ede8: 01 eb ldi r16, 0xB1 ; 177 edea: 14 e0 ldi r17, 0x04 ; 4 edec: 80 90 9c 17 lds r8, 0x179C ; 0x80179c edf0: 90 90 9d 17 lds r9, 0x179D ; 0x80179d edf4: a0 90 9e 17 lds r10, 0x179E ; 0x80179e edf8: b0 90 9f 17 lds r11, 0x179F ; 0x80179f edfc: 68 19 sub r22, r8 edfe: 79 09 sbc r23, r9 ee00: 8a 09 sbc r24, r10 ee02: 9b 09 sbc r25, r11 ee04: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> ee08: 9b 01 movw r18, r22 ee0a: ac 01 movw r20, r24 ee0c: 60 e0 ldi r22, 0x00 ; 0 ee0e: 70 e0 ldi r23, 0x00 ; 0 ee10: 8a e7 ldi r24, 0x7A ; 122 ee12: 93 e4 ldi r25, 0x43 ; 67 ee14: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> ee18: a7 01 movw r20, r14 ee1a: 96 01 movw r18, r12 ee1c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> ee20: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> ee24: f8 01 movw r30, r16 ee26: 71 83 std Z+1, r23 ; 0x01 ee28: 60 83 st Z, r22 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); ee2a: 6a 81 ldd r22, Y+2 ; 0x02 ee2c: 7b 81 ldd r23, Y+3 ; 0x03 ee2e: 07 2e mov r0, r23 ee30: 00 0c add r0, r0 ee32: 88 0b sbc r24, r24 ee34: 99 0b sbc r25, r25 ee36: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> ee3a: 6b 01 movw r12, r22 ee3c: 7c 01 movw r14, r24 ee3e: 0f 94 86 3e call 0x27d0c ; 0x27d0c ee42: 80 90 9c 17 lds r8, 0x179C ; 0x80179c ee46: 90 90 9d 17 lds r9, 0x179D ; 0x80179d ee4a: a0 90 9e 17 lds r10, 0x179E ; 0x80179e ee4e: b0 90 9f 17 lds r11, 0x179F ; 0x80179f ee52: 68 19 sub r22, r8 ee54: 79 09 sbc r23, r9 ee56: 8a 09 sbc r24, r10 ee58: 9b 09 sbc r25, r11 ee5a: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> ee5e: 9b 01 movw r18, r22 ee60: ac 01 movw r20, r24 ee62: 60 e0 ldi r22, 0x00 ; 0 ee64: 70 e0 ldi r23, 0x00 ; 0 ee66: 8a e7 ldi r24, 0x7A ; 122 ee68: 93 e4 ldi r25, 0x43 ; 67 ee6a: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> ee6e: a7 01 movw r20, r14 ee70: 96 01 movw r18, r12 ee72: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> ee76: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> ee7a: f8 01 movw r30, r16 ee7c: 73 83 std Z+3, r23 ; 0x03 ee7e: 62 83 std Z+2, r22 ; 0x02 /*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; ee80: 19 82 std Y+1, r1 ; 0x01 ee82: 18 82 st Y, r1 fan_edge_counter[1] = 0; ee84: 1b 82 std Y+3, r1 ; 0x03 ee86: 1a 82 std Y+2, r1 ; 0x02 } ee88: df 91 pop r29 ee8a: cf 91 pop r28 ee8c: 1f 91 pop r17 ee8e: 0f 91 pop r16 ee90: ff 90 pop r15 ee92: ef 90 pop r14 ee94: df 90 pop r13 ee96: cf 90 pop r12 ee98: bf 90 pop r11 ee9a: af 90 pop r10 ee9c: 9f 90 pop r9 ee9e: 8f 90 pop r8 eea0: 08 95 ret 0000eea2 : 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; eea2: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f newFanSpeed = 0; eea6: 10 92 6d 03 sts 0x036D, r1 ; 0x80036d if (fanState & 0x01) eeaa: 80 ff sbrs r24, 0 eeac: 08 c0 rjmp .+16 ; 0xeebe { #ifdef EXTRUDER_ALTFAN_DETECT if (altfanStatus.isAltfan && !altfanStatus.altfanOverride) newFanSpeed = EXTRUDER_ALTFAN_SPEED_SILENT; eeae: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> eeb2: 83 70 andi r24, 0x03 ; 3 eeb4: 81 30 cpi r24, 0x01 ; 1 eeb6: e9 f4 brne .+58 ; 0xeef2 eeb8: 80 e8 ldi r24, 0x80 ; 128 else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; eeba: 80 93 6d 03 sts 0x036D, r24 ; 0x80036d #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); eebe: 20 91 6d 03 lds r18, 0x036D ; 0x80036d } #ifdef EXTRUDER_0_AUTO_FAN_PIN void timer4_set_fan0(uint8_t duty) { if (duty == 0 || duty == 255) eec2: 8f ef ldi r24, 0xFF ; 255 eec4: 82 0f add r24, r18 eec6: 8e 3f cpi r24, 0xFE ; 254 eec8: d8 f0 brcs .+54 ; 0xef00 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); eeca: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> eece: 87 7f andi r24, 0xF7 ; 247 eed0: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; eed4: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> eed8: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); eedc: 9f b7 in r25, 0x3f ; 63 eede: 22 23 and r18, r18 eee0: 51 f0 breq .+20 ; 0xeef6 eee2: f8 94 cli eee4: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> eee8: 80 62 ori r24, 0x20 ; 32 eeea: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> eeee: 9f bf out 0x3f, r25 ; 63 eef0: 08 95 ret newFanSpeed = 0; if (fanState & 0x01) { #ifdef EXTRUDER_ALTFAN_DETECT if (altfanStatus.isAltfan && !altfanStatus.altfanOverride) newFanSpeed = EXTRUDER_ALTFAN_SPEED_SILENT; else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; eef2: 8f ef ldi r24, 0xFF ; 255 eef4: e2 cf rjmp .-60 ; 0xeeba eef6: f8 94 cli eef8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> eefc: 8f 7d andi r24, 0xDF ; 223 eefe: f5 cf rjmp .-22 ; 0xeeea 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; ef00: ef b7 in r30, 0x3f ; 63 ef02: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); ef04: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> ef08: 88 60 ori r24, 0x08 ; 8 ef0a: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; ef0e: 30 e0 ldi r19, 0x00 ; 0 ef10: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> ef14: 4f ef ldi r20, 0xFF ; 255 ef16: 50 e0 ldi r21, 0x00 ; 0 ef18: 81 ff sbrs r24, 1 ef1a: 04 c0 rjmp .+8 ; 0xef24 ef1c: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> ef20: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> ef24: 24 9f mul r18, r20 ef26: c0 01 movw r24, r0 ef28: 25 9f mul r18, r21 ef2a: 90 0d add r25, r0 ef2c: 34 9f mul r19, r20 ef2e: 90 0d add r25, r0 ef30: 11 24 eor r1, r1 ef32: 6f ef ldi r22, 0xFF ; 255 ef34: 70 e0 ldi r23, 0x00 ; 0 ef36: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> ef3a: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> ef3e: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; ef42: ef bf out 0x3f, r30 ; 63 #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } ef44: 08 95 ret 0000ef46 : void hotendDefaultAutoFanState() { #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); ef46: 8b e2 ldi r24, 0x2B ; 43 ef48: 9d e0 ldi r25, 0x0D ; 13 ef4a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 ef4e: 90 91 b9 04 lds r25, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> ef52: 80 fb bst r24, 0 ef54: 91 f9 bld r25, 1 ef56: 90 93 b9 04 sts 0x04B9, r25 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> #endif resetFanCheck(); ef5a: 0e 94 43 76 call 0xec86 ; 0xec86 setExtruderAutoFanState(1); ef5e: 81 e0 ldi r24, 0x01 ; 1 ef60: 0c 94 51 77 jmp 0xeea2 ; 0xeea2 0000ef64 : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { ef64: 1f 93 push r17 ef66: cf 93 push r28 ef68: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) ef6a: d0 91 4f 03 lds r29, 0x034F ; 0x80034f ef6e: d1 fd sbrc r29, 1 ef70: 1d c0 rjmp .+58 ; 0xefac temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; ef72: 10 91 1e 05 lds r17, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; ef76: c1 e0 ldi r28, 0x01 ; 1 ef78: 20 e0 ldi r18, 0x00 ; 0 ef7a: 30 e0 ldi r19, 0x00 ; 0 ef7c: 48 e4 ldi r20, 0x48 ; 72 ef7e: 52 e4 ldi r21, 0x42 ; 66 ef80: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 ef84: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 ef88: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 ef8c: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 ef90: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> ef94: 18 16 cp r1, r24 ef96: 0c f0 brlt .+2 ; 0xef9a ef98: 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; ef9a: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; ef9c: cd 2b or r28, r29 ef9e: 81 e0 ldi r24, 0x01 ; 1 efa0: 11 11 cpse r17, r1 efa2: 01 c0 rjmp .+2 ; 0xefa6 efa4: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); efa6: c8 2b or r28, r24 efa8: c0 93 4f 03 sts 0x034F, r28 ; 0x80034f } setExtruderAutoFanState(fanState); efac: 80 91 4f 03 lds r24, 0x034F ; 0x80034f #endif } efb0: df 91 pop r29 efb2: cf 91 pop r28 efb4: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); efb6: 0c 94 51 77 jmp 0xeea2 ; 0xeea2 0000efba : 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) { efba: ef 92 push r14 efbc: ff 92 push r15 efbe: 0f 93 push r16 efc0: 1f 93 push r17 efc2: cf 93 push r28 efc4: df 93 push r29 efc6: ec 01 movw r28, r24 efc8: 8b 01 movw r16, r22 efca: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) efcc: 0e 94 e1 5c call 0xb9c2 ; 0xb9c2 efd0: 81 11 cpse r24, r1 efd2: 0b c0 rjmp .+22 ; 0xefea #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); efd4: a8 01 movw r20, r16 efd6: be 01 movw r22, r28 efd8: 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); } efda: df 91 pop r29 efdc: cf 91 pop r28 efde: 1f 91 pop r17 efe0: 0f 91 pop r16 efe2: ff 90 pop r15 efe4: 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); efe6: 0d 94 6f dd jmp 0x3bade ; 0x3bade } 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); } efea: df 91 pop r29 efec: cf 91 pop r28 efee: 1f 91 pop r17 eff0: 0f 91 pop r16 eff2: ff 90 pop r15 eff4: ef 90 pop r14 eff6: 08 95 ret 0000eff8 : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { eff8: 0f 93 push r16 effa: 1f 93 push r17 effc: cf 93 push r28 effe: df 93 push r29 f000: 8c 01 movw r16, r24 f002: d6 2f mov r29, r22 f004: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); f006: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 if (val == EEPROM_EMPTY_VALUE16) { f00a: 8f 3f cpi r24, 0xFF ; 255 f00c: 98 07 cpc r25, r24 f00e: 39 f4 brne .+14 ; 0xf01e 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); f010: 6d 2f mov r22, r29 f012: 7c 2f mov r23, r28 f014: c8 01 movw r24, r16 f016: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 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; f01a: 8d 2f mov r24, r29 f01c: 9c 2f mov r25, r28 } return val; } f01e: df 91 pop r29 f020: cf 91 pop r28 f022: 1f 91 pop r17 f024: 0f 91 pop r16 f026: 08 95 ret 0000f028 : 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) { f028: 0f 93 push r16 f02a: 1f 93 push r17 f02c: cf 93 push r28 f02e: 8c 01 movw r16, r24 f030: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); f032: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 if (val == EEPROM_EMPTY_VALUE) { f036: 8f 3f cpi r24, 0xFF ; 255 f038: 29 f4 brne .+10 ; 0xf044 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); f03a: 6c 2f mov r22, r28 f03c: c8 01 movw r24, r16 f03e: 0f 94 a3 dd call 0x3bb46 ; 0x3bb46 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; f042: 8c 2f mov r24, r28 } return val; } f044: cf 91 pop r28 f046: 1f 91 pop r17 f048: 0f 91 pop r16 f04a: 08 95 ret 0000f04c : 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) { f04c: cf 93 push r28 f04e: df 93 push r29 f050: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); f052: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 f056: bc 01 movw r22, r24 f058: 6f 5f subi r22, 0xFF ; 255 f05a: 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); f05c: 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); } f05e: df 91 pop r29 f060: 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); f062: 0d 94 b9 dd jmp 0x3bb72 ; 0x3bb72 0000f066 : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { f066: cf 93 push r28 f068: df 93 push r29 f06a: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); f06c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 f070: 61 e0 ldi r22, 0x01 ; 1 f072: 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); f074: 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); } f076: df 91 pop r29 f078: 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); f07a: 0d 94 a3 dd jmp 0x3bb46 ; 0x3bb46 0000f07e : while (__n--) { eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { f07e: cf 93 push r28 f080: df 93 push r29 f082: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); f084: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 f088: 61 e0 ldi r22, 0x01 ; 1 f08a: 81 11 cpse r24, r1 f08c: 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); f08e: ce 01 movw r24, r28 } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } f090: df 91 pop r29 f092: 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); f094: 0d 94 a3 dd jmp 0x3bb46 ; 0x3bb46 0000f098 : 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); f098: 2b e0 ldi r18, 0x0B ; 11 f09a: 82 9f mul r24, r18 f09c: c0 01 movw r24, r0 f09e: 11 24 eor r1, r1 f0a0: 80 5b subi r24, 0xB0 ; 176 f0a2: 92 4f sbci r25, 0xF2 ; 242 f0a4: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 f0a8: 21 e0 ldi r18, 0x01 ; 1 f0aa: 01 96 adiw r24, 0x01 ; 1 f0ac: 09 f4 brne .+2 ; 0xf0b0 f0ae: 20 e0 ldi r18, 0x00 ; 0 } f0b0: 82 2f mov r24, r18 f0b2: 08 95 ret 0000f0b4 : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { f0b4: cf 93 push r28 f0b6: df 93 push r29 f0b8: c8 2f mov r28, r24 f0ba: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; f0bc: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; f0be: c8 30 cpi r28, 0x08 ; 8 f0c0: 0c f0 brlt .+2 ; 0xf0c4 f0c2: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; f0c4: 8c 2f mov r24, r28 f0c6: 0e 94 4c 78 call 0xf098 ; 0xf098 f0ca: 81 11 cpse r24, r1 f0cc: 03 c0 rjmp .+6 ; 0xf0d4 f0ce: 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) f0d0: a9 f7 brne .-22 ; 0xf0bc { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; f0d2: cf ef ldi r28, 0xFF ; 255 } f0d4: 8c 2f mov r24, r28 f0d6: df 91 pop r29 f0d8: cf 91 pop r28 f0da: 08 95 ret 0000f0dc : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); f0dc: 81 ea ldi r24, 0xA1 ; 161 f0de: 9d e0 ldi r25, 0x0D ; 13 f0e0: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 sheet = eeprom_next_initialized_sheet(sheet); f0e4: 0e 94 5a 78 call 0xf0b4 ; 0xf0b4 if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); f0e8: 87 fd sbrc r24, 7 f0ea: 05 c0 rjmp .+10 ; 0xf0f6 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f0ec: 68 2f mov r22, r24 f0ee: 81 ea ldi r24, 0xA1 ; 161 f0f0: 9d e0 ldi r25, 0x0D ; 13 f0f2: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe { 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); } f0f6: 08 95 ret 0000f0f8 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { f0f8: 0f 93 push r16 f0fa: 1f 93 push r17 f0fc: cf 93 push r28 f0fe: c8 2f mov r28, r24 f100: 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")); f102: 6e e5 ldi r22, 0x5E ; 94 f104: 7a e7 ldi r23, 0x7A ; 122 //! @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) f106: 82 30 cpi r24, 0x02 ; 2 f108: 70 f0 brcs .+28 ; 0xf126 { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); f10a: 67 e5 ldi r22, 0x57 ; 87 f10c: 7a e7 ldi r23, 0x7A ; 122 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) f10e: 84 30 cpi r24, 0x04 ; 4 f110: 50 f0 brcs .+20 ; 0xf126 { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); f112: 6f e4 ldi r22, 0x4F ; 79 f114: 7a e7 ldi r23, 0x7A ; 122 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) f116: 84 30 cpi r24, 0x04 ; 4 f118: 31 f0 breq .+12 ; 0xf126 { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); f11a: 67 e4 ldi r22, 0x47 ; 71 f11c: 7a e7 ldi r23, 0x7A ; 122 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) f11e: 85 30 cpi r24, 0x05 ; 5 f120: 11 f0 breq .+4 ; 0xf126 { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); f122: 60 e4 ldi r22, 0x40 ; 64 f124: 7a e7 ldi r23, 0x7A ; 122 f126: c8 01 movw r24, r16 f128: 0f 94 12 db call 0x3b624 ; 0x3b624 } if (index <4 || index >5) f12c: 8c ef ldi r24, 0xFC ; 252 f12e: 8c 0f add r24, r28 f130: 82 30 cpi r24, 0x02 ; 2 f132: 28 f0 brcs .+10 ; 0xf13e { sheetName.c[6] = '0' + ((index % 2)+1); f134: c1 70 andi r28, 0x01 ; 1 f136: cf 5c subi r28, 0xCF ; 207 f138: f8 01 movw r30, r16 f13a: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; f13c: 17 82 std Z+7, r1 ; 0x07 } } f13e: cf 91 pop r28 f140: 1f 91 pop r17 f142: 0f 91 pop r16 f144: 08 95 ret 0000f146 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f146: 61 e0 ldi r22, 0x01 ; 1 f148: 80 ec ldi r24, 0xC0 ; 192 f14a: 9f e0 ldi r25, 0x0F ; 15 f14c: 0f 94 7f dd call 0x3bafe ; 0x3bafe f150: 60 e0 ldi r22, 0x00 ; 0 f152: 8f eb ldi r24, 0xBF ; 191 f154: 9f e0 ldi r25, 0x0F ; 15 f156: 0f 94 7f dd call 0x3bafe ; 0x3bafe f15a: 60 e0 ldi r22, 0x00 ; 0 f15c: 8e eb ldi r24, 0xBE ; 190 f15e: 9f e0 ldi r25, 0x0F ; 15 f160: 0f 94 7f dd call 0x3bafe ; 0x3bafe f164: 60 e0 ldi r22, 0x00 ; 0 f166: 8d eb ldi r24, 0xBD ; 189 f168: 9f e0 ldi r25, 0x0F ; 15 f16a: 0f 94 7f dd call 0x3bafe ; 0x3bafe f16e: 60 e0 ldi r22, 0x00 ; 0 f170: 8c eb ldi r24, 0xBC ; 188 f172: 9f e0 ldi r25, 0x0F ; 15 f174: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0000f178 : } void print_hex_byte(uint8_t val) { f178: cf 93 push r28 f17a: c8 2f mov r28, r24 print_hex_nibble(val >> 4); f17c: 82 95 swap r24 f17e: 8f 70 andi r24, 0x0F ; 15 f180: 0e 94 0a 65 call 0xca14 ; 0xca14 print_hex_nibble(val & 15); f184: 8c 2f mov r24, r28 f186: 8f 70 andi r24, 0x0F ; 15 } f188: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); f18a: 0c 94 0a 65 jmp 0xca14 ; 0xca14 0000f18e : // 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) { f18e: 80 91 81 10 lds r24, 0x1081 ; 0x801081 f192: 90 91 82 10 lds r25, 0x1082 ; 0x801082 f196: 18 16 cp r1, r24 f198: 19 06 cpc r1, r25 f19a: 0c f0 brlt .+2 ; 0xf19e f19c: 43 c0 rjmp .+134 ; 0xf224 SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { f19e: 01 97 sbiw r24, 0x01 ; 1 f1a0: 90 93 82 10 sts 0x1082, r25 ; 0x801082 f1a4: 80 93 81 10 sts 0x1081, r24 ; 0x801081 f1a8: 89 2b or r24, r25 f1aa: a1 f4 brne .+40 ; 0xf1d4 // Empty buffer. if (serial_count == 0) f1ac: 80 91 7c 10 lds r24, 0x107C ; 0x80107c f1b0: 90 91 7d 10 lds r25, 0x107D ; 0x80107d f1b4: 89 2b or r24, r25 f1b6: 21 f4 brne .+8 ; 0xf1c0 // No serial communication is pending. Reset both pointers to zero. bufindw = 0; f1b8: 10 92 7f 10 sts 0x107F, r1 ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> f1bc: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e <_ZL7bufindw.lto_priv.569> bufindr = bufindw; f1c0: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.569> f1c4: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> f1c8: 90 93 71 12 sts 0x1271, r25 ; 0x801271 f1cc: 80 93 70 12 sts 0x1270, r24 ; 0x801270 SERIAL_ECHOPGM(" new command on the top: "); SERIAL_ECHO(cmdbuffer+bufindr+CMDHDRSIZE); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; f1d0: 81 e0 ldi r24, 0x01 ; 1 f1d2: 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) ; f1d4: 80 91 70 12 lds r24, 0x1270 ; 0x801270 f1d8: 90 91 71 12 lds r25, 0x1271 ; 0x801271 f1dc: 03 96 adiw r24, 0x03 ; 3 f1de: fc 01 movw r30, r24 f1e0: ed 57 subi r30, 0x7D ; 125 f1e2: ff 4e sbci r31, 0xEF ; 239 f1e4: 20 81 ld r18, Z f1e6: 01 96 adiw r24, 0x01 ; 1 f1e8: 21 11 cpse r18, r1 f1ea: f9 cf rjmp .-14 ; 0xf1de f1ec: fc 01 movw r30, r24 f1ee: ed 57 subi r30, 0x7D ; 125 f1f0: 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) ; f1f2: 8d 3e cpi r24, 0xED ; 237 f1f4: 21 e0 ldi r18, 0x01 ; 1 f1f6: 92 07 cpc r25, r18 f1f8: 40 f4 brcc .+16 ; 0xf20a f1fa: 41 91 ld r20, Z+ f1fc: 9c 01 movw r18, r24 f1fe: 2f 5f subi r18, 0xFF ; 255 f200: 3f 4f sbci r19, 0xFF ; 255 f202: 41 11 cpse r20, r1 f204: e1 cf rjmp .-62 ; 0xf1c8 f206: c9 01 movw r24, r18 f208: f4 cf rjmp .-24 ; 0xf1f2 // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { f20a: e3 e8 ldi r30, 0x83 ; 131 f20c: f0 e1 ldi r31, 0x10 ; 16 f20e: 8d 3e cpi r24, 0xED ; 237 f210: 21 e0 ldi r18, 0x01 ; 1 f212: 92 07 cpc r25, r18 f214: c9 f6 brne .-78 ; 0xf1c8 f216: cf 01 movw r24, r30 f218: 83 58 subi r24, 0x83 ; 131 f21a: 90 41 sbci r25, 0x10 ; 16 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; f21c: 21 91 ld r18, Z+ f21e: 22 23 and r18, r18 f220: d1 f3 breq .-12 ; 0xf216 f222: d2 cf rjmp .-92 ; 0xf1c8 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; f224: 80 e0 ldi r24, 0x00 ; 0 } f226: 08 95 ret 0000f228 : 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; f228: 80 91 93 04 lds r24, 0x0493 ; 0x800493 f22c: 90 91 94 04 lds r25, 0x0494 ; 0x800494 f230: 20 91 95 04 lds r18, 0x0495 ; 0x800495 f234: 30 91 96 04 lds r19, 0x0496 ; 0x800496 f238: 82 1b sub r24, r18 f23a: 93 0b sbc r25, r19 } f23c: 8f 77 andi r24, 0x7F ; 127 f23e: 99 27 eor r25, r25 f240: 08 95 ret 0000f242 : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; f242: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) f244: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; f246: 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; f248: db 01 movw r26, r22 f24a: 4d 91 ld r20, X+ f24c: bd 01 movw r22, r26 f24e: 40 32 cpi r20, 0x20 ; 32 f250: 49 f0 breq .+18 ; 0xf264 if (i == 8) f252: 28 30 cpi r18, 0x08 ; 8 f254: 11 f4 brne .+4 ; 0xf25a { *pos++='.'; f256: 30 83 st Z, r19 f258: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; f25a: db 01 movw r26, r22 f25c: 11 97 sbiw r26, 0x01 ; 1 f25e: 4c 91 ld r20, X f260: 40 83 st Z, r20 f262: 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++) f264: 2f 5f subi r18, 0xFF ; 255 f266: 2b 30 cpi r18, 0x0B ; 11 f268: 79 f7 brne .-34 ; 0xf248 { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; f26a: 10 82 st Z, r1 return buffer; } f26c: 08 95 ret 0000f26e : 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);} f26e: 40 e0 ldi r20, 0x00 ; 0 f270: 50 e0 ldi r21, 0x00 ; 0 f272: ba 01 movw r22, r20 f274: 0d 94 76 6d jmp 0x2daec ; 0x2daec 0000f278 : 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();} f278: fc 01 movw r30, r24 f27a: 23 81 ldd r18, Z+3 ; 0x03 f27c: 21 11 cpse r18, r1 f27e: 0d 94 3e a4 jmp 0x3487c ; 0x3487c f282: 08 95 ret 0000f284 : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) f284: 90 91 21 05 lds r25, 0x0521 ; 0x800521 f288: 91 11 cpse r25, r1 f28a: 07 c0 rjmp .+14 ; 0xf29a { while (!((M_UCSRxA) & (1 << M_UDREx))); f28c: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> f290: 95 ff sbrs r25, 5 f292: fc cf rjmp .-8 ; 0xf28c M_UDRx = c; f294: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> f298: 08 95 ret } else if (selectedSerialPort == 1) f29a: 91 30 cpi r25, 0x01 ; 1 f29c: 31 f4 brne .+12 ; 0xf2aa { while (!((UCSR1A) & (1 << UDRE1))); f29e: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> f2a2: 95 ff sbrs r25, 5 f2a4: fc cf rjmp .-8 ; 0xf29e UDR1 = c; f2a6: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } f2aa: 08 95 ret 0000f2ac : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); f2ac: 0e 94 42 79 call 0xf284 ; 0xf284 return 0; } f2b0: 90 e0 ldi r25, 0x00 ; 0 f2b2: 80 e0 ldi r24, 0x00 ; 0 f2b4: 08 95 ret 0000f2b6 : 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) { f2b6: cf 93 push r28 f2b8: df 93 push r29 f2ba: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { f2bc: fe 01 movw r30, r28 f2be: 84 91 lpm r24, Z f2c0: 88 23 and r24, r24 f2c2: 21 f0 breq .+8 ; 0xf2cc MYSERIAL.write((char)ch); f2c4: 0e 94 42 79 call 0xf284 ; 0xf284 ++str; f2c8: 21 96 adiw r28, 0x01 ; 1 f2ca: f8 cf rjmp .-16 ; 0xf2bc } } f2cc: df 91 pop r29 f2ce: cf 91 pop r28 f2d0: 08 95 ret 0000f2d2 : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { f2d2: cf 92 push r12 f2d4: df 92 push r13 f2d6: ef 92 push r14 f2d8: 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]; f2da: c0 90 61 0e lds r12, 0x0E61 ; 0x800e61 f2de: d0 90 62 0e lds r13, 0x0E62 ; 0x800e62 f2e2: e0 90 63 0e lds r14, 0x0E63 ; 0x800e63 f2e6: f0 90 64 0e lds r15, 0x0E64 ; 0x800e64 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); f2ea: 87 ed ldi r24, 0xD7 ; 215 f2ec: 9f e7 ldi r25, 0x7F ; 127 f2ee: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f2f2: 42 e0 ldi r20, 0x02 ; 2 f2f4: c7 01 movw r24, r14 f2f6: b6 01 movw r22, r12 f2f8: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); f2fc: 8f ec ldi r24, 0xCF ; 207 f2fe: 9f e7 ldi r25, 0x7F ; 127 f300: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 f304: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 f308: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 f30c: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 f310: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 f314: 41 e0 ldi r20, 0x01 ; 1 f316: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } f31a: ff 90 pop r15 f31c: ef 90 pop r14 f31e: df 90 pop r13 f320: 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(); f322: 0d 94 5d d6 jmp 0x3acba ; 0x3acba 0000f326 : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { f326: 4f 92 push r4 f328: 5f 92 push r5 f32a: 6f 92 push r6 f32c: 7f 92 push r7 f32e: 8f 92 push r8 f330: 9f 92 push r9 f332: af 92 push r10 f334: bf 92 push r11 f336: cf 92 push r12 f338: df 92 push r13 f33a: ef 92 push r14 f33c: ff 92 push r15 f33e: 0f 93 push r16 f340: 1f 93 push r17 f342: cf 93 push r28 f344: df 93 push r29 f346: cc 24 eor r12, r12 f348: ca 94 dec r12 f34a: dc 2c mov r13, r12 f34c: 76 01 movw r14, r12 f34e: 0e ea ldi r16, 0xAE ; 174 f350: 1f e0 ldi r17, 0x0F ; 15 f352: 93 e2 ldi r25, 0x23 ; 35 f354: 89 2e mov r8, r25 f356: 91 2c mov r9, r1 f358: a1 2c mov r10, r1 f35a: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; f35c: 41 2c mov r4, r1 f35e: 51 2c mov r5, r1 f360: 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; f362: d0 e0 ldi r29, 0x00 ; 0 f364: 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) { f366: 8f ef ldi r24, 0xFF ; 255 f368: c8 16 cp r12, r24 f36a: 09 f4 brne .+2 ; 0xf36e f36c: 5d c0 rjmp .+186 ; 0xf428 usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); f36e: c8 01 movw r24, r16 f370: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 f374: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; f376: bc 01 movw r22, r24 f378: 99 0f add r25, r25 f37a: 88 0b sbc r24, r24 f37c: 99 0b sbc r25, r25 f37e: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> f382: 20 91 7a 06 lds r18, 0x067A ; 0x80067a f386: 30 91 7b 06 lds r19, 0x067B ; 0x80067b f38a: 40 91 7c 06 lds r20, 0x067C ; 0x80067c f38e: 50 91 7d 06 lds r21, 0x067D ; 0x80067d f392: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> f396: 2b 01 movw r4, r22 f398: 3c 01 movw r6, r24 f39a: c7 01 movw r24, r14 f39c: b6 01 movw r22, r12 f39e: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); f3a2: 89 ec ldi r24, 0xC9 ; 201 f3a4: 9e e7 ldi r25, 0x7E ; 126 f3a6: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 f3aa: c5 01 movw r24, r10 f3ac: b4 01 movw r22, r8 f3ae: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); f3b2: 89 ec ldi r24, 0xC9 ; 201 f3b4: 9e e7 ldi r25, 0x7E ; 126 f3b6: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f3ba: be 01 movw r22, r28 f3bc: 0d 2e mov r0, r29 f3be: 00 0c add r0, r0 f3c0: 88 0b sbc r24, r24 f3c2: 99 0b sbc r25, r25 f3c4: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); f3c8: 89 ec ldi r24, 0xC9 ; 201 f3ca: 9e e7 ldi r25, 0x7E ; 126 f3cc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOLLN(mm * 1000); f3d0: 20 e0 ldi r18, 0x00 ; 0 f3d2: 30 e0 ldi r19, 0x00 ; 0 f3d4: 4a e7 ldi r20, 0x7A ; 122 f3d6: 54 e4 ldi r21, 0x44 ; 68 f3d8: c3 01 movw r24, r6 f3da: b2 01 movw r22, r4 f3dc: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> f3e0: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e f3e4: 85 e0 ldi r24, 0x05 ; 5 f3e6: 88 0e add r8, r24 f3e8: 91 1c adc r9, r1 f3ea: a1 1c adc r10, r1 f3ec: b1 1c adc r11, r1 f3ee: 0e 5f subi r16, 0xFE ; 254 f3f0: 1f 4f sbci r17, 0xFF ; 255 f3f2: 8f ef ldi r24, 0xFF ; 255 f3f4: c8 1a sub r12, r24 f3f6: d8 0a sbc r13, r24 f3f8: e8 0a sbc r14, r24 f3fa: 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++) { f3fc: 0a 3b cpi r16, 0xBA ; 186 f3fe: 8f e0 ldi r24, 0x0F ; 15 f400: 18 07 cpc r17, r24 f402: 09 f0 breq .+2 ; 0xf406 f404: b0 cf rjmp .-160 ; 0xf366 SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } f406: df 91 pop r29 f408: cf 91 pop r28 f40a: 1f 91 pop r17 f40c: 0f 91 pop r16 f40e: ff 90 pop r15 f410: ef 90 pop r14 f412: df 90 pop r13 f414: cf 90 pop r12 f416: bf 90 pop r11 f418: af 90 pop r10 f41a: 9f 90 pop r9 f41c: 8f 90 pop r8 f41e: 7f 90 pop r7 f420: 6f 90 pop r6 f422: 5f 90 pop r5 f424: 4f 90 pop r4 f426: 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); f428: 88 e5 ldi r24, 0x58 ; 88 f42a: 9d e3 ldi r25, 0x3D ; 61 f42c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 f430: b8 cf rjmp .-144 ; 0xf3a2 0000f432 : /// @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) { f432: 88 23 and r24, r24 f434: 71 f1 breq .+92 ; 0xf492 currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); f436: 8d eb ldi r24, 0xBD ; 189 f438: 9e e7 ldi r25, 0x7E ; 126 f43a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 f43e: 60 91 27 13 lds r22, 0x1327 ; 0x801327 f442: 70 e0 ldi r23, 0x00 ; 0 f444: 90 e0 ldi r25, 0x00 ; 0 f446: 80 e0 ldi r24, 0x00 ; 0 f448: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; f44c: 80 91 27 13 lds r24, 0x1327 ; 0x801327 f450: 84 30 cpi r24, 0x04 ; 4 f452: d8 f0 brcs .+54 ; 0xf48a f454: 10 92 27 13 sts 0x1327, r1 ; 0x801327 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); f458: 88 eb ldi r24, 0xB8 ; 184 f45a: 9e e7 ldi r25, 0x7E ; 126 f45c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN((int)currentMMUSlot); f460: 80 91 27 13 lds r24, 0x1327 ; 0x801327 f464: 90 e0 ldi r25, 0x00 ; 0 f466: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 return currentMMUSlot; f46a: 80 91 27 13 lds r24, 0x1327 ; 0x801327 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; f46e: 20 91 ad 05 lds r18, 0x05AD ; 0x8005ad f472: 30 91 ae 05 lds r19, 0x05AE ; 0x8005ae f476: 30 93 6e 0e sts 0x0E6E, r19 ; 0x800e6e f47a: 20 93 6d 0e sts 0x0E6D, r18 ; 0x800e6d slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); } setTargetHotend(saved_extruder_temperature); MMU2::mmu2.load_filament_to_nozzle(slot); f47e: 0f 94 33 1c call 0x23866 ; 0x23866 load_filament_final_feed(); // @@TODO verify f482: 0e 94 c8 65 call 0xcb90 ; 0xcb90 st_synchronize(); f486: 0d 94 27 58 jmp 0x2b04e ; 0x2b04e { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; else currentMMUSlot++; f48a: 8f 5f subi r24, 0xFF ; 255 f48c: 80 93 27 13 sts 0x1327, r24 ; 0x801327 f490: e3 cf rjmp .-58 ; 0xf458 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); f492: 80 e8 ldi r24, 0x80 ; 128 f494: 9f e3 ldi r25, 0x3F ; 63 f496: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 f49a: 70 e0 ldi r23, 0x00 ; 0 f49c: 60 e0 ldi r22, 0x00 ; 0 f49e: 0e 94 dd d8 call 0x1b1ba ; 0x1b1ba f4a2: e5 cf rjmp .-54 ; 0xf46e 0000f4a4 : return final_result; } void gcode_M114() { f4a4: cf 93 push r28 f4a6: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); f4a8: 85 eb ldi r24, 0xB5 ; 181 f4aa: 9e e7 ldi r25, 0x7E ; 126 f4ac: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOL(current_position[X_AXIS]); f4b0: c3 e4 ldi r28, 0x43 ; 67 f4b2: d7 e0 ldi r29, 0x07 ; 7 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f4b4: 68 81 ld r22, Y f4b6: 79 81 ldd r23, Y+1 ; 0x01 f4b8: 8a 81 ldd r24, Y+2 ; 0x02 f4ba: 9b 81 ldd r25, Y+3 ; 0x03 f4bc: 42 e0 ldi r20, 0x02 ; 2 f4be: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOLPGM(" Y:"); f4c2: 81 eb ldi r24, 0xB1 ; 177 f4c4: 9e e7 ldi r25, 0x7E ; 126 f4c6: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 f4ca: 6c 81 ldd r22, Y+4 ; 0x04 f4cc: 7d 81 ldd r23, Y+5 ; 0x05 f4ce: 8e 81 ldd r24, Y+6 ; 0x06 f4d0: 9f 81 ldd r25, Y+7 ; 0x07 f4d2: 42 e0 ldi r20, 0x02 ; 2 f4d4: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); f4d8: 8d ea ldi r24, 0xAD ; 173 f4da: 9e e7 ldi r25, 0x7E ; 126 f4dc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 f4e0: 68 85 ldd r22, Y+8 ; 0x08 f4e2: 79 85 ldd r23, Y+9 ; 0x09 f4e4: 8a 85 ldd r24, Y+10 ; 0x0a f4e6: 9b 85 ldd r25, Y+11 ; 0x0b f4e8: 42 e0 ldi r20, 0x02 ; 2 f4ea: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); f4ee: 89 ea ldi r24, 0xA9 ; 169 f4f0: 9e e7 ldi r25, 0x7E ; 126 f4f2: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 f4f6: 6c 85 ldd r22, Y+12 ; 0x0c f4f8: 7d 85 ldd r23, Y+13 ; 0x0d f4fa: 8e 85 ldd r24, Y+14 ; 0x0e f4fc: 9f 85 ldd r25, Y+15 ; 0x0f f4fe: 42 e0 ldi r20, 0x02 ; 2 f500: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X f504: 89 e7 ldi r24, 0x79 ; 121 f506: 97 e6 ldi r25, 0x67 ; 103 f508: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); f50c: 80 e0 ldi r24, 0x00 ; 0 f50e: 0f 94 05 58 call 0x2b00a ; 0x2b00a f512: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> f516: ce e6 ldi r28, 0x6E ; 110 f518: d6 e0 ldi r29, 0x06 ; 6 f51a: 2c 81 ldd r18, Y+4 ; 0x04 f51c: 3d 81 ldd r19, Y+5 ; 0x05 f51e: 4e 81 ldd r20, Y+6 ; 0x06 f520: 5f 81 ldd r21, Y+7 ; 0x07 f522: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> f526: 42 e0 ldi r20, 0x02 ; 2 f528: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOLPGM(" Y:"); f52c: 85 ea ldi r24, 0xA5 ; 165 f52e: 9e e7 ldi r25, 0x7E ; 126 f530: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); f534: 81 e0 ldi r24, 0x01 ; 1 f536: 0f 94 05 58 call 0x2b00a ; 0x2b00a f53a: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> f53e: 28 85 ldd r18, Y+8 ; 0x08 f540: 39 85 ldd r19, Y+9 ; 0x09 f542: 4a 85 ldd r20, Y+10 ; 0x0a f544: 5b 85 ldd r21, Y+11 ; 0x0b f546: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> f54a: 42 e0 ldi r20, 0x02 ; 2 f54c: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOLPGM(" Z:"); f550: 81 ea ldi r24, 0xA1 ; 161 f552: 9e e7 ldi r25, 0x7E ; 126 f554: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); f558: 82 e0 ldi r24, 0x02 ; 2 f55a: 0f 94 05 58 call 0x2b00a ; 0x2b00a f55e: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> f562: 2c 85 ldd r18, Y+12 ; 0x0c f564: 3d 85 ldd r19, Y+13 ; 0x0d f566: 4e 85 ldd r20, Y+14 ; 0x0e f568: 5f 85 ldd r21, Y+15 ; 0x0f f56a: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> f56e: 42 e0 ldi r20, 0x02 ; 2 f570: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOLPGM(" E:"); f574: 8d e9 ldi r24, 0x9D ; 157 f576: 9e e7 ldi r25, 0x7E ; 126 f578: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); f57c: 83 e0 ldi r24, 0x03 ; 3 f57e: 0f 94 05 58 call 0x2b00a ; 0x2b00a f582: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> f586: 28 89 ldd r18, Y+16 ; 0x10 f588: 39 89 ldd r19, Y+17 ; 0x11 f58a: 4a 89 ldd r20, Y+18 ; 0x12 f58c: 5b 89 ldd r21, Y+19 ; 0x13 f58e: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> } f592: df 91 pop r29 f594: 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]); f596: 0d 94 9f 75 jmp 0x2eb3e ; 0x2eb3e 0000f59a : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); f59a: 8c ea ldi r24, 0xAC ; 172 f59c: 9d e7 ldi r25, 0x7D ; 125 f59e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 f5a2: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 f5a6: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 f5aa: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 f5ae: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 f5b2: 41 e0 ldi r20, 0x01 ; 1 f5b4: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f5b8: 89 ea ldi r24, 0xA9 ; 169 f5ba: 9d e7 ldi r25, 0x7D ; 125 f5bc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f5c0: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d f5c4: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e f5c8: 07 2e mov r0, r23 f5ca: 00 0c add r0, r0 f5cc: 88 0b sbc r24, r24 f5ce: 99 0b sbc r25, r25 f5d0: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> f5d4: 41 e0 ldi r20, 0x01 ; 1 f5d6: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); f5da: 85 ea ldi r24, 0xA5 ; 165 f5dc: 9d e7 ldi r25, 0x7D ; 125 f5de: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 f5e2: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 f5e6: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 f5ea: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 f5ee: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 f5f2: 41 e0 ldi r20, 0x01 ; 1 f5f4: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); f5f8: 82 ea ldi r24, 0xA2 ; 162 f5fa: 9d e7 ldi r25, 0x7D ; 125 f5fc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; f600: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b f604: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c f608: 07 2e mov r0, r23 f60a: 00 0c add r0, r0 f60c: 88 0b sbc r24, r24 f60e: 99 0b sbc r25, r25 f610: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> f614: 41 e0 ldi r20, 0x01 ; 1 f616: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); f61a: 8d e9 ldi r24, 0x9D ; 157 f61c: 9d e7 ldi r25, 0x7D ; 125 f61e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 f622: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 f626: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 f62a: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 f62e: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 f632: 41 e0 ldi r20, 0x01 ; 1 f634: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f638: 8a e9 ldi r24, 0x9A ; 154 f63a: 9d e7 ldi r25, 0x7D ; 125 f63c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f640: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d f644: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e f648: 07 2e mov r0, r23 f64a: 00 0c add r0, r0 f64c: 88 0b sbc r24, r24 f64e: 99 0b sbc r25, r25 f650: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> f654: 41 e0 ldi r20, 0x01 ; 1 f656: 0f 94 e7 d5 call 0x3abce ; 0x3abce #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); f65a: 86 e9 ldi r24, 0x96 ; 150 f65c: 9d e7 ldi r25, 0x7D ; 125 f65e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f662: 60 91 19 05 lds r22, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.472> f666: 70 e0 ldi r23, 0x00 ; 0 f668: 90 e0 ldi r25, 0x00 ; 0 f66a: 80 e0 ldi r24, 0x00 ; 0 f66c: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); f670: 81 e9 ldi r24, 0x91 ; 145 f672: 9d e7 ldi r25, 0x7D ; 125 f674: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 f678: 60 91 1a 06 lds r22, 0x061A ; 0x80061a f67c: 70 e0 ldi r23, 0x00 ; 0 f67e: 90 e0 ldi r25, 0x00 ; 0 f680: 80 e0 ldi r24, 0x00 ; 0 f682: 0f 94 af d2 call 0x3a55e ; 0x3a55e #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); f686: 8d e8 ldi r24, 0x8D ; 141 f688: 9d e7 ldi r25, 0x7D ; 125 f68a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f68e: 60 91 99 03 lds r22, 0x0399 ; 0x800399 f692: 70 91 9a 03 lds r23, 0x039A ; 0x80039a f696: 80 91 9b 03 lds r24, 0x039B ; 0x80039b f69a: 90 91 9c 03 lds r25, 0x039C ; 0x80039c f69e: 41 e0 ldi r20, 0x01 ; 1 f6a0: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL_F(current_temperature_pinda,1); #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR SERIAL_PROTOCOLPGM(" A:"); f6a4: 89 e8 ldi r24, 0x89 ; 137 f6a6: 9d e7 ldi r25, 0x7D ; 125 f6a8: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 f6ac: 60 91 53 06 lds r22, 0x0653 ; 0x800653 f6b0: 70 91 54 06 lds r23, 0x0654 ; 0x800654 f6b4: 80 91 55 06 lds r24, 0x0655 ; 0x800655 f6b8: 90 91 56 06 lds r25, 0x0656 ; 0x800656 f6bc: 41 e0 ldi r20, 0x01 ; 1 f6be: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); f6c2: 0d 94 5d d6 jmp 0x3acba ; 0x3acba 0000f6c6 : } } 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); } f6c6: 20 91 66 14 lds r18, 0x1466 ; 0x801466 f6ca: 30 e0 ldi r19, 0x00 ; 0 f6cc: a8 ee ldi r26, 0xE8 ; 232 f6ce: b3 e0 ldi r27, 0x03 ; 3 f6d0: 0f 94 fb dd call 0x3bbf6 ; 0x3bbf6 <__umulhisi3> f6d4: ab 01 movw r20, r22 f6d6: bc 01 movw r22, r24 f6d8: 87 e6 ldi r24, 0x67 ; 103 f6da: 94 e1 ldi r25, 0x14 ; 20 f6dc: 0f 94 6a 3f call 0x27ed4 ; 0x27ed4 ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f6e0: 88 23 and r24, r24 f6e2: 99 f0 breq .+38 ; 0xf70a f6e4: 80 91 65 14 lds r24, 0x1465 ; 0x801465 { if(autoReportFeatures.Temp()){ f6e8: 80 fd sbrc r24, 0 gcode_M105(); f6ea: 0e 94 cd 7a call 0xf59a ; 0xf59a f6ee: 80 91 65 14 lds r24, 0x1465 ; 0x801465 } if(autoReportFeatures.Pos()){ f6f2: 82 fd sbrc r24, 2 gcode_M114(); f6f4: 0e 94 52 7a call 0xf4a4 ; 0xf4a4 f6f8: 80 91 65 14 lds r24, 0x1465 ; 0x801465 } #if defined(AUTO_REPORT) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) if(autoReportFeatures.Fans()){ f6fc: 81 fd sbrc r24, 1 gcode_M123(); f6fe: 0e 94 b9 67 call 0xcf72 ; 0xcf72 } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f702: 87 e6 ldi r24, 0x67 ; 103 f704: 94 e1 ldi r25, 0x14 ; 20 f706: 0d 94 29 41 jmp 0x28252 ; 0x28252 ::start()> gcode_M123(); } #endif //AUTO_REPORT and (FANCHECK and TACH_0 or TACH_1) autoReportFeatures.TimerStart(); } } f70a: 08 95 ret 0000f70c : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); f70c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 MYSERIAL.println(); f710: 0d 94 5d d6 jmp 0x3acba ; 0x3acba 0000f714 : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { f714: 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))); f716: 81 ea ldi r24, 0xA1 ; 161 f718: 9d e0 ldi r25, 0x0D ; 13 f71a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> f71e: cb e0 ldi r28, 0x0B ; 11 f720: 8c 9f mul r24, r28 f722: c0 01 movw r24, r0 f724: 11 24 eor r1, r1 f726: 80 5b subi r24, 0xB0 ; 176 f728: 92 4f sbci r25, 0xF2 ; 242 f72a: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { f72e: 81 56 subi r24, 0x61 ; 97 f730: 90 4f sbci r25, 0xF0 ; 240 f732: 80 3a cpi r24, 0xA0 ; 160 f734: 9f 40 sbci r25, 0x0F ; 15 f736: c8 f0 brcs .+50 ; 0xf76a 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"); f738: 86 ea ldi r24, 0xA6 ; 166 f73a: 9f e7 ldi r25, 0x7F ; 127 f73c: 0e 94 86 7b call 0xf70c ; 0xf70c eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), f740: 81 ea ldi r24, 0xA1 ; 161 f742: 9d e0 ldi r25, 0x0D ; 13 f744: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 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-> f748: 8c 9f mul r24, r28 f74a: c0 01 movw r24, r0 f74c: 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); f74e: 70 e0 ldi r23, 0x00 ; 0 f750: 60 e0 ldi r22, 0x00 ; 0 f752: 80 5b subi r24, 0xB0 ; 176 f754: 92 4f sbci r25, 0xF2 ; 242 f756: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 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.")); f75a: 89 e6 ldi r24, 0x69 ; 105 f75c: 9f e7 ldi r25, 0x7F ; 127 f75e: 0f 94 07 35 call 0x26a0e ; 0x26a0e lcd_update_enable(true); f762: 81 e0 ldi r24, 0x01 ; 1 } } f764: 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); f766: 0c 94 5a 70 jmp 0xe0b4 ; 0xe0b4 } } f76a: cf 91 pop r28 f76c: 08 95 ret 0000f76e : // 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) { f76e: ff 92 push r15 f770: 0f 93 push r16 f772: 1f 93 push r17 f774: cf 93 push r28 f776: df 93 push r29 if(Stopped == false) { f778: 90 91 14 05 lds r25, 0x0514 ; 0x800514 f77c: 91 11 cpse r25, r1 f77e: 4f c0 rjmp .+158 ; 0xf81e f780: c8 2f mov r28, r24 Stopped = true; f782: 81 e0 ldi r24, 0x01 ; 1 f784: 80 93 14 05 sts 0x0514, r24 ; 0x800514 // Either pause or stop the print if(allow_recovery && printJobOngoing()) { f788: cc 23 and r28, r28 f78a: 11 f1 breq .+68 ; 0xf7d0 f78c: 0e 94 c5 68 call 0xd18a ; 0xd18a f790: 88 23 and r24, r24 f792: f1 f0 breq .+60 ; 0xf7d0 if (!printingIsPaused()) { f794: 0e 94 ba 68 call 0xd174 ; 0xd174 f798: 81 11 cpse r24, r1 f79a: 22 c0 rjmp .+68 ; 0xf7e0 lcd_setalertstatuspgm(_T(MSG_PAUSED_THERMAL_ERROR), LCD_STATUS_CRITICAL); f79c: 81 ea ldi r24, 0xA1 ; 161 f79e: 96 e3 ldi r25, 0x36 ; 54 f7a0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 f7a4: 63 e0 ldi r22, 0x03 ; 3 f7a6: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 // 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; f7aa: f0 90 af 05 lds r15, 0x05AF ; 0x8005af uint16_t ext_temp = saved_extruder_temperature; f7ae: 00 91 ad 05 lds r16, 0x05AD ; 0x8005ad f7b2: 10 91 ae 05 lds r17, 0x05AE ; 0x8005ae uint8_t fan_speed = saved_fan_speed; f7b6: d0 91 ac 05 lds r29, 0x05AC ; 0x8005ac lcd_pause_print(); f7ba: 0f 94 92 3e call 0x27d24 ; 0x27d24 saved_bed_temperature = bed_temp; f7be: f0 92 af 05 sts 0x05AF, r15 ; 0x8005af saved_extruder_temperature = ext_temp; f7c2: 10 93 ae 05 sts 0x05AE, r17 ; 0x8005ae f7c6: 00 93 ad 05 sts 0x05AD, r16 ; 0x8005ad saved_fan_speed = fan_speed; f7ca: d0 93 ac 05 sts 0x05AC, r29 ; 0x8005ac f7ce: 08 c0 rjmp .+16 ; 0xf7e0 } } else { // We got a hard thermal error and/or there is no print going on. Just stop. print_stop(false, true); f7d0: 61 e0 ldi r22, 0x01 ; 1 f7d2: 80 e0 ldi r24, 0x00 ; 0 f7d4: 0f 94 12 15 call 0x22a24 ; 0x22a24 } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); f7d8: 8a ec ldi r24, 0xCA ; 202 f7da: 9a ea ldi r25, 0xAA ; 170 f7dc: cc 23 and r28, r28 f7de: 11 f0 breq .+4 ; 0xf7e4 f7e0: 82 ef ldi r24, 0xF2 ; 242 f7e2: 9a ea ldi r25, 0xAA ; 170 f7e4: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); f7e8: 82 ef ldi r24, 0xF2 ; 242 f7ea: 97 e6 ldi r25, 0x67 ; 103 f7ec: 0e 94 86 7b call 0xf70c ; 0xf70c // 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)); f7f0: 86 e9 ldi r24, 0x96 ; 150 f7f2: 96 e3 ldi r25, 0x36 ; 54 f7f4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 f7f8: 0f 94 0c 0b call 0x21618 ; 0x21618 // 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); f7fc: 9f b7 in r25, 0x3f ; 63 f7fe: f8 94 cli f800: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f804: 84 60 ori r24, 0x04 ; 4 f806: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f80a: 9f bf out 0x3f, r25 ; 63 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); f80c: 0f 94 4e 26 call 0x24c9c ; 0x24c9c if(!allow_recovery) { f810: c1 11 cpse r28, r1 f812: 05 c0 rjmp .+10 ; 0xf81e // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); f814: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 f818: 81 60 ori r24, 0x01 ; 1 f81a: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 } } } f81e: df 91 pop r29 f820: cf 91 pop r28 f822: 1f 91 pop r17 f824: 0f 91 pop r16 f826: ff 90 pop r15 f828: 08 95 ret 0000f82a : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { f82a: ec 01 movw r28, r24 cli(); // Stop interrupts f82c: f8 94 cli disable_heater(); f82e: 0f 94 52 44 call 0x288a4 ; 0x288a4 disable_x(); f832: 17 9a sbi 0x02, 7 ; 2 f834: 10 92 40 07 sts 0x0740, r1 ; 0x800740 disable_y(); f838: 16 9a sbi 0x02, 6 ; 2 f83a: 10 92 41 07 sts 0x0741, r1 ; 0x800741 poweroff_z(); disable_e0(); f83e: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; f840: 8a ec ldi r24, 0xCA ; 202 f842: 9a ea ldi r25, 0xAA ; 170 f844: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); f848: 8a e4 ldi r24, 0x4A ; 74 f84a: 9f e7 ldi r25, 0x7F ; 127 f84c: 0e 94 86 7b call 0xf70c ; 0xf70c if (full_screen_message != NULL) { f850: 20 97 sbiw r28, 0x00 ; 0 f852: 79 f0 breq .+30 ; 0xf872 SERIAL_ERRORLNRPGM(full_screen_message); f854: ce 01 movw r24, r28 f856: 0e 94 86 7b call 0xf70c ; 0xf70c f85a: be 01 movw r22, r28 f85c: 85 e9 ldi r24, 0x95 ; 149 f85e: 9c e0 ldi r25, 0x0C ; 12 f860: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 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); f864: 62 e4 ldi r22, 0x42 ; 66 f866: 84 e9 ldi r24, 0x94 ; 148 f868: 9c e0 ldi r25, 0x0C ; 12 f86a: 0f 94 a3 dd call 0x3bb46 ; 0x3bb46 // 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(); f86e: 0e 94 81 68 call 0xd102 ; 0xd102 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); f872: c2 e4 ldi r28, 0x42 ; 66 f874: df e7 ldi r29, 0x7F ; 127 f876: f1 cf rjmp .-30 ; 0xf85a 0000f878 : #endif //TMC2130 #ifdef TMC2130 void check_Z_crash(void) { if (!READ(Z_TMC2130_DIAG)) { //Z crash f878: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> f87c: 86 fd sbrc r24, 6 f87e: 35 c0 rjmp .+106 ; 0xf8ea FORCE_HIGH_POWER_END; f880: 80 e0 ldi r24, 0x00 ; 0 f882: 0e 94 e5 67 call 0xcfca ; 0xcfca current_position[Z_AXIS] = 0; f886: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b f88a: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c f88e: 10 92 4d 07 sts 0x074D, r1 ; 0x80074d f892: 10 92 4e 07 sts 0x074E, r1 ; 0x80074e plan_set_position_curposXYZE(); f896: 0f 94 1d b9 call 0x3723a ; 0x3723a current_position[Z_AXIS] += MESH_HOME_Z_SEARCH; f89a: 20 e0 ldi r18, 0x00 ; 0 f89c: 30 e0 ldi r19, 0x00 ; 0 f89e: 40 ea ldi r20, 0xA0 ; 160 f8a0: 50 e4 ldi r21, 0x40 ; 64 f8a2: 60 91 4b 07 lds r22, 0x074B ; 0x80074b f8a6: 70 91 4c 07 lds r23, 0x074C ; 0x80074c f8aa: 80 91 4d 07 lds r24, 0x074D ; 0x80074d f8ae: 90 91 4e 07 lds r25, 0x074E ; 0x80074e f8b2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> f8b6: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b f8ba: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c f8be: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d f8c2: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); f8c6: e0 91 99 02 lds r30, 0x0299 ; 0x800299 f8ca: f0 91 9a 02 lds r31, 0x029A ; 0x80029a f8ce: 60 85 ldd r22, Z+8 ; 0x08 f8d0: 71 85 ldd r23, Z+9 ; 0x09 f8d2: 82 85 ldd r24, Z+10 ; 0x0a f8d4: 93 85 ldd r25, Z+11 ; 0x0b f8d6: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); f8da: 0f 94 27 58 call 0x2b04e ; 0x2b04e kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); f8de: 82 e8 ldi r24, 0x82 ; 130 f8e0: 95 e6 ldi r25, 0x65 ; 101 f8e2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 f8e6: 0e 94 15 7c call 0xf82a ; 0xf82a } } f8ea: 08 95 ret 0000f8ec : #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) #endif //TMC2130 { f8ec: 2f 92 push r2 f8ee: 3f 92 push r3 f8f0: 4f 92 push r4 f8f2: 5f 92 push r5 f8f4: 6f 92 push r6 f8f6: 7f 92 push r7 f8f8: 8f 92 push r8 f8fa: 9f 92 push r9 f8fc: af 92 push r10 f8fe: bf 92 push r11 f900: cf 92 push r12 f902: df 92 push r13 f904: ef 92 push r14 f906: ff 92 push r15 f908: 0f 93 push r16 f90a: 1f 93 push r17 f90c: cf 93 push r28 f90e: df 93 push r29 f910: cd b7 in r28, 0x3d ; 61 f912: de b7 in r29, 0x3e ; 62 f914: 60 97 sbiw r28, 0x10 ; 16 f916: 0f b6 in r0, 0x3f ; 63 f918: f8 94 cli f91a: de bf out 0x3e, r29 ; 62 f91c: 0f be out 0x3f, r0 ; 63 f91e: cd bf out 0x3d, r28 ; 61 f920: 28 2e mov r2, r24 f922: 6e 87 std Y+14, r22 ; 0x0e f924: 5a 87 std Y+10, r21 ; 0x0a f926: 49 87 std Y+9, r20 ; 0x09 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; f928: 20 91 8f 02 lds r18, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> f92c: 2d 87 std Y+13, r18 ; 0x0d check_endstops = check; f92e: 77 24 eor r7, r7 f930: 73 94 inc r7 f932: 70 92 8f 02 sts 0x028F, r7 ; 0x80028f <_ZL14check_endstops.lto_priv.389> 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) f936: 42 e0 ldi r20, 0x02 ; 2 f938: 84 17 cp r24, r20 f93a: 09 f4 brne .+2 ; 0xf93e f93c: d4 c1 rjmp .+936 ; 0xfce6 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); f93e: 08 2f mov r16, r24 f940: 10 e0 ldi r17, 0x00 ; 0 f942: f8 01 movw r30, r16 f944: ea 57 subi r30, 0x7A ; 122 f946: f2 48 sbci r31, 0x82 ; 130 #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); f948: 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); f94a: 83 2d mov r24, r3 f94c: 03 2c mov r0, r3 f94e: 00 0c add r0, r0 f950: 99 0b sbc r25, r25 f952: 9c 87 std Y+12, r25 ; 0x0c f954: 8b 87 std Y+11, r24 ; 0x0b feedrate = homing_feedrate[axis]; f956: d8 01 movw r26, r16 f958: aa 0f add r26, r26 f95a: bb 1f adc r27, r27 f95c: aa 0f add r26, r26 f95e: bb 1f adc r27, r27 f960: ba 83 std Y+2, r27 ; 0x02 f962: a9 83 std Y+1, r26 ; 0x01 f964: fd 01 movw r30, r26 f966: e3 53 subi r30, 0x33 ; 51 f968: fd 4f sbci r31, 0xFD ; 253 f96a: 80 81 ld r24, Z f96c: 91 81 ldd r25, Z+1 ; 0x01 f96e: a2 81 ldd r26, Z+2 ; 0x02 f970: b3 81 ldd r27, Z+3 ; 0x03 f972: 8b 83 std Y+3, r24 ; 0x03 f974: 9c 83 std Y+4, r25 ; 0x04 f976: ad 83 std Y+5, r26 ; 0x05 f978: be 83 std Y+6, r27 ; 0x06 f97a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 f97e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 f982: a0 93 92 02 sts 0x0292, r26 ; 0x800292 f986: b0 93 93 02 sts 0x0293, r27 ; 0x800293 float feedrate_mm_s = get_feedrate_mm_s(feedrate); f98a: bc 01 movw r22, r24 f98c: cd 01 movw r24, r26 f98e: 0e 94 fc 67 call 0xcff8 ; 0xcff8 f992: 6b 01 movw r12, r22 f994: 7c 01 movw r14, r24 #ifdef TMC2130 tmc2130_home_enter(X_AXIS_MASK << axis); f996: 81 e0 ldi r24, 0x01 ; 1 f998: 02 2c mov r0, r2 f99a: 01 c0 rjmp .+2 ; 0xf99e f99c: 88 0f add r24, r24 f99e: 0a 94 dec r0 f9a0: ea f7 brpl .-6 ; 0xf99c f9a2: 0f 94 8e 3a call 0x2751c ; 0x2751c // 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; f9a6: a9 81 ldd r26, Y+1 ; 0x01 f9a8: ba 81 ldd r27, Y+2 ; 0x02 f9aa: ad 5b subi r26, 0xBD ; 189 f9ac: b8 4f sbci r27, 0xF8 ; 248 f9ae: b8 87 std Y+8, r27 ; 0x08 f9b0: af 83 std Y+7, r26 ; 0x07 f9b2: fd 01 movw r30, r26 f9b4: 10 82 st Z, r1 f9b6: 11 82 std Z+1, r1 ; 0x01 f9b8: 12 82 std Z+2, r1 ; 0x02 f9ba: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f9bc: 0f 94 1d b9 call 0x3723a ; 0x3723a set_destination_to_current(); f9c0: 0e 94 6f 69 call 0xd2de ; 0xd2de // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; f9c4: 63 2d mov r22, r3 f9c6: 03 2c mov r0, r3 f9c8: 00 0c add r0, r0 f9ca: 77 0b sbc r23, r23 f9cc: 88 0b sbc r24, r24 f9ce: 99 0b sbc r25, r25 f9d0: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> f9d4: 4b 01 movw r8, r22 f9d6: 5c 01 movw r10, r24 f9d8: 49 81 ldd r20, Y+1 ; 0x01 f9da: 5a 81 ldd r21, Y+2 ; 0x02 f9dc: 4c 5a subi r20, 0xAC ; 172 f9de: 5a 4f sbci r21, 0xFA ; 250 f9e0: 58 8b std Y+16, r21 ; 0x10 f9e2: 4f 87 std Y+15, r20 ; 0x0f f9e4: 20 e0 ldi r18, 0x00 ; 0 f9e6: 30 e0 ldi r19, 0x00 ; 0 f9e8: 40 e4 ldi r20, 0x40 ; 64 f9ea: 50 ec ldi r21, 0xC0 ; 192 f9ec: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> f9f0: af 85 ldd r26, Y+15 ; 0x0f f9f2: b8 89 ldd r27, Y+16 ; 0x10 f9f4: 6d 93 st X+, r22 f9f6: 7d 93 st X+, r23 f9f8: 8d 93 st X+, r24 f9fa: 9c 93 st X, r25 f9fc: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f9fe: c7 01 movw r24, r14 fa00: b6 01 movw r22, r12 fa02: 0f 94 2a ba call 0x37454 ; 0x37454 st_synchronize(); fa06: 0f 94 27 58 call 0x2b04e ; 0x2b04e // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); fa0a: 0f 94 71 63 call 0x2c6e2 ; 0x2c6e2 fa0e: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[axis] = 0; fa12: ef 81 ldd r30, Y+7 ; 0x07 fa14: f8 85 ldd r31, Y+8 ; 0x08 fa16: 10 82 st Z, r1 fa18: 11 82 std Z+1, r1 ; 0x01 fa1a: 12 82 std Z+2, r1 ; 0x02 fa1c: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); fa1e: 0f 94 1d b9 call 0x3723a ; 0x3723a destination[axis] = 1. * axis_home_dir; fa22: af 85 ldd r26, Y+15 ; 0x0f fa24: b8 89 ldd r27, Y+16 ; 0x10 fa26: 8d 92 st X+, r8 fa28: 9d 92 st X+, r9 fa2a: ad 92 st X+, r10 fa2c: bc 92 st X, r11 fa2e: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); fa30: c7 01 movw r24, r14 fa32: b6 01 movw r22, r12 fa34: 0f 94 2a ba call 0x37454 ; 0x37454 st_synchronize(); fa38: 0f 94 27 58 call 0x2b04e ; 0x2b04e fa3c: 70 92 8f 02 sts 0x028F, r7 ; 0x80028f <_ZL14check_endstops.lto_priv.389> { 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); fa40: e9 81 ldd r30, Y+1 ; 0x01 fa42: fa 81 ldd r31, Y+2 ; 0x02 fa44: e6 58 subi r30, 0x86 ; 134 fa46: f2 48 sbci r31, 0x82 ; 130 #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); fa48: 45 90 lpm r4, Z+ fa4a: 55 90 lpm r5, Z+ fa4c: 65 90 lpm r6, Z+ fa4e: 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); fa50: 2d ec ldi r18, 0xCD ; 205 fa52: 3c ec ldi r19, 0xCC ; 204 fa54: 4c e8 ldi r20, 0x8C ; 140 fa56: 5f e3 ldi r21, 0x3F ; 63 fa58: c5 01 movw r24, r10 fa5a: b4 01 movw r22, r8 fa5c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> fa60: a3 01 movw r20, r6 fa62: 92 01 movw r18, r4 fa64: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> fa68: ef 85 ldd r30, Y+15 ; 0x0f fa6a: f8 89 ldd r31, Y+16 ; 0x10 fa6c: 60 83 st Z, r22 fa6e: 71 83 std Z+1, r23 ; 0x01 fa70: 82 83 std Z+2, r24 ; 0x02 fa72: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); fa74: c7 01 movw r24, r14 fa76: b6 01 movw r22, r12 fa78: 0f 94 2a ba call 0x37454 ; 0x37454 st_synchronize(); fa7c: 0f 94 27 58 call 0x2b04e ; 0x2b04e fa80: 71 2c mov r7, r1 fa82: 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; fa84: 4f 80 ldd r4, Y+7 ; 0x07 fa86: 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(); fa88: 0f 94 71 63 call 0x2c6e2 ; 0x2c6e2 fa8c: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[axis] = 0; fa90: d2 01 movw r26, r4 fa92: 1d 92 st X+, r1 fa94: 1d 92 st X+, r1 fa96: 1d 92 st X+, r1 fa98: 1c 92 st X, r1 fa9a: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); fa9c: 0f 94 1d b9 call 0x3723a ; 0x3723a destination[axis] = -10.f * axis_home_dir; faa0: 20 e0 ldi r18, 0x00 ; 0 faa2: 30 e0 ldi r19, 0x00 ; 0 faa4: 40 e2 ldi r20, 0x20 ; 32 faa6: 51 ec ldi r21, 0xC1 ; 193 faa8: c5 01 movw r24, r10 faaa: b4 01 movw r22, r8 faac: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> fab0: ef 85 ldd r30, Y+15 ; 0x0f fab2: f8 89 ldd r31, Y+16 ; 0x10 fab4: 60 83 st Z, r22 fab6: 71 83 std Z+1, r23 ; 0x01 fab8: 82 83 std Z+2, r24 ; 0x02 faba: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); fabc: c7 01 movw r24, r14 fabe: b6 01 movw r22, r12 fac0: 0f 94 2a ba call 0x37454 ; 0x37454 st_synchronize(); fac4: 0f 94 27 58 call 0x2b04e ; 0x2b04e endstops_hit_on_purpose(); fac8: 0f 94 71 63 call 0x2c6e2 ; 0x2c6e2 facc: f1 e0 ldi r31, 0x01 ; 1 face: f0 93 8f 02 sts 0x028F, r31 ; 0x80028f <_ZL14check_endstops.lto_priv.389> // Now move left up to the collision, this time with a repeatable velocity. enable_endstops(true); destination[axis] = 11.f * axis_home_dir; fad2: 20 e0 ldi r18, 0x00 ; 0 fad4: 30 e0 ldi r19, 0x00 ; 0 fad6: 40 e3 ldi r20, 0x30 ; 48 fad8: 51 e4 ldi r21, 0x41 ; 65 fada: c5 01 movw r24, r10 fadc: b4 01 movw r22, r8 fade: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> fae2: af 85 ldd r26, Y+15 ; 0x0f fae4: b8 89 ldd r27, Y+16 ; 0x10 fae6: 6d 93 st X+, r22 fae8: 7d 93 st X+, r23 faea: 8d 93 st X+, r24 faec: 9c 93 st X, r25 faee: 13 97 sbiw r26, 0x03 ; 3 #ifdef TMC2130 feedrate = homing_feedrate[axis]; faf0: 8b 81 ldd r24, Y+3 ; 0x03 faf2: 9c 81 ldd r25, Y+4 ; 0x04 faf4: ad 81 ldd r26, Y+5 ; 0x05 faf6: be 81 ldd r27, Y+6 ; 0x06 faf8: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fafc: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fb00: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fb04: b0 93 93 02 sts 0x0293, r27 ; 0x800293 #else //TMC2130 feedrate = homing_feedrate[axis] / 2; feedrate_mm_s = get_feedrate_mm_s(feedrate); #endif //TMC2130 plan_buffer_line_destinationXYZE(feedrate_mm_s); fb08: c7 01 movw r24, r14 fb0a: b6 01 movw r22, r12 fb0c: 0f 94 2a ba call 0x37454 ; 0x37454 st_synchronize(); fb10: 0f 94 27 58 call 0x2b04e ; 0x2b04e #ifdef TMC2130 uint16_t mscnt = tmc2130_rd_MSCNT(axis); fb14: 82 2d mov r24, r2 fb16: 0f 94 2b 39 call 0x27256 ; 0x27256 fb1a: 9c 01 movw r18, r24 fb1c: 44 e0 ldi r20, 0x04 ; 4 fb1e: 36 95 lsr r19 fb20: 27 95 ror r18 fb22: 4a 95 dec r20 fb24: e1 f7 brne .-8 ; 0xfb1e if (pstep) pstep[i] = mscnt >> 4; fb26: a9 85 ldd r26, Y+9 ; 0x09 fb28: ba 85 ldd r27, Y+10 ; 0x0a fb2a: 10 97 sbiw r26, 0x00 ; 0 fb2c: 21 f0 breq .+8 ; 0xfb36 fb2e: fd 01 movw r30, r26 fb30: e6 0d add r30, r6 fb32: f7 1d adc r31, r7 fb34: 20 83 st Z, r18 printf_P(PSTR("%3d step=%2d mscnt=%4d\n"), i, mscnt >> 4, mscnt); fb36: 9f 93 push r25 fb38: 8f 93 push r24 fb3a: 3f 93 push r19 fb3c: 2f 93 push r18 fb3e: 7f 92 push r7 fb40: 6f 92 push r6 fb42: e2 e6 ldi r30, 0x62 ; 98 fb44: fd e7 ldi r31, 0x7D ; 125 fb46: ff 93 push r31 fb48: ef 93 push r30 fb4a: 0f 94 1d dc call 0x3b83a ; 0x3b83a fb4e: 4f ef ldi r20, 0xFF ; 255 fb50: 64 1a sub r6, r20 fb52: 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++) fb54: 0f b6 in r0, 0x3f ; 63 fb56: f8 94 cli fb58: de bf out 0x3e, r29 ; 62 fb5a: 0f be out 0x3f, r0 ; 63 fb5c: cd bf out 0x3d, r28 ; 61 fb5e: 9e 85 ldd r25, Y+14 ; 0x0e fb60: 69 16 cp r6, r25 fb62: 08 f4 brcc .+2 ; 0xfb66 fb64: 91 cf rjmp .-222 ; 0xfa88 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(); fb66: 0f 94 71 63 call 0x2c6e2 ; 0x2c6e2 fb6a: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> 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)) fb6e: 80 91 f5 04 lds r24, 0x04F5 ; 0x8004f5 fb72: 88 23 and r24, r24 fb74: 09 f4 brne .+2 ; 0xfb78 fb76: b2 c0 rjmp .+356 ; 0xfcdc } endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; fb78: f8 01 movw r30, r16 fb7a: ea 50 subi r30, 0x0A ; 10 fb7c: fb 4f sbci r31, 0xFB ; 251 fb7e: 60 81 ld r22, Z uint8_t back = tmc2130_home_bsteps[axis]; if (tmc2130_home_enabled && (orig <= 63)) fb80: 60 34 cpi r22, 0x40 ; 64 fb82: 08 f0 brcs .+2 ; 0xfb86 fb84: ab c0 rjmp .+342 ; 0xfcdc endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; uint8_t back = tmc2130_home_bsteps[axis]; fb86: f8 01 movw r30, r16 fb88: e6 5a subi r30, 0xA6 ; 166 fb8a: fd 4f sbci r31, 0xFD ; 253 fb8c: a0 81 ld r26, Z fb8e: ab 83 std Y+3, r26 ; 0x03 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); fb90: f8 01 movw r30, r16 fb92: e8 50 subi r30, 0x08 ; 8 fb94: fb 4f sbci r31, 0xFB ; 251 fb96: 80 81 ld r24, Z fb98: 40 e0 ldi r20, 0x00 ; 0 fb9a: 51 e0 ldi r21, 0x01 ; 1 fb9c: 02 c0 rjmp .+4 ; 0xfba2 fb9e: 56 95 lsr r21 fba0: 47 95 ror r20 fba2: 8a 95 dec r24 fba4: e2 f7 brpl .-8 ; 0xfb9e if (tmc2130_home_enabled && (orig <= 63)) { tmc2130_goto_step(axis, orig, 2, 1000, tmc2130_get_res(axis)); fba6: 82 2d mov r24, r2 fba8: 0f 94 3f 8b call 0x3167e ; 0x3167e if (back > 0) fbac: bb 81 ldd r27, Y+3 ; 0x03 fbae: bb 23 and r27, r27 fbb0: 39 f0 breq .+14 ; 0xfbc0 tmc2130_do_steps(axis, back, -axis_home_dir, 1000); fbb2: 43 2d mov r20, r3 fbb4: 41 95 neg r20 fbb6: 6b 2f mov r22, r27 fbb8: 70 e0 ldi r23, 0x00 ; 0 } else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); fbba: 82 2d mov r24, r2 fbbc: 0f 94 10 8b call 0x31620 ; 0x31620 tmc2130_home_exit(); fbc0: 0f 94 5f 3a call 0x274be ; 0x274be #endif //TMC2130 axis_is_at_home(axis); fbc4: 82 2d mov r24, r2 fbc6: 0e 94 d0 5b call 0xb7a0 ; 0xb7a0 axis_known_position[axis] = true; fbca: f8 01 movw r30, r16 fbcc: e0 5c subi r30, 0xC0 ; 192 fbce: f8 4f sbci r31, 0xF8 ; 248 fbd0: 81 e0 ldi r24, 0x01 ; 1 fbd2: 80 83 st Z, r24 // Move from minimum #ifdef TMC2130 float dist = - axis_home_dir * 0.01f * tmc2130_home_fsteps[axis]; fbd4: 6b 85 ldd r22, Y+11 ; 0x0b fbd6: 7c 85 ldd r23, Y+12 ; 0x0c fbd8: 71 95 neg r23 fbda: 61 95 neg r22 fbdc: 71 09 sbc r23, r1 fbde: 07 2e mov r0, r23 fbe0: 00 0c add r0, r0 fbe2: 88 0b sbc r24, r24 fbe4: 99 0b sbc r25, r25 fbe6: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> fbea: 2a e0 ldi r18, 0x0A ; 10 fbec: 37 ed ldi r19, 0xD7 ; 215 fbee: 43 e2 ldi r20, 0x23 ; 35 fbf0: 5c e3 ldi r21, 0x3C ; 60 fbf2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> fbf6: 4b 01 movw r8, r22 fbf8: 5c 01 movw r10, r24 fbfa: f8 01 movw r30, r16 fbfc: e8 5a subi r30, 0xA8 ; 168 fbfe: fd 4f sbci r31, 0xFD ; 253 fc00: 60 81 ld r22, Z fc02: 70 e0 ldi r23, 0x00 ; 0 fc04: 90 e0 ldi r25, 0x00 ; 0 fc06: 80 e0 ldi r24, 0x00 ; 0 fc08: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> fc0c: 9b 01 movw r18, r22 fc0e: ac 01 movw r20, r24 fc10: c5 01 movw r24, r10 fc12: b4 01 movw r22, r8 fc14: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> fc18: 4b 01 movw r8, r22 fc1a: 5c 01 movw r10, r24 #else //TMC2130 float dist = - axis_home_dir * 0.01f * 64; #endif //TMC2130 current_position[axis] -= dist; fc1c: e9 81 ldd r30, Y+1 ; 0x01 fc1e: fa 81 ldd r31, Y+2 ; 0x02 fc20: ed 5b subi r30, 0xBD ; 189 fc22: f8 4f sbci r31, 0xF8 ; 248 fc24: fc 83 std Y+4, r31 ; 0x04 fc26: eb 83 std Y+3, r30 ; 0x03 fc28: ac 01 movw r20, r24 fc2a: 9b 01 movw r18, r22 fc2c: 60 81 ld r22, Z fc2e: 71 81 ldd r23, Z+1 ; 0x01 fc30: 82 81 ldd r24, Z+2 ; 0x02 fc32: 93 81 ldd r25, Z+3 ; 0x03 fc34: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> fc38: ab 81 ldd r26, Y+3 ; 0x03 fc3a: bc 81 ldd r27, Y+4 ; 0x04 fc3c: 6d 93 st X+, r22 fc3e: 7d 93 st X+, r23 fc40: 8d 93 st X+, r24 fc42: 9c 93 st X, r25 fc44: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); fc46: 0f 94 1d b9 call 0x3723a ; 0x3723a current_position[axis] += dist; fc4a: eb 81 ldd r30, Y+3 ; 0x03 fc4c: fc 81 ldd r31, Y+4 ; 0x04 fc4e: 20 81 ld r18, Z fc50: 31 81 ldd r19, Z+1 ; 0x01 fc52: 42 81 ldd r20, Z+2 ; 0x02 fc54: 53 81 ldd r21, Z+3 ; 0x03 fc56: c5 01 movw r24, r10 fc58: b4 01 movw r22, r8 fc5a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> fc5e: ab 81 ldd r26, Y+3 ; 0x03 fc60: bc 81 ldd r27, Y+4 ; 0x04 fc62: 6d 93 st X+, r22 fc64: 7d 93 st X+, r23 fc66: 8d 93 st X+, r24 fc68: 9c 93 st X, r25 fc6a: 13 97 sbiw r26, 0x03 ; 3 destination[axis] = current_position[axis]; fc6c: e9 81 ldd r30, Y+1 ; 0x01 fc6e: fa 81 ldd r31, Y+2 ; 0x02 fc70: ec 5a subi r30, 0xAC ; 172 fc72: fa 4f sbci r31, 0xFA ; 250 fc74: 60 83 st Z, r22 fc76: 71 83 std Z+1, r23 ; 0x01 fc78: 82 83 std Z+2, r24 ; 0x02 fc7a: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); fc7c: 20 e0 ldi r18, 0x00 ; 0 fc7e: 30 e0 ldi r19, 0x00 ; 0 fc80: 40 e0 ldi r20, 0x00 ; 0 fc82: 5f e3 ldi r21, 0x3F ; 63 fc84: c7 01 movw r24, r14 fc86: b6 01 movw r22, r12 fc88: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> fc8c: 0f 94 2a ba call 0x37454 ; 0x37454 st_synchronize(); fc90: 0f 94 27 58 call 0x2b04e ; 0x2b04e feedrate = 0.0; fc94: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fc98: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fc9c: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fca0: 10 92 93 02 sts 0x0293, r1 ; 0x800293 fca4: fd 85 ldd r31, Y+13 ; 0x0d fca6: f0 93 8f 02 sts 0x028F, r31 ; 0x80028f <_ZL14check_endstops.lto_priv.389> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } fcaa: 60 96 adiw r28, 0x10 ; 16 fcac: 0f b6 in r0, 0x3f ; 63 fcae: f8 94 cli fcb0: de bf out 0x3e, r29 ; 62 fcb2: 0f be out 0x3f, r0 ; 63 fcb4: cd bf out 0x3d, r28 ; 61 fcb6: df 91 pop r29 fcb8: cf 91 pop r28 fcba: 1f 91 pop r17 fcbc: 0f 91 pop r16 fcbe: ff 90 pop r15 fcc0: ef 90 pop r14 fcc2: df 90 pop r13 fcc4: cf 90 pop r12 fcc6: bf 90 pop r11 fcc8: af 90 pop r10 fcca: 9f 90 pop r9 fccc: 8f 90 pop r8 fcce: 7f 90 pop r7 fcd0: 6f 90 pop r6 fcd2: 5f 90 pop r5 fcd4: 4f 90 pop r4 fcd6: 3f 90 pop r3 fcd8: 2f 90 pop r2 fcda: 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); fcdc: 43 2d mov r20, r3 fcde: 41 95 neg r20 fce0: 68 e0 ldi r22, 0x08 ; 8 fce2: 70 e0 ldi r23, 0x00 ; 0 fce4: 6a cf rjmp .-300 ; 0xfbba feedrate = 0.0; } else if ((axis==Z_AXIS)?HOMEAXIS_DO(Z):0) { #ifdef TMC2130 FORCE_HIGH_POWER_START; fce6: 81 e0 ldi r24, 0x01 ; 1 fce8: 0e 94 e5 67 call 0xcfca ; 0xcfca #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); fcec: e8 e8 ldi r30, 0x88 ; 136 fcee: fd e7 ldi r31, 0x7D ; 125 fcf0: b4 91 lpm r27, Z fcf2: 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; fcf4: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b fcf8: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c fcfc: 10 92 4d 07 sts 0x074D, r1 ; 0x80074d fd00: 10 92 4e 07 sts 0x074E, r1 ; 0x80074e plan_set_position_curposXYZE(); fd04: 0f 94 1d b9 call 0x3723a ; 0x3723a #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); fd08: e2 e8 ldi r30, 0x82 ; 130 fd0a: fd e7 ldi r31, 0x7D ; 125 fd0c: 85 90 lpm r8, Z+ fd0e: 95 90 lpm r9, Z+ fd10: a5 90 lpm r10, Z+ fd12: 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; fd14: e9 81 ldd r30, Y+1 ; 0x01 fd16: 6e 2f mov r22, r30 fd18: ee 0f add r30, r30 fd1a: 77 0b sbc r23, r23 fd1c: 88 0b sbc r24, r24 fd1e: 99 0b sbc r25, r25 fd20: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> fd24: 6b 01 movw r12, r22 fd26: 7c 01 movw r14, r24 fd28: 20 e0 ldi r18, 0x00 ; 0 fd2a: 30 e0 ldi r19, 0x00 ; 0 fd2c: 40 ec ldi r20, 0xC0 ; 192 fd2e: 5f e3 ldi r21, 0x3F ; 63 fd30: c5 01 movw r24, r10 fd32: b4 01 movw r22, r8 fd34: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> fd38: a7 01 movw r20, r14 fd3a: 96 01 movw r18, r12 fd3c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> fd40: 60 93 5c 05 sts 0x055C, r22 ; 0x80055c fd44: 70 93 5d 05 sts 0x055D, r23 ; 0x80055d fd48: 80 93 5e 05 sts 0x055E, r24 ; 0x80055e fd4c: 90 93 5f 05 sts 0x055F, r25 ; 0x80055f feedrate = homing_feedrate[axis]; fd50: 80 e0 ldi r24, 0x00 ; 0 fd52: 90 e0 ldi r25, 0x00 ; 0 fd54: a8 e4 ldi r26, 0x48 ; 72 fd56: b4 e4 ldi r27, 0x44 ; 68 fd58: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fd5c: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fd60: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fd64: b0 93 93 02 sts 0x0293, r27 ; 0x800293 float feedrate_mm_s = get_feedrate_mm_s(feedrate); fd68: bc 01 movw r22, r24 fd6a: cd 01 movw r24, r26 fd6c: 0e 94 fc 67 call 0xcff8 ; 0xcff8 fd70: 4b 01 movw r8, r22 fd72: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); fd74: 0f 94 2a ba call 0x37454 ; 0x37454 st_synchronize(); fd78: 0f 94 27 58 call 0x2b04e ; 0x2b04e #ifdef TMC2130 check_Z_crash(); fd7c: 0e 94 3c 7c call 0xf878 ; 0xf878 #endif //TMC2130 current_position[axis] = 0; fd80: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b fd84: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c fd88: 10 92 4d 07 sts 0x074D, r1 ; 0x80074d fd8c: 10 92 4e 07 sts 0x074E, r1 ; 0x80074e plan_set_position_curposXYZE(); fd90: 0f 94 1d b9 call 0x3723a ; 0x3723a #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); fd94: ee e5 ldi r30, 0x5E ; 94 fd96: fd e7 ldi r31, 0x7D ; 125 fd98: 65 91 lpm r22, Z+ fd9a: 75 91 lpm r23, Z+ fd9c: 85 91 lpm r24, Z+ fd9e: 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; fda0: 90 58 subi r25, 0x80 ; 128 fda2: a7 01 movw r20, r14 fda4: 96 01 movw r18, r12 fda6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> fdaa: 60 93 5c 05 sts 0x055C, r22 ; 0x80055c fdae: 70 93 5d 05 sts 0x055D, r23 ; 0x80055d fdb2: 80 93 5e 05 sts 0x055E, r24 ; 0x80055e fdb6: 90 93 5f 05 sts 0x055F, r25 ; 0x80055f plan_buffer_line_destinationXYZE(feedrate_mm_s); fdba: c5 01 movw r24, r10 fdbc: b4 01 movw r22, r8 fdbe: 0f 94 2a ba call 0x37454 ; 0x37454 st_synchronize(); fdc2: 0f 94 27 58 call 0x2b04e ; 0x2b04e #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); fdc6: ee e5 ldi r30, 0x5E ; 94 fdc8: fd e7 ldi r31, 0x7D ; 125 fdca: 65 91 lpm r22, Z+ fdcc: 75 91 lpm r23, Z+ fdce: 85 91 lpm r24, Z+ fdd0: 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; fdd2: 9b 01 movw r18, r22 fdd4: ac 01 movw r20, r24 fdd6: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> fdda: a7 01 movw r20, r14 fddc: 96 01 movw r18, r12 fdde: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> fde2: 60 93 5c 05 sts 0x055C, r22 ; 0x80055c fde6: 70 93 5d 05 sts 0x055D, r23 ; 0x80055d fdea: 80 93 5e 05 sts 0x055E, r24 ; 0x80055e fdee: 90 93 5f 05 sts 0x055F, r25 ; 0x80055f feedrate = homing_feedrate[axis] / 2; fdf2: 80 e0 ldi r24, 0x00 ; 0 fdf4: 90 e0 ldi r25, 0x00 ; 0 fdf6: a8 ec ldi r26, 0xC8 ; 200 fdf8: b3 e4 ldi r27, 0x43 ; 67 fdfa: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fdfe: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fe02: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fe06: b0 93 93 02 sts 0x0293, r27 ; 0x800293 feedrate_mm_s = get_feedrate_mm_s(feedrate); fe0a: bc 01 movw r22, r24 fe0c: cd 01 movw r24, r26 fe0e: 0e 94 fc 67 call 0xcff8 ; 0xcff8 plan_buffer_line_destinationXYZE(feedrate_mm_s); fe12: 0f 94 2a ba call 0x37454 ; 0x37454 st_synchronize(); fe16: 0f 94 27 58 call 0x2b04e ; 0x2b04e #ifdef TMC2130 check_Z_crash(); fe1a: 0e 94 3c 7c call 0xf878 ; 0xf878 #endif //TMC2130 axis_is_at_home(axis); fe1e: 82 e0 ldi r24, 0x02 ; 2 fe20: 0e 94 d0 5b call 0xb7a0 ; 0xb7a0 destination[axis] = current_position[axis]; fe24: 80 91 4b 07 lds r24, 0x074B ; 0x80074b fe28: 90 91 4c 07 lds r25, 0x074C ; 0x80074c fe2c: a0 91 4d 07 lds r26, 0x074D ; 0x80074d fe30: b0 91 4e 07 lds r27, 0x074E ; 0x80074e fe34: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c fe38: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d fe3c: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e fe40: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f feedrate = 0.0; fe44: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fe48: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fe4c: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fe50: 10 92 93 02 sts 0x0293, r1 ; 0x800293 endstops_hit_on_purpose(); fe54: 0f 94 71 63 call 0x2c6e2 ; 0x2c6e2 axis_known_position[axis] = true; fe58: 70 92 42 07 sts 0x0742, r7 ; 0x800742 #ifdef TMC2130 FORCE_HIGH_POWER_END; fe5c: 80 e0 ldi r24, 0x00 ; 0 fe5e: 0e 94 e5 67 call 0xcfca ; 0xcfca fe62: 20 cf rjmp .-448 ; 0xfca4 0000fe64 : #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 { fe64: 2f 92 push r2 fe66: 3f 92 push r3 fe68: 4f 92 push r4 fe6a: 5f 92 push r5 fe6c: 6f 92 push r6 fe6e: 7f 92 push r7 fe70: 8f 92 push r8 fe72: 9f 92 push r9 fe74: af 92 push r10 fe76: bf 92 push r11 fe78: cf 92 push r12 fe7a: df 92 push r13 fe7c: ef 92 push r14 fe7e: ff 92 push r15 fe80: 0f 93 push r16 fe82: 1f 93 push r17 fe84: cf 93 push r28 fe86: df 93 push r29 fe88: 00 d0 rcall .+0 ; 0xfe8a fe8a: 1f 92 push r1 fe8c: 1f 92 push r1 fe8e: cd b7 in r28, 0x3d ; 61 fe90: de b7 in r29, 0x3e ; 62 fe92: d8 2e mov r13, r24 fe94: 2a 01 movw r4, r20 fe96: 3b 01 movw r6, r22 fe98: 32 2e mov r3, r18 fe9a: e9 82 std Y+1, r14 ; 0x01 fe9c: fa 82 std Y+2, r15 ; 0x02 fe9e: 0b 83 std Y+3, r16 ; 0x03 fea0: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); fea2: 0f 94 27 58 call 0x2b04e ; 0x2b04e homing_flag = true; fea6: 81 e0 ldi r24, 0x01 ; 1 fea8: 80 93 58 0e sts 0x0E58, r24 ; 0x800e58 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; feac: fc 2c mov r15, r12 feae: e3 2c mov r14, r3 feb0: d3 10 cpse r13, r3 feb2: 10 c0 rjmp .+32 ; 0xfed4 feb4: ed 2c mov r14, r13 feb6: dc 10 cpse r13, r12 feb8: 0d c0 rjmp .+26 ; 0xfed4 // 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); feba: 60 e0 ldi r22, 0x00 ; 0 febc: 70 e0 ldi r23, 0x00 ; 0 febe: 80 ea ldi r24, 0xA0 ; 160 fec0: 90 e4 ldi r25, 0x40 ; 64 fec2: 0e 94 95 6f call 0xdf2a ; 0xdf2a // 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; fec6: ff 24 eor r15, r15 fec8: f3 94 inc r15 feca: ee 24 eor r14, r14 fecc: e3 94 inc r14 fece: 22 24 eor r2, r2 fed0: 23 94 inc r2 fed2: 01 c0 rjmp .+2 ; 0xfed6 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; fed4: 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(); fed6: 0f 94 7a cb call 0x396f4 ; 0x396f4 // 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; feda: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 fede: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; fee0: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); fee4: 82 e0 ldi r24, 0x02 ; 2 fee6: 0f 94 13 58 call 0x2b026 ; 0x2b026 feea: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b feee: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c fef2: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d fef6: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e #endif // Reset baby stepping to zero, if the babystepping has already been loaded before. if (home_z) fefa: f1 10 cpse r15, r1 babystep_undo(); fefc: 0f 94 1f c7 call 0x38e3e ; 0x38e3e int l_feedmultiply = setup_for_endstop_move(); ff00: 81 e0 ldi r24, 0x01 ; 1 ff02: 0e 94 1d 68 call 0xd03a ; 0xd03a ff06: 8c 01 movw r16, r24 set_destination_to_current(); ff08: 0e 94 6f 69 call 0xd2de ; 0xd2de feedrate = 0.0; ff0c: 10 92 90 02 sts 0x0290, r1 ; 0x800290 ff10: 10 92 91 02 sts 0x0291, r1 ; 0x800291 ff14: 10 92 92 02 sts 0x0292, r1 ; 0x800292 ff18: 10 92 93 02 sts 0x0293, r1 ; 0x800293 current_position[Z_AXIS] = destination[Z_AXIS]; } #endif /* QUICK_HOME */ #ifdef TMC2130 if(home_x) ff1c: 22 20 and r2, r2 ff1e: 09 f4 brne .+2 ; 0xff22 ff20: 77 c1 rjmp .+750 ; 0x10210 { if (!calib) ff22: 9b 8d ldd r25, Y+27 ; 0x1b ff24: 91 11 cpse r25, r1 ff26: 6a c1 rjmp .+724 ; 0x101fc homeaxis(X_AXIS); ff28: 50 e0 ldi r21, 0x00 ; 0 ff2a: 40 e0 ldi r20, 0x00 ; 0 ff2c: 61 e0 ldi r22, 0x01 ; 1 ff2e: 80 e0 ldi r24, 0x00 ; 0 ff30: 0e 94 76 7c call 0xf8ec ; 0xf8ec else tmc2130_home_calibrate(X_AXIS); } if(home_y) ff34: ee 20 and r14, r14 ff36: 31 f0 breq .+12 ; 0xff44 { if (!calib) homeaxis(Y_AXIS); ff38: 50 e0 ldi r21, 0x00 ; 0 ff3a: 40 e0 ldi r20, 0x00 ; 0 ff3c: 61 e0 ldi r22, 0x01 ; 1 ff3e: 81 e0 ldi r24, 0x01 ; 1 ff40: 0e 94 76 7c call 0xf8ec ; 0xf8ec if(home_x) homeaxis(X_AXIS); if(home_y) homeaxis(Y_AXIS); #endif //TMC2130 if(home_x_axis && home_x_value != 0) ff44: dd 20 and r13, r13 ff46: e9 f0 breq .+58 ; 0xff82 ff48: 41 14 cp r4, r1 ff4a: 51 04 cpc r5, r1 ff4c: 61 04 cpc r6, r1 ff4e: 71 04 cpc r7, r1 ff50: c1 f0 breq .+48 ; 0xff82 current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; ff52: c3 01 movw r24, r6 ff54: b2 01 movw r22, r4 ff56: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> ff5a: 9b 01 movw r18, r22 ff5c: ac 01 movw r20, r24 ff5e: 60 91 c6 06 lds r22, 0x06C6 ; 0x8006c6 ff62: 70 91 c7 06 lds r23, 0x06C7 ; 0x8006c7 ff66: 80 91 c8 06 lds r24, 0x06C8 ; 0x8006c8 ff6a: 90 91 c9 06 lds r25, 0x06C9 ; 0x8006c9 ff6e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> ff72: 60 93 43 07 sts 0x0743, r22 ; 0x800743 ff76: 70 93 44 07 sts 0x0744, r23 ; 0x800744 ff7a: 80 93 45 07 sts 0x0745, r24 ; 0x800745 ff7e: 90 93 46 07 sts 0x0746, r25 ; 0x800746 if(home_y_axis && home_y_value != 0) ff82: 33 20 and r3, r3 ff84: 01 f1 breq .+64 ; 0xffc6 ff86: 89 81 ldd r24, Y+1 ; 0x01 ff88: 9a 81 ldd r25, Y+2 ; 0x02 ff8a: ab 81 ldd r26, Y+3 ; 0x03 ff8c: bc 81 ldd r27, Y+4 ; 0x04 ff8e: 00 97 sbiw r24, 0x00 ; 0 ff90: a1 05 cpc r26, r1 ff92: b1 05 cpc r27, r1 ff94: c1 f0 breq .+48 ; 0xffc6 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; ff96: bc 01 movw r22, r24 ff98: cd 01 movw r24, r26 ff9a: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> ff9e: 9b 01 movw r18, r22 ffa0: ac 01 movw r20, r24 ffa2: 60 91 ca 06 lds r22, 0x06CA ; 0x8006ca ffa6: 70 91 cb 06 lds r23, 0x06CB ; 0x8006cb ffaa: 80 91 cc 06 lds r24, 0x06CC ; 0x8006cc ffae: 90 91 cd 06 lds r25, 0x06CD ; 0x8006cd ffb2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> ffb6: 60 93 47 07 sts 0x0747, r22 ; 0x800747 ffba: 70 93 48 07 sts 0x0748, r23 ; 0x800748 ffbe: 80 93 49 07 sts 0x0749, r24 ; 0x800749 ffc2: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { ffc6: ff 20 and r15, r15 ffc8: 09 f4 brne .+2 ; 0xffcc ffca: a2 c0 rjmp .+324 ; 0x10110 #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); ffcc: 60 e0 ldi r22, 0x00 ; 0 ffce: 70 e0 ldi r23, 0x00 ; 0 ffd0: 80 ea ldi r24, 0xA0 ; 160 ffd2: 90 e4 ldi r25, 0x40 ; 64 ffd4: 0e 94 95 6f call 0xdf2a ; 0xdf2a if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); ffd8: 80 91 40 07 lds r24, 0x0740 ; 0x800740 ffdc: 81 11 cpse r24, r1 ffde: 05 c0 rjmp .+10 ; 0xffea ffe0: 50 e0 ldi r21, 0x00 ; 0 ffe2: 40 e0 ldi r20, 0x00 ; 0 ffe4: 61 e0 ldi r22, 0x01 ; 1 ffe6: 0e 94 76 7c call 0xf8ec ; 0xf8ec if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); ffea: 80 91 41 07 lds r24, 0x0741 ; 0x800741 ffee: 81 11 cpse r24, r1 fff0: 06 c0 rjmp .+12 ; 0xfffe fff2: 50 e0 ldi r21, 0x00 ; 0 fff4: 40 e0 ldi r20, 0x00 ; 0 fff6: 61 e0 ldi r22, 0x01 ; 1 fff8: 81 e0 ldi r24, 0x01 ; 1 fffa: 0e 94 76 7c call 0xf8ec ; 0xf8ec // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); fffe: 0f 94 df cb call 0x397be ; 0x397be world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); 10002: e0 e1 ldi r30, 0x10 ; 16 10004: f3 e9 ldi r31, 0x93 ; 147 10006: 85 91 lpm r24, Z+ 10008: 95 91 lpm r25, Z+ 1000a: a5 91 lpm r26, Z+ 1000c: b4 91 lpm r27, Z 1000e: ec e0 ldi r30, 0x0C ; 12 10010: f3 e9 ldi r31, 0x93 ; 147 10012: 45 91 lpm r20, Z+ 10014: 55 91 lpm r21, Z+ 10016: 65 91 lpm r22, Z+ 10018: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; 1001a: 40 93 54 05 sts 0x0554, r20 ; 0x800554 1001e: 50 93 55 05 sts 0x0555, r21 ; 0x800555 10022: 60 93 56 05 sts 0x0556, r22 ; 0x800556 10026: 70 93 57 05 sts 0x0557, r23 ; 0x800557 out_y = y; 1002a: 80 93 58 05 sts 0x0558, r24 ; 0x800558 1002e: 90 93 59 05 sts 0x0559, r25 ; 0x800559 10032: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a 10036: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b world2machine(out_x, out_y); 1003a: 68 e5 ldi r22, 0x58 ; 88 1003c: 75 e0 ldi r23, 0x05 ; 5 1003e: 84 e5 ldi r24, 0x54 ; 84 10040: 95 e0 ldi r25, 0x05 ; 5 10042: 0e 94 37 6b call 0xd66e ; 0xd66e world2machine_reset(); 10046: 0f 94 41 cb call 0x39682 ; 0x39682 if (destination[Y_AXIS] < Y_MIN_POS) 1004a: 20 e0 ldi r18, 0x00 ; 0 1004c: 30 e0 ldi r19, 0x00 ; 0 1004e: 40 e8 ldi r20, 0x80 ; 128 10050: 50 ec ldi r21, 0xC0 ; 192 10052: 60 91 58 05 lds r22, 0x0558 ; 0x800558 10056: 70 91 59 05 lds r23, 0x0559 ; 0x800559 1005a: 80 91 5a 05 lds r24, 0x055A ; 0x80055a 1005e: 90 91 5b 05 lds r25, 0x055B ; 0x80055b 10062: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 10066: 87 ff sbrs r24, 7 10068: 0c c0 rjmp .+24 ; 0x10082 destination[Y_AXIS] = Y_MIN_POS; 1006a: 80 e0 ldi r24, 0x00 ; 0 1006c: 90 e0 ldi r25, 0x00 ; 0 1006e: a0 e8 ldi r26, 0x80 ; 128 10070: b0 ec ldi r27, 0xC0 ; 192 10072: 80 93 58 05 sts 0x0558, r24 ; 0x800558 10076: 90 93 59 05 sts 0x0559, r25 ; 0x800559 1007a: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a 1007e: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b feedrate = homing_feedrate[X_AXIS] / 20; 10082: 80 e0 ldi r24, 0x00 ; 0 10084: 90 e0 ldi r25, 0x00 ; 0 10086: a6 e1 ldi r26, 0x16 ; 22 10088: b3 e4 ldi r27, 0x43 ; 67 1008a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 1008e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 10092: a0 93 92 02 sts 0x0292, r26 ; 0x800292 10096: b0 93 93 02 sts 0x0293, r27 ; 0x800293 1009a: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> #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(); 1009e: 0f 94 1d b9 call 0x3723a ; 0x3723a 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); 100a2: 60 91 90 02 lds r22, 0x0290 ; 0x800290 100a6: 70 91 91 02 lds r23, 0x0291 ; 0x800291 100aa: 80 91 92 02 lds r24, 0x0292 ; 0x800292 100ae: 90 91 93 02 lds r25, 0x0293 ; 0x800293 100b2: 0f 94 2a ba call 0x37454 ; 0x37454 st_synchronize(); 100b6: 0f 94 27 58 call 0x2b04e ; 0x2b04e current_position[X_AXIS] = destination[X_AXIS]; 100ba: 80 91 54 05 lds r24, 0x0554 ; 0x800554 100be: 90 91 55 05 lds r25, 0x0555 ; 0x800555 100c2: a0 91 56 05 lds r26, 0x0556 ; 0x800556 100c6: b0 91 57 05 lds r27, 0x0557 ; 0x800557 100ca: 80 93 43 07 sts 0x0743, r24 ; 0x800743 100ce: 90 93 44 07 sts 0x0744, r25 ; 0x800744 100d2: a0 93 45 07 sts 0x0745, r26 ; 0x800745 100d6: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = destination[Y_AXIS]; 100da: 80 91 58 05 lds r24, 0x0558 ; 0x800558 100de: 90 91 59 05 lds r25, 0x0559 ; 0x800559 100e2: a0 91 5a 05 lds r26, 0x055A ; 0x80055a 100e6: b0 91 5b 05 lds r27, 0x055B ; 0x80055b 100ea: 80 93 47 07 sts 0x0747, r24 ; 0x800747 100ee: 90 93 48 07 sts 0x0748, r25 ; 0x800748 100f2: a0 93 49 07 sts 0x0749, r26 ; 0x800749 100f6: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a 100fa: 81 e0 ldi r24, 0x01 ; 1 100fc: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); endstops_hit_on_purpose(); 10100: 0f 94 71 63 call 0x2c6e2 ; 0x2c6e2 homeaxis(Z_AXIS); 10104: 50 e0 ldi r21, 0x00 ; 0 10106: 40 e0 ldi r20, 0x00 ; 0 10108: 61 e0 ldi r22, 0x01 ; 1 1010a: 82 e0 ldi r24, 0x02 ; 2 1010c: 0e 94 76 7c call 0xf8ec ; 0xf8ec homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) 10110: cc 20 and r12, r12 10112: e9 f0 breq .+58 ; 0x1014e 10114: 81 14 cp r8, r1 10116: 91 04 cpc r9, r1 10118: a1 04 cpc r10, r1 1011a: b1 04 cpc r11, r1 1011c: c1 f0 breq .+48 ; 0x1014e current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; 1011e: c5 01 movw r24, r10 10120: b4 01 movw r22, r8 10122: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 10126: 9b 01 movw r18, r22 10128: ac 01 movw r20, r24 1012a: 60 91 ce 06 lds r22, 0x06CE ; 0x8006ce 1012e: 70 91 cf 06 lds r23, 0x06CF ; 0x8006cf 10132: 80 91 d0 06 lds r24, 0x06D0 ; 0x8006d0 10136: 90 91 d1 06 lds r25, 0x06D1 ; 0x8006d1 1013a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1013e: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 10142: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 10146: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 1014a: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e // 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(); 1014e: 0f 94 1d b9 call 0x3723a ; 0x3723a clean_up_after_endstop_move(l_feedmultiply); 10152: c8 01 movw r24, r16 10154: 0e 94 03 68 call 0xd006 ; 0xd006 endstops_hit_on_purpose(); 10158: 0f 94 71 63 call 0x2c6e2 ; 0x2c6e2 // Load the machine correction matrix world2machine_initialize(); 1015c: 0f 94 df cb call 0x397be ; 0x397be // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); 10160: 0f 94 7d c9 call 0x392fa ; 0x392fa #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) 10164: d1 10 cpse r13, r1 10166: 07 c0 rjmp .+14 ; 0x10176 10168: 31 10 cpse r3, r1 1016a: 05 c0 rjmp .+10 ; 0x10176 1016c: 8c 8d ldd r24, Y+28 ; 0x1c 1016e: 81 11 cpse r24, r1 10170: 02 c0 rjmp .+4 ; 0x10176 10172: cc 20 and r12, r12 10174: 39 f1 breq .+78 ; 0x101c4 { if (! home_z && mbl_was_active) { 10176: f1 10 cpse r15, r1 10178: 25 c0 rjmp .+74 ; 0x101c4 1017a: 9d 81 ldd r25, Y+5 ; 0x05 1017c: 99 23 and r25, r25 1017e: 11 f1 breq .+68 ; 0x101c4 // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; 10180: 81 e0 ldi r24, 0x01 ; 1 10182: 80 93 a0 13 sts 0x13A0, r24 ; 0x8013a0 // 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)); 10186: 0f 94 13 58 call 0x2b026 ; 0x2b026 1018a: 6b 01 movw r12, r22 1018c: 7c 01 movw r14, r24 1018e: 80 e0 ldi r24, 0x00 ; 0 10190: 0f 94 13 58 call 0x2b026 ; 0x2b026 10194: a7 01 movw r20, r14 10196: 96 01 movw r18, r12 10198: 0f 94 1d 96 call 0x32c3a ; 0x32c3a 1019c: 9b 01 movw r18, r22 1019e: ac 01 movw r20, r24 101a0: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 101a4: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 101a8: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 101ac: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 101b0: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 101b4: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 101b8: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 101bc: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 101c0: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e } #endif prusa_statistics(20); st_synchronize(); 101c4: 0f 94 27 58 call 0x2b04e ; 0x2b04e homing_flag = false; 101c8: 10 92 58 0e sts 0x0E58, r1 ; 0x800e58 #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 } 101cc: 0f 90 pop r0 101ce: 0f 90 pop r0 101d0: 0f 90 pop r0 101d2: 0f 90 pop r0 101d4: 0f 90 pop r0 101d6: df 91 pop r29 101d8: cf 91 pop r28 101da: 1f 91 pop r17 101dc: 0f 91 pop r16 101de: ff 90 pop r15 101e0: ef 90 pop r14 101e2: df 90 pop r13 101e4: cf 90 pop r12 101e6: bf 90 pop r11 101e8: af 90 pop r10 101ea: 9f 90 pop r9 101ec: 8f 90 pop r8 101ee: 7f 90 pop r7 101f0: 6f 90 pop r6 101f2: 5f 90 pop r5 101f4: 4f 90 pop r4 101f6: 3f 90 pop r3 101f8: 2f 90 pop r2 101fa: 08 95 ret if(home_x) { if (!calib) homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); 101fc: 80 e0 ldi r24, 0x00 ; 0 101fe: 0f 94 51 37 call 0x26ea2 ; 0x26ea2 } if(home_y) 10202: ee 20 and r14, r14 10204: 09 f4 brne .+2 ; 0x10208 10206: 9e ce rjmp .-708 ; 0xff44 { if (!calib) homeaxis(Y_AXIS); else tmc2130_home_calibrate(Y_AXIS); 10208: 81 e0 ldi r24, 0x01 ; 1 1020a: 0f 94 51 37 call 0x26ea2 ; 0x26ea2 1020e: 9a ce rjmp .-716 ; 0xff44 homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); } if(home_y) 10210: ee 20 and r14, r14 10212: 09 f4 brne .+2 ; 0x10216 10214: 97 ce rjmp .-722 ; 0xff44 { if (!calib) 10216: ab 8d ldd r26, Y+27 ; 0x1b 10218: aa 23 and r26, r26 1021a: 09 f4 brne .+2 ; 0x1021e 1021c: 8d ce rjmp .-742 ; 0xff38 1021e: f4 cf rjmp .-24 ; 0x10208 00010220 : 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) { 10220: 8f 92 push r8 10222: 9f 92 push r9 10224: af 92 push r10 10226: bf 92 push r11 10228: cf 92 push r12 1022a: ef 92 push r14 1022c: ff 92 push r15 1022e: 0f 93 push r16 10230: 1f 93 push r17 10232: 26 2f mov r18, r22 #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); 10234: 91 e0 ldi r25, 0x01 ; 1 10236: 9f 93 push r25 10238: 1f 92 push r1 1023a: 81 2c mov r8, r1 1023c: 91 2c mov r9, r1 1023e: 54 01 movw r10, r8 10240: c4 2e mov r12, r20 10242: e1 2c mov r14, r1 10244: f1 2c mov r15, r1 10246: 87 01 movw r16, r14 10248: 40 e0 ldi r20, 0x00 ; 0 1024a: 50 e0 ldi r21, 0x00 ; 0 1024c: ba 01 movw r22, r20 1024e: 0e 94 32 7f call 0xfe64 ; 0xfe64 10252: 0f 90 pop r0 10254: 0f 90 pop r0 #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); #endif //TMC2130 } 10256: 1f 91 pop r17 10258: 0f 91 pop r16 1025a: ff 90 pop r15 1025c: ef 90 pop r14 1025e: cf 90 pop r12 10260: bf 90 pop r11 10262: af 90 pop r10 10264: 9f 90 pop r9 10266: 8f 90 pop r8 10268: 08 95 ret 0001026a : // 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(); 1026a: 88 e8 ldi r24, 0x88 ; 136 1026c: 93 e0 ldi r25, 0x03 ; 3 1026e: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) 10272: 80 91 81 10 lds r24, 0x1081 ; 0x801081 10276: 90 91 82 10 lds r25, 0x1082 ; 0x801082 1027a: 89 2b or r24, r25 1027c: 79 f0 breq .+30 ; 0x1029c 1027e: e0 91 70 12 lds r30, 0x1270 ; 0x801270 10282: f0 91 71 12 lds r31, 0x1271 ; 0x801271 10286: ed 57 subi r30, 0x7D ; 125 10288: ff 4e sbci r31, 0xEF ; 239 1028a: 80 81 ld r24, Z 1028c: 81 30 cpi r24, 0x01 ; 1 1028e: 11 f0 breq .+4 ; 0x10294 10290: 86 30 cpi r24, 0x06 ; 6 10292: 21 f4 brne .+8 ; 0x1029c SERIAL_PROTOCOLLNRPGM(MSG_OK); 10294: 8e ea ldi r24, 0xAE ; 174 10296: 9e e6 ldi r25, 0x6E ; 110 10298: 0c 94 86 7b jmp 0xf70c ; 0xf70c } 1029c: 08 95 ret 0001029e : void cmdqueue_reset() { while (buflen) 1029e: 80 91 81 10 lds r24, 0x1081 ; 0x801081 102a2: 90 91 82 10 lds r25, 0x1082 ; 0x801082 102a6: 89 2b or r24, r25 102a8: 29 f0 breq .+10 ; 0x102b4 { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); 102aa: 0e 94 35 81 call 0x1026a ; 0x1026a cmdqueue_pop_front(); 102ae: 0e 94 c7 78 call 0xf18e ; 0xf18e 102b2: f5 cf rjmp .-22 ; 0x1029e } bufindr = 0; 102b4: 10 92 71 12 sts 0x1271, r1 ; 0x801271 102b8: 10 92 70 12 sts 0x1270, r1 ; 0x801270 bufindw = 0; 102bc: 10 92 7f 10 sts 0x107F, r1 ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 102c0: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e <_ZL7bufindw.lto_priv.569> //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; 102c4: 81 e0 ldi r24, 0x01 ; 1 102c6: 80 93 80 10 sts 0x1080, r24 ; 0x801080 } 102ca: 08 95 ret 000102cc : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { 102cc: ef 92 push r14 102ce: ff 92 push r15 102d0: 0f 93 push r16 102d2: 1f 93 push r17 102d4: cf 93 push r28 102d6: df 93 push r29 if (mbl.active) { 102d8: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 102dc: 88 23 and r24, r24 102de: 89 f1 breq .+98 ; 0x10342 } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); 102e0: 82 e7 ldi r24, 0x72 ; 114 102e2: 9e e7 ldi r25, 0x7E ; 126 102e4: 0e 94 86 7b call 0xf70c ; 0xf70c SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); 102e8: 8c e5 ldi r24, 0x5C ; 92 102ea: 9e e7 ldi r25, 0x7E ; 126 102ec: 0e 94 86 7b call 0xf70c ; 0xf70c SERIAL_PROTOCOLLNPGM("Measured points:"); 102f0: 8b e4 ldi r24, 0x4B ; 75 102f2: 9e e7 ldi r25, 0x7E ; 126 102f4: 0e 94 86 7b call 0xf70c ; 0xf70c for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { 102f8: c7 e0 ldi r28, 0x07 ; 7 102fa: dc e1 ldi r29, 0x1C ; 28 102fc: c1 50 subi r28, 0x01 ; 1 102fe: 58 f1 brcs .+86 ; 0x10356 10300: cd 9f mul r28, r29 10302: 70 01 movw r14, r0 10304: 11 24 eor r1, r1 10306: 01 e0 ldi r16, 0x01 ; 1 10308: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); 1030a: 88 e4 ldi r24, 0x48 ; 72 1030c: 9e e7 ldi r25, 0x7E ; 126 1030e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOL_F(z_values[y][x], 5); 10312: f8 01 movw r30, r16 10314: ee 0f add r30, r30 10316: ff 1f adc r31, r31 10318: ee 0f add r30, r30 1031a: ff 1f adc r31, r31 1031c: ee 0d add r30, r14 1031e: ff 1d adc r31, r15 10320: e3 56 subi r30, 0x63 ; 99 10322: fc 4e sbci r31, 0xEC ; 236 10324: 60 81 ld r22, Z 10326: 71 81 ldd r23, Z+1 ; 0x01 10328: 82 81 ldd r24, Z+2 ; 0x02 1032a: 93 81 ldd r25, Z+3 ; 0x03 1032c: 45 e0 ldi r20, 0x05 ; 5 1032e: 0f 94 e7 d5 call 0x3abce ; 0x3abce 10332: 0f 5f subi r16, 0xFF ; 255 10334: 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++) { 10336: 08 30 cpi r16, 0x08 ; 8 10338: 11 05 cpc r17, r1 1033a: 39 f7 brne .-50 ; 0x1030a SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); 1033c: 0f 94 5d d6 call 0x3acba ; 0x3acba 10340: dd cf rjmp .-70 ; 0x102fc mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 10342: 8f e7 ldi r24, 0x7F ; 127 10344: 9e e7 ldi r25, 0x7E ; 126 return; } 10346: df 91 pop r29 10348: cf 91 pop r28 1034a: 1f 91 pop r17 1034c: 0f 91 pop r16 1034e: ff 90 pop r15 10350: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 10352: 0c 94 86 7b jmp 0xf70c ; 0xf70c return; } 10356: df 91 pop r29 10358: cf 91 pop r28 1035a: 1f 91 pop r17 1035c: 0f 91 pop r16 1035e: ff 90 pop r15 10360: ef 90 pop r14 10362: 08 95 ret 00010364 : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { 10364: 8f 92 push r8 10366: 9f 92 push r9 10368: af 92 push r10 1036a: bf 92 push r11 1036c: cf 92 push r12 1036e: df 92 push r13 10370: ef 92 push r14 10372: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); 10374: 0f 94 86 3e call 0x27d0c ; 0x27d0c 10378: 6b 01 movw r12, r22 1037a: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { 1037c: 20 91 2f 02 lds r18, 0x022F ; 0x80022f 10380: 22 23 and r18, r18 10382: 09 f1 breq .+66 ; 0x103c6 10384: 40 91 96 02 lds r20, 0x0296 ; 0x800296 10388: 41 30 cpi r20, 0x01 ; 1 1038a: e9 f0 breq .+58 ; 0x103c6 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; 1038c: 80 91 10 02 lds r24, 0x0210 ; 0x800210 10390: 90 91 11 02 lds r25, 0x0211 ; 0x800211 10394: a0 91 12 02 lds r26, 0x0212 ; 0x800212 10398: b0 91 13 02 lds r27, 0x0213 ; 0x800213 1039c: 46 01 movw r8, r12 1039e: 57 01 movw r10, r14 103a0: 88 1a sub r8, r24 103a2: 99 0a sbc r9, r25 103a4: aa 0a sbc r10, r26 103a6: bb 0a sbc r11, r27 103a8: 30 e0 ldi r19, 0x00 ; 0 103aa: a8 ee ldi r26, 0xE8 ; 232 103ac: b3 e0 ldi r27, 0x03 ; 3 103ae: 0f 94 fb dd call 0x3bbf6 ; 0x3bbf6 <__umulhisi3> 103b2: 86 16 cp r8, r22 103b4: 97 06 cpc r9, r23 103b6: a8 06 cpc r10, r24 103b8: b9 06 cpc r11, r25 103ba: 6c f0 brlt .+26 ; 0x103d6 switch (busy_state) { 103bc: 44 30 cpi r20, 0x04 ; 4 103be: 31 f1 breq .+76 ; 0x1040c 103c0: 9c f4 brge .+38 ; 0x103e8 103c2: 42 30 cpi r20, 0x02 ; 2 103c4: d4 f4 brge .+52 ; 0x103fa break; default: break; } } prev_busy_signal_ms = ms; 103c6: c0 92 10 02 sts 0x0210, r12 ; 0x800210 103ca: d0 92 11 02 sts 0x0211, r13 ; 0x800211 103ce: e0 92 12 02 sts 0x0212, r14 ; 0x800212 103d2: f0 92 13 02 sts 0x0213, r15 ; 0x800213 } 103d6: ff 90 pop r15 103d8: ef 90 pop r14 103da: df 90 pop r13 103dc: cf 90 pop r12 103de: bf 90 pop r11 103e0: af 90 pop r10 103e2: 9f 90 pop r9 103e4: 8f 90 pop r8 103e6: 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) { 103e8: 45 30 cpi r20, 0x05 ; 5 103ea: 69 f7 brne .-38 ; 0x103c6 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; 103ec: 82 ef ldi r24, 0xF2 ; 242 103ee: 9a ea ldi r25, 0xAA ; 170 103f0: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNPGM("busy: paused for input"); 103f4: 84 ef ldi r24, 0xF4 ; 244 103f6: 9c e7 ldi r25, 0x7C ; 124 103f8: 06 c0 rjmp .+12 ; 0x10406 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; 103fa: 82 ef ldi r24, 0xF2 ; 242 103fc: 9a ea ldi r25, 0xAA ; 170 103fe: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNPGM("busy: processing"); 10402: 81 e2 ldi r24, 0x21 ; 33 10404: 9d e7 ldi r25, 0x7D ; 125 SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for input"); 10406: 0e 94 86 7b call 0xf70c ; 0xf70c 1040a: dd cf rjmp .-70 ; 0x103c6 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; 1040c: 82 ef ldi r24, 0xF2 ; 242 1040e: 9a ea ldi r25, 0xAA ; 170 10410: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNPGM("busy: paused for user"); 10414: 8b e0 ldi r24, 0x0B ; 11 10416: 9d e7 ldi r25, 0x7D ; 125 10418: f6 cf rjmp .-20 ; 0x10406 0001041a : //} } #endif //TACH_0 void checkFans() { 1041a: cf 92 push r12 1041c: df 92 push r13 1041e: ef 92 push r14 10420: ff 92 push r15 10422: 0f 93 push r16 10424: 1f 93 push r17 10426: cf 93 push r28 10428: df 93 push r29 1042a: 1f 92 push r1 1042c: 1f 92 push r1 1042e: cd b7 in r28, 0x3d ; 61 10430: 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)) { 10432: 0f 94 86 3e call 0x27d0c ; 0x27d0c 10436: 00 91 9c 17 lds r16, 0x179C ; 0x80179c 1043a: 10 91 9d 17 lds r17, 0x179D ; 0x80179d 1043e: 20 91 9e 17 lds r18, 0x179E ; 0x80179e 10442: 30 91 9f 17 lds r19, 0x179F ; 0x80179f 10446: 60 1b sub r22, r16 10448: 71 0b sbc r23, r17 1044a: 82 0b sbc r24, r18 1044c: 93 0b sbc r25, r19 1044e: 69 38 cpi r22, 0x89 ; 137 10450: 73 41 sbci r23, 0x13 ; 19 10452: 81 05 cpc r24, r1 10454: 91 05 cpc r25, r1 10456: d0 f0 brcs .+52 ; 0x1048c 10458: 80 91 36 05 lds r24, 0x0536 ; 0x800536 1045c: 81 11 cpse r24, r1 1045e: 16 c0 rjmp .+44 ; 0x1048c extruder_autofan_last_check = _millis(); 10460: 0f 94 86 3e call 0x27d0c ; 0x27d0c 10464: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c 10468: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d 1046c: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e 10470: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f fanSpeedBckp = fanSpeedSoftPwm; 10474: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 10478: 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 1047c: 8b 34 cpi r24, 0x4B ; 75 1047e: 18 f0 brcs .+6 ; 0x10486 // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 10480: 8f ef ldi r24, 0xFF ; 255 10482: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 } fan_measuring = true; 10486: 81 e0 ldi r24, 0x01 ; 1 10488: 80 93 36 05 sts 0x0536, r24 ; 0x800536 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 1048c: 0f 94 86 3e call 0x27d0c ; 0x27d0c 10490: 00 91 9c 17 lds r16, 0x179C ; 0x80179c 10494: 10 91 9d 17 lds r17, 0x179D ; 0x80179d 10498: 20 91 9e 17 lds r18, 0x179E ; 0x80179e 1049c: 30 91 9f 17 lds r19, 0x179F ; 0x80179f 104a0: 60 1b sub r22, r16 104a2: 71 0b sbc r23, r17 104a4: 82 0b sbc r24, r18 104a6: 93 0b sbc r25, r19 104a8: 65 36 cpi r22, 0x65 ; 101 104aa: 71 05 cpc r23, r1 104ac: 81 05 cpc r24, r1 104ae: 91 05 cpc r25, r1 104b0: 08 f4 brcc .+2 ; 0x104b4 104b2: f7 c0 rjmp .+494 ; 0x106a2 104b4: 80 91 36 05 lds r24, 0x0536 ; 0x800536 104b8: 88 23 and r24, r24 104ba: 09 f4 brne .+2 ; 0x104be 104bc: f2 c0 rjmp .+484 ; 0x106a2 countFanSpeed(); 104be: 0e 94 da 76 call 0xedb4 ; 0xedb4 void checkFanSpeed() { uint8_t max_fan_errors[2]; #ifdef FAN_SOFT_PWM max_fan_errors[1] = 3; // 15 seconds (Print fan) 104c2: 83 e0 ldi r24, 0x03 ; 3 104c4: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 104c6: 82 e0 ldi r24, 0x02 ; 2 104c8: 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) 104ca: 80 91 38 02 lds r24, 0x0238 ; 0x800238 104ce: 88 23 and r24, r24 104d0: 51 f0 breq .+20 ; 0x104e6 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 104d2: 87 e8 ldi r24, 0x87 ; 135 104d4: 9f e0 ldi r25, 0x0F ; 15 104d6: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 104da: 91 e0 ldi r25, 0x01 ; 1 104dc: 81 11 cpse r24, r1 104de: 01 c0 rjmp .+2 ; 0x104e2 104e0: 90 e0 ldi r25, 0x00 ; 0 104e2: 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]++;} 104e6: 80 91 b1 04 lds r24, 0x04B1 ; 0x8004b1 104ea: 90 91 b2 04 lds r25, 0x04B2 ; 0x8004b2 104ee: 44 97 sbiw r24, 0x14 ; 20 104f0: 0c f0 brlt .+2 ; 0x104f4 104f2: a0 c0 rjmp .+320 ; 0x10634 104f4: 20 e0 ldi r18, 0x00 ; 0 104f6: 30 e0 ldi r19, 0x00 ; 0 104f8: 48 e4 ldi r20, 0x48 ; 72 104fa: 52 e4 ldi r21, 0x42 ; 66 104fc: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 10500: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 10504: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 10508: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 1050c: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 10510: 18 16 cp r1, r24 10512: 0c f0 brlt .+2 ; 0x10516 10514: 8f c0 rjmp .+286 ; 0x10634 10516: 80 91 50 03 lds r24, 0x0350 ; 0x800350 1051a: 8f 5f subi r24, 0xFF ; 255 1051c: 80 93 50 03 sts 0x0350, r24 ; 0x800350 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]++; 10520: 80 91 b3 04 lds r24, 0x04B3 ; 0x8004b3 10524: 90 91 b4 04 lds r25, 0x04B4 ; 0x8004b4 10528: 05 97 sbiw r24, 0x05 ; 5 1052a: 0c f0 brlt .+2 ; 0x1052e 1052c: 89 c0 rjmp .+274 ; 0x10640 return(block); } // Returns true if the buffer has a queued block, false otherwise FORCE_INLINE bool blocks_queued() { return (block_buffer_head != block_buffer_tail); 1052e: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 10532: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 10536: 98 17 cp r25, r24 10538: 09 f4 brne .+2 ; 0x1053c 1053a: 7f c0 rjmp .+254 ; 0x1063a 1053c: e0 91 57 0e lds r30, 0x0E57 ; 0x800e57 10540: 8e e6 ldi r24, 0x6E ; 110 10542: e8 9f mul r30, r24 10544: f0 01 movw r30, r0 10546: 11 24 eor r1, r1 10548: e4 54 subi r30, 0x44 ; 68 1054a: f8 4f sbci r31, 0xF8 ; 248 1054c: 80 81 ld r24, Z 1054e: 8c 34 cpi r24, 0x4C ; 76 10550: 08 f4 brcc .+2 ; 0x10554 10552: 76 c0 rjmp .+236 ; 0x10640 10554: 80 91 51 03 lds r24, 0x0351 ; 0x800351 10558: 8f 5f subi r24, 0xFF ; 255 1055a: 80 93 51 03 sts 0x0351, r24 ; 0x800351 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){ 1055e: 80 91 50 03 lds r24, 0x0350 ; 0x800350 10562: 81 11 cpse r24, r1 10564: 0b c0 rjmp .+22 ; 0x1057c 10566: 80 91 51 03 lds r24, 0x0351 ; 0x800351 1056a: 81 11 cpse r24, r1 1056c: 07 c0 rjmp .+14 ; 0x1057c 1056e: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 10572: 82 30 cpi r24, 0x02 ; 2 10574: 19 f4 brne .+6 ; 0x1057c // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 10576: 81 e0 ldi r24, 0x01 ; 1 10578: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 1057c: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 10580: 81 30 cpi r24, 0x01 ; 1 10582: 61 f4 brne .+24 ; 0x1059c 10584: 0e 94 16 69 call 0xd22c ; 0xd22c 10588: 81 11 cpse r24, r1 1058a: 08 c0 rjmp .+16 ; 0x1059c fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 1058c: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 10590: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.453> 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 10594: 8e e0 ldi r24, 0x0E ; 14 10596: 91 e7 ldi r25, 0x71 ; 113 10598: 0f 94 0c 0b call 0x21618 ; 0x21618 } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 1059c: 80 91 38 02 lds r24, 0x0238 ; 0x800238 105a0: 88 23 and r24, r24 105a2: 09 f4 brne .+2 ; 0x105a6 105a4: 6e c0 rjmp .+220 ; 0x10682 105a6: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 105aa: 82 30 cpi r24, 0x02 ; 2 105ac: 09 f4 brne .+2 ; 0x105b0 105ae: 69 c0 rjmp .+210 ; 0x10682 105b0: 80 e5 ldi r24, 0x50 ; 80 105b2: e8 2e mov r14, r24 105b4: 83 e0 ldi r24, 0x03 ; 3 105b6: f8 2e mov r15, r24 105b8: fe 01 movw r30, r28 105ba: 31 96 adiw r30, 0x01 ; 1 105bc: 6f 01 movw r12, r30 { for (uint8_t fan = 0; fan < 2; fan++) 105be: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 105c0: 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]) 105c2: f7 01 movw r30, r14 105c4: 91 91 ld r25, Z+ 105c6: 7f 01 movw r14, r30 105c8: f6 01 movw r30, r12 105ca: 81 91 ld r24, Z+ 105cc: 6f 01 movw r12, r30 105ce: 89 17 cp r24, r25 105d0: 68 f5 brcc .+90 ; 0x1062c { fan_speed_errors[fan] = 0; 105d2: f7 01 movw r30, r14 105d4: 31 97 sbiw r30, 0x01 ; 1 105d6: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 105d8: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 105dc: 82 30 cpi r24, 0x02 ; 2 105de: 31 f1 breq .+76 ; 0x1062c fan_check_error = EFCE_REPORTED; 105e0: 00 93 e2 03 sts 0x03E2, r16 ; 0x8003e2 if (printJobOngoing()) { 105e4: 0e 94 c5 68 call 0xd18a ; 0xd18a 105e8: 88 23 and r24, r24 105ea: 81 f1 breq .+96 ; 0x1064c // A print is ongoing, pause the print normally if(!printingIsPaused()) { 105ec: 0e 94 ba 68 call 0xd174 ; 0xd174 105f0: 81 11 cpse r24, r1 105f2: 06 c0 rjmp .+12 ; 0x10600 if (usb_timer.running()) 105f4: 80 91 11 05 lds r24, 0x0511 ; 0x800511 105f8: 88 23 and r24, r24 105fa: 29 f1 breq .+74 ; 0x10646 lcd_pause_usb_print(); 105fc: 0f 94 83 2b call 0x25706 ; 0x25706 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 10600: 11 30 cpi r17, 0x01 ; 1 10602: 59 f1 breq .+86 ; 0x1065a //! 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); 10604: 85 e6 ldi r24, 0x65 ; 101 10606: 9a e7 ldi r25, 0x7A ; 122 10608: 0e 94 86 7b call 0xf70c ; 0xf70c if (get_message_level() == 0) { 1060c: 80 91 d1 03 lds r24, 0x03D1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.453> 10610: 81 11 cpse r24, r1 10612: 0c c0 rjmp .+24 ; 0x1062c Sound_MakeCustom(200,0,true); 10614: 41 e0 ldi r20, 0x01 ; 1 10616: 70 e0 ldi r23, 0x00 ; 0 10618: 60 e0 ldi r22, 0x00 ; 0 1061a: 88 ec ldi r24, 0xC8 ; 200 1061c: 90 e0 ldi r25, 0x00 ; 0 1061e: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc LCD_ALERTMESSAGERPGM(lcdMsg); 10622: 62 e0 ldi r22, 0x02 ; 2 10624: 87 eb ldi r24, 0xB7 ; 183 10626: 9b e6 ldi r25, 0x6B ; 107 10628: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 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++) 1062c: 11 30 cpi r17, 0x01 ; 1 1062e: 49 f1 breq .+82 ; 0x10682 10630: 11 e0 ldi r17, 0x01 ; 1 10632: c7 cf rjmp .-114 ; 0x105c2 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; 10634: 10 92 50 03 sts 0x0350, r1 ; 0x800350 10638: 73 cf rjmp .-282 ; 0x10520 #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]++; 1063a: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 1063e: 87 cf rjmp .-242 ; 0x1054e else fan_speed_errors[1] = 0; 10640: 10 92 51 03 sts 0x0351, r1 ; 0x800351 10644: 8c cf rjmp .-232 ; 0x1055e // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 10646: 0f 94 92 3e call 0x27d24 ; 0x27d24 1064a: da cf rjmp .-76 ; 0x10600 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1064c: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 10650: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d } } else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; 10654: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df 10658: d3 cf rjmp .-90 ; 0x10600 //! 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); 1065a: 8d e8 ldi r24, 0x8D ; 141 1065c: 9a e7 ldi r25, 0x7A ; 122 1065e: 0e 94 86 7b call 0xf70c ; 0xf70c if (get_message_level() == 0) { 10662: 80 91 d1 03 lds r24, 0x03D1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.453> 10666: 81 11 cpse r24, r1 10668: 0c c0 rjmp .+24 ; 0x10682 Sound_MakeCustom(200,0,true); 1066a: 41 e0 ldi r20, 0x01 ; 1 1066c: 70 e0 ldi r23, 0x00 ; 0 1066e: 60 e0 ldi r22, 0x00 ; 0 10670: 88 ec ldi r24, 0xC8 ; 200 10672: 90 e0 ldi r25, 0x00 ; 0 10674: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc LCD_ALERTMESSAGERPGM(lcdMsg); 10678: 62 e0 ldi r22, 0x02 ; 2 1067a: 83 ea ldi r24, 0xA3 ; 163 1067c: 9b e6 ldi r25, 0x6B ; 107 1067e: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 10682: 80 91 14 02 lds r24, 0x0214 ; 0x800214 10686: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 //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(); 1068a: 0f 94 86 3e call 0x27d0c ; 0x27d0c 1068e: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c 10692: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d 10696: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e 1069a: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f fan_measuring = false; 1069e: 10 92 36 05 sts 0x0536, r1 ; 0x800536 } #endif //FAN_SOFT_PWM #endif #endif //DEBUG_DISABLE_FANCHECK } 106a2: 0f 90 pop r0 106a4: 0f 90 pop r0 106a6: df 91 pop r29 106a8: cf 91 pop r28 106aa: 1f 91 pop r17 106ac: 0f 91 pop r16 106ae: ff 90 pop r15 106b0: ef 90 pop r14 106b2: df 90 pop r13 106b4: 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(); 106b6: 0c 94 b2 77 jmp 0xef64 ; 0xef64 000106ba : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { 106ba: cf 92 push r12 106bc: df 92 push r13 106be: ef 92 push r14 106c0: ff 92 push r15 106c2: 6b 01 movw r12, r22 106c4: 7c 01 movw r14, r24 la10c_orig_jerk = j; 106c6: c0 92 56 03 sts 0x0356, r12 ; 0x800356 106ca: d0 92 57 03 sts 0x0357, r13 ; 0x800357 106ce: e0 92 58 03 sts 0x0358, r14 ; 0x800358 106d2: f0 92 59 03 sts 0x0359, r15 ; 0x800359 if(la10c_mode != LA10C_LA10) 106d6: 80 91 72 03 lds r24, 0x0372 ; 0x800372 106da: 82 30 cpi r24, 0x02 ; 2 106dc: b1 f4 brne .+44 ; 0x1070a 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) 106de: 20 e0 ldi r18, 0x00 ; 0 106e0: 30 e0 ldi r19, 0x00 ; 0 106e2: 40 e9 ldi r20, 0x90 ; 144 106e4: 50 e4 ldi r21, 0x40 ; 64 106e6: c7 01 movw r24, r14 106e8: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 106ec: 87 ff sbrs r24, 7 106ee: 14 c0 rjmp .+40 ; 0x10718 106f0: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 106f4: 90 91 9f 06 lds r25, 0x069F ; 0x80069f 106f8: a0 91 a0 06 lds r26, 0x06A0 ; 0x8006a0 106fc: b0 91 a1 06 lds r27, 0x06A1 ; 0x8006a1 10700: 80 3d cpi r24, 0xD0 ; 208 10702: 97 40 sbci r25, 0x07 ; 7 10704: a1 05 cpc r26, r1 10706: b1 05 cpc r27, r1 10708: 20 f5 brcc .+72 ; 0x10752 j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } 1070a: c7 01 movw r24, r14 1070c: b6 01 movw r22, r12 1070e: ff 90 pop r15 10710: ef 90 pop r14 10712: df 90 pop r13 10714: cf 90 pop r12 10716: 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: 10718: 2a e9 ldi r18, 0x9A ; 154 1071a: 39 e9 ldi r19, 0x99 ; 153 1071c: 49 e9 ldi r20, 0x99 ; 153 1071e: 5e e3 ldi r21, 0x3E ; 62 10720: c7 01 movw r24, r14 10722: b6 01 movw r22, r12 10724: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 10728: 87 ff sbrs r24, 7 1072a: 0a c0 rjmp .+20 ; 0x10740 1072c: 20 e0 ldi r18, 0x00 ; 0 1072e: 30 e0 ldi r19, 0x00 ; 0 10730: 48 e3 ldi r20, 0x38 ; 56 10732: 51 e4 ldi r21, 0x41 ; 65 10734: c7 01 movw r24, r14 10736: b6 01 movw r22, r12 10738: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1073c: 6b 01 movw r12, r22 1073e: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); 10740: 81 ee ldi r24, 0xE1 ; 225 10742: 9a e7 ldi r25, 0x7A ; 122 10744: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN(j); 10748: c7 01 movw r24, r14 1074a: b6 01 movw r22, r12 1074c: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e 10750: dc cf rjmp .-72 ; 0x1070a // 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: 10752: 2a e9 ldi r18, 0x9A ; 154 10754: 39 e9 ldi r19, 0x99 ; 153 10756: 49 e9 ldi r20, 0x99 ; 153 10758: 5e e3 ldi r21, 0x3E ; 62 1075a: c7 01 movw r24, r14 1075c: b6 01 movw r22, r12 1075e: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 10762: 87 fd sbrc r24, 7 10764: e3 cf rjmp .-58 ; 0x1072c j < 4.5? j * 0.25 + 3.375: 10766: 20 e0 ldi r18, 0x00 ; 0 10768: 30 e0 ldi r19, 0x00 ; 0 1076a: 40 e8 ldi r20, 0x80 ; 128 1076c: 5e e3 ldi r21, 0x3E ; 62 1076e: c7 01 movw r24, r14 10770: b6 01 movw r22, r12 10772: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__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: 10776: 20 e0 ldi r18, 0x00 ; 0 10778: 30 e0 ldi r19, 0x00 ; 0 1077a: 48 e5 ldi r20, 0x58 ; 88 1077c: 50 e4 ldi r21, 0x40 ; 64 1077e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 10782: dc cf rjmp .-72 ; 0x1073c 00010784 : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { 10784: cf 92 push r12 10786: df 92 push r13 10788: ef 92 push r14 1078a: ff 92 push r15 1078c: cf 93 push r28 if(mode == la10c_mode) return; 1078e: 90 91 72 03 lds r25, 0x0372 ; 0x800372 10792: 98 17 cp r25, r24 10794: b9 f1 breq .+110 ; 0x10804 10796: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) 10798: c0 90 56 03 lds r12, 0x0356 ; 0x800356 1079c: d0 90 57 03 lds r13, 0x0357 ; 0x800357 107a0: e0 90 58 03 lds r14, 0x0358 ; 0x800358 107a4: f0 90 59 03 lds r15, 0x0359 ; 0x800359 107a8: 20 e0 ldi r18, 0x00 ; 0 107aa: 30 e0 ldi r19, 0x00 ; 0 107ac: a9 01 movw r20, r18 107ae: c7 01 movw r24, r14 107b0: b6 01 movw r22, r12 107b2: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 107b6: 88 23 and r24, r24 107b8: 41 f0 breq .+16 ; 0x107ca cs.max_jerk[E_AXIS] = la10c_orig_jerk; 107ba: c0 92 c2 06 sts 0x06C2, r12 ; 0x8006c2 107be: d0 92 c3 06 sts 0x06C3, r13 ; 0x8006c3 107c2: e0 92 c4 06 sts 0x06C4, r14 ; 0x8006c4 107c6: f0 92 c5 06 sts 0x06C5, r15 ; 0x8006c5 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); 107ca: 84 ec ldi r24, 0xC4 ; 196 107cc: 9a e7 ldi r25, 0x7A ; 122 107ce: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 switch(mode) 107d2: c1 30 cpi r28, 0x01 ; 1 107d4: 11 f1 breq .+68 ; 0x1081a 107d6: e0 f0 brcs .+56 ; 0x10810 107d8: c2 30 cpi r28, 0x02 ; 2 107da: 11 f1 breq .+68 ; 0x10820 { 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; 107dc: c0 93 72 03 sts 0x0372, r28 ; 0x800372 // adjust the E-jerk if needed cs.max_jerk[E_AXIS] = la10c_jerk(cs.max_jerk[E_AXIS]); 107e0: 60 91 c2 06 lds r22, 0x06C2 ; 0x8006c2 107e4: 70 91 c3 06 lds r23, 0x06C3 ; 0x8006c3 107e8: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 107ec: 90 91 c5 06 lds r25, 0x06C5 ; 0x8006c5 107f0: 0e 94 5d 83 call 0x106ba ; 0x106ba 107f4: 60 93 c2 06 sts 0x06C2, r22 ; 0x8006c2 107f8: 70 93 c3 06 sts 0x06C3, r23 ; 0x8006c3 107fc: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 10800: 90 93 c5 06 sts 0x06C5, r25 ; 0x8006c5 } 10804: cf 91 pop r28 10806: ff 90 pop r15 10808: ef 90 pop r14 1080a: df 90 pop r13 1080c: cf 90 pop r12 1080e: 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; 10810: 8c eb ldi r24, 0xBC ; 188 10812: 9a e7 ldi r25, 0x7A ; 122 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10814: 0e 94 86 7b call 0xf70c ; 0xf70c 10818: e1 cf rjmp .-62 ; 0x107dc SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; 1081a: 88 eb ldi r24, 0xB8 ; 184 1081c: 9a e7 ldi r25, 0x7A ; 122 1081e: fa cf rjmp .-12 ; 0x10814 case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10820: 84 eb ldi r24, 0xB4 ; 180 10822: 9a e7 ldi r25, 0x7A ; 122 10824: f7 cf rjmp .-18 ; 0x10814 00010826 : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); 10826: 0f 94 27 58 call 0x2b04e ; 0x2b04e disable_x(); 1082a: 17 9a sbi 0x02, 7 ; 2 1082c: e0 e4 ldi r30, 0x40 ; 64 1082e: f7 e0 ldi r31, 0x07 ; 7 10830: 10 82 st Z, r1 disable_y(); 10832: 16 9a sbi 0x02, 6 ; 2 10834: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); 10836: 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); } 10838: 80 e0 ldi r24, 0x00 ; 0 1083a: 0e 94 c2 83 call 0x10784 ; 0x10784 return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; 1083e: 8f ef ldi r24, 0xFF ; 255 10840: 9f ef ldi r25, 0xFF ; 255 10842: 90 93 8a 02 sts 0x028A, r25 ; 0x80028a 10846: 80 93 89 02 sts 0x0289, r24 ; 0x800289 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; 1084a: 2f ef ldi r18, 0xFF ; 255 1084c: 20 93 86 02 sts 0x0286, r18 ; 0x800286 print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; 10850: 90 93 8e 02 sts 0x028E, r25 ; 0x80028e 10854: 80 93 8d 02 sts 0x028D, r24 ; 0x80028d print_percent_done_silent = PRINT_PERCENT_DONE_INIT; 10858: 20 93 85 02 sts 0x0285, r18 ; 0x800285 print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; 1085c: 90 93 88 02 sts 0x0288, r25 ; 0x800288 10860: 80 93 87 02 sts 0x0287, r24 ; 0x800287 print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; 10864: 90 93 8c 02 sts 0x028C, r25 ; 0x80028c 10868: 80 93 8b 02 sts 0x028B, r24 ; 0x80028b 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(); } 1086c: 08 95 ret 0001086e : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); 1086e: 41 ed ldi r20, 0xD1 ; 209 10870: 50 e0 ldi r21, 0x00 ; 0 10872: 6f e6 ldi r22, 0x6F ; 111 10874: 79 e7 ldi r23, 0x79 ; 121 10876: 8e e6 ldi r24, 0x6E ; 110 10878: 96 e0 ldi r25, 0x06 ; 6 1087a: 0f 94 f5 da call 0x3b5ea ; 0x3b5ea // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); 1087e: 0f 94 4f aa call 0x3549e ; 0x3549e #ifdef PIDTEMP updatePID(); 10882: 0f 94 12 50 call 0x2a024 ; 0x2a024 #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); 10886: 0f 94 e7 46 call 0x28dce ; 0x28dce #endif calculate_extruder_multipliers(); 1088a: 0e 94 ee 66 call 0xcddc ; 0xcddc SERIAL_ECHO_START; 1088e: 82 ef ldi r24, 0xF2 ; 242 10890: 9a ea ldi r25, 0xAA ; 170 10892: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); 10896: 8d e4 ldi r24, 0x4D ; 77 10898: 99 e7 ldi r25, 0x79 ; 121 1089a: 0c 94 86 7b jmp 0xf70c ; 0xf70c 0001089e : DEFAULT_ARC_SEGMENTS_PER_SEC }; void Config_StoreSettings() { 1089e: cf 93 push r28 108a0: df 93 push r29 strcpy_P(cs.version, default_conf.version); 108a2: 6f e6 ldi r22, 0x6F ; 111 108a4: 79 e7 ldi r23, 0x79 ; 121 108a6: 8e e6 ldi r24, 0x6E ; 110 108a8: 96 e0 ldi r25, 0x06 ; 6 108aa: 0f 94 12 db call 0x3b624 ; 0x3b624 #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); 108ae: 41 ed ldi r20, 0xD1 ; 209 108b0: 50 e0 ldi r21, 0x00 ; 0 108b2: 64 e1 ldi r22, 0x14 ; 20 108b4: 70 e0 ldi r23, 0x00 ; 0 108b6: 8e e6 ldi r24, 0x6E ; 110 108b8: 96 e0 ldi r25, 0x06 ; 6 108ba: 0f 94 6f dd call 0x3bade ; 0x3bade if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 108be: 60 91 20 05 lds r22, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> 108c2: 82 e0 ldi r24, 0x02 ; 2 108c4: 9d e0 ldi r25, 0x0D ; 13 108c6: 0f 94 7f dd call 0x3bafe ; 0x3bafe } 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); 108ca: ce e8 ldi r28, 0x8E ; 142 108cc: 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); 108ce: 4a a5 ldd r20, Y+42 ; 0x2a 108d0: 5b a5 ldd r21, Y+43 ; 0x2b 108d2: 6c a5 ldd r22, Y+44 ; 0x2c 108d4: 7d a5 ldd r23, Y+45 ; 0x2d 108d6: 8e ef ldi r24, 0xFE ; 254 108d8: 9c e0 ldi r25, 0x0C ; 12 108da: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 108de: 4e a5 ldd r20, Y+46 ; 0x2e 108e0: 5f a5 ldd r21, Y+47 ; 0x2f 108e2: 68 a9 ldd r22, Y+48 ; 0x30 108e4: 79 a9 ldd r23, Y+49 ; 0x31 108e6: 82 ea ldi r24, 0xA2 ; 162 108e8: 9c e0 ldi r25, 0x0C ; 12 108ea: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 108ee: 4a a9 ldd r20, Y+50 ; 0x32 108f0: 5b a9 ldd r21, Y+51 ; 0x33 108f2: 6c a9 ldd r22, Y+52 ; 0x34 108f4: 7d a9 ldd r23, Y+53 ; 0x35 108f6: 8e e9 ldi r24, 0x9E ; 158 108f8: 9c e0 ldi r25, 0x0C ; 12 108fa: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 108fe: 4e a9 ldd r20, Y+54 ; 0x36 10900: 5f a9 ldd r21, Y+55 ; 0x37 10902: 68 ad ldd r22, Y+56 ; 0x38 10904: 79 ad ldd r23, Y+57 ; 0x39 10906: 8a ef ldi r24, 0xFA ; 250 10908: 9c e0 ldi r25, 0x0C ; 12 1090a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1090e: 4a ad ldd r20, Y+58 ; 0x3a 10910: 5b ad ldd r21, Y+59 ; 0x3b 10912: 6c ad ldd r22, Y+60 ; 0x3c 10914: 7d ad ldd r23, Y+61 ; 0x3d 10916: 8a e9 ldi r24, 0x9A ; 154 10918: 9c e0 ldi r25, 0x0C ; 12 1091a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1091e: 6e ad ldd r22, Y+62 ; 0x3e 10920: 7f ad ldd r23, Y+63 ; 0x3f 10922: 88 e9 ldi r24, 0x98 ; 152 10924: 9c e0 ldi r25, 0x0C ; 12 10926: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a #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); 1092a: 40 e4 ldi r20, 0x40 ; 64 1092c: 50 e0 ldi r21, 0x00 ; 0 1092e: 6a eb ldi r22, 0xBA ; 186 10930: 7c e0 ldi r23, 0x0C ; 12 10932: 8e ec ldi r24, 0xCE ; 206 10934: 92 e1 ldi r25, 0x12 ; 18 10936: 0f 94 6f dd call 0x3bade ; 0x3bade if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1093a: 40 91 0e 13 lds r20, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 1093e: 50 91 0f 13 lds r21, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 10942: 60 91 10 13 lds r22, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 10946: 70 91 11 13 lds r23, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> 1094a: 86 eb ldi r24, 0xB6 ; 182 1094c: 9c e0 ldi r25, 0x0C ; 12 1094e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 10952: 40 91 12 13 lds r20, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 10956: 50 91 13 13 lds r21, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 1095a: 60 91 14 13 lds r22, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 1095e: 70 91 15 13 lds r23, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> 10962: 82 eb ldi r24, 0xB2 ; 178 10964: 9c e0 ldi r25, 0x0C ; 12 10966: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1096a: 40 91 16 13 lds r20, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 1096e: 50 91 17 13 lds r21, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 10972: 60 91 18 13 lds r22, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 10976: 70 91 19 13 lds r23, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> 1097a: 8e ea ldi r24, 0xAE ; 174 1097c: 9c e0 ldi r25, 0x0C ; 12 1097e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 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; 10982: 82 ef ldi r24, 0xF2 ; 242 10984: 9a ea ldi r25, 0xAA ; 170 10986: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNPGM("Settings Stored"); 1098a: 89 ef ldi r24, 0xF9 ; 249 1098c: 98 e7 ldi r25, 0x78 ; 120 } 1098e: df 91 pop r29 10990: cf 91 pop r28 #ifdef THERMAL_MODEL thermal_model_save_settings(); #endif SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Settings Stored"); 10992: 0c 94 86 7b jmp 0xf70c ; 0xf70c 00010996 : { cmdbuffer_front_already_processed = true; } void get_command() { 10996: 2f 92 push r2 10998: 3f 92 push r3 1099a: 4f 92 push r4 1099c: 5f 92 push r5 1099e: 6f 92 push r6 109a0: 7f 92 push r7 109a2: 8f 92 push r8 109a4: 9f 92 push r9 109a6: af 92 push r10 109a8: bf 92 push r11 109aa: cf 92 push r12 109ac: df 92 push r13 109ae: ef 92 push r14 109b0: ff 92 push r15 109b2: 0f 93 push r16 109b4: 1f 93 push r17 109b6: cf 93 push r28 109b8: df 93 push r29 109ba: cd b7 in r28, 0x3d ; 61 109bc: de b7 in r29, 0x3e ; 62 109be: a2 97 sbiw r28, 0x22 ; 34 109c0: 0f b6 in r0, 0x3f ; 63 109c2: f8 94 cli 109c4: de bf out 0x3e, r29 ; 62 109c6: 0f be out 0x3f, r0 ; 63 109c8: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) 109ca: 8f e5 ldi r24, 0x5F ; 95 109cc: 90 e0 ldi r25, 0x00 ; 0 109ce: 0e 94 77 5d call 0xbaee ; 0xbaee 109d2: 88 23 and r24, r24 109d4: 09 f4 brne .+2 ; 0x109d8 109d6: 91 c0 rjmp .+290 ; 0x10afa return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size 109d8: 0e 94 14 79 call 0xf228 ; 0xf228 109dc: 8f 37 cpi r24, 0x7F ; 127 109de: 91 05 cpc r25, r1 109e0: 61 f4 brne .+24 ; 0x109fa // 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; 109e2: 80 91 95 04 lds r24, 0x0495 ; 0x800495 109e6: 90 91 96 04 lds r25, 0x0496 ; 0x800496 109ea: 90 93 94 04 sts 0x0494, r25 ; 0x800494 109ee: 80 93 93 04 sts 0x0493, r24 ; 0x800493 MYSERIAL.flush(); SERIAL_ECHOLNPGM("Full RX Buffer"); //if buffer was full, there is danger that reading of last gcode will not be completed 109f2: 8a ee ldi r24, 0xEA ; 234 109f4: 98 e7 ldi r25, 0x78 ; 120 109f6: 0e 94 86 7b call 0xf70c ; 0xf70c 109fa: 1e 01 movw r2, r28 109fc: 2f e1 ldi r18, 0x1F ; 31 109fe: 22 0e add r2, r18 10a00: 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; 10a02: dd 24 eor r13, r13 10a04: 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 10a06: 0e 94 14 79 call 0xf228 ; 0xf228 10a0a: 18 16 cp r1, r24 10a0c: 19 06 cpc r1, r25 10a0e: 0c f0 brlt .+2 ; 0x10a12 10a10: 68 c0 rjmp .+208 ; 0x10ae2 10a12: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 10a16: 88 23 and r24, r24 10a18: 29 f0 breq .+10 ; 0x10a24 10a1a: 0e 94 ba 68 call 0xd174 ; 0xd174 10a1e: 88 23 and r24, r24 10a20: 09 f4 brne .+2 ; 0x10a24 10a22: 5f c0 rjmp .+190 ; 0x10ae2 10a24: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 10a28: 81 11 cpse r24, r1 10a2a: 5b c0 rjmp .+182 ; 0x10ae2 #ifdef ENABLE_MEATPACK // MeatPack Changes // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const int rec = MYSERIAL.read(); 10a2c: 0f 94 64 d6 call 0x3acc8 ; 0x3acc8 if (rec < 0) continue; 10a30: 97 fd sbrc r25, 7 10a32: e9 cf rjmp .-46 ; 0x10a06 mp_handle_rx_char((uint8_t)rec); 10a34: 28 2f mov r18, r24 //========================================================================== void mp_handle_rx_char(const uint8_t c) { // Check for commit complete // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (c == (uint8_t)(MeatPack_CommandByte)) { 10a36: 8f 3f cpi r24, 0xFF ; 255 10a38: 09 f0 breq .+2 ; 0x10a3c 10a3a: 7b c0 rjmp .+246 ; 0x10b32 if (mp_cmd_count > 0) { 10a3c: 80 91 42 03 lds r24, 0x0342 ; 0x800342 10a40: 88 23 and r24, r24 10a42: 09 f4 brne .+2 ; 0x10a46 10a44: 73 c0 rjmp .+230 ; 0x10b2c mp_cmd_active = 1; 10a46: d0 92 41 03 sts 0x0341, r13 ; 0x800341 mp_cmd_count = 0; 10a4a: 10 92 42 03 sts 0x0342, r1 ; 0x800342 char c_res[2] = {0, 0}; 10a4e: 1f 8e std Y+31, r1 ; 0x1f 10a50: 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) { 10a52: c0 90 45 03 lds r12, 0x0345 ; 0x800345 10a56: cc 20 and r12, r12 10a58: b1 f2 breq .-84 ; 0x10a06 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]; 10a5a: 80 91 43 03 lds r24, 0x0343 ; 0x800343 10a5e: 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) 10a60: 91 e0 ldi r25, 0x01 ; 1 10a62: 9c 15 cp r25, r12 10a64: 18 f4 brcc .+6 ; 0x10a6c out[i] = (char)mp_char_out_buf[i]; 10a66: 80 91 44 03 lds r24, 0x0344 ; 0x800344 10a6a: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; 10a6c: 10 92 45 03 sts 0x0345, r1 ; 0x800345 10a70: 3a a2 std Y+34, r3 ; 0x22 10a72: 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]; 10a74: 89 a1 ldd r24, Y+33 ; 0x21 10a76: 82 19 sub r24, r2 10a78: 8c 15 cp r24, r12 10a7a: 28 f6 brcc .-118 ; 0x10a06 10a7c: e9 a1 ldd r30, Y+33 ; 0x21 10a7e: fa a1 ldd r31, Y+34 ; 0x22 10a80: 11 91 ld r17, Z+ 10a82: fa a3 std Y+34, r31 ; 0x22 10a84: e9 a3 std Y+33, r30 ; 0x21 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); 10a86: 88 e4 ldi r24, 0x48 ; 72 10a88: 93 e0 ldi r25, 0x03 ; 3 10a8a: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> if (serial_char < 0) 10a8e: 17 fd sbrc r17, 7 10a90: f1 cf rjmp .-30 ; 0x10a74 10a92: 80 91 7c 10 lds r24, 0x107C ; 0x80107c 10a96: 90 91 7d 10 lds r25, 0x107D ; 0x80107d // 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' || 10a9a: 1a 30 cpi r17, 0x0A ; 10 10a9c: 09 f4 brne .+2 ; 0x10aa0 10a9e: 4a c1 rjmp .+660 ; 0x10d34 10aa0: 1d 30 cpi r17, 0x0D ; 13 10aa2: 09 f4 brne .+2 ; 0x10aa6 10aa4: 47 c1 rjmp .+654 ; 0x10d34 serial_char == '\r' || 10aa6: 8f 35 cpi r24, 0x5F ; 95 10aa8: 91 05 cpc r25, r1 10aaa: 0c f0 brlt .+2 ; 0x10aae 10aac: 48 c1 rjmp .+656 ; 0x10d3e 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; 10aae: 1b 33 cpi r17, 0x3B ; 59 10ab0: 11 f4 brne .+4 ; 0x10ab6 10ab2: d0 92 47 03 sts 0x0347, r13 ; 0x800347 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 10ab6: 20 91 47 03 lds r18, 0x0347 ; 0x800347 10aba: 21 11 cpse r18, r1 10abc: db cf rjmp .-74 ; 0x10a74 10abe: 9c 01 movw r18, r24 10ac0: 2f 5f subi r18, 0xFF ; 255 10ac2: 3f 4f sbci r19, 0xFF ; 255 10ac4: 30 93 7d 10 sts 0x107D, r19 ; 0x80107d 10ac8: 20 93 7c 10 sts 0x107C, r18 ; 0x80107c 10acc: 20 91 7e 10 lds r18, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.569> 10ad0: 30 91 7f 10 lds r19, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 10ad4: 2d 57 subi r18, 0x7D ; 125 10ad6: 3f 4e sbci r19, 0xEF ; 239 10ad8: 82 0f add r24, r18 10ada: 93 1f adc r25, r19 10adc: fc 01 movw r30, r24 10ade: 13 83 std Z+3, r17 ; 0x03 10ae0: c9 cf rjmp .-110 ; 0x10a74 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10ae2: 80 91 7c 10 lds r24, 0x107C ; 0x80107c 10ae6: 90 91 7d 10 lds r25, 0x107D ; 0x80107d 10aea: 18 16 cp r1, r24 10aec: 19 06 cpc r1, r25 10aee: 0c f4 brge .+2 ; 0x10af2 10af0: 56 c2 rjmp .+1196 ; 0x10f9e SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10af2: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 10af6: 81 11 cpse r24, r1 10af8: 66 c2 rjmp .+1228 ; 0x10fc6 prusa_statistics(6); } } #endif //SDSUPPORT } 10afa: a2 96 adiw r28, 0x22 ; 34 10afc: 0f b6 in r0, 0x3f ; 63 10afe: f8 94 cli 10b00: de bf out 0x3e, r29 ; 62 10b02: 0f be out 0x3f, r0 ; 63 10b04: cd bf out 0x3d, r28 ; 61 10b06: df 91 pop r29 10b08: cf 91 pop r28 10b0a: 1f 91 pop r17 10b0c: 0f 91 pop r16 10b0e: ff 90 pop r15 10b10: ef 90 pop r14 10b12: df 90 pop r13 10b14: cf 90 pop r12 10b16: bf 90 pop r11 10b18: af 90 pop r10 10b1a: 9f 90 pop r9 10b1c: 8f 90 pop r8 10b1e: 7f 90 pop r7 10b20: 6f 90 pop r6 10b22: 5f 90 pop r5 10b24: 4f 90 pop r4 10b26: 3f 90 pop r3 10b28: 2f 90 pop r2 10b2a: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; 10b2c: d0 92 42 03 sts 0x0342, r13 ; 0x800342 10b30: 8e cf rjmp .-228 ; 0x10a4e return; } if (mp_cmd_active > 0) { 10b32: 30 91 41 03 lds r19, 0x0341 ; 0x800341 10b36: 33 23 and r19, r19 10b38: 09 f4 brne .+2 ; 0x10b3c 10b3a: 57 c0 rjmp .+174 ; 0x10bea } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10b3c: 89 3f cpi r24, 0xF9 ; 249 10b3e: 09 f4 brne .+2 ; 0x10b42 10b40: 3f c0 rjmp .+126 ; 0x10bc0 10b42: 80 f5 brcc .+96 ; 0x10ba4 10b44: 86 3f cpi r24, 0xF6 ; 246 10b46: 09 f4 brne .+2 ; 0x10b4a 10b48: 48 c0 rjmp .+144 ; 0x10bda #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; 10b4a: 80 91 40 03 lds r24, 0x0340 ; 0x800340 10b4e: 82 60 ori r24, 0x02 ; 2 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10b50: 27 3f cpi r18, 0xF7 ; 247 10b52: 79 f1 breq .+94 ; 0x10bb2 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. 10b54: 85 eb ldi r24, 0xB5 ; 181 10b56: 98 e7 ldi r25, 0x78 ; 120 10b58: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 // 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); 10b5c: 80 eb ldi r24, 0xB0 ; 176 10b5e: 98 e7 ldi r25, 0x78 ; 120 10b60: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 // Echo current state if (mp_config & MPConfig_Active) 10b64: 10 91 40 03 lds r17, 0x0340 ; 0x800340 SERIAL_ECHOPGM(" ON"); 10b68: 8c ea ldi r24, 0xAC ; 172 10b6a: 98 e7 ldi r25, 0x78 ; 120 // 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) 10b6c: 10 fd sbrc r17, 0 10b6e: 02 c0 rjmp .+4 ; 0x10b74 SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); 10b70: 87 ea ldi r24, 0xA7 ; 167 10b72: 98 e7 ldi r25, 0x78 ; 120 10b74: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if (mp_config & MPConfig_NoSpaces) 10b78: 01 2f mov r16, r17 10b7a: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces 10b7c: 82 ea ldi r24, 0xA2 ; 162 10b7e: 98 e7 ldi r25, 0x78 ; 120 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) 10b80: 11 fd sbrc r17, 1 10b82: 02 c0 rjmp .+4 ; 0x10b88 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces 10b84: 8d e9 ldi r24, 0x9D ; 157 10b86: 98 e7 ldi r25, 0x78 ; 120 10b88: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNPGM(""); 10b8c: 8c e9 ldi r24, 0x9C ; 156 10b8e: 98 e7 ldi r25, 0x78 ; 120 10b90: 0e 94 86 7b call 0xf70c ; 0xf70c // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) 10b94: 00 23 and r16, r16 10b96: 29 f1 breq .+74 ; 0x10be2 MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); 10b98: 45 e4 ldi r20, 0x45 ; 69 10b9a: 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; 10b9e: 10 92 41 03 sts 0x0341, r1 ; 0x800341 10ba2: 55 cf rjmp .-342 ; 0x10a4e } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10ba4: 8a 3f cpi r24, 0xFA ; 250 10ba6: 41 f0 breq .+16 ; 0x10bb8 case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; 10ba8: 80 91 40 03 lds r24, 0x0340 ; 0x800340 10bac: 81 60 ori r24, 0x01 ; 1 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10bae: 2b 3f cpi r18, 0xFB ; 251 10bb0: 89 f6 brne .-94 ; 0x10b54 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10bb2: 80 93 40 03 sts 0x0340, r24 ; 0x800340 10bb6: ce cf rjmp .-100 ; 0x10b54 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); 10bb8: 80 91 40 03 lds r24, 0x0340 ; 0x800340 10bbc: 8e 7f andi r24, 0xFE ; 254 10bbe: f9 cf rjmp .-14 ; 0x10bb2 return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; 10bc0: 10 92 45 03 sts 0x0345, r1 ; 0x800345 mp_cmd_active = MPCommand_None; 10bc4: 10 92 41 03 sts 0x0341, r1 ; 0x800341 mp_config = MPConfig_None; 10bc8: 10 92 40 03 sts 0x0340, r1 ; 0x800340 mp_char_buf = 0; 10bcc: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f mp_cmd_count = 0; 10bd0: 10 92 42 03 sts 0x0342, r1 ; 0x800342 mp_cmd_active = 0; mp_full_char_queue = 0; 10bd4: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e 10bd8: bd cf rjmp .-134 ; 0x10b54 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10bda: 80 91 40 03 lds r24, 0x0340 ; 0x800340 10bde: 8d 7f andi r24, 0xFD ; 253 10be0: e8 cf rjmp .-48 ; 0x10bb2 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; 10be2: 50 e2 ldi r21, 0x20 ; 32 10be4: 50 93 0b 02 sts 0x020B, r21 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> 10be8: da cf rjmp .-76 ; 0x10b9e mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { 10bea: 20 91 42 03 lds r18, 0x0342 ; 0x800342 10bee: 40 91 40 03 lds r20, 0x0340 ; 0x800340 10bf2: 22 23 and r18, r18 10bf4: 31 f1 breq .+76 ; 0x10c42 10bf6: e0 91 45 03 lds r30, 0x0345 ; 0x800345 //========================================================================== 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) { 10bfa: 40 ff sbrs r20, 0 10bfc: 49 c0 rjmp .+146 ; 0x10c90 if (mp_full_char_queue > 0) { 10bfe: 30 91 3e 03 lds r19, 0x033E ; 0x80033e 10c02: 33 23 and r19, r19 10c04: 09 f4 brne .+2 ; 0x10c08 10c06: 40 c0 rjmp .+128 ; 0x10c88 #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; 10c08: 21 e0 ldi r18, 0x01 ; 1 10c0a: 2e 0f add r18, r30 10c0c: 20 93 45 03 sts 0x0345, r18 ; 0x800345 10c10: ae 2f mov r26, r30 10c12: b0 e0 ldi r27, 0x00 ; 0 10c14: ad 5b subi r26, 0xBD ; 189 10c16: bc 4f sbci r27, 0xFC ; 252 10c18: ff ef ldi r31, 0xFF ; 255 10c1a: 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) { 10c1c: 50 91 3f 03 lds r21, 0x033F ; 0x80033f 10c20: 55 23 and r21, r21 10c22: 51 f0 breq .+20 ; 0x10c38 #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; 10c24: ee 5f subi r30, 0xFE ; 254 10c26: e0 93 45 03 sts 0x0345, r30 ; 0x800345 10c2a: e2 2f mov r30, r18 10c2c: f0 e0 ldi r31, 0x00 ; 0 10c2e: ed 5b subi r30, 0xBD ; 189 10c30: fc 4f sbci r31, 0xFC ; 252 10c32: 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; 10c34: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f } --mp_full_char_queue; 10c38: 31 50 subi r19, 0x01 ; 1 10c3a: 30 93 3e 03 sts 0x033E, r19 ; 0x80033e return; } if (mp_cmd_count > 0) { mp_handle_rx_char_inner((uint8_t)(MeatPack_CommandByte)); mp_cmd_count = 0; 10c3e: 10 92 42 03 sts 0x0342, r1 ; 0x800342 10c42: e0 91 45 03 lds r30, 0x0345 ; 0x800345 //========================================================================== 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) { 10c46: 40 ff sbrs r20, 0 10c48: 6c c0 rjmp .+216 ; 0x10d22 if (mp_full_char_queue > 0) { 10c4a: 20 91 3e 03 lds r18, 0x033E ; 0x80033e 10c4e: 22 23 and r18, r18 10c50: 49 f1 breq .+82 ; 0x10ca4 #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; 10c52: 91 e0 ldi r25, 0x01 ; 1 10c54: 9e 0f add r25, r30 10c56: 90 93 45 03 sts 0x0345, r25 ; 0x800345 10c5a: ae 2f mov r26, r30 10c5c: b0 e0 ldi r27, 0x00 ; 0 10c5e: ad 5b subi r26, 0xBD ; 189 10c60: bc 4f sbci r27, 0xFC ; 252 10c62: 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) { 10c64: 80 91 3f 03 lds r24, 0x033F ; 0x80033f 10c68: 88 23 and r24, r24 10c6a: 51 f0 breq .+20 ; 0x10c80 #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; 10c6c: ee 5f subi r30, 0xFE ; 254 10c6e: e0 93 45 03 sts 0x0345, r30 ; 0x800345 10c72: e9 2f mov r30, r25 10c74: f0 e0 ldi r31, 0x00 ; 0 10c76: ed 5b subi r30, 0xBD ; 189 10c78: fc 4f sbci r31, 0xFC ; 252 10c7a: 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; 10c7c: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f } --mp_full_char_queue; 10c80: 21 50 subi r18, 0x01 ; 1 10c82: 20 93 3e 03 sts 0x033E, r18 ; 0x80033e 10c86: e3 ce rjmp .-570 ; 0x10a4e 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; 10c88: 22 e0 ldi r18, 0x02 ; 2 10c8a: 20 93 3e 03 sts 0x033E, r18 ; 0x80033e 10c8e: d7 cf rjmp .-82 ; 0x10c3e #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; 10c90: 21 e0 ldi r18, 0x01 ; 1 10c92: 2e 0f add r18, r30 10c94: 20 93 45 03 sts 0x0345, r18 ; 0x800345 10c98: f0 e0 ldi r31, 0x00 ; 0 10c9a: ed 5b subi r30, 0xBD ; 189 10c9c: fc 4f sbci r31, 0xFC ; 252 10c9e: 5f ef ldi r21, 0xFF ; 255 10ca0: 50 83 st Z, r21 10ca2: cd cf rjmp .-102 ; 0x10c3e 10ca4: a8 2f mov r26, r24 10ca6: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; 10ca8: 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; 10caa: 31 e0 ldi r19, 0x01 ; 1 10cac: af 30 cpi r26, 0x0F ; 15 10cae: 29 f0 breq .+10 ; 0x10cba 10cb0: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char 10cb2: a0 50 subi r26, 0x00 ; 0 10cb4: be 4f sbci r27, 0xFE ; 254 10cb6: 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; 10cb8: 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; 10cba: 58 2f mov r21, r24 10cbc: 50 7f andi r21, 0xF0 ; 240 10cbe: 50 3f cpi r21, 0xF0 ; 240 10cc0: 59 f4 brne .+22 ; 0x10cd8 10cc2: 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) { 10cc4: 30 ff sbrs r19, 0 10cc6: 13 c0 rjmp .+38 ; 0x10cee ++mp_full_char_queue; 10cc8: d0 92 3e 03 sts 0x033E, r13 ; 0x80033e if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10ccc: 31 ff sbrs r19, 1 10cce: 0c c0 rjmp .+24 ; 0x10ce8 10cd0: 82 e0 ldi r24, 0x02 ; 2 10cd2: 80 93 3e 03 sts 0x033E, r24 ; 0x80033e 10cd6: bb ce rjmp .-650 ; 0x10a4e 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 10cd8: 82 95 swap r24 10cda: 8f 70 andi r24, 0x0F ; 15 10cdc: a8 2f mov r26, r24 10cde: b0 e0 ldi r27, 0x00 ; 0 10ce0: a0 50 subi r26, 0x00 ; 0 10ce2: be 4f sbci r27, 0xFE ; 254 10ce4: 2c 91 ld r18, X 10ce6: ee cf rjmp .-36 ; 0x10cc4 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]; 10ce8: 20 93 3f 03 sts 0x033F, r18 ; 0x80033f 10cec: b0 ce rjmp .-672 ; 0x10a4e #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; 10cee: 81 e0 ldi r24, 0x01 ; 1 10cf0: 8e 0f add r24, r30 10cf2: 80 93 45 03 sts 0x0345, r24 ; 0x800345 10cf6: ae 2f mov r26, r30 10cf8: b0 e0 ldi r27, 0x00 ; 0 10cfa: ad 5b subi r26, 0xBD ; 189 10cfc: bc 4f sbci r27, 0xFC ; 252 10cfe: 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') { 10d00: 4a 30 cpi r20, 0x0A ; 10 10d02: 09 f4 brne .+2 ; 0x10d06 10d04: a4 ce rjmp .-696 ; 0x10a4e if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10d06: 31 ff sbrs r19, 1 10d08: 03 c0 rjmp .+6 ; 0x10d10 10d0a: d0 92 3e 03 sts 0x033E, r13 ; 0x80033e 10d0e: 9f ce rjmp .-706 ; 0x10a4e #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; 10d10: ee 5f subi r30, 0xFE ; 254 10d12: e0 93 45 03 sts 0x0345, r30 ; 0x800345 10d16: e8 2f mov r30, r24 10d18: f0 e0 ldi r31, 0x00 ; 0 10d1a: ed 5b subi r30, 0xBD ; 189 10d1c: fc 4f sbci r31, 0xFC ; 252 10d1e: 20 83 st Z, r18 10d20: 96 ce rjmp .-724 ; 0x10a4e 10d22: 91 e0 ldi r25, 0x01 ; 1 10d24: 9e 0f add r25, r30 10d26: 90 93 45 03 sts 0x0345, r25 ; 0x800345 10d2a: f0 e0 ldi r31, 0x00 ; 0 10d2c: ed 5b subi r30, 0xBD ; 189 10d2e: fc 4f sbci r31, 0xFC ; 252 10d30: 80 83 st Z, r24 10d32: 8d ce rjmp .-742 ; 0x10a4e continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line 10d34: 00 97 sbiw r24, 0x00 ; 0 10d36: 19 f4 brne .+6 ; 0x10d3e comment_mode = false; //for new command 10d38: 10 92 47 03 sts 0x0347, r1 ; 0x800347 10d3c: de ce rjmp .-580 ; 0x10afa 10d3e: 00 91 7e 10 lds r16, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.569> 10d42: 10 91 7f 10 lds r17, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string 10d46: 0a 57 subi r16, 0x7A ; 122 10d48: 1f 4e sbci r17, 0xEF ; 239 10d4a: 80 0f add r24, r16 10d4c: 91 1f adc r25, r17 10d4e: fc 01 movw r30, r24 10d50: 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) 10d52: 1a 83 std Y+2, r17 ; 0x02 10d54: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ 10d56: 80 91 47 03 lds r24, 0x0347 ; 0x800347 10d5a: 81 11 cpse r24, r1 10d5c: 03 c1 rjmp .+518 ; 0x10f64 long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { 10d5e: f8 01 movw r30, r16 10d60: 80 81 ld r24, Z 10d62: 8e 34 cpi r24, 0x4E ; 78 10d64: 09 f0 breq .+2 ; 0x10d68 10d66: 8a c0 rjmp .+276 ; 0x10e7c // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); 10d68: 4a e0 ldi r20, 0x0A ; 10 10d6a: 50 e0 ldi r21, 0x00 ; 0 10d6c: be 01 movw r22, r28 10d6e: 6f 5f subi r22, 0xFF ; 255 10d70: 7f 4f sbci r23, 0xFF ; 255 10d72: c8 01 movw r24, r16 10d74: 01 96 adiw r24, 0x01 ; 1 10d76: 0f 94 e6 d8 call 0x3b1cc ; 0x3b1cc 10d7a: 2b 01 movw r4, r22 10d7c: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; 10d7e: e9 80 ldd r14, Y+1 ; 0x01 10d80: fa 80 ldd r15, Y+2 ; 0x02 10d82: f7 01 movw r30, r14 10d84: 80 81 ld r24, Z 10d86: 80 32 cpi r24, 0x20 ; 32 10d88: 31 f4 brne .+12 ; 0x10d96 10d8a: ff ef ldi r31, 0xFF ; 255 10d8c: ef 1a sub r14, r31 10d8e: ff 0a sbc r15, r31 10d90: fa 82 std Y+2, r15 ; 0x02 10d92: e9 82 std Y+1, r14 ; 0x01 10d94: f4 cf rjmp .-24 ; 0x10d7e // 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)) { 10d96: 80 90 7c 03 lds r8, 0x037C ; 0x80037c 10d9a: 90 90 7d 03 lds r9, 0x037D ; 0x80037d 10d9e: a0 90 7e 03 lds r10, 0x037E ; 0x80037e 10da2: b0 90 7f 03 lds r11, 0x037F ; 0x80037f 10da6: d5 01 movw r26, r10 10da8: c4 01 movw r24, r8 10daa: 01 96 adiw r24, 0x01 ; 1 10dac: a1 1d adc r26, r1 10dae: b1 1d adc r27, r1 10db0: 84 15 cp r24, r4 10db2: 95 05 cpc r25, r5 10db4: a6 05 cpc r26, r6 10db6: b7 05 cpc r27, r7 10db8: 49 f0 breq .+18 ; 0x10dcc 10dba: 44 e0 ldi r20, 0x04 ; 4 10dbc: 50 e0 ldi r21, 0x00 ; 0 10dbe: 65 ee ldi r22, 0xE5 ; 229 10dc0: 78 e7 ldi r23, 0x78 ; 120 10dc2: c7 01 movw r24, r14 10dc4: 0f 94 3a db call 0x3b674 ; 0x3b674 10dc8: 89 2b or r24, r25 10dca: a1 f4 brne .+40 ; 0x10df4 FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) 10dcc: 6a e2 ldi r22, 0x2A ; 42 10dce: 70 e0 ldi r23, 0x00 ; 0 10dd0: c7 01 movw r24, r14 10dd2: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 10dd6: 90 93 98 03 sts 0x0398, r25 ; 0x800398 10dda: 80 93 97 03 sts 0x0397, r24 ; 0x800397 10dde: 00 97 sbiw r24, 0x00 ; 0 10de0: 09 f4 brne .+2 ; 0x10de4 10de2: 45 c0 rjmp .+138 ; 0x10e6e 10de4: f8 01 movw r30, r16 { byte checksum = 0; 10de6: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) 10de8: e8 17 cp r30, r24 10dea: f9 07 cpc r31, r25 10dec: 71 f0 breq .+28 ; 0x10e0a checksum = checksum^(*p++); 10dee: 21 91 ld r18, Z+ 10df0: f2 26 eor r15, r18 10df2: fa cf rjmp .-12 ; 0x10de8 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; 10df4: 8a ec ldi r24, 0xCA ; 202 10df6: 9a ea ldi r25, 0xAA ; 170 10df8: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO 10dfc: 8e e8 ldi r24, 0x8E ; 142 10dfe: 96 e6 ldi r25, 0x66 ; 102 *strchr_pointer = 0; } else { SERIAL_ERROR_START; SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10e00: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 10e04: c5 01 movw r24, r10 10e06: b4 01 movw r22, r8 10e08: 15 c0 rjmp .+42 ; 0x10e34 { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { 10e0a: 0e 94 9b 5c call 0xb936 ; 0xb936 10e0e: f8 16 cp r15, r24 10e10: 19 06 cpc r1, r25 10e12: d9 f0 breq .+54 ; 0x10e4a SERIAL_ERROR_START; 10e14: 8a ec ldi r24, 0xCA ; 202 10e16: 9a ea ldi r25, 0xAA ; 170 10e18: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 10e1c: 8f e6 ldi r24, 0x6F ; 111 10e1e: 96 e6 ldi r25, 0x66 ; 102 10e20: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 10e24: 60 91 7c 03 lds r22, 0x037C ; 0x80037c 10e28: 70 91 7d 03 lds r23, 0x037D ; 0x80037d 10e2c: 80 91 7e 03 lds r24, 0x037E ; 0x80037e 10e30: 90 91 7f 03 lds r25, 0x037F ; 0x80037f 10e34: 0f 94 af d2 call 0x3a55e ; 0x3a55e } void MarlinSerial::println(long n, int base) { print(n, base); println(); 10e38: 0f 94 5d d6 call 0x3acba ; 0x3acba SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); 10e3c: 0e 94 b3 5c call 0xb966 ; 0xb966 serial_count = 0; 10e40: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d 10e44: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c 10e48: 58 ce rjmp .-848 ; 0x10afa return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; 10e4a: e0 91 97 03 lds r30, 0x0397 ; 0x800397 10e4e: f0 91 98 03 lds r31, 0x0398 ; 0x800398 10e52: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) 10e54: e9 80 ldd r14, Y+1 ; 0x01 10e56: fa 80 ldd r15, Y+2 ; 0x02 10e58: 60 ee ldi r22, 0xE0 ; 224 10e5a: 78 e7 ldi r23, 0x78 ; 120 10e5c: c7 01 movw r24, r14 10e5e: 0f 94 09 db call 0x3b612 ; 0x3b612 10e62: 89 2b or r24, r25 10e64: 39 f5 brne .+78 ; 0x10eb4 kill(MSG_M112_KILL); 10e66: 89 ea ldi r24, 0xA9 ; 169 10e68: 99 e6 ldi r25, 0x69 ; 105 10e6a: 0e 94 15 7c call 0xf82a ; 0xf82a // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; 10e6e: 8a ec ldi r24, 0xCA ; 202 10e70: 9a ea ldi r25, 0xAA ; 170 10e72: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10e76: 85 e4 ldi r24, 0x45 ; 69 10e78: 96 e6 ldi r25, 0x66 ; 102 10e7a: c2 cf rjmp .-124 ; 0x10e00 } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; 10e7c: 89 81 ldd r24, Y+1 ; 0x01 10e7e: 9a 81 ldd r25, Y+2 ; 0x02 10e80: fc 01 movw r30, r24 10e82: 20 81 ld r18, Z 10e84: 20 32 cpi r18, 0x20 ; 32 10e86: 21 f4 brne .+8 ; 0x10e90 10e88: 01 96 adiw r24, 0x01 ; 1 10e8a: 9a 83 std Y+2, r25 ; 0x02 10e8c: 89 83 std Y+1, r24 ; 0x01 10e8e: f6 cf rjmp .-20 ; 0x10e7c // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) 10e90: 6a e2 ldi r22, 0x2A ; 42 10e92: 70 e0 ldi r23, 0x00 ; 0 10e94: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 10e98: 89 2b or r24, r25 10e9a: 39 f0 breq .+14 ; 0x10eaa { SERIAL_ERROR_START; 10e9c: 8a ec ldi r24, 0xCA ; 202 10e9e: 9a ea ldi r25, 0xAA ; 170 10ea0: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM 10ea4: 8b e1 ldi r24, 0x1B ; 27 10ea6: 96 e6 ldi r25, 0x66 ; 102 10ea8: bb cf rjmp .-138 ; 0x10e20 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 10eaa: 44 24 eor r4, r4 10eac: 4a 94 dec r4 10eae: 54 2c mov r5, r4 10eb0: 32 01 movw r6, r4 10eb2: d0 cf rjmp .-96 ; 0x10e54 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) 10eb4: 44 e0 ldi r20, 0x04 ; 4 10eb6: 50 e0 ldi r21, 0x00 ; 0 10eb8: 6b ed ldi r22, 0xDB ; 219 10eba: 78 e7 ldi r23, 0x78 ; 120 10ebc: c7 01 movw r24, r14 10ebe: 0f 94 3a db call 0x3b674 ; 0x3b674 10ec2: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { 10ec4: f7 01 movw r30, r14 10ec6: 80 81 ld r24, Z 10ec8: 87 34 cpi r24, 0x47 ; 71 10eca: 81 f4 brne .+32 ; 0x10eec 10ecc: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 <_ZL13printer_state.lto_priv.395> 10ed0: 85 30 cpi r24, 0x05 ; 5 10ed2: 61 f0 breq .+24 ; 0x10eec usb_timer.start(); 10ed4: 81 e1 ldi r24, 0x11 ; 17 10ed6: 95 e0 ldi r25, 0x05 ; 5 10ed8: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 10edc: f6 e0 ldi r31, 0x06 ; 6 10ede: f0 93 67 0e sts 0x0E67, r31 ; 0x800e67 <_ZL13printer_state.lto_priv.395> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 10ee2: 60 e0 ldi r22, 0x00 ; 0 10ee4: 85 ea ldi r24, 0xA5 ; 165 10ee6: 9f e0 ldi r25, 0x0F ; 15 10ee8: 0f 94 7f dd call 0x3bafe ; 0x3bafe 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) { 10eec: ab 28 or r10, r11 10eee: 21 f0 breq .+8 ; 0x10ef8 10ef0: 80 91 14 05 lds r24, 0x0514 ; 0x800514 10ef4: 81 11 cpse r24, r1 10ef6: a4 cf rjmp .-184 ; 0x10e40 } // 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; 10ef8: 26 e0 ldi r18, 0x06 ; 6 10efa: 77 fc sbrc r7, 7 10efc: 21 e0 ldi r18, 0x01 ; 1 10efe: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.569> 10f02: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 10f06: fc 01 movw r30, r24 10f08: ed 57 subi r30, 0x7D ; 125 10f0a: ff 4e sbci r31, 0xEF ; 239 10f0c: 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) 10f0e: 49 81 ldd r20, Y+1 ; 0x01 10f10: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; 10f12: 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) 10f14: da 01 movw r26, r20 10f16: 40 17 cp r20, r16 10f18: 51 07 cpc r21, r17 10f1a: a1 f5 brne .+104 ; 0x10f84 cmd_len = strlen(cmd_start) + 1; 10f1c: 01 90 ld r0, Z+ 10f1e: 00 20 and r0, r0 10f20: e9 f7 brne .-6 ; 0x10f1c 10f22: 9f 01 movw r18, r30 10f24: 20 1b sub r18, r16 10f26: 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; 10f28: 03 96 adiw r24, 0x03 ; 3 10f2a: 28 0f add r18, r24 10f2c: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) 10f2e: 2d 3e cpi r18, 0xED ; 237 10f30: f1 e0 ldi r31, 0x01 ; 1 10f32: 3f 07 cpc r19, r31 10f34: 79 f1 breq .+94 ; 0x10f94 // 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; 10f36: 30 93 7f 10 sts 0x107F, r19 ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 10f3a: 20 93 7e 10 sts 0x107E, r18 ; 0x80107e <_ZL7bufindw.lto_priv.569> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 10f3e: 80 91 81 10 lds r24, 0x1081 ; 0x801081 10f42: 90 91 82 10 lds r25, 0x1082 ; 0x801082 10f46: 01 96 adiw r24, 0x01 ; 1 10f48: 90 93 82 10 sts 0x1082, r25 ; 0x801082 10f4c: 80 93 81 10 sts 0x1081, r24 ; 0x801081 // Update the processed gcode line if (gcode_N >= 0) 10f50: 77 fc sbrc r7, 7 10f52: 08 c0 rjmp .+16 ; 0x10f64 gcode_LastN = gcode_N; 10f54: 40 92 7c 03 sts 0x037C, r4 ; 0x80037c 10f58: 50 92 7d 03 sts 0x037D, r5 ; 0x80037d 10f5c: 60 92 7e 03 sts 0x037E, r6 ; 0x80037e 10f60: 70 92 7f 03 sts 0x037F, r7 ; 0x80037f 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 10f64: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d 10f68: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c // 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)) 10f6c: 0e 94 14 79 call 0xf228 ; 0xf228 10f70: 89 2b or r24, r25 10f72: 09 f4 brne .+2 ; 0x10f76 10f74: c2 cd rjmp .-1148 ; 0x10afa 10f76: 8f e5 ldi r24, 0x5F ; 95 10f78: 90 e0 ldi r25, 0x00 ; 0 10f7a: 0e 94 77 5d call 0xbaee ; 0xbaee 10f7e: 81 11 cpse r24, r1 10f80: 79 cd rjmp .-1294 ; 0x10a74 10f82: bb cd rjmp .-1162 ; 0x10afa 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]; } 10f84: 6d 91 ld r22, X+ 10f86: 61 93 st Z+, r22 10f88: 9d 01 movw r18, r26 10f8a: 24 1b sub r18, r20 10f8c: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); 10f8e: 61 11 cpse r22, r1 10f90: f9 cf rjmp .-14 ; 0x10f84 10f92: ca cf rjmp .-108 ; 0x10f28 } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 10f94: 10 92 7f 10 sts 0x107F, r1 ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 10f98: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e <_ZL7bufindw.lto_priv.569> 10f9c: d0 cf rjmp .-96 ; 0x10f3e #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10f9e: 60 ed ldi r22, 0xD0 ; 208 10fa0: 77 e0 ldi r23, 0x07 ; 7 10fa2: 88 e4 ldi r24, 0x48 ; 72 10fa4: 93 e0 ldi r25, 0x03 ; 3 10fa6: 0f 94 b8 3e call 0x27d70 ; 0x27d70 ::expired(unsigned short)> 10faa: 88 23 and r24, r24 10fac: 09 f4 brne .+2 ; 0x10fb0 10fae: a1 cd rjmp .-1214 ; 0x10af2 comment_mode = false; 10fb0: 10 92 47 03 sts 0x0347, r1 ; 0x800347 serial_count = 0; 10fb4: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d 10fb8: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c SERIAL_ECHOLNPGM("RX timeout"); 10fbc: 80 ed ldi r24, 0xD0 ; 208 10fbe: 98 e7 ldi r25, 0x78 ; 120 10fc0: 0e 94 86 7b call 0xf70c ; 0xf70c 10fc4: 9a cd rjmp .-1228 ; 0x10afa return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10fc6: 80 91 01 17 lds r24, 0x1701 ; 0x801701 10fca: 88 23 and r24, r24 10fcc: 09 f4 brne .+2 ; 0x10fd0 10fce: 95 cd rjmp .-1238 ; 0x10afa 10fd0: 80 91 7c 10 lds r24, 0x107C ; 0x80107c 10fd4: 90 91 7d 10 lds r25, 0x107D ; 0x80107d 10fd8: 89 2b or r24, r25 10fda: 09 f0 breq .+2 ; 0x10fde 10fdc: 8e cd rjmp .-1252 ; 0x10afa //'#' 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; 10fde: 80 91 81 10 lds r24, 0x1081 ; 0x801081 10fe2: 90 91 82 10 lds r25, 0x1082 ; 0x801082 10fe6: 89 2b or r24, r25 10fe8: 11 f4 brne .+4 ; 0x10fee 10fea: 10 92 46 03 sts 0x0346, r1 ; 0x800346 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10fee: 2b e7 ldi r18, 0x7B ; 123 10ff0: e2 2e mov r14, r18 10ff2: 20 e1 ldi r18, 0x10 ; 16 10ff4: 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; 10ff6: 32 e0 ldi r19, 0x02 ; 2 10ff8: d3 2e mov r13, r19 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 10ffa: cc 24 eor r12, r12 10ffc: 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) { 10ffe: 40 91 82 17 lds r20, 0x1782 ; 0x801782 11002: 50 91 83 17 lds r21, 0x1783 ; 0x801783 11006: 60 91 84 17 lds r22, 0x1784 ; 0x801784 1100a: 70 91 85 17 lds r23, 0x1785 ; 0x801785 1100e: 80 91 7b 17 lds r24, 0x177B ; 0x80177b 11012: 90 91 7c 17 lds r25, 0x177C ; 0x80177c 11016: a0 91 7d 17 lds r26, 0x177D ; 0x80177d 1101a: b0 91 7e 17 lds r27, 0x177E ; 0x80177e 1101e: 48 17 cp r20, r24 11020: 59 07 cpc r21, r25 11022: 6a 07 cpc r22, r26 11024: 7b 07 cpc r23, r27 11026: 08 f0 brcs .+2 ; 0x1102a 11028: 2f c1 rjmp .+606 ; 0x11288 1102a: 80 91 46 03 lds r24, 0x0346 ; 0x800346 1102e: 81 11 cpse r24, r1 11030: 2b c1 rjmp .+598 ; 0x11288 : "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() ){ 11032: 0f 94 6e 7b call 0x2f6dc ; 0x2f6dc 11036: 88 23 and r24, r24 11038: 49 f1 breq .+82 ; 0x1108c 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; 1103a: 20 91 19 17 lds r18, 0x1719 ; 0x801719 1103e: 30 91 1a 17 lds r19, 0x171A ; 0x80171a // 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; 11042: 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; 11044: 9b ef ldi r25, 0xFB ; 251 11046: 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 == ';' ){ 11048: f8 01 movw r30, r16 1104a: 80 81 ld r24, Z 1104c: 8b 33 cpi r24, 0x3B ; 59 1104e: 51 f5 brne .+84 ; 0x110a4 // 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); 11050: f8 01 movw r30, r16 00011052 : 11052: 61 91 ld r22, Z+ 11054: 6a 30 cpi r22, 0x0A ; 10 11056: e9 f7 brne .-6 ; 0x11052 11058: 8f 01 movw r16, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 1105a: cf 01 movw r24, r30 1105c: 8b 57 subi r24, 0x7B ; 123 1105e: 9e 40 sbci r25, 0x0E ; 14 11060: 81 30 cpi r24, 0x01 ; 1 11062: 92 40 sbci r25, 0x02 ; 2 11064: d4 f0 brlt .+52 ; 0x1109a // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 11066: c8 01 movw r24, r16 11068: 82 1b sub r24, r18 1106a: 93 0b sbc r25, r19 1106c: 01 97 sbiw r24, 0x01 ; 1 1106e: 0f 94 5f 7b call 0x2f6be ; 0x2f6be if( ! gfComputeNextFileBlock() )goto eof_or_fail; 11072: 8e ef ldi r24, 0xFE ; 254 11074: 96 e1 ldi r25, 0x16 ; 22 11076: 0f 94 60 6c call 0x2d8c0 ; 0x2d8c0 1107a: 88 23 and r24, r24 1107c: 39 f0 breq .+14 ; 0x1108c if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 1107e: 0f 94 6e 7b call 0x2f6dc ; 0x2f6dc rdPtr = start = blockBuffBegin; 11082: 2b e7 ldi r18, 0x7B ; 123 11084: 3e e0 ldi r19, 0x0E ; 14 11086: 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 11088: 81 11 cpse r24, r1 1108a: e2 cf rjmp .-60 ; 0x11050 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 1108c: f0 92 1a 17 sts 0x171A, r15 ; 0x80171a 11090: e0 92 19 17 sts 0x1719, r14 ; 0x801719 return -1; 11094: 0f ef ldi r16, 0xFF ; 255 11096: 1f ef ldi r17, 0xFF ; 255 11098: 37 c0 rjmp .+110 ; 0x11108 1109a: 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){ 1109c: b1 10 cpse r11, r1 1109e: d5 c0 rjmp .+426 ; 0x1124a // 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 110a0: 01 50 subi r16, 0x01 ; 1 110a2: 11 09 sbc r17, r1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 110a4: c8 01 movw r24, r16 110a6: 82 1b sub r24, r18 110a8: 93 0b sbc r25, r19 110aa: 01 96 adiw r24, 0x01 ; 1 110ac: 0f 94 5f 7b call 0x2f6be ; 0x2f6be int16_t rv = *rdPtr++; 110b0: c8 01 movw r24, r16 110b2: 01 96 adiw r24, 0x01 ; 1 110b4: f8 01 movw r30, r16 110b6: 00 81 ld r16, Z 110b8: 10 e0 ldi r17, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 110ba: 80 90 06 17 lds r8, 0x1706 ; 0x801706 110be: 90 90 07 17 lds r9, 0x1707 ; 0x801707 110c2: a0 90 08 17 lds r10, 0x1708 ; 0x801708 110c6: b0 90 09 17 lds r11, 0x1709 ; 0x801709 110ca: 40 91 0f 17 lds r20, 0x170F ; 0x80170f 110ce: 50 91 10 17 lds r21, 0x1710 ; 0x801710 110d2: 60 91 11 17 lds r22, 0x1711 ; 0x801711 110d6: 70 91 12 17 lds r23, 0x1712 ; 0x801712 110da: 84 16 cp r8, r20 110dc: 95 06 cpc r9, r21 110de: a6 06 cpc r10, r22 110e0: b7 06 cpc r11, r23 110e2: a0 f6 brcc .-88 ; 0x1108c // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 110e4: 9c 01 movw r18, r24 110e6: 2b 57 subi r18, 0x7B ; 123 110e8: 3e 40 sbci r19, 0x0E ; 14 110ea: 21 15 cp r18, r1 110ec: 32 40 sbci r19, 0x02 ; 2 110ee: 44 f0 brlt .+16 ; 0x11100 // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 110f0: 8e ef ldi r24, 0xFE ; 254 110f2: 96 e1 ldi r25, 0x16 ; 22 110f4: 0f 94 60 6c call 0x2d8c0 ; 0x2d8c0 110f8: 88 23 and r24, r24 110fa: 41 f2 breq .-112 ; 0x1108c // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 110fc: 8b e7 ldi r24, 0x7B ; 123 110fe: 9e e0 ldi r25, 0x0E ; 14 } // save the current read ptr for the next run gfReadPtr = rdPtr; 11100: 90 93 1a 17 sts 0x171A, r25 ; 0x80171a 11104: 80 93 19 17 sts 0x1719, r24 ; 0x801719 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_;} 11108: 40 91 06 17 lds r20, 0x1706 ; 0x801706 1110c: 50 91 07 17 lds r21, 0x1707 ; 0x801707 11110: 60 91 08 17 lds r22, 0x1708 ; 0x801708 11114: 70 91 09 17 lds r23, 0x1709 ; 0x801709 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(); 11118: 40 93 82 17 sts 0x1782, r20 ; 0x801782 1111c: 50 93 83 17 sts 0x1783, r21 ; 0x801783 11120: 60 93 84 17 sts 0x1784, r22 ; 0x801784 11124: 70 93 85 17 sts 0x1785, r23 ; 0x801785 11128: 80 91 7c 10 lds r24, 0x107C ; 0x80107c 1112c: 90 91 7d 10 lds r25, 0x107D ; 0x80107d int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' 11130: 0a 30 cpi r16, 0x0A ; 10 11132: 61 f0 breq .+24 ; 0x1114c || serial_char == '\r' 11134: 0d 30 cpi r16, 0x0D ; 13 11136: 51 f0 breq .+20 ; 0x1114c || serial_char == '#' 11138: 03 32 cpi r16, 0x23 ; 35 1113a: 09 f4 brne .+2 ; 0x1113e 1113c: 8c c0 rjmp .+280 ; 0x11256 || serial_count >= (MAX_CMD_SIZE - 1) 1113e: 8f 35 cpi r24, 0x5F ; 95 11140: 91 05 cpc r25, r1 11142: 3c f4 brge .+14 ; 0x11152 || n==-1 11144: 0f 3f cpi r16, 0xFF ; 255 11146: 10 07 cpc r17, r16 11148: 09 f0 breq .+2 ; 0x1114c 1114a: 8c c0 rjmp .+280 ; 0x11264 ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) 1114c: 00 97 sbiw r24, 0x00 ; 0 1114e: 09 f4 brne .+2 ; 0x11152 11150: d4 cc rjmp .-1624 ; 0x10afa 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); }; 11152: 20 91 01 17 lds r18, 0x1701 ; 0x801701 11156: 21 11 cpse r18, r1 11158: 03 c0 rjmp .+6 ; 0x11160 1115a: 40 e0 ldi r20, 0x00 ; 0 1115c: 50 e0 ldi r21, 0x00 ; 0 1115e: 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; 11160: 20 91 84 03 lds r18, 0x0384 ; 0x800384 11164: 30 91 85 03 lds r19, 0x0385 ; 0x800385 11168: 42 1b sub r20, r18 1116a: 53 0b sbc r21, r19 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; 1116c: a0 91 7e 10 lds r26, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.569> 11170: b0 91 7f 10 lds r27, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 11174: fd 01 movw r30, r26 11176: ed 57 subi r30, 0x7D ; 125 11178: ff 4e sbci r31, 0xEF ; 239 1117a: d0 82 st Z, r13 cmdbuffer[bufindw+1] = sd_count.lohi.lo; 1117c: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; 1117e: 52 83 std Z+2, r21 ; 0x02 11180: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string 11182: 8d 57 subi r24, 0x7D ; 125 11184: 9f 4e sbci r25, 0xEF ; 239 11186: fc 01 movw r30, r24 11188: ea 0f add r30, r26 1118a: fb 1f adc r31, r27 1118c: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 1118e: ad 57 subi r26, 0x7D ; 125 11190: bf 4e sbci r27, 0xEF ; 239 11192: fd 01 movw r30, r26 11194: 01 90 ld r0, Z+ 11196: 00 20 and r0, r0 11198: e9 f7 brne .-6 ; 0x11194 1119a: 31 97 sbiw r30, 0x01 ; 1 1119c: ea 1b sub r30, r26 1119e: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); 111a0: 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; 111a2: 80 91 81 10 lds r24, 0x1081 ; 0x801081 111a6: 90 91 82 10 lds r25, 0x1082 ; 0x801082 111aa: 01 96 adiw r24, 0x01 ; 1 111ac: 90 93 82 10 sts 0x1082, r25 ; 0x801082 111b0: 80 93 81 10 sts 0x1081, r24 ; 0x801081 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); 111b4: 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; 111b6: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.569> 111ba: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 111be: e8 0f add r30, r24 111c0: f9 2f mov r31, r25 111c2: f1 1d adc r31, r1 111c4: f0 93 7f 10 sts 0x107F, r31 ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 111c8: e0 93 7e 10 sts 0x107E, r30 ; 0x80107e <_ZL7bufindw.lto_priv.569> 111cc: 80 91 01 17 lds r24, 0x1701 ; 0x801701 111d0: 88 23 and r24, r24 111d2: 09 f4 brne .+2 ; 0x111d6 111d4: 43 c0 rjmp .+134 ; 0x1125c 111d6: 80 91 82 17 lds r24, 0x1782 ; 0x801782 111da: 90 91 83 17 lds r25, 0x1783 ; 0x801783 111de: a0 91 84 17 lds r26, 0x1784 ; 0x801784 111e2: b0 91 85 17 lds r27, 0x1785 ; 0x801785 sdpos_atomic = card.get_sdpos(); 111e6: 80 93 84 03 sts 0x0384, r24 ; 0x800384 111ea: 90 93 85 03 sts 0x0385, r25 ; 0x800385 111ee: a0 93 86 03 sts 0x0386, r26 ; 0x800386 111f2: b0 93 87 03 sts 0x0387, r27 ; 0x800387 if (bufindw == sizeof(cmdbuffer)) 111f6: ed 3e cpi r30, 0xED ; 237 111f8: f1 40 sbci r31, 0x01 ; 1 111fa: 21 f4 brne .+8 ; 0x11204 bufindw = 0; 111fc: 10 92 7f 10 sts 0x107F, r1 ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 11200: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e <_ZL7bufindw.lto_priv.569> sei(); 11204: 78 94 sei comment_mode = false; //for new command 11206: 10 92 47 03 sts 0x0347, r1 ; 0x800347 serial_count = 0; //clear buffer 1120a: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d 1120e: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c if(card.eof()) break; 11212: 40 91 82 17 lds r20, 0x1782 ; 0x801782 11216: 50 91 83 17 lds r21, 0x1783 ; 0x801783 1121a: 60 91 84 17 lds r22, 0x1784 ; 0x801784 1121e: 70 91 85 17 lds r23, 0x1785 ; 0x801785 11222: 80 91 7b 17 lds r24, 0x177B ; 0x80177b 11226: 90 91 7c 17 lds r25, 0x177C ; 0x80177c 1122a: a0 91 7d 17 lds r26, 0x177D ; 0x80177d 1122e: b0 91 7e 17 lds r27, 0x177E ; 0x80177e 11232: 48 17 cp r20, r24 11234: 59 07 cpc r21, r25 11236: 6a 07 cpc r22, r26 11238: 7b 07 cpc r23, r27 1123a: 30 f5 brcc .+76 ; 0x11288 // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 1123c: 8f e5 ldi r24, 0x5F ; 95 1123e: 90 e0 ldi r25, 0x00 ; 0 11240: 0e 94 77 5d call 0xbaee ; 0xbaee 11244: 81 11 cpse r24, r1 11246: db ce rjmp .-586 ; 0x10ffe 11248: 58 cc rjmp .-1872 ; 0x10afa 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 == ';' ){ 1124a: f8 01 movw r30, r16 1124c: 80 81 ld r24, Z 1124e: 8b 33 cpi r24, 0x3B ; 59 11250: 09 f4 brne .+2 ; 0x11254 11252: fa ce rjmp .-524 ; 0x11048 11254: 25 cf rjmp .-438 ; 0x110a0 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 11256: c0 92 46 03 sts 0x0346, r12 ; 0x800346 1125a: 78 cf rjmp .-272 ; 0x1114c 1125c: 80 e0 ldi r24, 0x00 ; 0 1125e: 90 e0 ldi r25, 0x00 ; 0 11260: dc 01 movw r26, r24 11262: c1 cf rjmp .-126 ; 0x111e6 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 11264: 9c 01 movw r18, r24 11266: 2f 5f subi r18, 0xFF ; 255 11268: 3f 4f sbci r19, 0xFF ; 255 1126a: 30 93 7d 10 sts 0x107D, r19 ; 0x80107d 1126e: 20 93 7c 10 sts 0x107C, r18 ; 0x80107c 11272: 20 91 7e 10 lds r18, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.569> 11276: 30 91 7f 10 lds r19, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 1127a: 2d 57 subi r18, 0x7D ; 125 1127c: 3f 4e sbci r19, 0xEF ; 239 1127e: 82 0f add r24, r18 11280: 93 1f adc r25, r19 11282: fc 01 movw r30, r24 11284: 03 83 std Z+3, r16 ; 0x03 11286: bb ce rjmp .-650 ; 0x10ffe } } if(card.eof()) 11288: 40 91 82 17 lds r20, 0x1782 ; 0x801782 1128c: 50 91 83 17 lds r21, 0x1783 ; 0x801783 11290: 60 91 84 17 lds r22, 0x1784 ; 0x801784 11294: 70 91 85 17 lds r23, 0x1785 ; 0x801785 11298: 80 91 7b 17 lds r24, 0x177B ; 0x80177b 1129c: 90 91 7c 17 lds r25, 0x177C ; 0x80177c 112a0: a0 91 7d 17 lds r26, 0x177D ; 0x80177d 112a4: b0 91 7e 17 lds r27, 0x177E ; 0x80177e 112a8: 48 17 cp r20, r24 112aa: 59 07 cpc r21, r25 112ac: 6a 07 cpc r22, r26 112ae: 7b 07 cpc r23, r27 112b0: 08 f4 brcc .+2 ; 0x112b4 112b2: 23 cc rjmp .-1978 ; 0x10afa { // 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()) 112b4: 0e 94 39 5c call 0xb872 ; 0xb872 112b8: 89 2b or r24, r25 112ba: 09 f0 breq .+2 ; 0x112be 112bc: 1e cc rjmp .-1988 ; 0x10afa lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 112be: 8e ef ldi r24, 0xFE ; 254 112c0: 96 e1 ldi r25, 0x16 ; 22 112c2: 0f 94 41 6d call 0x2da82 ; 0x2da82 file.close(); 112c6: 8e ef ldi r24, 0xFE ; 254 112c8: 96 e1 ldi r25, 0x16 ; 22 112ca: 0f 94 3e a4 call 0x3487c ; 0x3487c saving = false; 112ce: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c logging = false; 112d2: 10 92 6d 14 sts 0x146D, r1 ; 0x80146d { // 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 112d6: 88 e0 ldi r24, 0x08 ; 8 112d8: 96 e6 ldi r25, 0x66 ; 102 112da: 0e 94 86 7b call 0xf70c ; 0xf70c char time[30]; uint32_t t = print_job_timer.duration() / 60; 112de: 0f 94 e2 53 call 0x2a7c4 ; 0x2a7c4 112e2: 6b 01 movw r12, r22 112e4: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); 112e6: 0e 94 54 67 call 0xcea8 ; 0xcea8 // 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; 112ea: 8c e3 ldi r24, 0x3C ; 60 112ec: 88 2e mov r8, r24 112ee: 91 2c mov r9, r1 112f0: a1 2c mov r10, r1 112f2: b1 2c mov r11, r1 112f4: c7 01 movw r24, r14 112f6: b6 01 movw r22, r12 112f8: a5 01 movw r20, r10 112fa: 94 01 movw r18, r8 112fc: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> int hours, minutes; minutes = t % 60; 11300: ca 01 movw r24, r20 11302: b9 01 movw r22, r18 11304: a5 01 movw r20, r10 11306: 94 01 movw r18, r8 11308: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 1130c: 7f 93 push r23 1130e: 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; 11310: c7 01 movw r24, r14 11312: b6 01 movw r22, r12 11314: 20 e1 ldi r18, 0x10 ; 16 11316: 3e e0 ldi r19, 0x0E ; 14 11318: 40 e0 ldi r20, 0x00 ; 0 1131a: 50 e0 ldi r21, 0x00 ; 0 1131c: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 11320: 3f 93 push r19 11322: 2f 93 push r18 11324: 8c eb ldi r24, 0xBC ; 188 11326: 98 e7 ldi r25, 0x78 ; 120 11328: 9f 93 push r25 1132a: 8f 93 push r24 1132c: 8e 01 movw r16, r28 1132e: 0f 5f subi r16, 0xFF ; 255 11330: 1f 4f sbci r17, 0xFF ; 255 11332: 1f 93 push r17 11334: 0f 93 push r16 11336: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 SERIAL_ECHO_START; 1133a: 82 ef ldi r24, 0xF2 ; 242 1133c: 9a ea ldi r25, 0xAA ; 170 1133e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN(time); 11342: c8 01 movw r24, r16 11344: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 lcd_setstatus(time); 11348: c8 01 movw r24, r16 1134a: 0f 94 51 14 call 0x228a2 ; 0x228a2 card.printingHasFinished(); 1134e: 0f 94 00 80 call 0x30000 ; 0x30000 if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; 11352: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.570> if(!mounted) 11356: 0f b6 in r0, 0x3f ; 63 11358: f8 94 cli 1135a: de bf out 0x3e, r29 ; 62 1135c: 0f be out 0x3f, r0 ; 63 1135e: cd bf out 0x3d, r28 ; 61 11360: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 11364: 88 23 and r24, r24 11366: 19 f0 breq .+6 ; 0x1136e 11368: 0f 94 a2 76 call 0x2ed44 ; 0x2ed44 1136c: c6 cb rjmp .-2164 ; 0x10afa { mount(); 1136e: 81 e0 ldi r24, 0x01 ; 1 11370: 0f 94 3f 80 call 0x3007e ; 0x3007e if(!mounted) //fail 11374: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 11378: 81 11 cpse r24, r1 1137a: f6 cf rjmp .-20 ; 0x11368 1137c: be cb rjmp .-2180 ; 0x10afa 0001137e : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) 1137e: cf 93 push r28 11380: df 93 push r29 11382: ec 01 movw r28, r24 { while (*str) 11384: 89 91 ld r24, Y+ 11386: 88 23 and r24, r24 11388: 19 f0 breq .+6 ; 0x11390 write(*str++); 1138a: 0e 94 42 79 call 0xf284 ; 0xf284 1138e: fa cf rjmp .-12 ; 0x11384 } 11390: df 91 pop r29 11392: cf 91 pop r28 11394: 08 95 ret 00011396 : //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) { 11396: ff 92 push r15 11398: 0f 93 push r16 1139a: 1f 93 push r17 1139c: cf 93 push r28 1139e: df 93 push r29 113a0: ec 01 movw r28, r24 113a2: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); 113a4: 66 23 and r22, r22 113a6: 09 f4 brne .+2 ; 0x113aa 113a8: 4b c0 rjmp .+150 ; 0x11440 #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); 113aa: 0f 94 19 db call 0x3b632 ; 0x3b632 <__strlen_P> 113ae: 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)) { 113b0: c8 01 movw r24, r16 113b2: 0e 94 77 5d call 0xbaee ; 0xbaee 113b6: 88 23 and r24, r24 113b8: 09 f4 brne .+2 ; 0x113bc 113ba: 53 c0 rjmp .+166 ; 0x11462 // 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; 113bc: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.569> 113c0: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 113c4: fc 01 movw r30, r24 113c6: ed 57 subi r30, 0x7D ; 125 113c8: ff 4e sbci r31, 0xEF ; 239 113ca: 23 e0 ldi r18, 0x03 ; 3 113cc: 20 83 st Z, r18 113ce: 8a 57 subi r24, 0x7A ; 122 113d0: 9f 4e sbci r25, 0xEF ; 239 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 113d2: 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) 113d4: ff 20 and r15, r15 113d6: e9 f1 breq .+122 ; 0x11452 strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 113d8: 0f 94 12 db call 0x3b624 ; 0x3b624 else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; 113dc: 82 ef ldi r24, 0xF2 ; 242 113de: 9a ea ldi r25, 0xAA ; 170 113e0: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(MSG_Enqueing); 113e4: 8d ef ldi r24, 0xFD ; 253 113e6: 95 e6 ldi r25, 0x65 ; 101 113e8: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); 113ec: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.569> 113f0: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); 113f4: 8a 57 subi r24, 0x7A ; 122 113f6: 9f 4e sbci r25, 0xEF ; 239 113f8: 0e 94 bf 89 call 0x1137e ; 0x1137e SERIAL_ECHOLNPGM("\""); 113fc: 8a e9 ldi r24, 0x9A ; 154 113fe: 98 e7 ldi r25, 0x78 ; 120 11400: 0e 94 86 7b call 0xf70c ; 0xf70c bufindw += len + (CMDHDRSIZE + 1); 11404: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.569> 11408: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 1140c: 04 96 adiw r24, 0x04 ; 4 1140e: 08 0f add r16, r24 11410: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) 11412: 0d 3e cpi r16, 0xED ; 237 11414: 81 e0 ldi r24, 0x01 ; 1 11416: 18 07 cpc r17, r24 11418: f9 f0 breq .+62 ; 0x11458 strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); 1141a: 10 93 7f 10 sts 0x107F, r17 ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 1141e: 00 93 7e 10 sts 0x107E, r16 ; 0x80107e <_ZL7bufindw.lto_priv.569> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 11422: 80 91 81 10 lds r24, 0x1081 ; 0x801081 11426: 90 91 82 10 lds r25, 0x1082 ; 0x801082 1142a: 01 96 adiw r24, 0x01 ; 1 1142c: 90 93 82 10 sts 0x1082, r25 ; 0x801082 11430: 80 93 81 10 sts 0x1081, r24 ; 0x801081 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11434: df 91 pop r29 11436: cf 91 pop r28 11438: 1f 91 pop r17 1143a: 0f 91 pop r16 1143c: ff 90 pop r15 1143e: 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); 11440: fc 01 movw r30, r24 11442: 01 90 ld r0, Z+ 11444: 00 20 and r0, r0 11446: e9 f7 brne .-6 ; 0x11442 11448: 31 97 sbiw r30, 0x01 ; 1 1144a: 8f 01 movw r16, r30 1144c: 08 1b sub r16, r24 1144e: 19 0b sbc r17, r25 11450: af cf rjmp .-162 ; 0x113b0 // 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); 11452: 0f 94 c6 e3 call 0x3c78c ; 0x3c78c 11456: c2 cf rjmp .-124 ; 0x113dc SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11458: 10 92 7f 10 sts 0x107F, r1 ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 1145c: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e <_ZL7bufindw.lto_priv.569> 11460: e0 cf rjmp .-64 ; 0x11422 ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 11462: 8a ec ldi r24, 0xCA ; 202 11464: 9a ea ldi r25, 0xAA ; 170 11466: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(MSG_Enqueing); 1146a: 8d ef ldi r24, 0xFD ; 253 1146c: 95 e6 ldi r25, 0x65 ; 101 1146e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 11472: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) 11474: ff 20 and r15, r15 11476: 59 f0 breq .+22 ; 0x1148e SERIAL_PROTOCOLRPGM(cmd); 11478: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 1147c: 83 eb ldi r24, 0xB3 ; 179 1147e: 9a ea ldi r25, 0xAA ; 170 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11480: df 91 pop r29 11482: cf 91 pop r28 11484: 1f 91 pop r17 11486: 0f 91 pop r16 11488: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 1148a: 0c 94 86 7b jmp 0xf70c ; 0xf70c 1148e: 0e 94 bf 89 call 0x1137e ; 0x1137e 11492: f4 cf rjmp .-24 ; 0x1147c 00011494 : { 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) { 11494: 0f 93 push r16 11496: 1f 93 push r17 11498: cf 93 push r28 1149a: df 93 push r29 1149c: d6 2f mov r29, r22 1149e: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) 114a0: c0 e0 ldi r28, 0x00 ; 0 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); 114a2: f8 01 movw r30, r16 114a4: 85 91 lpm r24, Z+ 114a6: 94 91 lpm r25, Z 114a8: 61 e0 ldi r22, 0x01 ; 1 114aa: 0e 94 cb 89 call 0x11396 ; 0x11396 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) 114ae: cf 5f subi r28, 0xFF ; 255 114b0: 0e 5f subi r16, 0xFE ; 254 114b2: 1f 4f sbci r17, 0xFF ; 255 114b4: dc 13 cpse r29, r28 114b6: f5 cf rjmp .-22 ; 0x114a2 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); } } 114b8: df 91 pop r29 114ba: cf 91 pop r28 114bc: 1f 91 pop r17 114be: 0f 91 pop r16 114c0: 08 95 ret 000114c2 : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { 114c2: cf 93 push r28 114c4: df 93 push r29 114c6: cd b7 in r28, 0x3d ; 61 114c8: de b7 in r29, 0x3e ; 62 114ca: 6e 97 sbiw r28, 0x1e ; 30 114cc: 0f b6 in r0, 0x3f ; 63 114ce: f8 94 cli 114d0: de bf out 0x3e, r29 ; 62 114d2: 0f be out 0x3f, r0 ; 63 114d4: cd bf out 0x3d, r28 ; 61 114d6: 9e 01 movw r18, r28 114d8: 2c 5d subi r18, 0xDC ; 220 114da: 3f 4f sbci r19, 0xFF ; 255 114dc: f9 01 movw r30, r18 114de: 41 91 ld r20, Z+ 114e0: 51 91 ld r21, Z+ 114e2: 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); 114e4: 6e e1 ldi r22, 0x1E ; 30 114e6: 70 e0 ldi r23, 0x00 ; 0 114e8: ce 01 movw r24, r28 114ea: 01 96 adiw r24, 0x01 ; 1 114ec: 0f 94 b1 dc call 0x3b962 ; 0x3b962 va_end(ap); enquecommand(cmd_buffer, false); 114f0: 60 e0 ldi r22, 0x00 ; 0 114f2: ce 01 movw r24, r28 114f4: 01 96 adiw r24, 0x01 ; 1 114f6: 0e 94 cb 89 call 0x11396 ; 0x11396 } 114fa: 6e 96 adiw r28, 0x1e ; 30 114fc: 0f b6 in r0, 0x3f ; 63 114fe: f8 94 cli 11500: de bf out 0x3e, r29 ; 62 11502: 0f be out 0x3f, r0 ; 63 11504: cd bf out 0x3d, r28 ; 61 11506: df 91 pop r29 11508: cf 91 pop r28 1150a: 08 95 ret 0001150c : } } /// @brief Read saved filename from EEPROM and send g-code command: M23 void restore_file_from_sd() { 1150c: ef 92 push r14 1150e: ff 92 push r15 11510: 0f 93 push r16 11512: 1f 93 push r17 11514: cf 93 push r28 11516: df 93 push r29 11518: cd b7 in r28, 0x3d ; 61 1151a: de b7 in r29, 0x3e ; 62 1151c: 6b 97 sbiw r28, 0x1b ; 27 1151e: 0f b6 in r0, 0x3f ; 63 11520: f8 94 cli 11522: de bf out 0x3e, r29 ; 62 11524: 0f be out 0x3f, r0 ; 63 11526: 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); 11528: 8a e5 ldi r24, 0x5A ; 90 1152a: 9f e0 ldi r25, 0x0F ; 15 1152c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 11530: e8 2e mov r14, r24 11532: 0a e0 ldi r16, 0x0A ; 10 11534: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 11536: 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); 11538: 48 e0 ldi r20, 0x08 ; 8 1153a: 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++) { 1153c: fe 14 cp r15, r14 1153e: 79 f0 breq .+30 ; 0x1155e eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 11540: b8 01 movw r22, r16 11542: ce 01 movw r24, r28 11544: 0e 96 adiw r24, 0x0e ; 14 11546: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 dir_name[8] = '\0'; 1154a: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 1154c: 60 e0 ldi r22, 0x00 ; 0 1154e: ce 01 movw r24, r28 11550: 0e 96 adiw r24, 0x0e ; 14 11552: 0f 94 91 7d call 0x2fb22 ; 0x2fb22 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++) { 11556: f3 94 inc r15 11558: 08 5f subi r16, 0xF8 ; 248 1155a: 1f 4f sbci r17, 0xFF ; 255 1155c: ed cf rjmp .-38 ; 0x11538 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); 1155e: 65 e9 ldi r22, 0x95 ; 149 11560: 7f e0 ldi r23, 0x0F ; 15 11562: 8e 01 movw r16, r28 11564: 0f 5f subi r16, 0xFF ; 255 11566: 1f 4f sbci r17, 0xFF ; 255 11568: c8 01 movw r24, r16 1156a: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 1156e: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 11570: 8e e2 ldi r24, 0x2E ; 46 11572: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 11574: 43 e0 ldi r20, 0x03 ; 3 11576: 50 e0 ldi r21, 0x00 ; 0 11578: 61 e9 ldi r22, 0x91 ; 145 1157a: 7c e0 ldi r23, 0x0C ; 12 1157c: ce 01 movw r24, r28 1157e: 48 96 adiw r24, 0x18 ; 24 11580: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 extension_ptr[4] = '\0'; 11584: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 11586: be 01 movw r22, r28 11588: 69 5e subi r22, 0xE9 ; 233 1158a: 7f 4f sbci r23, 0xFF ; 255 1158c: c8 01 movw r24, r16 1158e: 0f 94 a7 e3 call 0x3c74e ; 0x3c74e enquecommandf_P(MSG_M23, filename); 11592: 1f 93 push r17 11594: 0f 93 push r16 11596: 81 e9 ldi r24, 0x91 ; 145 11598: 91 e7 ldi r25, 0x71 ; 113 1159a: 9f 93 push r25 1159c: 8f 93 push r24 1159e: 0e 94 61 8a call 0x114c2 ; 0x114c2 115a2: 0f 90 pop r0 115a4: 0f 90 pop r0 115a6: 0f 90 pop r0 115a8: 0f 90 pop r0 } 115aa: 6b 96 adiw r28, 0x1b ; 27 115ac: 0f b6 in r0, 0x3f ; 63 115ae: f8 94 cli 115b0: de bf out 0x3e, r29 ; 62 115b2: 0f be out 0x3f, r0 ; 63 115b4: cd bf out 0x3d, r28 ; 61 115b6: df 91 pop r29 115b8: cf 91 pop r28 115ba: 1f 91 pop r17 115bc: 0f 91 pop r16 115be: ff 90 pop r15 115c0: ef 90 pop r14 115c2: 08 95 ret 000115c4 : //! 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) { 115c4: bf 92 push r11 115c6: cf 92 push r12 115c8: df 92 push r13 115ca: ef 92 push r14 115cc: ff 92 push r15 115ce: 0f 93 push r16 115d0: 1f 93 push r17 115d2: cf 93 push r28 115d4: df 93 push r29 if (saved_printing) return; 115d6: e0 91 5a 0e lds r30, 0x0E5A ; 0x800e5a 115da: e1 11 cpse r30, r1 115dc: b1 c0 rjmp .+354 ; 0x11740 115de: 05 2f mov r16, r21 115e0: 14 2f mov r17, r20 115e2: e9 01 movw r28, r18 115e4: 6b 01 movw r12, r22 115e6: 7c 01 movw r14, r24 cli(); 115e8: f8 94 cli save_print_file_state(); 115ea: 0e 94 6f 66 call 0xccde ; 0xccde // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 115ee: b0 90 59 0e lds r11, 0x0E59 ; 0x800e59 115f2: b1 10 cpse r11, r1 115f4: 02 c0 rjmp .+4 ; 0x115fa 115f6: b0 90 58 0e lds r11, 0x0E58 ; 0x800e58 save_planner_global_state(); 115fa: 0e 94 25 66 call 0xcc4a ; 0xcc4a planner_abort_hard(); //abort printing 115fe: 0f 94 d7 bb call 0x377ae ; 0x377ae memcpy(saved_pos, current_position, sizeof(saved_pos)); 11602: 80 e1 ldi r24, 0x10 ; 16 11604: e3 e4 ldi r30, 0x43 ; 67 11606: f7 e0 ldi r31, 0x07 ; 7 11608: ab e9 ldi r26, 0x9B ; 155 1160a: b2 e0 ldi r27, 0x02 ; 2 1160c: 01 90 ld r0, Z+ 1160e: 0d 92 st X+, r0 11610: 8a 95 dec r24 11612: e1 f7 brne .-8 ; 0x1160c if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 11614: bb 20 and r11, r11 11616: 61 f0 breq .+24 ; 0x11630 11618: 80 e0 ldi r24, 0x00 ; 0 1161a: 90 e0 ldi r25, 0x00 ; 0 1161c: a0 e8 ldi r26, 0x80 ; 128 1161e: bf eb ldi r27, 0xBF ; 191 11620: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b 11624: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c 11628: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d 1162c: b0 93 9e 02 sts 0x029E, r27 ; 0x80029e saved_feedmultiply2 = feedmultiply; //save feedmultiply 11630: 80 91 39 02 lds r24, 0x0239 ; 0x800239 11634: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 11638: 90 93 74 03 sts 0x0374, r25 ; 0x800374 1163c: 80 93 73 03 sts 0x0373, r24 ; 0x800373 saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 11640: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 11644: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 11648: 90 93 ae 05 sts 0x05AE, r25 ; 0x8005ae 1164c: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_bed_temperature = (uint8_t)degTargetBed(); 11650: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 11654: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 11658: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 1165c: 83 fb bst r24, 3 1165e: 88 27 eor r24, r24 11660: 80 f9 bld r24, 0 11662: 80 93 06 18 sts 0x1806, r24 ; 0x801806 saved_fan_speed = fanSpeed; 11666: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 1166a: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac cmdqueue_reset(); //empty cmdqueue 1166e: 0e 94 4f 81 call 0x1029e ; 0x1029e card.sdprinting = false; 11672: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e // card.closefile(); saved_printing = true; 11676: 81 e0 ldi r24, 0x01 ; 1 11678: 80 93 5a 0e sts 0x0E5A, r24 ; 0x800e5a // We may have missed a stepper timer interrupt. Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); 1167c: 0f 94 81 58 call 0x2b102 ; 0x2b102 sei(); 11680: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 11682: 20 e0 ldi r18, 0x00 ; 0 11684: 30 e0 ldi r19, 0x00 ; 0 11686: a9 01 movw r20, r18 11688: c7 01 movw r24, r14 1168a: b6 01 movw r22, r12 1168c: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__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) 11690: 20 e0 ldi r18, 0x00 ; 0 11692: 30 e0 ldi r19, 0x00 ; 0 11694: a9 01 movw r20, r18 11696: f8 01 movw r30, r16 11698: 6c 2f mov r22, r28 1169a: 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 1169c: 81 11 cpse r24, r1 1169e: 5a c0 rjmp .+180 ; 0x11754 116a0: 8f 2f mov r24, r31 116a2: 90 2f mov r25, r16 116a4: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 116a8: 88 23 and r24, r24 116aa: 09 f4 brne .+2 ; 0x116ae 116ac: 49 c0 rjmp .+146 ; 0x11740 // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 116ae: 80 91 06 18 lds r24, 0x1806 ; 0x801806 116b2: 81 11 cpse r24, r1 116b4: 05 c0 rjmp .+10 ; 0x116c0 enquecommand_P(MSG_M83); 116b6: 61 e0 ldi r22, 0x01 ; 1 116b8: 81 ec ldi r24, 0xC1 ; 193 116ba: 9c e6 ldi r25, 0x6C ; 108 116bc: 0e 94 cb 89 call 0x11396 ; 0x11396 // 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); 116c0: 0f 93 push r16 116c2: 1f 93 push r17 116c4: df 93 push r29 116c6: cf 93 push r28 116c8: 86 e7 ldi r24, 0x76 ; 118 116ca: 92 e7 ldi r25, 0x72 ; 114 116cc: 9f 93 push r25 116ce: 8f 93 push r24 116d0: 0e 94 61 8a call 0x114c2 ; 0x114c2 } if(z_move) 116d4: 0f 90 pop r0 116d6: 0f 90 pop r0 116d8: 0f 90 pop r0 116da: 0f 90 pop r0 116dc: 0f 90 pop r0 116de: 0f 90 pop r0 116e0: 20 e0 ldi r18, 0x00 ; 0 116e2: 30 e0 ldi r19, 0x00 ; 0 116e4: a9 01 movw r20, r18 116e6: c7 01 movw r24, r14 116e8: b6 01 movw r22, r12 116ea: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 116ee: 88 23 and r24, r24 116f0: 21 f1 breq .+72 ; 0x1173a { // Then lift Z axis enquecommandf_P(PSTR("G1 Z%-.3f F%-.3f"), saved_pos[Z_AXIS] + z_move, homing_feedrate[Z_AXIS]); 116f2: 84 e4 ldi r24, 0x44 ; 68 116f4: 8f 93 push r24 116f6: 88 e4 ldi r24, 0x48 ; 72 116f8: 8f 93 push r24 116fa: 1f 92 push r1 116fc: 1f 92 push r1 116fe: 20 91 a3 02 lds r18, 0x02A3 ; 0x8002a3 11702: 30 91 a4 02 lds r19, 0x02A4 ; 0x8002a4 11706: 40 91 a5 02 lds r20, 0x02A5 ; 0x8002a5 1170a: 50 91 a6 02 lds r21, 0x02A6 ; 0x8002a6 1170e: c7 01 movw r24, r14 11710: b6 01 movw r22, r12 11712: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 11716: 9f 93 push r25 11718: 8f 93 push r24 1171a: 7f 93 push r23 1171c: 6f 93 push r22 1171e: 8a ed ldi r24, 0xDA ; 218 11720: 9f e7 ldi r25, 0x7F ; 127 11722: 9f 93 push r25 11724: 8f 93 push r24 11726: 0e 94 61 8a call 0x114c2 ; 0x114c2 1172a: 8d b7 in r24, 0x3d ; 61 1172c: 9e b7 in r25, 0x3e ; 62 1172e: 0a 96 adiw r24, 0x0a ; 10 11730: 0f b6 in r0, 0x3f ; 63 11732: f8 94 cli 11734: 9e bf out 0x3e, r25 ; 62 11736: 0f be out 0x3f, r0 ; 63 11738: 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; 1173a: 81 e0 ldi r24, 0x01 ; 1 1173c: 80 93 80 10 sts 0x1080, r24 ; 0x801080 // 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(); } } 11740: df 91 pop r29 11742: cf 91 pop r28 11744: 1f 91 pop r17 11746: 0f 91 pop r16 11748: ff 90 pop r15 1174a: ef 90 pop r14 1174c: df 90 pop r13 1174e: cf 90 pop r12 11750: bf 90 pop r11 11752: 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) 11754: 8f 2f mov r24, r31 11756: 90 2f mov r25, r16 11758: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1175c: 88 23 and r24, r24 1175e: 49 f2 breq .-110 ; 0x116f2 11760: a6 cf rjmp .-180 ; 0x116ae 00011762 : eeprom_update_word_notify((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, backlightTimer_period); } void backlight_update() { if (!backlightSupport) return; 11762: 80 91 fe 03 lds r24, 0x03FE ; 0x8003fe 11766: 88 23 and r24, r24 11768: 21 f1 breq .+72 ; 0x117b2 if (backlightMode == BACKLIGHT_MODE_AUTO) 1176a: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1176e: 82 30 cpi r24, 0x02 ; 2 11770: e9 f4 brne .+58 ; 0x117ac { if (backlightTimer.expired((uint32_t)backlightTimer_period * 1000ul)) analogWrite(LCD_BL_PIN, backlightLevel_LOW); 11772: a0 91 4d 02 lds r26, 0x024D ; 0x80024d 11776: b0 91 4e 02 lds r27, 0x024E ; 0x80024e 1177a: 28 ee ldi r18, 0xE8 ; 232 1177c: 33 e0 ldi r19, 0x03 ; 3 1177e: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__usmulhisi3> 11782: ab 01 movw r20, r22 11784: bc 01 movw r22, r24 11786: 89 e3 ldi r24, 0x39 ; 57 11788: 93 e0 ldi r25, 0x03 ; 3 1178a: 0f 94 6a 3f call 0x27ed4 ; 0x27ed4 ::expired(unsigned long)> 1178e: 88 23 and r24, r24 11790: 31 f0 breq .+12 ; 0x1179e 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); 11792: 60 91 fc 03 lds r22, 0x03FC ; 0x8003fc else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); 11796: 70 e0 ldi r23, 0x00 ; 0 11798: 85 e0 ldi r24, 0x05 ; 5 1179a: 0c 94 b8 de jmp 0x1bd70 ; 0x1bd70 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); 1179e: 80 91 39 03 lds r24, 0x0339 ; 0x800339 117a2: 88 23 and r24, r24 117a4: 31 f0 breq .+12 ; 0x117b2 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); 117a6: 60 91 fd 03 lds r22, 0x03FD ; 0x8003fd 117aa: f5 cf rjmp .-22 ; 0x11796 { 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); 117ac: 81 11 cpse r24, r1 117ae: fb cf rjmp .-10 ; 0x117a6 117b0: f0 cf rjmp .-32 ; 0x11792 else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); } 117b2: 08 95 ret 000117b4 : 117b4: 60 91 fd 03 lds r22, 0x03FD ; 0x8003fd 117b8: 84 e3 ldi r24, 0x34 ; 52 117ba: 9d e0 ldi r25, 0x0D ; 13 117bc: 0f 94 7f dd call 0x3bafe ; 0x3bafe 117c0: 60 91 fc 03 lds r22, 0x03FC ; 0x8003fc 117c4: 83 e3 ldi r24, 0x33 ; 51 117c6: 9d e0 ldi r25, 0x0D ; 13 117c8: 0f 94 7f dd call 0x3bafe ; 0x3bafe 117cc: 60 91 4f 02 lds r22, 0x024F ; 0x80024f 117d0: 82 e3 ldi r24, 0x32 ; 50 117d2: 9d e0 ldi r25, 0x0D ; 13 117d4: 0f 94 7f dd call 0x3bafe ; 0x3bafe if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 117d8: 60 91 4d 02 lds r22, 0x024D ; 0x80024d 117dc: 70 91 4e 02 lds r23, 0x024E ; 0x80024e 117e0: 80 e3 ldi r24, 0x30 ; 48 117e2: 9d e0 ldi r25, 0x0D ; 13 117e4: 0d 94 9d dd jmp 0x3bb3a ; 0x3bb3a 000117e8 : backlight_update(); } void force_bl_on(bool section_start) { if (section_start) 117e8: 88 23 and r24, r24 117ea: 61 f0 breq .+24 ; 0x11804 { backlightMode = BACKLIGHT_MODE_BRIGHT; 117ec: 81 e0 ldi r24, 0x01 ; 1 117ee: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f if (backlightLevel_HIGH < 30) backlightLevel_HIGH = 30; 117f2: 80 91 fd 03 lds r24, 0x03FD ; 0x8003fd 117f6: 8e 31 cpi r24, 0x1E ; 30 117f8: 18 f4 brcc .+6 ; 0x11800 117fa: 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); 117fc: 80 93 fd 03 sts 0x03FD, r24 ; 0x8003fd } backlight_update(); 11800: 0c 94 b1 8b jmp 0x11762 ; 0x11762 backlightMode = BACKLIGHT_MODE_BRIGHT; if (backlightLevel_HIGH < 30) backlightLevel_HIGH = 30; } else { backlightMode = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_MODE); 11804: 82 e3 ldi r24, 0x32 ; 50 11806: 9d e0 ldi r25, 0x0D ; 13 11808: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1180c: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH); 11810: 84 e3 ldi r24, 0x34 ; 52 11812: 9d e0 ldi r25, 0x0D ; 13 11814: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 11818: f1 cf rjmp .-30 ; 0x117fc 0001181a : 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; 1181a: 80 91 fe 03 lds r24, 0x03FE ; 0x8003fe 1181e: 88 23 and r24, r24 11820: 31 f0 breq .+12 ; 0x1182e backlightTimer.start(); 11822: 89 e3 ldi r24, 0x39 ; 57 11824: 93 e0 ldi r25, 0x03 ; 3 11826: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> backlight_update(); 1182a: 0c 94 b1 8b jmp 0x11762 ; 0x11762 } 1182e: 08 95 ret 00011830 : } backlight_update(); } void backlight_wake(const uint8_t flashNo) { 11830: ff 92 push r15 11832: 0f 93 push r16 11834: 1f 93 push r17 11836: cf 93 push r28 11838: df 93 push r29 if (!backlightSupport) return; 1183a: 90 91 fe 03 lds r25, 0x03FE ; 0x8003fe 1183e: 99 23 and r25, r25 11840: 99 f1 breq .+102 ; 0x118a8 if (flashNo) 11842: 88 23 and r24, r24 11844: 51 f1 breq .+84 ; 0x1189a { uint8_t backlightMode_bck = backlightMode; 11846: 00 91 4f 02 lds r16, 0x024F ; 0x80024f for (uint8_t i = 0; i < (((backlightMode_bck == BACKLIGHT_MODE_AUTO) && !backlightTimer.running()) + (flashNo * 2)); i++) 1184a: c8 2f mov r28, r24 1184c: d0 e0 ldi r29, 0x00 ; 0 1184e: cc 0f add r28, r28 11850: dd 1f adc r29, r29 11852: 10 e0 ldi r17, 0x00 ; 0 11854: ff 24 eor r15, r15 11856: f3 94 inc r15 11858: 21 2f mov r18, r17 1185a: 30 e0 ldi r19, 0x00 ; 0 1185c: 80 91 39 03 lds r24, 0x0339 ; 0x800339 11860: 8f 25 eor r24, r15 11862: 02 30 cpi r16, 0x02 ; 2 11864: 09 f0 breq .+2 ; 0x11868 11866: 80 e0 ldi r24, 0x00 ; 0 11868: 8c 0f add r24, r28 1186a: 9d 2f mov r25, r29 1186c: 91 1d adc r25, r1 1186e: 28 17 cp r18, r24 11870: 39 07 cpc r19, r25 11872: 8c f4 brge .+34 ; 0x11896 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM 11874: 81 e0 ldi r24, 0x01 ; 1 11876: 90 91 4f 02 lds r25, 0x024F ; 0x80024f 1187a: 91 11 cpse r25, r1 1187c: 80 e0 ldi r24, 0x00 ; 0 1187e: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlight_update(); 11882: 0e 94 b1 8b call 0x11762 ; 0x11762 _delay(BL_FLASH_DELAY_MS); 11886: 69 e1 ldi r22, 0x19 ; 25 11888: 70 e0 ldi r23, 0x00 ; 0 1188a: 80 e0 ldi r24, 0x00 ; 0 1188c: 90 e0 ldi r25, 0x00 ; 0 1188e: 0f 94 8d 3c call 0x2791a ; 0x2791a 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++) 11892: 1f 5f subi r17, 0xFF ; 255 11894: e1 cf rjmp .-62 ; 0x11858 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; 11896: 00 93 4f 02 sts 0x024F, r16 ; 0x80024f } backlightTimer_reset(); } 1189a: df 91 pop r29 1189c: cf 91 pop r28 1189e: 1f 91 pop r17 118a0: 0f 91 pop r16 118a2: ff 90 pop r15 backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; } backlightTimer_reset(); 118a4: 0c 94 0d 8c jmp 0x1181a ; 0x1181a } 118a8: df 91 pop r29 118aa: cf 91 pop r28 118ac: 1f 91 pop r17 118ae: 0f 91 pop r16 118b0: ff 90 pop r15 118b2: 08 95 ret 000118b4 : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { 118b4: 0f 93 push r16 118b6: 1f 93 push r17 118b8: cf 93 push r28 118ba: df 93 push r29 118bc: d8 2f mov r29, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup state = State::disabled; } bool IR_sensor::update() { switch (state) { 118be: 80 91 88 17 lds r24, 0x1788 ; 0x801788 118c2: 81 30 cpi r24, 0x01 ; 1 118c4: 21 f0 breq .+8 ; 0x118ce 118c6: 82 30 cpi r24, 0x02 ; 2 118c8: 49 f0 breq .+18 ; 0x118dc return checkFilamentEvents(); } break; case State::disabled: case State::error: default: return false; 118ca: c0 e0 ldi r28, 0x00 ; 0 118cc: 4b c0 rjmp .+150 ; 0x11964 } bool IR_sensor::update() { switch (state) { case State::initializing: state = State::ready; // the IR sensor gets ready instantly as it's just a gpio read operation. 118ce: 82 e0 ldi r24, 0x02 ; 2 118d0: 80 93 88 17 sts 0x1788, r24 ; 0x801788 // initialize the current filament state so that we don't create a switching event right after the sensor is ready. oldFilamentPresent = fsensor.getFilamentPresent(); 118d4: 0e 94 df e3 call 0x1c7be ; 0x1c7be 118d8: 80 93 8b 17 sts 0x178B, r24 ; 0x80178b [[fallthrough]]; case State::ready: { postponedLoadEvent = false; 118dc: 10 92 8c 17 sts 0x178C, r1 ; 0x80178c sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) 118e0: 80 91 88 17 lds r24, 0x1788 ; 0x801788 118e4: 82 30 cpi r24, 0x02 ; 2 118e6: 09 f0 breq .+2 ; 0x118ea 118e8: 92 c0 rjmp .+292 ; 0x11a0e return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 118ea: 80 91 8d 17 lds r24, 0x178D ; 0x80178d 118ee: 81 11 cpse r24, r1 118f0: cc c0 rjmp .+408 ; 0x11a8a return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); 118f2: 0e 94 df e3 call 0x1c7be ; 0x1c7be 118f6: c8 2f mov r28, r24 if (oldFilamentPresent != newFilamentPresent) { 118f8: 80 91 8b 17 lds r24, 0x178B ; 0x80178b 118fc: c8 17 cp r28, r24 118fe: 29 f3 breq .-54 ; 0x118ca oldFilamentPresent = newFilamentPresent; 11900: c0 93 8b 17 sts 0x178B, r28 ; 0x80178b eventBlankingTimer.start(); 11904: 8d e8 ldi r24, 0x8D ; 141 11906: 97 e1 ldi r25, 0x17 ; 23 11908: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> if (newFilamentPresent) { // filament insertion 1190c: cc 23 and r28, r28 1190e: 09 f4 brne .+2 ; 0x11912 11910: c5 c0 rjmp .+394 ; 0x11a9c } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11912: 80 91 89 17 lds r24, 0x1789 ; 0x801789 11916: 88 23 and r24, r24 11918: 11 f1 breq .+68 ; 0x1195e return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) 1191a: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1191e: 81 11 cpse r24, r1 11920: 1e c0 rjmp .+60 ; 0x1195e && !( 11922: 80 91 98 13 lds r24, 0x1398 ; 0x801398 11926: 81 30 cpi r24, 0x01 ; 1 11928: d1 f0 breq .+52 ; 0x1195e } //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); 1192a: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 1192e: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 11932: 89 1b sub r24, r25 11934: 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 11936: 99 f4 brne .+38 ; 0x1195e || printJobOngoing() 11938: 0e 94 c5 68 call 0xd18a ; 0xd18a 1193c: 81 11 cpse r24, r1 1193e: 0f c0 rjmp .+30 ; 0x1195e || (lcd_commands_type == LcdCommands::Layer1Cal) 11940: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 11944: 84 30 cpi r24, 0x04 ; 4 11946: 59 f0 breq .+22 ; 0x1195e || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 11948: 8f e5 ldi r24, 0x5F ; 95 1194a: 9f e0 ldi r25, 0x0F ; 15 1194c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11950: 81 11 cpse r24, r1 11952: 05 c0 rjmp .+10 ; 0x1195e || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); 11954: 61 e0 ldi r22, 0x01 ; 1 11956: 8c e5 ldi r24, 0x5C ; 92 11958: 9a e3 ldi r25, 0x3A ; 58 1195a: 0f 94 47 d0 call 0x3a08e ; 0x3a08e oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; 1195e: 81 e0 ldi r24, 0x01 ; 1 11960: 80 93 8c 17 sts 0x178C, r24 ; 0x80178c sensorRevision = (SensorRevision)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_PCB); } bool IR_sensor_analog::update() { bool event = IR_sensor::update(); if (state == State::ready) { 11964: 80 91 88 17 lds r24, 0x1788 ; 0x801788 11968: 82 30 cpi r24, 0x02 ; 2 1196a: 09 f0 breq .+2 ; 0x1196e 1196c: 4b c0 rjmp .+150 ; 0x11a04 return true; } bool IR_sensor_analog::getVoltReady() const { bool ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ ret = voltReady; } 1196e: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11970: f8 94 cli 11972: 80 91 92 17 lds r24, 0x1792 ; 0x801792 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11976: 9f bf out 0x3f, r25 ; 63 } bool IR_sensor_analog::update() { bool event = IR_sensor::update(); if (state == State::ready) { if (getVoltReady()) { 11978: 88 23 and r24, r24 1197a: 09 f4 brne .+2 ; 0x1197e 1197c: 43 c0 rjmp .+134 ; 0x11a04 ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ ret = voltReady; } return ret; } void IR_sensor_analog::clearVoltReady(){ ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ voltReady = false; } 1197e: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11980: f8 94 cli 11982: 10 92 92 17 sts 0x1792, r1 ; 0x801792 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11986: 8f bf out 0x3f, r24 ; 63 bool IR_sensor_analog::update() { bool event = IR_sensor::update(); if (state == State::ready) { if (getVoltReady()) { clearVoltReady(); uint16_t volt = getVoltRaw(); 11988: 0f 94 ae 7b call 0x2f75c ; 0x2f75c 1198c: 8c 01 movw r16, r24 // printf_P(PSTR("newVoltRaw:%u\n"), volt / OVERSAMPLENR); // detect min-max, some long term sliding window for filtration may be added // avoiding floating point operations, thus computing in raw if (volt > maxVolt) { 1198e: 80 91 97 17 lds r24, 0x1797 ; 0x801797 11992: 90 91 98 17 lds r25, 0x1798 ; 0x801798 11996: 80 17 cp r24, r16 11998: 91 07 cpc r25, r17 1199a: 08 f0 brcs .+2 ; 0x1199e 1199c: d7 c0 rjmp .+430 ; 0x11b4c maxVolt = volt; 1199e: 10 93 98 17 sts 0x1798, r17 ; 0x801798 119a2: 00 93 97 17 sts 0x1797, r16 ; 0x801797 //! what we want to detect: //! if minvolt gets below ~0.3V, it means there is an old fsensor //! if maxvolt gets above 4.6V, it means we either have an old fsensor or broken cables/fsensor //! So I'm waiting for a situation, when minVolt gets to range <0, 1.5> and maxVolt gets into range <3.0, 5> //! If and only if minVolt is in range <0.3, 1.5> and maxVolt is in range <3.0, 4.6>, I'm considering a situation with the new fsensor if (minVolt >= IRsensor_Ldiode_TRESHOLD && minVolt <= IRsensor_Lmax_TRESHOLD && maxVolt >= IRsensor_Hmin_TRESHOLD && 119a6: 80 91 95 17 lds r24, 0x1795 ; 0x801795 119aa: 90 91 96 17 lds r25, 0x1796 ; 0x801796 119ae: 9c 01 movw r18, r24 119b0: 26 5d subi r18, 0xD6 ; 214 119b2: 33 40 sbci r19, 0x03 ; 3 119b4: 29 35 cpi r18, 0x59 ; 89 119b6: 3f 40 sbci r19, 0x0F ; 15 119b8: 08 f0 brcs .+2 ; 0x119bc 119ba: d5 c0 rjmp .+426 ; 0x11b66 119bc: 80 91 97 17 lds r24, 0x1797 ; 0x801797 119c0: 90 91 98 17 lds r25, 0x1798 ; 0x801798 119c4: 8d 55 subi r24, 0x5D ; 93 119c6: 96 42 sbci r25, 0x26 ; 38 119c8: 87 37 cpi r24, 0x77 ; 119 119ca: 94 41 sbci r25, 0x14 ; 20 119cc: 20 f4 brcc .+8 ; 0x119d6 maxVolt <= IRsensor_Hopen_TRESHOLD) { IR_ANALOG_Check(SensorRevision::_Old, SensorRevision::_Rev04); 119ce: 61 e0 ldi r22, 0x01 ; 1 119d0: 80 e0 ldi r24, 0x00 ; 0 } //! If and only if minVolt is in range <0.0, 0.3> and maxVolt is in range <4.6, 5.0V>, I'm considering a situation with the old fsensor //! Note, we are not relying on one voltage here - getting just +5V can mean an old fsensor or a broken new sensor - that's why //! we need to have both voltages detected correctly to allow switching back to the old fsensor. else if (minVolt < IRsensor_Ldiode_TRESHOLD && maxVolt > IRsensor_Hopen_TRESHOLD && maxVolt <= IRsensor_VMax_TRESHOLD) { IR_ANALOG_Check(SensorRevision::_Rev04, SensorRevision::_Old); 119d2: 0f 94 c6 7b call 0x2f78c ; 0x2f78c eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_PCB, (uint8_t)rev); } } bool IR_sensor_analog::checkVoltage(uint16_t raw) { if (IRsensor_Lmax_TRESHOLD <= raw && raw <= IRsensor_Hmin_TRESHOLD) { 119d6: c8 01 movw r24, r16 119d8: 8e 52 subi r24, 0x2E ; 46 119da: 93 41 sbci r25, 0x13 ; 19 119dc: 80 33 cpi r24, 0x30 ; 48 119de: 93 41 sbci r25, 0x13 ; 19 119e0: 08 f0 brcs .+2 ; 0x119e4 119e2: d2 c0 rjmp .+420 ; 0x11b88 /// If the voltage is in forbidden range, the fsensor is ok, but the lever is mounted improperly. /// Or the user is so creative so that he can hold a piece of fillament in the hole in such a genius way, /// that the IR fsensor reading is within 1.5 and 3V ... this would have been highly unusual /// and would have been considered more like a sabotage than normal printer operation if (voltageErrorCnt++ > 4) { 119e4: 80 91 9b 17 lds r24, 0x179B ; 0x80179b 119e8: 91 e0 ldi r25, 0x01 ; 1 119ea: 98 0f add r25, r24 119ec: 90 93 9b 17 sts 0x179B, r25 ; 0x80179b 119f0: 85 30 cpi r24, 0x05 ; 5 119f2: 08 f4 brcc .+2 ; 0x119f6 119f4: cb c0 rjmp .+406 ; 0x11b8c puts_P(PSTR("fsensor in forbidden range 1.5-3V - check sensor")); 119f6: 8d ef ldi r24, 0xFD ; 253 119f8: 9e e7 ldi r25, 0x7E ; 126 voltageErrorCnt = 0; } if (sensorRevision == SensorRevision::_Rev04) { /// newer IR sensor cannot normally produce 4.6-5V, this is considered a failure/bad mount if (IRsensor_Hopen_TRESHOLD <= raw && raw <= IRsensor_VMax_TRESHOLD) { puts_P(PSTR("fsensor v0.4 in fault range 4.6-5V - unconnected")); 119fa: 0f 94 44 dc call 0x3b888 ; 0x3b888 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); enquecommand_front_P(MSG_M600); } void Filament_sensor::triggerError() { state = State::error; 119fe: 83 e0 ldi r24, 0x03 ; 3 11a00: 80 93 88 17 sts 0x1788, r24 ; 0x801788 #ifdef FILAMENT_SENSOR if (fsensor.update()) { 11a04: cc 23 and r28, r28 11a06: 19 f0 breq .+6 ; 0x11a0e lcd_draw_update = 1; //cause lcd update so that fsensor event polling can be done from the lcd draw routine. 11a08: 81 e0 ldi r24, 0x01 ; 1 11a0a: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d * * 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) 11a0e: 0e 94 16 69 call 0xd22c ; 0xd22c 11a12: 81 11 cpse r24, r1 11a14: c9 c0 rjmp .+402 ; 0x11ba8 11a16: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 11a1a: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 11a1e: 00 97 sbiw r24, 0x00 ; 0 11a20: 39 f4 brne .+14 ; 0x11a30 11a22: 20 91 6b 0e lds r18, 0x0E6B ; 0x800e6b 11a26: 30 91 6c 0e lds r19, 0x0E6C ; 0x800e6c 11a2a: 23 2b or r18, r19 11a2c: 09 f4 brne .+2 ; 0x11a30 11a2e: bc c0 rjmp .+376 ; 0x11ba8 11a30: 40 91 30 02 lds r20, 0x0230 ; 0x800230 11a34: 50 91 31 02 lds r21, 0x0231 ; 0x800231 11a38: 60 91 32 02 lds r22, 0x0232 ; 0x800232 11a3c: 70 91 33 02 lds r23, 0x0233 ; 0x800233 11a40: 41 15 cp r20, r1 11a42: 51 05 cpc r21, r1 11a44: 61 05 cpc r22, r1 11a46: 71 05 cpc r23, r1 11a48: 09 f4 brne .+2 ; 0x11a4c 11a4a: ae c0 rjmp .+348 ; 0x11ba8 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) 11a4c: 89 2b or r24, r25 11a4e: 31 f4 brne .+12 ; 0x11a5c 11a50: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 11a54: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 11a58: 89 2b or r24, r25 11a5a: 29 f0 breq .+10 ; 0x11a66 11a5c: 80 91 db 05 lds r24, 0x05DB ; 0x8005db 11a60: 88 23 and r24, r24 11a62: 09 f4 brne .+2 ; 0x11a66 11a64: 09 c1 rjmp .+530 ; 0x11c78 { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) 11a66: 8b ed ldi r24, 0xDB ; 219 11a68: 95 e0 ldi r25, 0x05 ; 5 11a6a: 0f 94 6a 3f call 0x27ed4 ; 0x27ed4 ::expired(unsigned long)> 11a6e: 88 23 and r24, r24 11a70: 09 f4 brne .+2 ; 0x11a74 11a72: 9c c0 rjmp .+312 ; 0x11bac { disable_heater(); 11a74: 0f 94 52 44 call 0x288a4 ; 0x288a4 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); 11a78: 82 e7 ldi r24, 0x72 ; 114 11a7a: 96 e3 ldi r25, 0x36 ; 54 11a7c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 11a80: 0f 94 07 35 call 0x26a0e ; 0x26a0e lcd_return_to_status(); 11a84: 0f 94 4e 26 call 0x24c9c ; 0x24c9c 11a88: 91 c0 rjmp .+290 ; 0x11bac } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 11a8a: 64 e6 ldi r22, 0x64 ; 100 11a8c: 70 e0 ldi r23, 0x00 ; 0 11a8e: 8d e8 ldi r24, 0x8D ; 141 11a90: 97 e1 ldi r25, 0x17 ; 23 11a92: 0f 94 b8 3e call 0x27d70 ; 0x27d70 ::expired(unsigned short)> 11a96: 81 11 cpse r24, r1 11a98: 2c cf rjmp .-424 ; 0x118f2 11a9a: 17 cf rjmp .-466 ; 0x118ca } } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled 11a9c: c0 91 8a 17 lds r28, 0x178A ; 0x80178a && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11aa0: cc 23 and r28, r28 11aa2: 09 f4 brne .+2 ; 0x11aa6 11aa4: 4f c0 rjmp .+158 ; 0x11b44 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) 11aa6: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 11aaa: 81 11 cpse r24, r1 11aac: 5b cf rjmp .-330 ; 0x11964 11aae: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 11ab2: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 11ab6: 89 1b sub r24, r25 11ab8: 8f 70 andi r24, 0x0F ; 15 && ( 11aba: 29 f4 brne .+10 ; 0x11ac6 moves_planned() != 0 || printJobOngoing() 11abc: 0e 94 c5 68 call 0xd18a ; 0xd18a 11ac0: 88 23 and r24, r24 11ac2: 09 f4 brne .+2 ; 0x11ac6 11ac4: 4f cf rjmp .-354 ; 0x11964 ) && !( saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 11ac6: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11aca: 81 11 cpse r24, r1 11acc: 3d c0 rjmp .+122 ; 0x11b48 saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 11ace: 80 91 98 13 lds r24, 0x1398 ; 0x801398 11ad2: 81 30 cpi r24, 0x01 ; 1 11ad4: 09 f4 brne .+2 ; 0x11ad8 11ad6: 46 cf rjmp .-372 ; 0x11964 || (lcd_commands_type == LcdCommands::Layer1Cal) 11ad8: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 11adc: 84 30 cpi r24, 0x04 ; 4 11ade: 09 f4 brne .+2 ; 0x11ae2 11ae0: 41 cf rjmp .-382 ; 0x11964 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 11ae2: 8f e5 ldi r24, 0x5F ; 95 11ae4: 9f e0 ldi r25, 0x0F ; 15 11ae6: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11aea: 81 11 cpse r24, r1 11aec: 3b cf rjmp .-394 ; 0x11964 } //! @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); 11aee: 88 ed ldi r24, 0xD8 ; 216 11af0: 97 e6 ldi r25, 0x67 ; 103 11af2: 9f 93 push r25 11af4: 8f 93 push r24 11af6: 8e eb ldi r24, 0xBE ; 190 11af8: 97 e6 ldi r25, 0x67 ; 103 11afa: 9f 93 push r25 11afc: 8f 93 push r24 11afe: 0f 94 1d dc call 0x3b83a ; 0x3b83a void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; 11b02: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a autoLoadEnabled = false; 11b06: 10 92 89 17 sts 0x1789, r1 ; 0x801789 stop_and_save_print_to_ram(0, 0); 11b0a: 20 e0 ldi r18, 0x00 ; 0 11b0c: 30 e0 ldi r19, 0x00 ; 0 11b0e: a9 01 movw r20, r18 11b10: ca 01 movw r24, r20 11b12: b9 01 movw r22, r18 11b14: 0e 94 e2 8a call 0x115c4 ; 0x115c4 restore_print_from_ram_and_continue(0); 11b18: 60 e0 ldi r22, 0x00 ; 0 11b1a: 70 e0 ldi r23, 0x00 ; 0 11b1c: cb 01 movw r24, r22 11b1e: 0e 94 79 69 call 0xd2f2 ; 0xd2f2 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 11b22: 85 e6 ldi r24, 0x65 ; 101 11b24: 9f e0 ldi r25, 0x0F ; 15 11b26: 0e 94 33 78 call 0xf066 ; 0xf066 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 11b2a: 81 e0 ldi r24, 0x01 ; 1 11b2c: 9f e0 ldi r25, 0x0F ; 15 11b2e: 0e 94 26 78 call 0xf04c ; 0xf04c enquecommand_front_P(MSG_M600); 11b32: 83 e2 ldi r24, 0x23 ; 35 11b34: 91 e7 ldi r25, 0x71 ; 113 11b36: 0f 94 e8 75 call 0x2ebd0 ; 0x2ebd0 11b3a: 0f 90 pop r0 11b3c: 0f 90 pop r0 11b3e: 0f 90 pop r0 11b40: 0f 90 pop r0 11b42: 10 cf rjmp .-480 ; 0x11964 postponedLoadEvent = true; } else { // filament removal // puts_P(PSTR("filament removed")); triggerFilamentRemoved(); } return true; 11b44: c1 e0 ldi r28, 0x01 ; 1 11b46: 0e cf rjmp .-484 ; 0x11964 11b48: c8 2f mov r28, r24 11b4a: 0c cf rjmp .-488 ; 0x11964 // detect min-max, some long term sliding window for filtration may be added // avoiding floating point operations, thus computing in raw if (volt > maxVolt) { maxVolt = volt; } else if (volt < minVolt) { 11b4c: 80 91 95 17 lds r24, 0x1795 ; 0x801795 11b50: 90 91 96 17 lds r25, 0x1796 ; 0x801796 11b54: 08 17 cp r16, r24 11b56: 19 07 cpc r17, r25 11b58: 08 f0 brcs .+2 ; 0x11b5c 11b5a: 25 cf rjmp .-438 ; 0x119a6 minVolt = volt; 11b5c: 10 93 96 17 sts 0x1796, r17 ; 0x801796 11b60: 00 93 95 17 sts 0x1795, r16 ; 0x801795 11b64: 20 cf rjmp .-448 ; 0x119a6 IR_ANALOG_Check(SensorRevision::_Old, SensorRevision::_Rev04); } //! If and only if minVolt is in range <0.0, 0.3> and maxVolt is in range <4.6, 5.0V>, I'm considering a situation with the old fsensor //! Note, we are not relying on one voltage here - getting just +5V can mean an old fsensor or a broken new sensor - that's why //! we need to have both voltages detected correctly to allow switching back to the old fsensor. else if (minVolt < IRsensor_Ldiode_TRESHOLD && maxVolt > IRsensor_Hopen_TRESHOLD && maxVolt <= IRsensor_VMax_TRESHOLD) { 11b66: 86 3d cpi r24, 0xD6 ; 214 11b68: 93 40 sbci r25, 0x03 ; 3 11b6a: 08 f0 brcs .+2 ; 0x11b6e 11b6c: 34 cf rjmp .-408 ; 0x119d6 11b6e: 80 91 97 17 lds r24, 0x1797 ; 0x801797 11b72: 90 91 98 17 lds r25, 0x1798 ; 0x801798 11b76: 84 5d subi r24, 0xD4 ; 212 11b78: 9a 43 sbci r25, 0x3A ; 58 11b7a: 8d 31 cpi r24, 0x1D ; 29 11b7c: 95 40 sbci r25, 0x05 ; 5 11b7e: 08 f0 brcs .+2 ; 0x11b82 11b80: 2a cf rjmp .-428 ; 0x119d6 IR_ANALOG_Check(SensorRevision::_Rev04, SensorRevision::_Old); 11b82: 60 e0 ldi r22, 0x00 ; 0 11b84: 81 e0 ldi r24, 0x01 ; 1 11b86: 25 cf rjmp .-438 ; 0x119d2 if (voltageErrorCnt++ > 4) { puts_P(PSTR("fsensor in forbidden range 1.5-3V - check sensor")); return false; } } else { voltageErrorCnt = 0; 11b88: 10 92 9b 17 sts 0x179B, r1 ; 0x80179b } if (sensorRevision == SensorRevision::_Rev04) { 11b8c: 80 91 91 17 lds r24, 0x1791 ; 0x801791 11b90: 81 30 cpi r24, 0x01 ; 1 11b92: 09 f0 breq .+2 ; 0x11b96 11b94: 37 cf rjmp .-402 ; 0x11a04 /// newer IR sensor cannot normally produce 4.6-5V, this is considered a failure/bad mount if (IRsensor_Hopen_TRESHOLD <= raw && raw <= IRsensor_VMax_TRESHOLD) { 11b96: 03 5d subi r16, 0xD3 ; 211 11b98: 1a 43 sbci r17, 0x3A ; 58 11b9a: 0e 31 cpi r16, 0x1E ; 30 11b9c: 15 40 sbci r17, 0x05 ; 5 11b9e: 08 f0 brcs .+2 ; 0x11ba2 11ba0: 31 cf rjmp .-414 ; 0x11a04 puts_P(PSTR("fsensor v0.4 in fault range 4.6-5V - unconnected")); 11ba2: 8c ec ldi r24, 0xCC ; 204 11ba4: 9e e7 ldi r25, 0x7E ; 126 11ba6: 29 cf rjmp .-430 ; 0x119fa inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} 11ba8: 10 92 db 05 sts 0x05DB, r1 ; 0x8005db #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)){ 11bac: 80 91 81 10 lds r24, 0x1081 ; 0x801081 11bb0: 90 91 82 10 lds r25, 0x1082 ; 0x801082 11bb4: 03 97 sbiw r24, 0x03 ; 3 11bb6: 14 f4 brge .+4 ; 0x11bbc get_command(); 11bb8: 0e 94 cb 84 call 0x10996 ; 0x10996 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); 11bbc: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 11bc0: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) 11bc4: 98 17 cp r25, r24 11bc6: 81 f0 breq .+32 ; 0x11be8 11bc8: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 <_ZL13printer_state.lto_priv.395> 11bcc: 86 30 cpi r24, 0x06 ; 6 11bce: 61 f4 brne .+24 ; 0x11be8 11bd0: 68 e8 ldi r22, 0x88 ; 136 11bd2: 73 e1 ldi r23, 0x13 ; 19 11bd4: 81 e1 ldi r24, 0x11 ; 17 11bd6: 95 e0 ldi r25, 0x05 ; 5 11bd8: 0f 94 b8 3e call 0x27d70 ; 0x27d70 ::expired(unsigned short)> 11bdc: 88 23 and r24, r24 11bde: 21 f0 breq .+8 ; 0x11be8 { // 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(); 11be0: 81 e1 ldi r24, 0x11 ; 17 11be2: 95 e0 ldi r25, 0x05 ; 5 11be4: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) 11be8: 40 91 80 03 lds r20, 0x0380 ; 0x800380 11bec: 50 91 81 03 lds r21, 0x0381 ; 0x800381 11bf0: 60 91 82 03 lds r22, 0x0382 ; 0x800382 11bf4: 70 91 83 03 lds r23, 0x0383 ; 0x800383 11bf8: 41 15 cp r20, r1 11bfa: 51 05 cpc r21, r1 11bfc: 61 05 cpc r22, r1 11bfe: 71 05 cpc r23, r1 11c00: 09 f0 breq .+2 ; 0x11c04 11c02: 3f c0 rjmp .+126 ; 0x11c82 kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { 11c04: 40 91 34 02 lds r20, 0x0234 ; 0x800234 11c08: 50 91 35 02 lds r21, 0x0235 ; 0x800235 11c0c: 60 91 36 02 lds r22, 0x0236 ; 0x800236 11c10: 70 91 37 02 lds r23, 0x0237 ; 0x800237 11c14: 41 15 cp r20, r1 11c16: 51 05 cpc r21, r1 11c18: 61 05 cpc r22, r1 11c1a: 71 05 cpc r23, r1 11c1c: a9 f0 breq .+42 ; 0x11c48 11c1e: 88 e8 ldi r24, 0x88 ; 136 11c20: 93 e0 ldi r25, 0x03 ; 3 11c22: 0f 94 6a 3f call 0x27ed4 ; 0x27ed4 ::expired(unsigned long)> 11c26: 88 23 and r24, r24 11c28: 79 f0 breq .+30 ; 0x11c48 11c2a: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 11c2e: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 if(blocks_queued() == false && ignore_stepper_queue == false) { 11c32: 98 13 cpse r25, r24 11c34: 09 c0 rjmp .+18 ; 0x11c48 11c36: d1 11 cpse r29, r1 11c38: 07 c0 rjmp .+14 ; 0x11c48 disable_x(); 11c3a: 17 9a sbi 0x02, 7 ; 2 11c3c: 10 92 40 07 sts 0x0740, r1 ; 0x800740 disable_y(); 11c40: 16 9a sbi 0x02, 6 ; 2 11c42: 10 92 41 07 sts 0x0741, r1 ; 0x800741 disable_z(); disable_e0(); 11c46: 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; 11c48: c0 91 e3 03 lds r28, 0x03E3 ; 0x8003e3 block_t *block; if(block_buffer_tail != block_buffer_head) 11c4c: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 11c50: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 11c54: 98 17 cp r25, r24 11c56: 01 f1 breq .+64 ; 0x11c98 { uint8_t block_index = block_buffer_tail; 11c58: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 tail_fan_speed = block_buffer[block_index].fan_speed; 11c5c: 9e e6 ldi r25, 0x6E ; 110 11c5e: 89 9f mul r24, r25 11c60: f0 01 movw r30, r0 11c62: 11 24 eor r1, r1 11c64: e4 54 subi r30, 0x44 ; 68 11c66: f8 4f sbci r31, 0xF8 ; 248 11c68: c0 81 ld r28, Z while(block_index != block_buffer_head) 11c6a: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 11c6e: 98 17 cp r25, r24 11c70: 99 f0 breq .+38 ; 0x11c98 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); 11c72: 8f 5f subi r24, 0xFF ; 255 11c74: 8f 70 andi r24, 0x0F ; 15 11c76: f9 cf rjmp .-14 ; 0x11c6a { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); 11c78: 8b ed ldi r24, 0xDB ; 219 11c7a: 95 e0 ldi r25, 0x05 ; 5 11c7c: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> 11c80: 95 cf rjmp .-214 ; 0x11bac // 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)) 11c82: 88 e8 ldi r24, 0x88 ; 136 11c84: 93 e0 ldi r25, 0x03 ; 3 11c86: 0f 94 6a 3f call 0x27ed4 ; 0x27ed4 ::expired(unsigned long)> 11c8a: 88 23 and r24, r24 11c8c: 09 f4 brne .+2 ; 0x11c90 11c8e: ba cf rjmp .-140 ; 0x11c04 kill(PSTR("Inactivity Shutdown")); 11c90: 8e e2 ldi r24, 0x2E ; 46 11c92: 9f e7 ldi r25, 0x7F ; 127 11c94: 0e 94 15 7c call 0xf82a ; 0xf82a 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) { 11c98: cc 23 and r28, r28 11c9a: 09 f4 brne .+2 ; 0x11c9e 11c9c: 9f c0 rjmp .+318 ; 0x11ddc if (fan_kick_end == 0) { 11c9e: 80 91 6e 03 lds r24, 0x036E ; 0x80036e 11ca2: 90 91 6f 03 lds r25, 0x036F ; 0x80036f 11ca6: a0 91 70 03 lds r26, 0x0370 ; 0x800370 11caa: b0 91 71 03 lds r27, 0x0371 ; 0x800371 11cae: 89 2b or r24, r25 11cb0: 8a 2b or r24, r26 11cb2: 8b 2b or r24, r27 11cb4: 81 f4 brne .+32 ; 0x11cd6 // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; 11cb6: 0f 94 86 3e call 0x27d0c ; 0x27d0c 11cba: 60 5e subi r22, 0xE0 ; 224 11cbc: 7c 4f sbci r23, 0xFC ; 252 11cbe: 8f 4f sbci r24, 0xFF ; 255 11cc0: 9f 4f sbci r25, 0xFF ; 255 11cc2: 60 93 6e 03 sts 0x036E, r22 ; 0x80036e 11cc6: 70 93 6f 03 sts 0x036F, r23 ; 0x80036f 11cca: 80 93 70 03 sts 0x0370, r24 ; 0x800370 11cce: 90 93 71 03 sts 0x0371, r25 ; 0x800371 tail_fan_speed = 255; } else if (fan_kick_end > _millis()) // Fan still spinning up. tail_fan_speed = 255; 11cd2: cf ef ldi r28, 0xFF ; 255 11cd4: 0f c0 rjmp .+30 ; 0x11cf4 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()) 11cd6: 0f 94 86 3e call 0x27d0c ; 0x27d0c 11cda: 00 91 6e 03 lds r16, 0x036E ; 0x80036e 11cde: 10 91 6f 03 lds r17, 0x036F ; 0x80036f 11ce2: 20 91 70 03 lds r18, 0x0370 ; 0x800370 11ce6: 30 91 71 03 lds r19, 0x0371 ; 0x800371 11cea: 60 17 cp r22, r16 11cec: 71 07 cpc r23, r17 11cee: 82 07 cpc r24, r18 11cf0: 93 07 cpc r25, r19 11cf2: 78 f3 brcs .-34 ; 0x11cd2 } 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 11cf4: 80 91 36 05 lds r24, 0x0536 ; 0x800536 11cf8: 88 23 and r24, r24 11cfa: 09 f4 brne .+2 ; 0x11cfe 11cfc: 78 c0 rjmp .+240 ; 0x11dee fanSpeedBckp = tail_fan_speed; 11cfe: 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) { 11d02: 80 91 0f 05 lds r24, 0x050F ; 0x80050f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.559> 11d06: 81 11 cpse r24, r1 11d08: 07 c0 rjmp .+14 ; 0x11d18 return; } avoidRecursion = true; 11d0a: 81 e0 ldi r24, 0x01 ; 1 11d0c: 80 93 0f 05 sts 0x050F, r24 ; 0x80050f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.559> mmu_loop_inner(true); 11d10: 0f 94 f8 99 call 0x333f0 ; 0x333f0 avoidRecursion = false; 11d14: 10 92 0f 05 sts 0x050F, r1 ; 0x80050f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.559> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { 11d18: 80 91 d4 05 lds r24, 0x05D4 ; 0x8005d4 <_ZL26lcd_backlight_wake_trigger.lto_priv.557> 11d1c: 88 23 and r24, r24 11d1e: e1 f1 breq .+120 ; 0x11d98 lcd_backlight_wake_trigger = false; 11d20: 10 92 d4 05 sts 0x05D4, r1 ; 0x8005d4 <_ZL26lcd_backlight_wake_trigger.lto_priv.557> backlight_wake(); 11d24: 80 e0 ldi r24, 0x00 ; 0 11d26: 0e 94 18 8c call 0x11830 ; 0x11830 bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 11d2a: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11d2c: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 11d2e: 80 91 d2 05 lds r24, 0x05D2 ; 0x8005d2 <_ZL16lcd_encoder_diff.lto_priv.558> 11d32: 28 2f mov r18, r24 11d34: 08 2e mov r0, r24 11d36: 00 0c add r0, r0 11d38: 33 0b sbc r19, r19 11d3a: 37 ff sbrs r19, 7 11d3c: 03 c0 rjmp .+6 ; 0x11d44 11d3e: 31 95 neg r19 11d40: 21 95 neg r18 11d42: 31 09 sbc r19, r1 11d44: 24 30 cpi r18, 0x04 ; 4 11d46: 31 05 cpc r19, r1 11d48: 0c f4 brge .+2 ; 0x11d4c 11d4a: 54 c0 rjmp .+168 ; 0x11df4 lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; 11d4c: 98 2f mov r25, r24 11d4e: 87 ff sbrs r24, 7 11d50: 02 c0 rjmp .+4 ; 0x11d56 11d52: 93 e0 ldi r25, 0x03 ; 3 11d54: 98 0f add r25, r24 11d56: 95 95 asr r25 11d58: 95 95 asr r25 11d5a: 20 91 37 05 lds r18, 0x0537 ; 0x800537 11d5e: 30 91 38 05 lds r19, 0x0538 ; 0x800538 11d62: 29 0f add r18, r25 11d64: 31 1d adc r19, r1 11d66: 97 fd sbrc r25, 7 11d68: 3a 95 dec r19 11d6a: 30 93 38 05 sts 0x0538, r19 ; 0x800538 11d6e: 20 93 37 05 sts 0x0537, r18 ; 0x800537 lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; 11d72: 83 78 andi r24, 0x83 ; 131 11d74: 87 ff sbrs r24, 7 11d76: 03 c0 rjmp .+6 ; 0x11d7e 11d78: 81 50 subi r24, 0x01 ; 1 11d7a: 8c 6f ori r24, 0xFC ; 252 11d7c: 8f 5f subi r24, 0xFF ; 255 11d7e: 80 93 d2 05 sts 0x05D2, r24 ; 0x8005d2 <_ZL16lcd_encoder_diff.lto_priv.558> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11d82: 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); 11d84: 86 e0 ldi r24, 0x06 ; 6 11d86: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 if (lcd_draw_update == 0) { 11d8a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 11d8e: 81 11 cpse r24, r1 11d90: 03 c0 rjmp .+6 ; 0x11d98 // Update LCD rendering at minimum lcd_draw_update = 1; 11d92: 81 e0 ldi r24, 0x01 ; 1 11d94: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d #endif check_axes_activity(); MMU2::mmu2.mmu_loop(); lcd_knob_update(); backlight_update(); 11d98: 0e 94 b1 8b call 0x11762 ; 0x11762 // handle longpress if(lcd_longpress_trigger) 11d9c: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 11da0: 88 23 and r24, r24 11da2: 61 f0 breq .+24 ; 0x11dbc { lcd_consume_click(); // Reset trigger to prevent recursion 11da4: 0e 94 2d 72 call 0xe45a ; 0xe45a // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) 11da8: e0 91 11 04 lds r30, 0x0411 ; 0x800411 11dac: f0 91 12 04 lds r31, 0x0412 ; 0x800412 11db0: 30 97 sbiw r30, 0x00 ; 0 11db2: 21 f0 breq .+8 ; 0x11dbc 11db4: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 11db8: 81 11 cpse r24, r1 { lcd_longpress_func(); 11dba: 19 95 eicall } } #if defined(AUTO_REPORT) host_autoreport(); 11dbc: 0e 94 63 7b call 0xf6c6 ; 0xf6c6 #endif //AUTO_REPORT host_keepalive(); 11dc0: 0e 94 b2 81 call 0x10364 ; 0x10364 bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); 11dc4: 40 e3 ldi r20, 0x30 ; 48 11dc6: 55 e7 ldi r21, 0x75 ; 117 11dc8: 60 e0 ldi r22, 0x00 ; 0 11dca: 70 e0 ldi r23, 0x00 ; 0 11dcc: 8e e9 ldi r24, 0x9E ; 158 11dce: 93 e0 ldi r25, 0x03 ; 3 M79_timer_update_status(); } 11dd0: df 91 pop r29 11dd2: cf 91 pop r28 11dd4: 1f 91 pop r17 11dd6: 0f 91 pop r16 11dd8: 0d 94 6a 3f jmp 0x27ed4 ; 0x27ed4 ::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; 11ddc: 10 92 6e 03 sts 0x036E, r1 ; 0x80036e 11de0: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f 11de4: 10 92 70 03 sts 0x0370, r1 ; 0x800370 11de8: 10 92 71 03 sts 0x0371, r1 ; 0x800371 11dec: 83 cf rjmp .-250 ; 0x11cf4 #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; 11dee: c0 93 a0 04 sts 0x04A0, r28 ; 0x8004a0 11df2: 87 cf rjmp .-242 ; 0x11d02 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; 11df4: 10 92 d2 05 sts 0x05D2, r1 ; 0x8005d2 <_ZL16lcd_encoder_diff.lto_priv.558> 11df8: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); 11dfa: 80 e0 ldi r24, 0x00 ; 0 11dfc: c4 cf rjmp .-120 ; 0x11d86 00011dfe : #endif #endif } void delay_keep_alive(unsigned int ms) { 11dfe: cf 93 push r28 11e00: df 93 push r29 11e02: ec 01 movw r28, r24 for (;;) { manage_heater(); 11e04: 0f 94 9b 4d call 0x29b36 ; 0x29b36 // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); 11e08: 81 e0 ldi r24, 0x01 ; 1 11e0a: 0e 94 5a 8c call 0x118b4 ; 0x118b4 lcd_update(0); 11e0e: 80 e0 ldi r24, 0x00 ; 0 11e10: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 if (ms == 0) 11e14: 20 97 sbiw r28, 0x00 ; 0 11e16: 99 f0 breq .+38 ; 0x11e3e break; else if (ms >= 50) { 11e18: c2 33 cpi r28, 0x32 ; 50 11e1a: d1 05 cpc r29, r1 11e1c: 40 f0 brcs .+16 ; 0x11e2e _delay(50); 11e1e: 62 e3 ldi r22, 0x32 ; 50 11e20: 70 e0 ldi r23, 0x00 ; 0 11e22: 80 e0 ldi r24, 0x00 ; 0 11e24: 90 e0 ldi r25, 0x00 ; 0 11e26: 0f 94 8d 3c call 0x2791a ; 0x2791a ms -= 50; 11e2a: e2 97 sbiw r28, 0x32 ; 50 11e2c: eb cf rjmp .-42 ; 0x11e04 } else { _delay(ms); 11e2e: be 01 movw r22, r28 11e30: 90 e0 ldi r25, 0x00 ; 0 11e32: 80 e0 ldi r24, 0x00 ; 0 11e34: 0f 94 8d 3c call 0x2791a ; 0x2791a ms = 0; 11e38: d0 e0 ldi r29, 0x00 ; 0 11e3a: c0 e0 ldi r28, 0x00 ; 0 11e3c: e3 cf rjmp .-58 ; 0x11e04 } } } 11e3e: df 91 pop r29 11e40: cf 91 pop r28 11e42: 08 95 ret 00011e44 : /// @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) { 11e44: cf 93 push r28 11e46: df 93 push r29 11e48: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11e4a: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); 11e4c: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(true); 11e50: 81 e0 ldi r24, 0x01 ; 1 11e52: 0e 94 5a 8c call 0x118b4 ; 0x118b4 11e56: 80 91 96 13 lds r24, 0x1396 ; 0x801396 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) 11e5a: 8f 3f cpi r24, 0xFF ; 255 11e5c: d9 f4 brne .+54 ; 0x11e94 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 11e5e: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 11e62: 84 30 cpi r24, 0x04 ; 4 11e64: 21 f4 brne .+8 ; 0x11e6e }; 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 11e66: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 11e6a: 81 11 cpse r24, r1 11e6c: ef cf rjmp .-34 ; 0x11e4c 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 11e6e: 80 91 69 13 lds r24, 0x1369 ; 0x801369 11e72: 90 91 6a 13 lds r25, 0x136A ; 0x80136a 11e76: 01 97 sbiw r24, 0x01 ; 1 11e78: 49 f7 brne .-46 ; 0x11e4c && lastErrorCode != ec) // The error code is not a duplicate 11e7a: 80 91 90 13 lds r24, 0x1390 ; 0x801390 11e7e: 90 91 91 13 lds r25, 0x1391 ; 0x801391 11e82: 89 32 cpi r24, 0x29 ; 41 11e84: 90 48 sbci r25, 0x80 ; 128 11e86: 11 f3 breq .-60 ; 0x11e4c { ReportError(ec, ErrorSource::ErrorSourcePrinter); 11e88: 60 e0 ldi r22, 0x00 ; 0 11e8a: 89 e2 ldi r24, 0x29 ; 41 11e8c: 90 e8 ldi r25, 0x80 ; 128 11e8e: 0f 94 6b 82 call 0x304d6 ; 0x304d6 11e92: dc cf rjmp .-72 ; 0x11e4c inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11e94: d0 93 96 13 sts 0x1396, r29 ; 0x801396 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { 11e98: 85 30 cpi r24, 0x05 ; 5 11e9a: 39 f4 brne .+14 ; 0x11eaa if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { 11e9c: cf 3f cpi r28, 0xFF ; 255 11e9e: f9 f2 breq .-66 ; 0x11e5e MMU2::mmu2.eject_filament(eject_slot, true); 11ea0: 61 e0 ldi r22, 0x01 ; 1 11ea2: 8c 2f mov r24, r28 11ea4: 0f 94 92 a0 call 0x34124 ; 0x34124 11ea8: d1 cf rjmp .-94 ; 0x11e4c // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) 11eaa: 84 30 cpi r24, 0x04 ; 4 11eac: c1 f6 brne .-80 ; 0x11e5e } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } 11eae: df 91 pop r29 11eb0: cf 91 pop r28 11eb2: 08 95 ret 00011eb4 <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { 11eb4: 1f 92 push r1 11eb6: 0f 92 push r0 11eb8: 0f b6 in r0, 0x3f ; 63 11eba: 0f 92 push r0 11ebc: 11 24 eor r1, r1 11ebe: 0b b6 in r0, 0x3b ; 59 11ec0: 0f 92 push r0 11ec2: 2f 93 push r18 11ec4: 3f 93 push r19 11ec6: 4f 93 push r20 11ec8: 5f 93 push r21 11eca: 6f 93 push r22 11ecc: 7f 93 push r23 11ece: 8f 93 push r24 11ed0: 9f 93 push r25 11ed2: af 93 push r26 11ed4: bf 93 push r27 11ed6: ef 93 push r30 11ed8: ff 93 push r31 adc_values[adc_channel] += ADC; 11eda: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> 11ede: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> 11ee2: e0 91 38 03 lds r30, 0x0338 ; 0x800338 11ee6: f0 e0 ldi r31, 0x00 ; 0 11ee8: ee 0f add r30, r30 11eea: ff 1f adc r31, r31 11eec: e8 5d subi r30, 0xD8 ; 216 11eee: fc 4f sbci r31, 0xFC ; 252 11ef0: 80 81 ld r24, Z 11ef2: 91 81 ldd r25, Z+1 ; 0x01 11ef4: 82 0f add r24, r18 11ef6: 93 1f adc r25, r19 11ef8: 91 83 std Z+1, r25 ; 0x01 11efa: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) 11efc: 80 91 27 03 lds r24, 0x0327 ; 0x800327 11f00: 8f 5f subi r24, 0xFF ; 255 11f02: 80 93 27 03 sts 0x0327, r24 ; 0x800327 11f06: 80 31 cpi r24, 0x10 ; 16 11f08: 09 f0 breq .+2 ; 0x11f0c <__vector_29+0x58> 11f0a: 60 c0 rjmp .+192 ; 0x11fcc <__vector_29+0x118> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { 11f0c: 80 91 38 03 lds r24, 0x0338 ; 0x800338 11f10: 8f 5f subi r24, 0xFF ; 255 11f12: 80 93 38 03 sts 0x0338, r24 ; 0x800338 11f16: 88 30 cpi r24, 0x08 ; 8 11f18: 09 f0 breq .+2 ; 0x11f1c <__vector_29+0x68> 11f1a: 50 c0 rjmp .+160 ; 0x11fbc <__vector_29+0x108> #endif // ISR callback from adc when sampling finished void adc_callback() { current_temperature_raw[0] = adc_values[ADC_PIN_IDX(TEMP_0_PIN)]; //heater 11f1c: 80 91 28 03 lds r24, 0x0328 ; 0x800328 11f20: 90 91 29 03 lds r25, 0x0329 ; 0x800329 11f24: 90 93 09 06 sts 0x0609, r25 ; 0x800609 11f28: 80 93 08 06 sts 0x0608, r24 ; 0x800608 current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; 11f2c: 80 91 2c 03 lds r24, 0x032C ; 0x80032c 11f30: 90 91 2d 03 lds r25, 0x032D ; 0x80032d 11f34: 90 93 07 06 sts 0x0607, r25 ; 0x800607 11f38: 80 93 06 06 sts 0x0606, r24 ; 0x800606 #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; 11f3c: 80 91 2e 03 lds r24, 0x032E ; 0x80032e 11f40: 90 91 2f 03 lds r25, 0x032F ; 0x80032f 11f44: 90 93 05 06 sts 0x0605, r25 ; 0x800605 11f48: 80 93 04 06 sts 0x0604, r24 ; 0x800604 #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR current_temperature_raw_ambient = adc_values[ADC_PIN_IDX(TEMP_AMBIENT_PIN)]; // 5->6 11f4c: 80 91 32 03 lds r24, 0x0332 ; 0x800332 11f50: 90 91 33 03 lds r25, 0x0333 ; 0x800333 11f54: 90 93 13 06 sts 0x0613, r25 ; 0x800613 11f58: 80 93 12 06 sts 0x0612, r24 ; 0x800612 #endif //AMBIENT_THERMISTOR #ifdef VOLT_PWR_PIN current_voltage_raw_pwr = adc_values[ADC_PIN_IDX(VOLT_PWR_PIN)]; 11f5c: 80 91 30 03 lds r24, 0x0330 ; 0x800330 11f60: 90 91 31 03 lds r25, 0x0331 ; 0x800331 11f64: 90 93 5a 06 sts 0x065A, r25 ; 0x80065a 11f68: 80 93 59 06 sts 0x0659, r24 ; 0x800659 #endif #ifdef VOLT_BED_PIN current_voltage_raw_bed = adc_values[ADC_PIN_IDX(VOLT_BED_PIN)]; // 6->9 11f6c: 80 91 36 03 lds r24, 0x0336 ; 0x800336 11f70: 90 91 37 03 lds r25, 0x0337 ; 0x800337 11f74: 90 93 58 06 sts 0x0658, r25 ; 0x800658 11f78: 80 93 57 06 sts 0x0657, r24 ; 0x800657 #endif #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) fsensor.voltUpdate(adc_values[ADC_PIN_IDX(VOLT_IR_PIN)]); 11f7c: 80 91 34 03 lds r24, 0x0334 ; 0x800334 11f80: 90 91 35 03 lds r25, 0x0335 ; 0x800335 return event; } void IR_sensor_analog::voltUpdate(uint16_t raw) { // to be called from the ADC ISR when a cycle is finished voltRaw = raw; 11f84: 90 93 94 17 sts 0x1794, r25 ; 0x801794 11f88: 80 93 93 17 sts 0x1793, r24 ; 0x801793 voltReady = true; 11f8c: 81 e0 ldi r24, 0x01 ; 1 11f8e: 80 93 92 17 sts 0x1792, r24 ; 0x801792 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) adc_values_ready = true; 11f92: 80 93 1f 05 sts 0x051F, r24 ; 0x80051f <_ZL16adc_values_ready.lto_priv.470> break; } } } ADCSRA |= (1 << ADSC); //start conversion } 11f96: ff 91 pop r31 11f98: ef 91 pop r30 11f9a: bf 91 pop r27 11f9c: af 91 pop r26 11f9e: 9f 91 pop r25 11fa0: 8f 91 pop r24 11fa2: 7f 91 pop r23 11fa4: 6f 91 pop r22 11fa6: 5f 91 pop r21 11fa8: 4f 91 pop r20 11faa: 3f 91 pop r19 11fac: 2f 91 pop r18 11fae: 0f 90 pop r0 11fb0: 0b be out 0x3b, r0 ; 59 11fb2: 0f 90 pop r0 11fb4: 0f be out 0x3f, r0 ; 63 11fb6: 0f 90 pop r0 11fb8: 1f 90 pop r1 11fba: 18 95 reti 11fbc: 80 91 26 03 lds r24, 0x0326 ; 0x800326 <__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)) { 11fc0: 4f e5 ldi r20, 0x5F ; 95 11fc2: 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) { 11fc4: 8f 5f subi r24, 0xFF ; 255 11fc6: 41 f4 brne .+16 ; 0x11fd8 <__vector_29+0x124> 11fc8: 10 92 26 03 sts 0x0326, r1 ; 0x800326 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion 11fcc: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11fd0: 80 64 ori r24, 0x40 ; 64 11fd2: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11fd6: df cf rjmp .-66 ; 0x11f96 <__vector_29+0xe2> 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)) { 11fd8: 9a 01 movw r18, r20 11fda: 08 2e mov r0, r24 11fdc: 02 c0 rjmp .+4 ; 0x11fe2 <__vector_29+0x12e> 11fde: 35 95 asr r19 11fe0: 27 95 ror r18 11fe2: 0a 94 dec r0 11fe4: e2 f7 brpl .-8 ; 0x11fde <__vector_29+0x12a> 11fe6: 20 ff sbrs r18, 0 11fe8: ed cf rjmp .-38 ; 0x11fc4 <__vector_29+0x110> 11fea: 80 93 26 03 sts 0x0326, r24 ; 0x800326 <__data_end> adc_setmux(adc_channel_idx); 11fee: 0e 94 79 5c call 0xb8f2 ; 0xb8f2 adc_count = 0; 11ff2: 10 92 27 03 sts 0x0327, r1 ; 0x800327 11ff6: ea cf rjmp .-44 ; 0x11fcc <__vector_29+0x118> 00011ff8 : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { 11ff8: cf 93 push r28 11ffa: 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 11ffc: ca e7 ldi r28, 0x7A ; 122 11ffe: d0 e0 ldi r29, 0x00 ; 0 12000: 88 81 ld r24, Y 12002: 8f 7b andi r24, 0xBF ; 191 12004: 88 83 st Y, r24 adc_count = 0; 12006: 10 92 27 03 sts 0x0327, r1 ; 0x800327 adc_channel = 0; 1200a: 10 92 38 03 sts 0x0338, r1 ; 0x800338 adc_channel_idx = first_channel_idx; 1200e: 10 92 26 03 sts 0x0326, r1 ; 0x800326 <__data_end> adc_setmux(adc_channel_idx); 12012: 80 e0 ldi r24, 0x00 ; 0 12014: 0e 94 79 5c call 0xb8f2 ; 0xb8f2 memset((void*)adc_values, 0, sizeof(adc_values)); 12018: e8 e2 ldi r30, 0x28 ; 40 1201a: f3 e0 ldi r31, 0x03 ; 3 1201c: 80 e1 ldi r24, 0x10 ; 16 1201e: df 01 movw r26, r30 12020: 1d 92 st X+, r1 12022: 8a 95 dec r24 12024: e9 f7 brne .-6 ; 0x12020 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion 12026: 88 81 ld r24, Y 12028: 80 64 ori r24, 0x40 ; 64 1202a: 88 83 st Y, r24 } 1202c: df 91 pop r29 1202e: cf 91 pop r28 12030: 08 95 ret 00012032 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { 12032: 2f 92 push r2 12034: 3f 92 push r3 12036: 4f 92 push r4 12038: 5f 92 push r5 1203a: 6f 92 push r6 1203c: 7f 92 push r7 1203e: 8f 92 push r8 12040: 9f 92 push r9 12042: af 92 push r10 12044: bf 92 push r11 12046: cf 92 push r12 12048: df 92 push r13 1204a: ef 92 push r14 1204c: ff 92 push r15 1204e: 0f 93 push r16 12050: 1f 93 push r17 12052: cf 93 push r28 12054: df 93 push r29 12056: cd b7 in r28, 0x3d ; 61 12058: de b7 in r29, 0x3e ; 62 1205a: a4 97 sbiw r28, 0x24 ; 36 1205c: 0f b6 in r0, 0x3f ; 63 1205e: f8 94 cli 12060: de bf out 0x3e, r29 ; 62 12062: 0f be out 0x3f, r0 ; 63 12064: 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(); 12066: 0f 94 27 58 call 0x2b04e ; 0x2b04e if (planner_aborted) 1206a: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 1206e: 81 11 cpse r24, r1 12070: 17 c0 rjmp .+46 ; 0x120a0 return; mesh_bed_leveling_flag = true; 12072: 81 e0 ldi r24, 0x01 ; 1 12074: 80 93 59 0e sts 0x0E59, r24 ; 0x800e59 // Firstly check if we know where we are if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) { 12078: 80 91 40 07 lds r24, 0x0740 ; 0x800740 1207c: 88 23 and r24, r24 1207e: 49 f0 breq .+18 ; 0x12092 12080: 80 91 41 07 lds r24, 0x0741 ; 0x800741 12084: 88 23 and r24, r24 12086: 29 f0 breq .+10 ; 0x12092 12088: 20 91 42 07 lds r18, 0x0742 ; 0x800742 1208c: 2f 83 std Y+7, r18 ; 0x07 1208e: 21 11 cpse r18, r1 12090: 20 c0 rjmp .+64 ; 0x120d2 12092: 81 e0 ldi r24, 0x01 ; 1 12094: 80 93 80 10 sts 0x1080, r24 ; 0x801080 // 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); 12098: 85 ec ldi r24, 0xC5 ; 197 1209a: 9c e6 ldi r25, 0x6C ; 108 1209c: 0f 94 e8 75 call 0x2ebd0 ; 0x2ebd0 custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } 120a0: a4 96 adiw r28, 0x24 ; 36 120a2: 0f b6 in r0, 0x3f ; 63 120a4: f8 94 cli 120a6: de bf out 0x3e, r29 ; 62 120a8: 0f be out 0x3f, r0 ; 63 120aa: cd bf out 0x3d, r28 ; 61 120ac: df 91 pop r29 120ae: cf 91 pop r28 120b0: 1f 91 pop r17 120b2: 0f 91 pop r16 120b4: ff 90 pop r15 120b6: ef 90 pop r14 120b8: df 90 pop r13 120ba: cf 90 pop r12 120bc: bf 90 pop r11 120be: af 90 pop r10 120c0: 9f 90 pop r9 120c2: 8f 90 pop r8 120c4: 7f 90 pop r7 120c6: 6f 90 pop r6 120c8: 5f 90 pop r5 120ca: 4f 90 pop r4 120cc: 3f 90 pop r3 120ce: 2f 90 pop r2 120d0: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 120d2: 8b ea ldi r24, 0xAB ; 171 120d4: 9d e0 ldi r25, 0x0D ; 13 120d6: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 120da: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) 120dc: 8e e4 ldi r24, 0x4E ; 78 120de: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 120e2: 08 2f mov r16, r24 120e4: 0e 94 8e 5c call 0xb91c ; 0xb91c 120e8: 8e 83 std Y+6, r24 ; 0x06 120ea: 00 23 and r16, r16 120ec: 29 f0 breq .+10 ; 0x120f8 120ee: 87 30 cpi r24, 0x07 ; 7 120f0: 09 f4 brne .+2 ; 0x120f4 120f2: c9 c0 rjmp .+402 ; 0x12286 120f4: 83 30 cpi r24, 0x03 ; 3 120f6: 29 f0 breq .+10 ; 0x12102 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; 120f8: 13 30 cpi r17, 0x03 ; 3 120fa: 09 f0 breq .+2 ; 0x120fe 120fc: c3 c0 rjmp .+390 ; 0x12284 120fe: 63 e0 ldi r22, 0x03 ; 3 12100: 6e 83 std Y+6, r22 ; 0x06 12102: 80 e0 ldi r24, 0x00 ; 0 12104: 90 e0 ldi r25, 0x00 ; 0 12106: a0 e8 ldi r26, 0x80 ; 128 12108: bf e3 ldi r27, 0x3F ; 63 1210a: 8a 83 std Y+2, r24 ; 0x02 1210c: 9b 83 std Y+3, r25 ; 0x03 1210e: ac 83 std Y+4, r26 ; 0x04 12110: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 12112: 8a ea ldi r24, 0xAA ; 170 12114: 9d e0 ldi r25, 0x0D ; 13 12116: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1211a: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) 1211c: 83 e4 ldi r24, 0x43 ; 67 1211e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 12122: 18 2f mov r17, r24 12124: 0e 94 8e 5c call 0xb91c ; 0xb91c 12128: 11 23 and r17, r17 1212a: 29 f0 breq .+10 ; 0x12136 1212c: 88 23 and r24, r24 1212e: 19 f0 breq .+6 ; 0x12136 12130: 8b 30 cpi r24, 0x0B ; 11 12132: 08 f4 brcc .+2 ; 0x12136 12134: 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; 12136: 88 e5 ldi r24, 0x58 ; 88 12138: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1213c: 88 23 and r24, r24 1213e: 09 f4 brne .+2 ; 0x12142 12140: ab c0 rjmp .+342 ; 0x12298 12142: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 12146: 20 e0 ldi r18, 0x00 ; 0 12148: 30 e0 ldi r19, 0x00 ; 0 1214a: 48 e0 ldi r20, 0x08 ; 8 1214c: 52 e4 ldi r21, 0x42 ; 66 1214e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 12152: 20 e0 ldi r18, 0x00 ; 0 12154: 30 e0 ldi r19, 0x00 ; 0 12156: 48 eb ldi r20, 0xB8 ; 184 12158: 51 e4 ldi r21, 0x41 ; 65 1215a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1215e: 6a 87 std Y+10, r22 ; 0x0a 12160: 7b 87 std Y+11, r23 ; 0x0b 12162: 8c 87 std Y+12, r24 ; 0x0c 12164: 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; 12166: 89 e5 ldi r24, 0x59 ; 89 12168: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1216c: 88 23 and r24, r24 1216e: 09 f4 brne .+2 ; 0x12172 12170: 9c c0 rjmp .+312 ; 0x122aa 12172: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 12176: 20 e0 ldi r18, 0x00 ; 0 12178: 30 e0 ldi r19, 0x00 ; 0 1217a: 48 e0 ldi r20, 0x08 ; 8 1217c: 52 e4 ldi r21, 0x42 ; 66 1217e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 12182: 20 e0 ldi r18, 0x00 ; 0 12184: 30 e0 ldi r19, 0x00 ; 0 12186: 40 ea ldi r20, 0xA0 ; 160 12188: 50 e4 ldi r21, 0x40 ; 64 1218a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1218e: 6c 8b std Y+20, r22 ; 0x14 12190: 7d 8b std Y+21, r23 ; 0x15 12192: 8e 8b std Y+22, r24 ; 0x16 12194: 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; 12196: 87 e5 ldi r24, 0x57 ; 87 12198: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1219c: 88 23 and r24, r24 1219e: 09 f4 brne .+2 ; 0x121a2 121a0: 89 c0 rjmp .+274 ; 0x122b4 121a2: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 121a6: 2a 85 ldd r18, Y+10 ; 0x0a 121a8: 3b 85 ldd r19, Y+11 ; 0x0b 121aa: 4c 85 ldd r20, Y+12 ; 0x0c 121ac: 5d 85 ldd r21, Y+13 ; 0x0d 121ae: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 121b2: 20 e0 ldi r18, 0x00 ; 0 121b4: 30 e0 ldi r19, 0x00 ; 0 121b6: 48 e8 ldi r20, 0x88 ; 136 121b8: 52 e4 ldi r21, 0x42 ; 66 121ba: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 121be: 69 8f std Y+25, r22 ; 0x19 121c0: 7a 8f std Y+26, r23 ; 0x1a 121c2: 8b 8f std Y+27, r24 ; 0x1b 121c4: 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; 121c6: 88 e4 ldi r24, 0x48 ; 72 121c8: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 121cc: 88 23 and r24, r24 121ce: 09 f4 brne .+2 ; 0x121d2 121d0: 7a c0 rjmp .+244 ; 0x122c6 121d2: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 121d6: 2c 89 ldd r18, Y+20 ; 0x14 121d8: 3d 89 ldd r19, Y+21 ; 0x15 121da: 4e 89 ldd r20, Y+22 ; 0x16 121dc: 5f 89 ldd r21, Y+23 ; 0x17 121de: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 121e2: 20 e0 ldi r18, 0x00 ; 0 121e4: 30 e0 ldi r19, 0x00 ; 0 121e6: 48 e8 ldi r20, 0x88 ; 136 121e8: 52 e4 ldi r21, 0x42 ; 66 121ea: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 121ee: 6d 8f std Y+29, r22 ; 0x1d 121f0: 7e 8f std Y+30, r23 ; 0x1e 121f2: 8f 8f std Y+31, r24 ; 0x1f 121f4: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling 121f6: 0f 94 e9 8b call 0x317d2 ; 0x317d2 mbl.z_values[0][0] = min_pos[Z_AXIS]; 121fa: 80 91 29 02 lds r24, 0x0229 ; 0x800229 121fe: 90 91 2a 02 lds r25, 0x022A ; 0x80022a 12202: a0 91 2b 02 lds r26, 0x022B ; 0x80022b 12206: b0 91 2c 02 lds r27, 0x022C ; 0x80022c 1220a: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 1220e: 90 93 a2 13 sts 0x13A2, r25 ; 0x8013a2 12212: a0 93 a3 13 sts 0x13A3, r26 ; 0x8013a3 12216: b0 93 a4 13 sts 0x13A4, r27 ; 0x8013a4 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); 1221a: 0f 94 1f c7 call 0x38e3e ; 0x38e3e 1221e: 05 ec ldi r16, 0xC5 ; 197 12220: 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) 12222: c8 01 movw r24, r16 12224: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 12228: 01 96 adiw r24, 0x01 ; 1 1222a: 09 f0 breq .+2 ; 0x1222e 1222c: 51 c0 rjmp .+162 ; 0x122d0 1222e: 0e 5f subi r16, 0xFE ; 254 12230: 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) { 12232: 05 3d cpi r16, 0xD5 ; 213 12234: 8f e0 ldi r24, 0x0F ; 15 12236: 18 07 cpc r17, r24 12238: a1 f7 brne .-24 ; 0x12222 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; 1223a: 21 2c mov r2, r1 1223c: a0 ea ldi r26, 0xA0 ; 160 1223e: b3 e1 ldi r27, 0x13 ; 19 12240: ba a3 std Y+34, r27 ; 0x22 12242: 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; 12244: b9 87 std Y+9, r27 ; 0x09 12246: a8 87 std Y+8, r26 ; 0x08 12248: 51 2c mov r5, r1 1224a: 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; 1224c: 31 2c mov r3, r1 1224e: 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)); 12250: 84 2d mov r24, r4 12252: 63 e0 ldi r22, 0x03 ; 3 12254: 0f 94 0a de call 0x3bc14 ; 0x3bc14 <__udivmodqi4> 12258: 98 8b std Y+16, r25 ; 0x10 1225a: 68 84 ldd r6, Y+8 ; 0x08 1225c: 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++) { 1225e: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); 12260: f8 89 ldd r31, Y+16 ; 0x10 12262: f1 11 cpse r31, r1 12264: 37 c0 rjmp .+110 ; 0x122d4 12266: 81 2f mov r24, r17 12268: 63 e0 ldi r22, 0x03 ; 3 1226a: 0f 94 0a de call 0x3bc14 ; 0x3bc14 <__udivmodqi4> 1226e: 91 11 cpse r25, r1 12270: 31 c0 rjmp .+98 ; 0x122d4 if (isOn3x3Mesh) { if (has_z && (row || col)) { 12272: 21 10 cpse r2, r1 12274: 3f c1 rjmp .+638 ; 0x124f4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 12276: 7e 81 ldd r23, Y+6 ; 0x06 12278: 73 30 cpi r23, 0x03 ; 3 1227a: 09 f4 brne .+2 ; 0x1227e 1227c: 70 c0 rjmp .+224 ; 0x1235e 1227e: 8f 81 ldd r24, Y+7 ; 0x07 12280: 8e 87 std Y+14, r24 ; 0x0e 12282: 37 c0 rjmp .+110 ; 0x122f2 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; 12284: 1e 83 std Y+6, r17 ; 0x06 12286: 6a e9 ldi r22, 0x9A ; 154 12288: 79 e9 ldi r23, 0x99 ; 153 1228a: 89 e1 ldi r24, 0x19 ; 25 1228c: 9f e3 ldi r25, 0x3F ; 63 1228e: 6a 83 std Y+2, r22 ; 0x02 12290: 7b 83 std Y+3, r23 ; 0x03 12292: 8c 83 std Y+4, r24 ; 0x04 12294: 9d 83 std Y+5, r25 ; 0x05 12296: 3d cf rjmp .-390 ; 0x12112 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; 12298: 80 e0 ldi r24, 0x00 ; 0 1229a: 90 e0 ldi r25, 0x00 ; 0 1229c: a0 e8 ldi r26, 0x80 ; 128 1229e: bf ef ldi r27, 0xFF ; 255 122a0: 8a 87 std Y+10, r24 ; 0x0a 122a2: 9b 87 std Y+11, r25 ; 0x0b 122a4: ac 87 std Y+12, r26 ; 0x0c 122a6: bd 87 std Y+13, r27 ; 0x0d 122a8: 5e cf rjmp .-324 ; 0x12166 const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; 122aa: 60 e0 ldi r22, 0x00 ; 0 122ac: 70 e0 ldi r23, 0x00 ; 0 122ae: 80 e8 ldi r24, 0x80 ; 128 122b0: 9f ef ldi r25, 0xFF ; 255 122b2: 6d cf rjmp .-294 ; 0x1218e const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; 122b4: 80 e0 ldi r24, 0x00 ; 0 122b6: 90 e0 ldi r25, 0x00 ; 0 122b8: a0 e8 ldi r26, 0x80 ; 128 122ba: bf e7 ldi r27, 0x7F ; 127 122bc: 89 8f std Y+25, r24 ; 0x19 122be: 9a 8f std Y+26, r25 ; 0x1a 122c0: ab 8f std Y+27, r26 ; 0x1b 122c2: bc 8f std Y+28, r27 ; 0x1c 122c4: 80 cf rjmp .-256 ; 0x121c6 const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; 122c6: 60 e0 ldi r22, 0x00 ; 0 122c8: 70 e0 ldi r23, 0x00 ; 0 122ca: 80 e8 ldi r24, 0x80 ; 128 122cc: 9f e7 ldi r25, 0x7F ; 127 122ce: 8f cf rjmp .-226 ; 0x121ee 122d0: 2f 80 ldd r2, Y+7 ; 0x07 122d2: b4 cf rjmp .-152 ; 0x1223c 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; } 122d4: 60 e0 ldi r22, 0x00 ; 0 122d6: 70 e0 ldi r23, 0x00 ; 0 122d8: 80 ec ldi r24, 0xC0 ; 192 122da: 9f e7 ldi r25, 0x7F ; 127 122dc: d3 01 movw r26, r6 122de: 11 96 adiw r26, 0x01 ; 1 122e0: 6d 93 st X+, r22 122e2: 7d 93 st X+, r23 122e4: 8d 93 st X+, r24 122e6: 9c 93 st X, r25 122e8: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 122ea: be 81 ldd r27, Y+6 ; 0x06 122ec: b3 30 cpi r27, 0x03 ; 3 122ee: c1 f1 breq .+112 ; 0x12360 122f0: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); 122f2: 81 2f mov r24, r17 122f4: 0f 94 79 c7 call 0x38ef2 ; 0x38ef2 122f8: 4b 01 movw r8, r22 122fa: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); 122fc: 80 2f mov r24, r16 122fe: 0f 94 79 c7 call 0x38ef2 ; 0x38ef2 12302: 6b 01 movw r12, r22 12304: 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)) { 12306: a5 01 movw r20, r10 12308: 94 01 movw r18, r8 1230a: 6a 85 ldd r22, Y+10 ; 0x0a 1230c: 7b 85 ldd r23, Y+11 ; 0x0b 1230e: 8c 85 ldd r24, Y+12 ; 0x0c 12310: 9d 85 ldd r25, Y+13 ; 0x0d 12312: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 12316: 18 16 cp r1, r24 12318: 0c f4 brge .+2 ; 0x1231c 1231a: 1c c1 rjmp .+568 ; 0x12554 1231c: 29 8d ldd r18, Y+25 ; 0x19 1231e: 3a 8d ldd r19, Y+26 ; 0x1a 12320: 4b 8d ldd r20, Y+27 ; 0x1b 12322: 5c 8d ldd r21, Y+28 ; 0x1c 12324: c5 01 movw r24, r10 12326: b4 01 movw r22, r8 12328: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1232c: 18 16 cp r1, r24 1232e: 0c f4 brge .+2 ; 0x12332 12330: 11 c1 rjmp .+546 ; 0x12554 12332: a7 01 movw r20, r14 12334: 96 01 movw r18, r12 12336: 6c 89 ldd r22, Y+20 ; 0x14 12338: 7d 89 ldd r23, Y+21 ; 0x15 1233a: 8e 89 ldd r24, Y+22 ; 0x16 1233c: 9f 89 ldd r25, Y+23 ; 0x17 1233e: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 12342: 18 16 cp r1, r24 12344: 0c f4 brge .+2 ; 0x12348 12346: 06 c1 rjmp .+524 ; 0x12554 12348: 2d 8d ldd r18, Y+29 ; 0x1d 1234a: 3e 8d ldd r19, Y+30 ; 0x1e 1234c: 4f 8d ldd r20, Y+31 ; 0x1f 1234e: 58 a1 ldd r21, Y+32 ; 0x20 12350: c7 01 movw r24, r14 12352: b6 01 movw r22, r12 12354: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 12358: 18 16 cp r1, r24 1235a: 0c f4 brge .+2 ; 0x1235e 1235c: fb c0 rjmp .+502 ; 0x12554 continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; 1235e: 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++) { 12360: 1f 5f subi r17, 0xFF ; 255 12362: 24 e0 ldi r18, 0x04 ; 4 12364: 62 0e add r6, r18 12366: 71 1c adc r7, r1 12368: 17 30 cpi r17, 0x07 ; 7 1236a: 09 f0 breq .+2 ; 0x1236e 1236c: 79 cf rjmp .-270 ; 0x12260 1236e: 6f ef ldi r22, 0xFF ; 255 12370: 46 1a sub r4, r22 12372: 56 0a sbc r5, r22 12374: 88 85 ldd r24, Y+8 ; 0x08 12376: 99 85 ldd r25, Y+9 ; 0x09 12378: 4c 96 adiw r24, 0x1c ; 28 1237a: 99 87 std Y+9, r25 ; 0x09 1237c: 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++) { 1237e: 97 e0 ldi r25, 0x07 ; 7 12380: 49 16 cp r4, r25 12382: 51 04 cpc r5, r1 12384: 09 f0 breq .+2 ; 0x12388 12386: 63 cf rjmp .-314 ; 0x1224e // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh 12388: 0f 94 82 16 call 0x22d04 ; 0x22d04 // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; 1238c: a0 91 75 07 lds r26, 0x0775 ; 0x800775 12390: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; 12392: b0 91 f3 03 lds r27, 0x03F3 ; 0x8003f3 12396: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; 12398: 81 e0 ldi r24, 0x01 ; 1 1239a: 80 93 75 07 sts 0x0775, r24 ; 0x800775 custom_message_state = meshPointsToProbe + 10; 1239e: 8a e0 ldi r24, 0x0A ; 10 123a0: 83 0d add r24, r3 123a2: 80 93 f3 03 sts 0x03F3, r24 ; 0x8003f3 lcd_update(1); 123a6: 81 e0 ldi r24, 0x01 ; 1 123a8: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 123ac: 80 e0 ldi r24, 0x00 ; 0 123ae: 90 e0 ldi r25, 0x00 ; 0 123b0: a0 ea ldi r26, 0xA0 ; 160 123b2: b0 e4 ldi r27, 0x40 ; 64 123b4: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 123b8: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 123bc: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 123c0: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 123c4: 65 e5 ldi r22, 0x55 ; 85 123c6: 75 e5 ldi r23, 0x55 ; 85 123c8: 85 e5 ldi r24, 0x55 ; 85 123ca: 91 e4 ldi r25, 0x41 ; 65 123cc: 0f 94 5d ba call 0x374ba ; 0x374ba // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 123d0: 80 e0 ldi r24, 0x00 ; 0 123d2: 0e 94 1d 68 call 0xd03a ; 0xd03a 123d6: 9c a3 std Y+36, r25 ; 0x24 123d8: 8b a3 std Y+35, r24 ; 0x23 123da: 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 123dc: 83 2d mov r24, r3 123de: 67 e0 ldi r22, 0x07 ; 7 123e0: 0f 94 0a de call 0x3bc14 ; 0x3bc14 <__udivmodqi4> 123e4: f8 2e mov r15, r24 123e6: 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 123e8: 68 2f mov r22, r24 123ea: 70 e0 ldi r23, 0x00 ; 0 123ec: 7f 87 std Y+15, r23 ; 0x0f 123ee: 6e 87 std Y+14, r22 ; 0x0e 123f0: 80 ff sbrs r24, 0 123f2: 03 c0 rjmp .+6 ; 0x123fa 123f4: 76 e0 ldi r23, 0x06 ; 6 123f6: 79 1b sub r23, r25 123f8: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); 123fa: 80 2f mov r24, r16 123fc: 63 e0 ldi r22, 0x03 ; 3 123fe: 0f 94 0a de call 0x3bc14 ; 0x3bc14 <__udivmodqi4> 12402: 91 11 cpse r25, r1 12404: 05 c0 rjmp .+10 ; 0x12410 12406: 8f 2d mov r24, r15 12408: 0f 94 0a de call 0x3bc14 ; 0x3bc14 <__udivmodqi4> 1240c: 11 e0 ldi r17, 0x01 ; 1 1240e: 91 11 cpse r25, r1 12410: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); 12412: 80 2f mov r24, r16 12414: 0f 94 79 c7 call 0x38ef2 ; 0x38ef2 12418: 68 8b std Y+16, r22 ; 0x10 1241a: 79 8b std Y+17, r23 ; 0x11 1241c: 8a 8b std Y+18, r24 ; 0x12 1241e: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 12420: 8f 2d mov r24, r15 12422: 0f 94 79 c7 call 0x38ef2 ; 0x38ef2 12426: 4b 01 movw r8, r22 12428: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 1242a: 8e 81 ldd r24, Y+6 ; 0x06 1242c: 83 30 cpi r24, 0x03 ; 3 1242e: 09 f0 breq .+2 ; 0x12432 12430: 99 c0 rjmp .+306 ; 0x12564 if (!isOn3x3Mesh) { 12432: 11 11 cpse r17, r1 12434: c8 c0 rjmp .+400 ; 0x125c6 12436: 27 e0 ldi r18, 0x07 ; 7 12438: ae 85 ldd r26, Y+14 ; 0x0e 1243a: bf 85 ldd r27, Y+15 ; 0x0f 1243c: 2a 9f mul r18, r26 1243e: f0 01 movw r30, r0 12440: 2b 9f mul r18, r27 12442: f0 0d add r31, r0 12444: 11 24 eor r1, r1 12446: e0 0f add r30, r16 12448: f1 1d adc r31, r1 1244a: ee 0f add r30, r30 1244c: ff 1f adc r31, r31 1244e: ee 0f add r30, r30 12450: ff 1f adc r31, r31 12452: e0 56 subi r30, 0x60 ; 96 12454: fc 4e sbci r31, 0xEC ; 236 12456: 60 e0 ldi r22, 0x00 ; 0 12458: 70 e0 ldi r23, 0x00 ; 0 1245a: 80 ec ldi r24, 0xC0 ; 192 1245c: 9f e7 ldi r25, 0x7F ; 127 1245e: 61 83 std Z+1, r22 ; 0x01 12460: 72 83 std Z+2, r23 ; 0x02 12462: 83 83 std Z+3, r24 ; 0x03 12464: 94 83 std Z+4, r25 ; 0x04 12466: 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) { 12468: e1 e3 ldi r30, 0x31 ; 49 1246a: 3e 12 cpse r3, r30 1246c: b7 cf rjmp .-146 ; 0x123dc custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1246e: 80 e0 ldi r24, 0x00 ; 0 12470: 90 e0 ldi r25, 0x00 ; 0 12472: a0 ea ldi r26, 0xA0 ; 160 12474: b0 e4 ldi r27, 0x40 ; 64 12476: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 1247a: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 1247e: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 12482: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12486: 65 e5 ldi r22, 0x55 ; 85 12488: 75 e5 ldi r23, 0x55 ; 85 1248a: 85 e5 ldi r24, 0x55 ; 85 1248c: 91 e4 ldi r25, 0x41 ; 65 1248e: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 12492: 0f 94 27 58 call 0x2b04e ; 0x2b04e static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 12496: b1 e3 ldi r27, 0x31 ; 49 12498: 3b 16 cp r3, r27 1249a: 09 f4 brne .+2 ; 0x1249e 1249c: 33 c2 rjmp .+1126 ; 0x12904 if (g80_fail_cnt++ >= 1) { 1249e: 80 91 6c 03 lds r24, 0x036C ; 0x80036c 124a2: 91 e0 ldi r25, 0x01 ; 1 124a4: 98 0f add r25, r24 124a6: 90 93 6c 03 sts 0x036C, r25 ; 0x80036c 124aa: 88 23 and r24, r24 124ac: 09 f4 brne .+2 ; 0x124b0 124ae: d3 c1 rjmp .+934 ; 0x12856 print_stop(); 124b0: 60 e0 ldi r22, 0x00 ; 0 124b2: 80 e0 ldi r24, 0x00 ; 0 124b4: 0f 94 12 15 call 0x22a24 ; 0x22a24 lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 124b8: 86 e4 ldi r24, 0x46 ; 70 124ba: 96 e3 ldi r25, 0x36 ; 54 124bc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 124c0: 0f 94 07 35 call 0x26a0e ; 0x26a0e lcd_z_calibration_prompt(false); 124c4: 80 e0 ldi r24, 0x00 ; 0 124c6: 0f 94 8e 66 call 0x2cd1c ; 0x2cd1c current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 124ca: 81 e0 ldi r24, 0x01 ; 1 124cc: 80 93 96 02 sts 0x0296, r24 ; 0x800296 // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 124d0: 8e e0 ldi r24, 0x0E ; 14 124d2: 91 e7 ldi r25, 0x71 ; 113 124d4: 0f 94 0c 0b call 0x21618 ; 0x21618 custom_message_type = custom_message_type_old; 124d8: 2f 81 ldd r18, Y+7 ; 0x07 124da: 20 93 75 07 sts 0x0775, r18 ; 0x800775 custom_message_state = custom_message_state_old; 124de: 68 85 ldd r22, Y+8 ; 0x08 124e0: 60 93 f3 03 sts 0x03F3, r22 ; 0x8003f3 lcd_update(2); 124e4: 82 e0 ldi r24, 0x02 ; 2 124e6: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 st_synchronize(); 124ea: 0f 94 27 58 call 0x2b04e ; 0x2b04e mesh_bed_leveling_flag = false; 124ee: 10 92 59 0e sts 0x0E59, r1 ; 0x800e59 124f2: d6 cd rjmp .-1108 ; 0x120a0 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)) { 124f4: 01 11 cpse r16, r1 124f6: 03 c0 rjmp .+6 ; 0x124fe 124f8: 11 23 and r17, r17 124fa: 09 f4 brne .+2 ; 0x124fe 124fc: bc ce rjmp .-648 ; 0x12276 // 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))); 124fe: 81 2f mov r24, r17 12500: 63 e0 ldi r22, 0x03 ; 3 12502: 0f 94 16 de call 0x3bc2c ; 0x3bc2c <__divmodqi4> 12506: 84 0d add r24, r4 12508: 95 2d mov r25, r5 1250a: 91 1d adc r25, r1 1250c: 88 0f add r24, r24 1250e: 99 1f adc r25, r25 12510: 8d 53 subi r24, 0x3D ; 61 12512: 90 4f sbci r25, 0xF0 ; 240 12514: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 12518: bc 01 movw r22, r24 1251a: 99 0f add r25, r25 1251c: 88 0b sbc r24, r24 1251e: 99 0b sbc r25, r25 12520: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 12524: 2a e0 ldi r18, 0x0A ; 10 12526: 37 ed ldi r19, 0xD7 ; 215 12528: 43 e2 ldi r20, 0x23 ; 35 1252a: 5c e3 ldi r21, 0x3C ; 60 1252c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 12530: 9b 01 movw r18, r22 12532: ac 01 movw r20, r24 12534: 60 91 a1 13 lds r22, 0x13A1 ; 0x8013a1 12538: 70 91 a2 13 lds r23, 0x13A2 ; 0x8013a2 1253c: 80 91 a3 13 lds r24, 0x13A3 ; 0x8013a3 12540: 90 91 a4 13 lds r25, 0x13A4 ; 0x8013a4 12544: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 12548: f3 01 movw r30, r6 1254a: 61 83 std Z+1, r22 ; 0x01 1254c: 72 83 std Z+2, r23 ; 0x02 1254e: 83 83 std Z+3, r24 ; 0x03 12550: 94 83 std Z+4, r25 ; 0x04 12552: 91 ce rjmp .-734 ; 0x12276 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)) { 12554: fe 85 ldd r31, Y+14 ; 0x0e 12556: ff 23 and r31, r31 12558: 09 f4 brne .+2 ; 0x1255c 1255a: 02 cf rjmp .-508 ; 0x12360 1255c: 22 20 and r2, r2 1255e: 09 f4 brne .+2 ; 0x12562 12560: fe ce rjmp .-516 ; 0x1235e 12562: fe ce rjmp .-516 ; 0x12360 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)) { 12564: 28 89 ldd r18, Y+16 ; 0x10 12566: 39 89 ldd r19, Y+17 ; 0x11 12568: 4a 89 ldd r20, Y+18 ; 0x12 1256a: 5b 89 ldd r21, Y+19 ; 0x13 1256c: 6a 85 ldd r22, Y+10 ; 0x0a 1256e: 7b 85 ldd r23, Y+11 ; 0x0b 12570: 8c 85 ldd r24, Y+12 ; 0x0c 12572: 9d 85 ldd r25, Y+13 ; 0x0d 12574: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 12578: 18 16 cp r1, r24 1257a: 04 f1 brlt .+64 ; 0x125bc 1257c: 28 89 ldd r18, Y+16 ; 0x10 1257e: 39 89 ldd r19, Y+17 ; 0x11 12580: 4a 89 ldd r20, Y+18 ; 0x12 12582: 5b 89 ldd r21, Y+19 ; 0x13 12584: 69 8d ldd r22, Y+25 ; 0x19 12586: 7a 8d ldd r23, Y+26 ; 0x1a 12588: 8b 8d ldd r24, Y+27 ; 0x1b 1258a: 9c 8d ldd r25, Y+28 ; 0x1c 1258c: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 12590: 87 fd sbrc r24, 7 12592: 14 c0 rjmp .+40 ; 0x125bc 12594: a5 01 movw r20, r10 12596: 94 01 movw r18, r8 12598: 6c 89 ldd r22, Y+20 ; 0x14 1259a: 7d 89 ldd r23, Y+21 ; 0x15 1259c: 8e 89 ldd r24, Y+22 ; 0x16 1259e: 9f 89 ldd r25, Y+23 ; 0x17 125a0: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 125a4: 18 16 cp r1, r24 125a6: 54 f0 brlt .+20 ; 0x125bc 125a8: a5 01 movw r20, r10 125aa: 94 01 movw r18, r8 125ac: 6d 8d ldd r22, Y+29 ; 0x1d 125ae: 7e 8d ldd r23, Y+30 ; 0x1e 125b0: 8f 8d ldd r24, Y+31 ; 0x1f 125b2: 98 a1 ldd r25, Y+32 ; 0x20 125b4: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 125b8: 87 ff sbrs r24, 7 125ba: 05 c0 rjmp .+10 ; 0x125c6 125bc: 11 23 and r17, r17 125be: 09 f4 brne .+2 ; 0x125c2 125c0: 52 cf rjmp .-348 ; 0x12466 125c2: 21 10 cpse r2, r1 125c4: 50 cf rjmp .-352 ; 0x12466 mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 125c6: 10 e0 ldi r17, 0x00 ; 0 125c8: a7 e0 ldi r26, 0x07 ; 7 125ca: 8e 85 ldd r24, Y+14 ; 0x0e 125cc: 9f 85 ldd r25, Y+15 ; 0x0f 125ce: a8 9f mul r26, r24 125d0: f0 01 movw r30, r0 125d2: a9 9f mul r26, r25 125d4: f0 0d add r31, r0 125d6: 11 24 eor r1, r1 125d8: e0 0f add r30, r16 125da: f1 1f adc r31, r17 125dc: ee 0f add r30, r30 125de: ff 1f adc r31, r31 125e0: ee 0f add r30, r30 125e2: ff 1f adc r31, r31 125e4: e0 56 subi r30, 0x60 ; 96 125e6: fc 4e sbci r31, 0xEC ; 236 125e8: 41 80 ldd r4, Z+1 ; 0x01 125ea: 52 80 ldd r5, Z+2 ; 0x02 125ec: 63 80 ldd r6, Z+3 ; 0x03 125ee: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 125f0: c1 2c mov r12, r1 125f2: d1 2c mov r13, r1 125f4: e0 ea ldi r30, 0xA0 ; 160 125f6: ee 2e mov r14, r30 125f8: e0 e4 ldi r30, 0x40 ; 64 125fa: fe 2e mov r15, r30 125fc: 22 20 and r2, r2 125fe: 51 f0 breq .+20 ; 0x12614 12600: 23 e3 ldi r18, 0x33 ; 51 12602: 33 e3 ldi r19, 0x33 ; 51 12604: 43 eb ldi r20, 0xB3 ; 179 12606: 5e e3 ldi r21, 0x3E ; 62 12608: c3 01 movw r24, r6 1260a: b2 01 movw r22, r4 1260c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 12610: 6b 01 movw r12, r22 12612: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 12614: a7 01 movw r20, r14 12616: 96 01 movw r18, r12 12618: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 1261c: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 12620: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 12624: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 12628: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1262c: 87 ff sbrs r24, 7 1262e: 10 c0 rjmp .+32 ; 0x12650 current_position[Z_AXIS] = init_z_bckp; 12630: c0 92 4b 07 sts 0x074B, r12 ; 0x80074b 12634: d0 92 4c 07 sts 0x074C, r13 ; 0x80074c 12638: e0 92 4d 07 sts 0x074D, r14 ; 0x80074d 1263c: f0 92 4e 07 sts 0x074E, r15 ; 0x80074e plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12640: 65 e5 ldi r22, 0x55 ; 85 12642: 75 e5 ldi r23, 0x55 ; 85 12644: 85 e5 ldi r24, 0x55 ; 85 12646: 91 e4 ldi r25, 0x41 ; 65 12648: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 1264c: 0f 94 27 58 call 0x2b04e ; 0x2b04e } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 12650: 68 89 ldd r22, Y+16 ; 0x10 12652: 79 89 ldd r23, Y+17 ; 0x11 12654: 8a 89 ldd r24, Y+18 ; 0x12 12656: 9b 89 ldd r25, Y+19 ; 0x13 12658: 60 93 43 07 sts 0x0743, r22 ; 0x800743 1265c: 70 93 44 07 sts 0x0744, r23 ; 0x800744 12660: 80 93 45 07 sts 0x0745, r24 ; 0x800745 12664: 90 93 46 07 sts 0x0746, r25 ; 0x800746 current_position[Y_AXIS] = y_pos; 12668: 80 92 47 07 sts 0x0747, r8 ; 0x800747 1266c: 90 92 48 07 sts 0x0748, r9 ; 0x800748 12670: a0 92 49 07 sts 0x0749, r10 ; 0x800749 12674: b0 92 4a 07 sts 0x074A, r11 ; 0x80074a world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 12678: 67 e4 ldi r22, 0x47 ; 71 1267a: 77 e0 ldi r23, 0x07 ; 7 1267c: 83 e4 ldi r24, 0x43 ; 67 1267e: 97 e0 ldi r25, 0x07 ; 7 12680: 0e 94 df 6b call 0xd7be ; 0xd7be plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 12684: 60 e0 ldi r22, 0x00 ; 0 12686: 70 e0 ldi r23, 0x00 ; 0 12688: 86 e1 ldi r24, 0x16 ; 22 1268a: 93 e4 ldi r25, 0x43 ; 67 1268c: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 12690: 0f 94 27 58 call 0x2b04e ; 0x2b04e if (planner_aborted) 12694: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 12698: 88 23 and r24, r24 1269a: 39 f0 breq .+14 ; 0x126aa { custom_message_type = custom_message_type_old; 1269c: 7f 81 ldd r23, Y+7 ; 0x07 1269e: 70 93 75 07 sts 0x0775, r23 ; 0x800775 custom_message_state = custom_message_state_old; 126a2: 88 85 ldd r24, Y+8 ; 0x08 126a4: 80 93 f3 03 sts 0x03F3, r24 ; 0x8003f3 126a8: fb cc rjmp .-1546 ; 0x120a0 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 126aa: 81 2c mov r8, r1 126ac: 91 2c mov r9, r1 126ae: 70 e2 ldi r23, 0x20 ; 32 126b0: a7 2e mov r10, r23 126b2: 71 ec ldi r23, 0xC1 ; 193 126b4: b7 2e mov r11, r23 126b6: 22 20 and r2, r2 126b8: 51 f0 breq .+20 ; 0x126ce 126ba: 2a 81 ldd r18, Y+2 ; 0x02 126bc: 3b 81 ldd r19, Y+3 ; 0x03 126be: 4c 81 ldd r20, Y+4 ; 0x04 126c0: 5d 81 ldd r21, Y+5 ; 0x05 126c2: c3 01 movw r24, r6 126c4: b2 01 movw r22, r4 126c6: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 126ca: 4b 01 movw r8, r22 126cc: 5c 01 movw r10, r24 126ce: 48 8d ldd r20, Y+24 ; 0x18 126d0: c5 01 movw r24, r10 126d2: b4 01 movw r22, r8 126d4: 0f 94 f3 8b call 0x317e6 ; 0x317e6 126d8: 81 11 cpse r24, r1 126da: 0b c0 rjmp .+22 ; 0x126f2 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)); 126dc: 82 e8 ldi r24, 0x82 ; 130 126de: 95 e6 ldi r25, 0x65 ; 101 126e0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 126e4: 9f 93 push r25 126e6: 8f 93 push r24 126e8: 0f 94 1d dc call 0x3b83a ; 0x3b83a 126ec: 0f 90 pop r0 126ee: 0f 90 pop r0 126f0: be ce rjmp .-644 ; 0x1246e // 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. 126f2: 20 91 4b 07 lds r18, 0x074B ; 0x80074b 126f6: 30 91 4c 07 lds r19, 0x074C ; 0x80074c 126fa: 40 91 4d 07 lds r20, 0x074D ; 0x80074d 126fe: 50 91 4e 07 lds r21, 0x074E ; 0x80074e 12702: c7 01 movw r24, r14 12704: b6 01 movw r22, r12 12706: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1270a: 20 e0 ldi r18, 0x00 ; 0 1270c: 30 e0 ldi r19, 0x00 ; 0 1270e: a9 01 movw r20, r18 12710: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 12714: 87 ff sbrs r24, 7 12716: 36 c0 rjmp .+108 ; 0x12784 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12718: 60 e0 ldi r22, 0x00 ; 0 1271a: 70 e0 ldi r23, 0x00 ; 0 1271c: 80 ea ldi r24, 0xA0 ; 160 1271e: 90 e4 ldi r25, 0x40 ; 64 12720: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 12724: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 12728: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 1272c: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12730: 65 e5 ldi r22, 0x55 ; 85 12732: 75 e5 ldi r23, 0x55 ; 85 12734: 85 e5 ldi r24, 0x55 ; 85 12736: 91 e4 ldi r25, 0x41 ; 65 12738: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 1273c: 0f 94 27 58 call 0x2b04e ; 0x2b04e 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 12740: 48 8d ldd r20, Y+24 ; 0x18 12742: c5 01 movw r24, r10 12744: b4 01 movw r22, r8 12746: 0f 94 f3 8b call 0x317e6 ; 0x317e6 1274a: 88 23 and r24, r24 1274c: 39 f2 breq .-114 ; 0x126dc printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 1274e: 20 91 4b 07 lds r18, 0x074B ; 0x80074b 12752: 30 91 4c 07 lds r19, 0x074C ; 0x80074c 12756: 40 91 4d 07 lds r20, 0x074D ; 0x80074d 1275a: 50 91 4e 07 lds r21, 0x074E ; 0x80074e 1275e: 60 e0 ldi r22, 0x00 ; 0 12760: 70 e0 ldi r23, 0x00 ; 0 12762: 80 ea ldi r24, 0xA0 ; 160 12764: 90 e4 ldi r25, 0x40 ; 64 12766: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1276a: 2d ec ldi r18, 0xCD ; 205 1276c: 3c ec ldi r19, 0xCC ; 204 1276e: 4c ec ldi r20, 0xCC ; 204 12770: 5d e3 ldi r21, 0x3D ; 61 12772: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 12776: 87 ff sbrs r24, 7 12778: 05 c0 rjmp .+10 ; 0x12784 puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 1277a: 89 e1 ldi r24, 0x19 ; 25 1277c: 9e e7 ldi r25, 0x7E ; 126 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")); 1277e: 0f 94 44 dc call 0x3b888 ; 0x3b888 12782: 75 ce rjmp .-790 ; 0x1246e 12784: c0 90 4b 07 lds r12, 0x074B ; 0x80074b 12788: d0 90 4c 07 lds r13, 0x074C ; 0x80074c 1278c: e0 90 4d 07 lds r14, 0x074D ; 0x80074d 12790: f0 90 4e 07 lds r15, 0x074E ; 0x80074e 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 12794: 22 20 and r2, r2 12796: a1 f0 breq .+40 ; 0x127c0 12798: a7 01 movw r20, r14 1279a: 96 01 movw r18, r12 1279c: c3 01 movw r24, r6 1279e: b2 01 movw r22, r4 127a0: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 127a4: 9b 01 movw r18, r22 127a6: ac 01 movw r20, r24 127a8: 5f 77 andi r21, 0x7F ; 127 127aa: 6a 81 ldd r22, Y+2 ; 0x02 127ac: 7b 81 ldd r23, Y+3 ; 0x03 127ae: 8c 81 ldd r24, Y+4 ; 0x04 127b0: 9d 81 ldd r25, Y+5 ; 0x05 127b2: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 127b6: 87 ff sbrs r24, 7 127b8: 03 c0 rjmp .+6 ; 0x127c0 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 127ba: 80 ee ldi r24, 0xE0 ; 224 127bc: 9d e7 ldi r25, 0x7D ; 125 127be: df cf rjmp .-66 ; 0x1277e } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 127c0: 8f ea ldi r24, 0xAF ; 175 127c2: 9f e0 ldi r25, 0x0F ; 15 127c4: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 127c8: 88 23 and r24, r24 127ca: 09 f4 brne .+2 ; 0x127ce 127cc: 40 c0 rjmp .+128 ; 0x1284e 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); } 127ce: 86 ea ldi r24, 0xA6 ; 166 127d0: 9f e0 ldi r25, 0x0F ; 15 127d2: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 if (!calibration_status_pinda()) return 0; 127d6: 88 23 and r24, r24 127d8: d1 f1 breq .+116 ; 0x1284e return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 127da: 60 91 99 03 lds r22, 0x0399 ; 0x800399 127de: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 127e2: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 127e6: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 127ea: 0e 94 bf 5d call 0xbb7e ; 0xbb7e 127ee: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 127f2: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 127f6: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 127fa: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 127fe: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 12802: 9b 01 movw r18, r22 12804: ac 01 movw r20, r24 12806: e7 e0 ldi r30, 0x07 ; 7 12808: ae 85 ldd r26, Y+14 ; 0x0e 1280a: bf 85 ldd r27, Y+15 ; 0x0f 1280c: ea 9f mul r30, r26 1280e: c0 01 movw r24, r0 12810: eb 9f mul r30, r27 12812: 90 0d add r25, r0 12814: 11 24 eor r1, r1 12816: 08 0f add r16, r24 12818: 19 1f adc r17, r25 1281a: 00 0f add r16, r16 1281c: 11 1f adc r17, r17 1281e: 00 0f add r16, r16 12820: 11 1f adc r17, r17 12822: 00 56 subi r16, 0x60 ; 96 12824: 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; 12826: c7 01 movw r24, r14 12828: b6 01 movw r22, r12 1282a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1282e: d8 01 movw r26, r16 12830: 11 96 adiw r26, 0x01 ; 1 12832: 6d 93 st X+, r22 12834: 7d 93 st X+, r23 12836: 8d 93 st X+, r24 12838: 9c 93 st X, r25 1283a: 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--; 1283c: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 12840: 81 50 subi r24, 0x01 ; 1 12842: 80 93 f3 03 sts 0x03F3, r24 ; 0x8003f3 mesh_point++; lcd_update(1); 12846: 81 e0 ldi r24, 0x01 ; 1 12848: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 1284c: 0c ce rjmp .-1000 ; 0x12466 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 1284e: 20 e0 ldi r18, 0x00 ; 0 12850: 30 e0 ldi r19, 0x00 ; 0 12852: a9 01 movw r20, r18 12854: d8 cf rjmp .-80 ; 0x12806 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); 12856: 85 e0 ldi r24, 0x05 ; 5 12858: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 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; 1285c: c1 2c mov r12, r1 1285e: d1 2c mov r13, r1 12860: 90 ea ldi r25, 0xA0 ; 160 12862: e9 2e mov r14, r25 12864: 90 e4 ldi r25, 0x40 ; 64 12866: 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)); 12868: 82 e1 ldi r24, 0x12 ; 18 1286a: 96 e3 ldi r25, 0x36 ; 54 1286c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 12870: 0f 94 80 34 call 0x26900 ; 0x26900 #ifdef TMC2130 lcd_wait_for_click_delay(MSG_BED_LEVELING_FAILED_TIMEOUT); 12874: 8e e1 ldi r24, 0x1E ; 30 12876: 90 e0 ldi r25, 0x00 ; 0 12878: 0f 94 6e 4f call 0x29edc ; 0x29edc calibrate_z_auto(); // Z-leveling (X-assembly stay up!!!) 1287c: 0e 94 73 74 call 0xe8e6 ; 0xe8e6 #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); 12880: 80 e0 ldi r24, 0x00 ; 0 12882: 0f 94 55 63 call 0x2c6aa ; 0x2c6aa 12886: 18 2f mov r17, r24 raise_z(-1); 12888: 60 e0 ldi r22, 0x00 ; 0 1288a: 70 e0 ldi r23, 0x00 ; 0 1288c: 80 e8 ldi r24, 0x80 ; 128 1288e: 9f eb ldi r25, 0xBF ; 191 12890: 0e 94 16 6f call 0xde2c ; 0xde2c enable_z_endstop(true); 12894: 81 e0 ldi r24, 0x01 ; 1 12896: 0f 94 55 63 call 0x2c6aa ; 0x2c6aa #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 1289a: 84 e0 ldi r24, 0x04 ; 4 1289c: 0f 94 8e 3a call 0x2751c ; 0x2751c #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 128a0: c0 92 4b 07 sts 0x074B, r12 ; 0x80074b 128a4: d0 92 4c 07 sts 0x074C, r13 ; 0x80074c 128a8: e0 92 4d 07 sts 0x074D, r14 ; 0x80074d 128ac: f0 92 4e 07 sts 0x074E, r15 ; 0x80074e plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 128b0: 65 e5 ldi r22, 0x55 ; 85 128b2: 75 e5 ldi r23, 0x55 ; 85 128b4: 85 e5 ldi r24, 0x55 ; 85 128b6: 91 e4 ldi r25, 0x41 ; 65 128b8: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 128bc: 0f 94 27 58 call 0x2b04e ; 0x2b04e #ifdef TMC2130 tmc2130_home_exit(); 128c0: 0f 94 5f 3a call 0x274be ; 0x274be #endif // TMC2130 enable_z_endstop(bState); 128c4: 81 2f mov r24, r17 128c6: 0f 94 55 63 call 0x2c6aa ; 0x2c6aa } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 128ca: 82 e0 ldi r24, 0x02 ; 2 128cc: 0f 94 13 58 call 0x2b026 ; 0x2b026 128d0: 20 e0 ldi r18, 0x00 ; 0 128d2: 30 e0 ldi r19, 0x00 ; 0 128d4: 40 ea ldi r20, 0xA0 ; 160 128d6: 50 e4 ldi r21, 0x40 ; 64 128d8: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 128dc: 18 16 cp r1, r24 128de: 24 f2 brlt .-120 ; 0x12868 custom_message_type = custom_message_type_old; 128e0: ef 81 ldd r30, Y+7 ; 0x07 128e2: e0 93 75 07 sts 0x0775, r30 ; 0x800775 custom_message_state = custom_message_state_old; 128e6: f8 85 ldd r31, Y+8 ; 0x08 128e8: f0 93 f3 03 sts 0x03F3, r31 ; 0x8003f3 lcd_update_enable(true); // display / status-line recovery 128ec: 81 e0 ldi r24, 0x01 ; 1 128ee: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 gcode_G28(true, true, true); // X & Y & Z-homing (must be after individual Z-homing (problem with spool-holder)!) 128f2: 41 e0 ldi r20, 0x01 ; 1 128f4: 61 e0 ldi r22, 0x01 ; 1 128f6: 81 e0 ldi r24, 0x01 ; 1 128f8: 0e 94 10 81 call 0x10220 ; 0x10220 128fc: 81 e0 ldi r24, 0x01 ; 1 128fe: 80 93 80 10 sts 0x1080, r24 ; 0x801080 12902: ce cb rjmp .-2148 ; 0x120a0 repeatcommand_front(); // re-run (i.e. of "G80") return; } g80_fail_cnt = 0; // no fail was detected. Reset the error counter. 12904: 10 92 6c 03 sts 0x036C, r1 ; 0x80036c clean_up_after_endstop_move(l_feedmultiply); 12908: 8b a1 ldd r24, Y+35 ; 0x23 1290a: 9c a1 ldd r25, Y+36 ; 0x24 1290c: 0e 94 03 68 call 0xd006 ; 0xd006 } } void babystep_apply() { babystep_load(); 12910: 0f 94 c9 c6 call 0x38d92 ; 0x38d92 shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 12914: 60 91 6a 05 lds r22, 0x056A ; 0x80056a <_ZL13babystepLoadZ.lto_priv.514> 12918: 70 91 6b 05 lds r23, 0x056B ; 0x80056b <_ZL13babystepLoadZ.lto_priv.514+0x1> 1291c: 07 2e mov r0, r23 1291e: 00 0c add r0, r0 12920: 88 0b sbc r24, r24 12922: 99 0b sbc r25, r25 12924: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 12928: 90 58 subi r25, 0x80 ; 128 1292a: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 1292e: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 12932: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 12936: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 1293a: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1293e: 0f 94 e5 c6 call 0x38dca ; 0x38dca 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; 12942: 80 ec ldi r24, 0xC0 ; 192 12944: 9f e0 ldi r25, 0x0F ; 15 12946: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1294a: 91 e0 ldi r25, 0x01 ; 1 1294c: 81 30 cpi r24, 0x01 ; 1 1294e: 09 f0 breq .+2 ; 0x12952 12950: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 12952: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 12954: 4f eb ldi r20, 0xBF ; 191 12956: 5f e0 ldi r21, 0x0F ; 15 12958: 6c e4 ldi r22, 0x4C ; 76 1295a: ce 01 movw r24, r28 1295c: 01 96 adiw r24, 0x01 ; 1 1295e: 0e 94 11 5d call 0xba22 ; 0xba22 12962: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 12964: 4e eb ldi r20, 0xBE ; 190 12966: 5f e0 ldi r21, 0x0F ; 15 12968: 62 e5 ldi r22, 0x52 ; 82 1296a: ce 01 movw r24, r28 1296c: 01 96 adiw r24, 0x01 ; 1 1296e: 0e 94 11 5d call 0xba22 ; 0xba22 12972: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 12974: 4d eb ldi r20, 0xBD ; 189 12976: 5f e0 ldi r21, 0x0F ; 15 12978: 66 e4 ldi r22, 0x46 ; 70 1297a: ce 01 movw r24, r28 1297c: 01 96 adiw r24, 0x01 ; 1 1297e: 0e 94 11 5d call 0xba22 ; 0xba22 12982: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 12984: 4c eb ldi r20, 0xBC ; 188 12986: 5f e0 ldi r21, 0x0F ; 15 12988: 62 e4 ldi r22, 0x42 ; 66 1298a: ce 01 movw r24, r28 1298c: 01 96 adiw r24, 0x01 ; 1 1298e: 0e 94 11 5d call 0xba22 ; 0xba22 12992: 21 2f mov r18, r17 12994: 11 0f add r17, r17 12996: 33 0b sbc r19, r19 12998: 08 2e mov r0, r24 1299a: 00 0c add r0, r0 1299c: 99 0b sbc r25, r25 1299e: 5c 01 movw r10, r24 129a0: a2 1a sub r10, r18 129a2: b3 0a sbc r11, r19 129a4: 8f 2d mov r24, r15 129a6: ff 0c add r15, r15 129a8: 99 0b sbc r25, r25 129aa: 28 0f add r18, r24 129ac: 39 1f adc r19, r25 129ae: 46 e0 ldi r20, 0x06 ; 6 129b0: 42 9f mul r20, r18 129b2: 60 01 movw r12, r0 129b4: 43 9f mul r20, r19 129b6: d0 0c add r13, r0 129b8: 11 24 eor r1, r1 129ba: f1 2c mov r15, r1 129bc: e1 2c mov r14, r1 129be: 00 2e mov r0, r16 129c0: 00 0c add r0, r0 129c2: 11 0b sbc r17, r17 129c4: 08 1b sub r16, r24 129c6: 19 0b sbc r17, r25 129c8: b7 01 movw r22, r14 129ca: 6f 55 subi r22, 0x5F ; 95 129cc: 7c 4e sbci r23, 0xEC ; 236 129ce: 3b 01 movw r6, r22 129d0: 46 01 movw r8, r12 129d2: 77 e0 ldi r23, 0x07 ; 7 129d4: 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 * ( 129d6: d3 01 movw r26, r6 129d8: 2d 90 ld r2, X+ 129da: 3d 90 ld r3, X+ 129dc: 4d 90 ld r4, X+ 129de: 5d 90 ld r5, X+ 129e0: 3d 01 movw r6, r26 129e2: fd 01 movw r30, r26 129e4: 34 97 sbiw r30, 0x04 ; 4 129e6: fb 87 std Y+11, r31 ; 0x0b 129e8: ea 87 std Y+10, r30 ; 0x0a 129ea: b4 01 movw r22, r8 129ec: 09 2c mov r0, r9 129ee: 00 0c add r0, r0 129f0: 88 0b sbc r24, r24 129f2: 99 0b sbc r25, r25 129f4: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 129f8: 2f e3 ldi r18, 0x3F ; 63 129fa: 33 ec ldi r19, 0xC3 ; 195 129fc: 4e e2 ldi r20, 0x2E ; 46 129fe: 59 e3 ldi r21, 0x39 ; 57 12a00: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 12a04: a2 01 movw r20, r4 12a06: 91 01 movw r18, r2 12a08: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 12a0c: aa 85 ldd r26, Y+10 ; 0x0a 12a0e: bb 85 ldd r27, Y+11 ; 0x0b 12a10: 6d 93 st X+, r22 12a12: 7d 93 st X+, r23 12a14: 8d 93 st X+, r24 12a16: 9c 93 st X, r25 12a18: 13 97 sbiw r26, 0x03 ; 3 12a1a: ba 81 ldd r27, Y+2 ; 0x02 12a1c: b1 50 subi r27, 0x01 ; 1 12a1e: ba 83 std Y+2, r27 ; 0x02 12a20: 80 0e add r8, r16 12a22: 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++) { 12a24: b1 11 cpse r27, r1 12a26: d7 cf rjmp .-82 ; 0x129d6 12a28: ca 0c add r12, r10 12a2a: db 1c adc r13, r11 12a2c: ec e1 ldi r30, 0x1C ; 28 12a2e: ee 0e add r14, r30 12a30: 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++) { 12a32: f4 ec ldi r31, 0xC4 ; 196 12a34: ef 16 cp r14, r31 12a36: f1 04 cpc r15, r1 12a38: 39 f6 brne .-114 ; 0x129c8 + 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) 12a3a: 0f 94 82 16 call 0x22d04 ; 0x22d04 { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 12a3e: 8d e4 ldi r24, 0x4D ; 77 12a40: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 12a44: 88 23 and r24, r24 12a46: 09 f4 brne .+2 ; 0x12a4a 12a48: 84 c0 rjmp .+264 ; 0x12b52 12a4a: 0e 94 8e 5c call 0xb91c ; 0xb91c if (nMeasPoints == 7 && useMagnetCompensation) { 12a4e: 2e 81 ldd r18, Y+6 ; 0x06 12a50: 27 30 cpi r18, 0x07 ; 7 12a52: 09 f0 breq .+2 ; 0x12a56 12a54: 94 c0 rjmp .+296 ; 0x12b7e 12a56: 88 23 and r24, r24 12a58: 09 f4 brne .+2 ; 0x12a5c 12a5a: 91 c0 rjmp .+290 ; 0x12b7e 12a5c: bb 24 eor r11, r11 12a5e: b3 94 inc r11 12a60: aa 24 eor r10, r10 12a62: aa 94 dec r10 12a64: ab 0c add r10, r11 12a66: 09 a1 ldd r16, Y+33 ; 0x21 12a68: 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++) { 12a6a: 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++; } 12a6c: 8e ef ldi r24, 0xFE ; 254 12a6e: 88 2e mov r8, r24 12a70: 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)) { 12a72: 6a 2d mov r22, r10 12a74: 86 2d mov r24, r6 12a76: 0f 94 94 c6 call 0x38d28 ; 0x38d28 12a7a: 99 24 eor r9, r9 12a7c: 93 94 inc r9 12a7e: 96 0c add r9, r6 12a80: 81 11 cpse r24, r1 12a82: 6e c0 rjmp .+220 ; 0x12b60 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++; } 12a84: 6b 2d mov r22, r11 12a86: 86 2d mov r24, r6 12a88: 0f 94 94 c6 call 0x38d28 ; 0x38d28 } 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; 12a8c: c1 2c mov r12, r1 12a8e: d1 2c mov r13, r1 12a90: 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; 12a92: 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++; } 12a94: 88 23 and r24, r24 12a96: 81 f0 breq .+32 ; 0x12ab8 12a98: 20 e0 ldi r18, 0x00 ; 0 12a9a: 30 e0 ldi r19, 0x00 ; 0 12a9c: a9 01 movw r20, r18 12a9e: d8 01 movw r26, r16 12aa0: 5d 96 adiw r26, 0x1d ; 29 12aa2: 6d 91 ld r22, X+ 12aa4: 7d 91 ld r23, X+ 12aa6: 8d 91 ld r24, X+ 12aa8: 9c 91 ld r25, X 12aaa: 90 97 sbiw r26, 0x20 ; 32 12aac: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 12ab0: 6b 01 movw r12, r22 12ab2: 7c 01 movw r14, r24 12ab4: 77 24 eor r7, r7 12ab6: 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++; } 12ab8: 68 2d mov r22, r8 12aba: 86 2d mov r24, r6 12abc: 0f 94 94 c6 call 0x38d28 ; 0x38d28 12ac0: 88 23 and r24, r24 12ac2: 69 f0 breq .+26 ; 0x12ade 12ac4: f8 01 movw r30, r16 12ac6: 7b 97 sbiw r30, 0x1b ; 27 12ac8: 20 81 ld r18, Z 12aca: 31 81 ldd r19, Z+1 ; 0x01 12acc: 42 81 ldd r20, Z+2 ; 0x02 12ace: 53 81 ldd r21, Z+3 ; 0x03 12ad0: c7 01 movw r24, r14 12ad2: b6 01 movw r22, r12 12ad4: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 12ad8: 6b 01 movw r12, r22 12ada: 7c 01 movw r14, r24 12adc: 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++; } 12ade: 6a 2d mov r22, r10 12ae0: 89 2d mov r24, r9 12ae2: 0f 94 94 c6 call 0x38d28 ; 0x38d28 12ae6: 88 23 and r24, r24 12ae8: 61 f0 breq .+24 ; 0x12b02 12aea: f8 01 movw r30, r16 12aec: 25 81 ldd r18, Z+5 ; 0x05 12aee: 36 81 ldd r19, Z+6 ; 0x06 12af0: 47 81 ldd r20, Z+7 ; 0x07 12af2: 50 85 ldd r21, Z+8 ; 0x08 12af4: c7 01 movw r24, r14 12af6: b6 01 movw r22, r12 12af8: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 12afc: 6b 01 movw r12, r22 12afe: 7c 01 movw r14, r24 12b00: 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++; } 12b02: 6a 2d mov r22, r10 12b04: 8f ef ldi r24, 0xFF ; 255 12b06: 86 0d add r24, r6 12b08: 0f 94 94 c6 call 0x38d28 ; 0x38d28 12b0c: 88 23 and r24, r24 12b0e: 31 f1 breq .+76 ; 0x12b5c 12b10: f8 01 movw r30, r16 12b12: 33 97 sbiw r30, 0x03 ; 3 12b14: 20 81 ld r18, Z 12b16: 31 81 ldd r19, Z+1 ; 0x01 12b18: 42 81 ldd r20, Z+2 ; 0x02 12b1a: 53 81 ldd r21, Z+3 ; 0x03 12b1c: c7 01 movw r24, r14 12b1e: b6 01 movw r22, r12 12b20: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 12b24: 6b 01 movw r12, r22 12b26: 7c 01 movw r14, r24 12b28: 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 12b2a: 67 2d mov r22, r7 12b2c: 70 e0 ldi r23, 0x00 ; 0 12b2e: 90 e0 ldi r25, 0x00 ; 0 12b30: 80 e0 ldi r24, 0x00 ; 0 12b32: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 12b36: 9b 01 movw r18, r22 12b38: ac 01 movw r20, r24 12b3a: c7 01 movw r24, r14 12b3c: b6 01 movw r22, r12 12b3e: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 12b42: d8 01 movw r26, r16 12b44: 11 96 adiw r26, 0x01 ; 1 12b46: 6d 93 st X+, r22 12b48: 7d 93 st X+, r23 12b4a: 8d 93 st X+, r24 12b4c: 9c 93 st X, r25 12b4e: 14 97 sbiw r26, 0x04 ; 4 12b50: 07 c0 rjmp .+14 ; 0x12b60 } 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); 12b52: 8c ea ldi r24, 0xAC ; 172 12b54: 9d e0 ldi r25, 0x0D ; 13 12b56: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 12b5a: 79 cf rjmp .-270 ; 0x12a4e 12b5c: 71 10 cpse r7, r1 12b5e: e5 cf rjmp .-54 ; 0x12b2a //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++) { 12b60: 69 2c mov r6, r9 12b62: 0c 5f subi r16, 0xFC ; 252 12b64: 1f 4f sbci r17, 0xFF ; 255 12b66: b7 e0 ldi r27, 0x07 ; 7 12b68: 9b 12 cpse r9, r27 12b6a: 83 cf rjmp .-250 ; 0x12a72 12b6c: b3 94 inc r11 12b6e: e9 a1 ldd r30, Y+33 ; 0x21 12b70: fa a1 ldd r31, Y+34 ; 0x22 12b72: 7c 96 adiw r30, 0x1c ; 28 12b74: fa a3 std Y+34, r31 ; 0x22 12b76: 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++) { 12b78: f8 e0 ldi r31, 0x08 ; 8 12b7a: bf 12 cpse r11, r31 12b7c: 71 cf rjmp .-286 ; 0x12a60 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 12b7e: 81 e0 ldi r24, 0x01 ; 1 12b80: 80 93 a0 13 sts 0x13A0, r24 ; 0x8013a0 if (code_seen('O') && !code_value_uint8()) { 12b84: 8f e4 ldi r24, 0x4F ; 79 12b86: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 12b8a: 81 11 cpse r24, r1 12b8c: 03 c0 rjmp .+6 ; 0x12b94 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 12b8e: 0f 94 3a c7 call 0x38e74 ; 0x38e74 12b92: 9b cc rjmp .-1738 ; 0x124ca } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 12b94: 0e 94 8e 5c call 0xb91c ; 0xb91c 12b98: 81 11 cpse r24, r1 12b9a: f9 cf rjmp .-14 ; 0x12b8e // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 12b9c: 0e 94 f8 67 call 0xcff0 ; 0xcff0 12ba0: 94 cc rjmp .-1752 ; 0x124ca 00012ba2 : //! @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() { 12ba2: 4f 92 push r4 12ba4: 5f 92 push r5 12ba6: 6f 92 push r6 12ba8: 7f 92 push r7 12baa: 8f 92 push r8 12bac: 9f 92 push r9 12bae: af 92 push r10 12bb0: bf 92 push r11 12bb2: ef 92 push r14 12bb4: ff 92 push r15 12bb6: 0f 93 push r16 12bb8: 1f 93 push r17 12bba: cf 93 push r28 12bbc: df 93 push r29 12bbe: 1f 92 push r1 12bc0: cd b7 in r28, 0x3d ; 61 12bc2: de b7 in r29, 0x3e ; 62 eeprom_read_block(reinterpret_cast(cs.version), reinterpret_cast(EEPROM_M500_base->version), sizeof(cs.version)); 12bc4: 44 e0 ldi r20, 0x04 ; 4 12bc6: 50 e0 ldi r21, 0x00 ; 0 12bc8: 64 e1 ldi r22, 0x14 ; 20 12bca: 70 e0 ldi r23, 0x00 ; 0 12bcc: 8e e6 ldi r24, 0x6E ; 110 12bce: 96 e0 ldi r25, 0x06 ; 6 12bd0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match 12bd4: 43 e0 ldi r20, 0x03 ; 3 12bd6: 50 e0 ldi r21, 0x00 ; 0 12bd8: 6f e6 ldi r22, 0x6F ; 111 12bda: 79 e7 ldi r23, 0x79 ; 121 12bdc: 8e e6 ldi r24, 0x6E ; 110 12bde: 96 e0 ldi r25, 0x06 ; 6 12be0: 0f 94 3a db call 0x3b674 ; 0x3b674 12be4: 89 2b or r24, r25 12be6: 09 f0 breq .+2 ; 0x12bea 12be8: a0 c1 rjmp .+832 ; 0x12f2a { // 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)); 12bea: e3 e3 ldi r30, 0x33 ; 51 12bec: fa e7 ldi r31, 0x7A ; 122 12bee: 45 91 lpm r20, Z+ 12bf0: 55 91 lpm r21, Z+ 12bf2: 65 91 lpm r22, Z+ 12bf4: 74 91 lpm r23, Z 12bf6: 88 ed ldi r24, 0xD8 ; 216 12bf8: 90 e0 ldi r25, 0x00 ; 0 12bfa: 0e 94 5c 65 call 0xcab8 ; 0xcab8 eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); 12bfe: e7 e3 ldi r30, 0x37 ; 55 12c00: fa e7 ldi r31, 0x7A ; 122 12c02: 45 91 lpm r20, Z+ 12c04: 55 91 lpm r21, Z+ 12c06: 65 91 lpm r22, Z+ 12c08: 74 91 lpm r23, Z 12c0a: 8c ed ldi r24, 0xDC ; 220 12c0c: 90 e0 ldi r25, 0x00 ; 0 12c0e: 0e 94 5c 65 call 0xcab8 ; 0xcab8 eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); 12c12: eb e3 ldi r30, 0x3B ; 59 12c14: fa e7 ldi r31, 0x7A ; 122 12c16: 64 91 lpm r22, Z 12c18: 80 ee ldi r24, 0xE0 ; 224 12c1a: 90 e0 ldi r25, 0x00 ; 0 12c1c: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); 12c20: ec e3 ldi r30, 0x3C ; 60 12c22: fa e7 ldi r31, 0x7A ; 122 12c24: 65 91 lpm r22, Z+ 12c26: 74 91 lpm r23, Z 12c28: 81 ee ldi r24, 0xE1 ; 225 12c2a: 90 e0 ldi r25, 0x00 ; 0 12c2c: 0e 94 fc 77 call 0xeff8 ; 0xeff8 eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); 12c30: ee e3 ldi r30, 0x3E ; 62 12c32: fa e7 ldi r31, 0x7A ; 122 12c34: 65 91 lpm r22, Z+ 12c36: 74 91 lpm r23, Z 12c38: 83 ee ldi r24, 0xE3 ; 227 12c3a: 90 e0 ldi r25, 0x00 ; 0 12c3c: 0e 94 fc 77 call 0xeff8 ; 0xeff8 // 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)); 12c40: ef e2 ldi r30, 0x2F ; 47 12c42: fa e7 ldi r31, 0x7A ; 122 12c44: 45 91 lpm r20, Z+ 12c46: 55 91 lpm r21, Z+ 12c48: 65 91 lpm r22, Z+ 12c4a: 74 91 lpm r23, Z 12c4c: 84 ed ldi r24, 0xD4 ; 212 12c4e: 90 e0 ldi r25, 0x00 ; 0 12c50: 0e 94 5c 65 call 0xcab8 ; 0xcab8 // 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); 12c54: 4b e0 ldi r20, 0x0B ; 11 12c56: 5a e7 ldi r21, 0x7A ; 122 12c58: 60 e1 ldi r22, 0x10 ; 16 12c5a: 70 e0 ldi r23, 0x00 ; 0 12c5c: 80 eb ldi r24, 0xB0 ; 176 12c5e: 90 e0 ldi r25, 0x00 ; 0 12c60: 0e 94 dd 77 call 0xefba ; 0xefba 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); 12c64: 4b e1 ldi r20, 0x1B ; 27 12c66: 5a e7 ldi r21, 0x7A ; 122 12c68: 60 e1 ldi r22, 0x10 ; 16 12c6a: 70 e0 ldi r23, 0x00 ; 0 12c6c: 80 ec ldi r24, 0xC0 ; 192 12c6e: 90 e0 ldi r25, 0x00 ; 0 12c70: 0e 94 dd 77 call 0xefba ; 0xefba #ifdef TMC2130 eeprom_init_default_block(&EEPROM_M500_base->axis_ustep_resolution, sizeof(EEPROM_M500_base->axis_ustep_resolution), default_conf.axis_ustep_resolution); 12c74: 4b e2 ldi r20, 0x2B ; 43 12c76: 5a e7 ldi r21, 0x7A ; 122 12c78: 64 e0 ldi r22, 0x04 ; 4 12c7a: 70 e0 ldi r23, 0x00 ; 0 12c7c: 80 ed ldi r24, 0xD0 ; 208 12c7e: 90 e0 ldi r25, 0x00 ; 0 12c80: 0e 94 dd 77 call 0xefba ; 0xefba #endif // TMC2130 // load the CS to RAM eeprom_read_block(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); 12c84: 41 ed ldi r20, 0xD1 ; 209 12c86: 50 e0 ldi r21, 0x00 ; 0 12c88: 64 e1 ldi r22, 0x14 ; 20 12c8a: 70 e0 ldi r23, 0x00 ; 0 12c8c: 8e e6 ldi r24, 0x6E ; 110 12c8e: 96 e0 ldi r25, 0x06 ; 6 12c90: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 calculate_extruder_multipliers(); 12c94: 0e 94 ee 66 call 0xcddc ; 0xcddc 12c98: 0e e6 ldi r16, 0x6E ; 110 12c9a: 16 e0 ldi r17, 0x06 ; 6 12c9c: 8a e0 ldi r24, 0x0A ; 10 12c9e: e8 2e mov r14, r24 12ca0: 87 e0 ldi r24, 0x07 ; 7 12ca2: 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; 12ca4: 94 ec ldi r25, 0xC4 ; 196 12ca6: 89 2e mov r8, r25 12ca8: 99 e0 ldi r25, 0x09 ; 9 12caa: 99 2e mov r9, r25 12cac: a1 2c mov r10, r1 12cae: 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; 12cb0: 20 ec ldi r18, 0xC0 ; 192 12cb2: 42 2e mov r4, r18 12cb4: 23 e0 ldi r18, 0x03 ; 3 12cb6: 52 2e mov r5, r18 12cb8: 61 2c mov r6, r1 12cba: 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) 12cbc: 20 e0 ldi r18, 0x00 ; 0 12cbe: 30 e0 ldi r19, 0x00 ; 0 12cc0: 48 e4 ldi r20, 0x48 ; 72 12cc2: 53 e4 ldi r21, 0x43 ; 67 12cc4: f8 01 movw r30, r16 12cc6: 64 89 ldd r22, Z+20 ; 0x14 12cc8: 75 89 ldd r23, Z+21 ; 0x15 12cca: 86 89 ldd r24, Z+22 ; 0x16 12ccc: 97 89 ldd r25, Z+23 ; 0x17 12cce: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 12cd2: 18 16 cp r1, r24 12cd4: 4c f4 brge .+18 ; 0x12ce8 cs.max_feedrate_normal[j] = NORMAL_MAX_FEEDRATE_XY; 12cd6: 80 e0 ldi r24, 0x00 ; 0 12cd8: 90 e0 ldi r25, 0x00 ; 0 12cda: a8 e4 ldi r26, 0x48 ; 72 12cdc: b3 e4 ldi r27, 0x43 ; 67 12cde: f8 01 movw r30, r16 12ce0: 84 8b std Z+20, r24 ; 0x14 12ce2: 95 8b std Z+21, r25 ; 0x15 12ce4: a6 8b std Z+22, r26 ; 0x16 12ce6: b7 8b std Z+23, r27 ; 0x17 if (cs.max_feedrate_silent[j] > SILENT_MAX_FEEDRATE_XY) 12ce8: f7 01 movw r30, r14 12cea: 61 91 ld r22, Z+ 12cec: 71 91 ld r23, Z+ 12cee: 81 91 ld r24, Z+ 12cf0: 91 91 ld r25, Z+ 12cf2: 7f 01 movw r14, r30 12cf4: 20 e0 ldi r18, 0x00 ; 0 12cf6: 30 e0 ldi r19, 0x00 ; 0 12cf8: 48 ec ldi r20, 0xC8 ; 200 12cfa: 52 e4 ldi r21, 0x42 ; 66 12cfc: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 12d00: 18 16 cp r1, r24 12d02: 54 f4 brge .+20 ; 0x12d18 cs.max_feedrate_silent[j] = SILENT_MAX_FEEDRATE_XY; 12d04: 80 e0 ldi r24, 0x00 ; 0 12d06: 90 e0 ldi r25, 0x00 ; 0 12d08: a8 ec ldi r26, 0xC8 ; 200 12d0a: b2 e4 ldi r27, 0x42 ; 66 12d0c: f7 01 movw r30, r14 12d0e: 34 97 sbiw r30, 0x04 ; 4 12d10: 80 83 st Z, r24 12d12: 91 83 std Z+1, r25 ; 0x01 12d14: a2 83 std Z+2, r26 ; 0x02 12d16: b3 83 std Z+3, r27 ; 0x03 if (cs.max_acceleration_mm_per_s2_normal[j] > NORMAL_MAX_ACCEL_XY) 12d18: f8 01 movw r30, r16 12d1a: 84 a1 ldd r24, Z+36 ; 0x24 12d1c: 95 a1 ldd r25, Z+37 ; 0x25 12d1e: a6 a1 ldd r26, Z+38 ; 0x26 12d20: b7 a1 ldd r27, Z+39 ; 0x27 12d22: 85 3c cpi r24, 0xC5 ; 197 12d24: 99 40 sbci r25, 0x09 ; 9 12d26: a1 05 cpc r26, r1 12d28: b1 05 cpc r27, r1 12d2a: 28 f0 brcs .+10 ; 0x12d36 cs.max_acceleration_mm_per_s2_normal[j] = NORMAL_MAX_ACCEL_XY; 12d2c: f8 01 movw r30, r16 12d2e: 84 a2 std Z+36, r8 ; 0x24 12d30: 95 a2 std Z+37, r9 ; 0x25 12d32: a6 a2 std Z+38, r10 ; 0x26 12d34: b7 a2 std Z+39, r11 ; 0x27 if (cs.max_acceleration_mm_per_s2_silent[j] > SILENT_MAX_ACCEL_XY) 12d36: f7 01 movw r30, r14 12d38: 84 85 ldd r24, Z+12 ; 0x0c 12d3a: 95 85 ldd r25, Z+13 ; 0x0d 12d3c: a6 85 ldd r26, Z+14 ; 0x0e 12d3e: b7 85 ldd r27, Z+15 ; 0x0f 12d40: 81 3c cpi r24, 0xC1 ; 193 12d42: 93 40 sbci r25, 0x03 ; 3 12d44: a1 05 cpc r26, r1 12d46: b1 05 cpc r27, r1 12d48: 28 f0 brcs .+10 ; 0x12d54 cs.max_acceleration_mm_per_s2_silent[j] = SILENT_MAX_ACCEL_XY; 12d4a: f7 01 movw r30, r14 12d4c: 44 86 std Z+12, r4 ; 0x0c 12d4e: 55 86 std Z+13, r5 ; 0x0d 12d50: 66 86 std Z+14, r6 ; 0x0e 12d52: 77 86 std Z+15, r7 ; 0x0f 12d54: 0c 5f subi r16, 0xFC ; 252 12d56: 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++) 12d58: f6 e0 ldi r31, 0x06 ; 6 12d5a: 06 37 cpi r16, 0x76 ; 118 12d5c: 1f 07 cpc r17, r31 12d5e: 09 f0 breq .+2 ; 0x12d62 12d60: ad cf rjmp .-166 ; 0x12cbc 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]); 12d62: 60 91 2a 07 lds r22, 0x072A ; 0x80072a 12d66: 70 e0 ldi r23, 0x00 ; 0 12d68: 80 e0 ldi r24, 0x00 ; 0 12d6a: 0f 94 b0 39 call 0x27360 ; 0x27360 tmc2130_set_res(Y_AXIS, cs.axis_ustep_resolution[Y_AXIS]); 12d6e: 60 91 2b 07 lds r22, 0x072B ; 0x80072b 12d72: 70 e0 ldi r23, 0x00 ; 0 12d74: 81 e0 ldi r24, 0x01 ; 1 12d76: 0f 94 b0 39 call 0x27360 ; 0x27360 tmc2130_set_res(Z_AXIS, cs.axis_ustep_resolution[Z_AXIS]); 12d7a: 60 91 2c 07 lds r22, 0x072C ; 0x80072c 12d7e: 70 e0 ldi r23, 0x00 ; 0 12d80: 82 e0 ldi r24, 0x02 ; 2 12d82: 0f 94 b0 39 call 0x27360 ; 0x27360 tmc2130_set_res(E_AXIS, cs.axis_ustep_resolution[E_AXIS]); 12d86: 60 91 2d 07 lds r22, 0x072D ; 0x80072d 12d8a: 70 e0 ldi r23, 0x00 ; 0 12d8c: 83 e0 ldi r24, 0x03 ; 3 12d8e: 0f 94 b0 39 call 0x27360 ; 0x27360 #endif //TMC2130 reset_acceleration_rates(); 12d92: 0f 94 4f aa call 0x3549e ; 0x3549e // Call updatePID (similar to when we have processed M301) updatePID(); 12d96: 0f 94 12 50 call 0x2a024 ; 0x2a024 } 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; 12d9a: ce 01 movw r24, r28 12d9c: 01 96 adiw r24, 0x01 ; 1 12d9e: 0f 94 d9 46 call 0x28db2 ; 0x28db2 // 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)); 12da2: 44 e3 ldi r20, 0x34 ; 52 12da4: 50 e8 ldi r21, 0x80 ; 128 12da6: 67 eb ldi r22, 0xB7 ; 183 12da8: 7a eb ldi r23, 0xBA ; 186 12daa: 82 ea ldi r24, 0xA2 ; 162 12dac: 9c e0 ldi r25, 0x0C ; 12 12dae: 0e 94 5c 65 call 0xcab8 ; 0xcab8 eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_V, THERMAL_MODEL_DEF(V)); 12db2: 46 e6 ldi r20, 0x66 ; 102 12db4: 56 e6 ldi r21, 0x66 ; 102 12db6: 66 e8 ldi r22, 0x86 ; 134 12db8: 7f e3 ldi r23, 0x3F ; 63 12dba: 8e e9 ldi r24, 0x9E ; 158 12dbc: 9c e0 ldi r25, 0x0C ; 12 12dbe: 0e 94 5c 65 call 0xcab8 ; 0xcab8 eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_D, THERMAL_MODEL_DEF(fS)); 12dc2: 4a e9 ldi r20, 0x9A ; 154 12dc4: 59 e9 ldi r21, 0x99 ; 153 12dc6: 69 e1 ldi r22, 0x19 ; 25 12dc8: 7e e3 ldi r23, 0x3E ; 62 12dca: 8a e9 ldi r24, 0x9A ; 154 12dcc: 9c e0 ldi r25, 0x0C ; 12 12dce: 0e 94 5c 65 call 0xcab8 ; 0xcab8 eeprom_init_default_word((uint16_t*)EEPROM_THERMAL_MODEL_L, THERMAL_MODEL_DEF(LAG)); 12dd2: 6e e0 ldi r22, 0x0E ; 14 12dd4: 71 e0 ldi r23, 0x01 ; 1 12dd6: 88 e9 ldi r24, 0x98 ; 152 12dd8: 9c e0 ldi r25, 0x0C ; 12 12dda: 0e 94 fc 77 call 0xeff8 ; 0xeff8 eeprom_init_default_byte((uint8_t*)EEPROM_THERMAL_MODEL_VER, THERMAL_MODEL_DEF(VER)); 12dde: 61 e0 ldi r22, 0x01 ; 1 12de0: 87 e9 ldi r24, 0x97 ; 151 12de2: 9c e0 ldi r25, 0x0C ; 12 12de4: 0e 94 14 78 call 0xf028 ; 0xf028 thermal_model::enabled = eeprom_read_byte((uint8_t*)EEPROM_THERMAL_MODEL_ENABLE); 12de8: 82 e0 ldi r24, 0x02 ; 2 12dea: 9d e0 ldi r25, 0x0D ; 13 12dec: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 12df0: 91 e0 ldi r25, 0x01 ; 1 12df2: 81 11 cpse r24, r1 12df4: 01 c0 rjmp .+2 ; 0x12df8 12df6: 90 e0 ldi r25, 0x00 ; 0 12df8: 90 93 20 05 sts 0x0520, r25 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> thermal_model::data.P = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_P); 12dfc: 8e ef ldi r24, 0xFE ; 254 12dfe: 9c e0 ldi r25, 0x0C ; 12 12e00: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 12e04: 60 93 b8 12 sts 0x12B8, r22 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2a> 12e08: 70 93 b9 12 sts 0x12B9, r23 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2b> 12e0c: 80 93 ba 12 sts 0x12BA, r24 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.394+0x2c> 12e10: 90 93 bb 12 sts 0x12BB, r25 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.394+0x2d> thermal_model::data.U = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_U); 12e14: 82 ea ldi r24, 0xA2 ; 162 12e16: 9c e0 ldi r25, 0x0C ; 12 12e18: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 12e1c: 60 93 bc 12 sts 0x12BC, r22 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.394+0x2e> 12e20: 70 93 bd 12 sts 0x12BD, r23 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.394+0x2f> 12e24: 80 93 be 12 sts 0x12BE, r24 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.394+0x30> 12e28: 90 93 bf 12 sts 0x12BF, r25 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.394+0x31> thermal_model::data.V = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_V); 12e2c: 8e e9 ldi r24, 0x9E ; 158 12e2e: 9c e0 ldi r25, 0x0C ; 12 12e30: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 12e34: 60 93 c0 12 sts 0x12C0, r22 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x32> 12e38: 70 93 c1 12 sts 0x12C1, r23 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x33> 12e3c: 80 93 c2 12 sts 0x12C2, r24 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x34> 12e40: 90 93 c3 12 sts 0x12C3, r25 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x35> thermal_model::data.C = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_C); 12e44: 8a ef ldi r24, 0xFA ; 250 12e46: 9c e0 ldi r25, 0x0C ; 12 12e48: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 12e4c: 60 93 c4 12 sts 0x12C4, r22 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 12e50: 70 93 c5 12 sts 0x12C5, r23 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 12e54: 80 93 c6 12 sts 0x12C6, r24 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 12e58: 90 93 c7 12 sts 0x12C7, r25 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> thermal_model::data.fS = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_D); 12e5c: 8a e9 ldi r24, 0x9A ; 154 12e5e: 9c e0 ldi r25, 0x0C ; 12 12e60: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 12e64: 60 93 c8 12 sts 0x12C8, r22 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3a> 12e68: 70 93 c9 12 sts 0x12C9, r23 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3b> 12e6c: 80 93 ca 12 sts 0x12CA, r24 ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.394+0x3c> 12e70: 90 93 cb 12 sts 0x12CB, r25 ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.394+0x3d> thermal_model_set_lag(eeprom_read_word((uint16_t*)EEPROM_THERMAL_MODEL_L)); 12e74: 88 e9 ldi r24, 0x98 ; 152 12e76: 9c e0 ldi r25, 0x0C ; 12 12e78: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 12e7c: 0f 94 bc 43 call 0x28778 ; 0x28778 eeprom_read_block(&thermal_model::data.R[0], (float*)EEPROM_THERMAL_MODEL_R, THERMAL_MODEL_R_SIZE * sizeof(float)); 12e80: 40 e4 ldi r20, 0x40 ; 64 12e82: 50 e0 ldi r21, 0x00 ; 0 12e84: 6a eb ldi r22, 0xBA ; 186 12e86: 7c e0 ldi r23, 0x0C ; 12 12e88: 8e ec ldi r24, 0xCE ; 206 12e8a: 92 e1 ldi r25, 0x12 ; 18 12e8c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 thermal_model::data.Ta_corr = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_Ta_corr); 12e90: 86 eb ldi r24, 0xB6 ; 182 12e92: 9c e0 ldi r25, 0x0C ; 12 12e94: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 12e98: 60 93 0e 13 sts 0x130E, r22 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 12e9c: 70 93 0f 13 sts 0x130F, r23 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 12ea0: 80 93 10 13 sts 0x1310, r24 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 12ea4: 90 93 11 13 sts 0x1311, r25 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> thermal_model::data.warn = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_W); 12ea8: 82 eb ldi r24, 0xB2 ; 178 12eaa: 9c e0 ldi r25, 0x0C ; 12 12eac: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 12eb0: 60 93 12 13 sts 0x1312, r22 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 12eb4: 70 93 13 13 sts 0x1313, r23 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 12eb8: 80 93 14 13 sts 0x1314, r24 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 12ebc: 90 93 15 13 sts 0x1315, r25 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> thermal_model::data.err = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_E); 12ec0: 8e ea ldi r24, 0xAE ; 174 12ec2: 9c e0 ldi r25, 0x0C ; 12 12ec4: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 12ec8: 60 93 16 13 sts 0x1316, r22 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 12ecc: 70 93 17 13 sts 0x1317, r23 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 12ed0: 80 93 18 13 sts 0x1318, r24 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 12ed4: 90 93 19 13 sts 0x1319, r25 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> if(!thermal_model::calibrated()) { 12ed8: 0f 94 db 43 call 0x287b6 ; 0x287b6 12edc: 81 11 cpse r24, r1 12ede: 06 c0 rjmp .+12 ; 0x12eec SERIAL_ECHOLNPGM("TM: stored calibration invalid, resetting"); 12ee0: 89 e0 ldi r24, 0x09 ; 9 12ee2: 99 e7 ldi r25, 0x79 ; 121 12ee4: 0e 94 86 7b call 0xf70c ; 0xf70c thermal_model_reset_settings(); 12ee8: 0f 94 e7 46 call 0x28dce ; 0x28dce } thermal_model::setup(); 12eec: 0f 94 43 44 call 0x28886 ; 0x28886 } 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; 12ef0: ce 01 movw r24, r28 12ef2: 01 96 adiw r24, 0x01 ; 1 12ef4: 0f 94 cc 46 call 0x28d98 ; 0x28d98 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; 12ef8: 82 ef ldi r24, 0xF2 ; 242 12efa: 9a ea ldi r25, 0xAA ; 170 12efc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNPGM("Stored settings retrieved"); 12f00: 83 e3 ldi r24, 0x33 ; 51 12f02: 99 e7 ldi r25, 0x79 ; 121 12f04: 0e 94 86 7b call 0xf70c ; 0xf70c 12f08: 81 e0 ldi r24, 0x01 ; 1 if (eeprom_is_initialized_block(EEPROM_M500_base->version, sizeof(EEPROM_M500_base->version))) { return false; } } return true; } 12f0a: 0f 90 pop r0 12f0c: df 91 pop r29 12f0e: cf 91 pop r28 12f10: 1f 91 pop r17 12f12: 0f 91 pop r16 12f14: ff 90 pop r15 12f16: ef 90 pop r14 12f18: bf 90 pop r11 12f1a: af 90 pop r10 12f1c: 9f 90 pop r9 12f1e: 8f 90 pop r8 12f20: 7f 90 pop r7 12f22: 6f 90 pop r6 12f24: 5f 90 pop r5 12f26: 4f 90 pop r4 12f28: 08 95 ret SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Stored settings retrieved"); } else { Config_ResetDefault(); 12f2a: 0e 94 37 84 call 0x1086e ; 0x1086e //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))) { 12f2e: 64 e0 ldi r22, 0x04 ; 4 12f30: 70 e0 ldi r23, 0x00 ; 0 12f32: 84 e1 ldi r24, 0x14 ; 20 12f34: 90 e0 ldi r25, 0x00 ; 0 12f36: 0e 94 e1 5c call 0xb9c2 ; 0xb9c2 12f3a: 91 e0 ldi r25, 0x01 ; 1 12f3c: 89 27 eor r24, r25 12f3e: e5 cf rjmp .-54 ; 0x12f0a 00012f40 : 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() 12f40: 2f 92 push r2 12f42: 3f 92 push r3 12f44: 4f 92 push r4 12f46: 5f 92 push r5 12f48: 6f 92 push r6 12f4a: 7f 92 push r7 12f4c: 8f 92 push r8 12f4e: 9f 92 push r9 12f50: af 92 push r10 12f52: bf 92 push r11 12f54: cf 92 push r12 12f56: df 92 push r13 12f58: ef 92 push r14 12f5a: ff 92 push r15 12f5c: 0f 93 push r16 12f5e: 1f 93 push r17 12f60: cf 93 push r28 12f62: df 93 push r29 12f64: cd b7 in r28, 0x3d ; 61 12f66: de b7 in r29, 0x3e ; 62 12f68: cf 58 subi r28, 0x8F ; 143 12f6a: d1 09 sbc r29, r1 12f6c: 0f b6 in r0, 0x3f ; 63 12f6e: f8 94 cli 12f70: de bf out 0x3e, r29 ; 62 12f72: 0f be out 0x3f, r0 ; 63 12f74: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 12f76: 82 e0 ldi r24, 0x02 ; 2 12f78: 80 93 96 02 sts 0x0296, r24 ; 0x800296 - 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) 12f7c: a0 90 70 12 lds r10, 0x1270 ; 0x801270 12f80: b0 90 71 12 lds r11, 0x1271 ; 0x801271 12f84: 85 01 movw r16, r10 12f86: 0a 57 subi r16, 0x7A ; 122 12f88: 1f 4e sbci r17, 0xEF ; 239 12f8a: 46 e0 ldi r20, 0x06 ; 6 12f8c: 50 e0 ldi r21, 0x00 ; 0 12f8e: 62 e5 ldi r22, 0x52 ; 82 12f90: 7a e8 ldi r23, 0x8A ; 138 12f92: c8 01 movw r24, r16 12f94: 0f 94 3a db call 0x3b674 ; 0x3b674 12f98: 89 2b or r24, r25 12f9a: 09 f0 breq .+2 ; 0x12f9e 12f9c: b8 c0 rjmp .+368 ; 0x1310e { // ### CRASH_DETECTED - TMC2130 // --------------------------------- if(code_seen_P(PSTR("CRASH_DETECTED"))) 12f9e: 83 e4 ldi r24, 0x43 ; 67 12fa0: 9a e8 ldi r25, 0x8A ; 138 12fa2: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 12fa6: 88 23 and r24, r24 12fa8: 09 f4 brne .+2 ; 0x12fac 12faa: 91 c0 rjmp .+290 ; 0x130ce { uint8_t mask = 0; if (code_seen('X')) mask |= X_AXIS_MASK; 12fac: 88 e5 ldi r24, 0x58 ; 88 12fae: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 12fb2: 18 2f mov r17, r24 if (code_seen('Y')) mask |= Y_AXIS_MASK; 12fb4: 89 e5 ldi r24, 0x59 ; 89 12fb6: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 12fba: 81 11 cpse r24, r1 12fbc: 12 60 ori r17, 0x02 ; 2 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); } void crashdet_detected(uint8_t mask) { st_synchronize(); 12fbe: 0f 94 27 58 call 0x2b04e ; 0x2b04e static uint8_t crashDet_counter = 0; static uint8_t crashDet_axes = 0; bool automatic_recovery_after_crash = true; char msg[LCD_WIDTH+1] = ""; 12fc2: 1a 82 std Y+2, r1 ; 0x02 12fc4: 19 82 std Y+1, r1 ; 0x01 12fc6: fe 01 movw r30, r28 12fc8: 33 96 adiw r30, 0x03 ; 3 12fca: 83 e1 ldi r24, 0x13 ; 19 12fcc: df 01 movw r26, r30 12fce: 1d 92 st X+, r1 12fd0: 8a 95 dec r24 12fd2: e9 f7 brne .-6 ; 0x12fce if (crashDetTimer.expired(CRASHDET_TIMER * 1000ul)) { 12fd4: 48 ec ldi r20, 0xC8 ; 200 12fd6: 5f ea ldi r21, 0xAF ; 175 12fd8: 60 e0 ldi r22, 0x00 ; 0 12fda: 70 e0 ldi r23, 0x00 ; 0 12fdc: 87 e7 ldi r24, 0x77 ; 119 12fde: 93 e0 ldi r25, 0x03 ; 3 12fe0: 0f 94 6a 3f call 0x27ed4 ; 0x27ed4 ::expired(unsigned long)> 12fe4: 81 11 cpse r24, r1 crashDet_counter = 0; 12fe6: 10 92 76 03 sts 0x0376, r1 ; 0x800376 } if(++crashDet_counter >= CRASHDET_COUNTER_MAX) { 12fea: 00 91 76 03 lds r16, 0x0376 ; 0x800376 12fee: 0f 5f subi r16, 0xFF ; 255 12ff0: 00 93 76 03 sts 0x0376, r16 ; 0x800376 automatic_recovery_after_crash = false; } crashDetTimer.start(); 12ff4: 87 e7 ldi r24, 0x77 ; 119 12ff6: 93 e0 ldi r25, 0x03 ; 3 12ff8: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> crashDet_axes |= mask; 12ffc: 80 91 75 03 lds r24, 0x0375 ; 0x800375 13000: 81 2b or r24, r17 13002: 80 93 75 03 sts 0x0375, r24 ; 0x800375 if (mask & X_AXIS_MASK) { 13006: 10 ff sbrs r17, 0 13008: 08 c0 rjmp .+16 ; 0x1301a eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 1300a: 86 e6 ldi r24, 0x66 ; 102 1300c: 9f e0 ldi r25, 0x0F ; 15 1300e: 0e 94 33 78 call 0xf066 ; 0xf066 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT); 13012: 85 e0 ldi r24, 0x05 ; 5 13014: 9f e0 ldi r25, 0x0F ; 15 13016: 0e 94 26 78 call 0xf04c ; 0xf04c } if (mask & Y_AXIS_MASK) { 1301a: 11 ff sbrs r17, 1 1301c: 08 c0 rjmp .+16 ; 0x1302e eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 1301e: 88 e6 ldi r24, 0x68 ; 104 13020: 9f e0 ldi r25, 0x0F ; 15 13022: 0e 94 33 78 call 0xf066 ; 0xf066 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT); 13026: 83 e0 ldi r24, 0x03 ; 3 13028: 9f e0 ldi r25, 0x0F ; 15 1302a: 0e 94 26 78 call 0xf04c ; 0xf04c } lcd_update_enable(true); 1302e: 81 e0 ldi r24, 0x01 ; 1 13030: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_update(2); 13034: 82 e0 ldi r24, 0x02 ; 2 13036: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 // prepare the status message with the _current_ axes status crashdet_fmt_error(msg, mask); 1303a: 61 2f mov r22, r17 1303c: ce 01 movw r24, r28 1303e: 01 96 adiw r24, 0x01 ; 1 13040: 0e 94 3e 75 call 0xea7c ; 0xea7c lcd_setstatus(msg); 13044: ce 01 movw r24, r28 13046: 01 96 adiw r24, 0x01 ; 1 13048: 0f 94 51 14 call 0x228a2 ; 0x228a2 gcode_G28(true, true, false); //home X and Y 1304c: 40 e0 ldi r20, 0x00 ; 0 1304e: 61 e0 ldi r22, 0x01 ; 1 13050: 81 e0 ldi r24, 0x01 ; 1 13052: 0e 94 10 81 call 0x10220 ; 0x10220 if (automatic_recovery_after_crash) { enquecommand_P(PSTR("CRASH_RECOVER")); 13056: 61 e0 ldi r22, 0x01 ; 1 13058: 83 ed ldi r24, 0xD3 ; 211 1305a: 96 e8 ldi r25, 0x86 ; 134 crashdet_fmt_error(msg, mask); lcd_setstatus(msg); gcode_G28(true, true, false); //home X and Y if (automatic_recovery_after_crash) { 1305c: 03 30 cpi r16, 0x03 ; 3 1305e: 60 f1 brcs .+88 ; 0x130b8 13060: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 13064: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d 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); 13068: 80 e0 ldi r24, 0x00 ; 0 1306a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_clear(); 1306e: 0e 94 48 70 call 0xe090 ; 0xe090 crashdet_fmt_error(msg, crashDet_axes); 13072: 60 91 75 03 lds r22, 0x0375 ; 0x800375 13076: ce 01 movw r24, r28 13078: 01 96 adiw r24, 0x01 ; 1 1307a: 0e 94 3e 75 call 0xea7c ; 0xea7c crashDet_axes = 0; 1307e: 10 92 75 03 sts 0x0375, r1 ; 0x800375 lcd_print(msg); 13082: ce 01 movw r24, r28 13084: 01 96 adiw r24, 0x01 ; 1 13086: 0e 94 1c 72 call 0xe438 ; 0xe438 // ask whether to resume printing lcd_puts_at_P(0, 1, _T(MSG_RESUME_PRINT)); 1308a: 82 e7 ldi r24, 0x72 ; 114 1308c: 9c e3 ldi r25, 0x3C ; 60 1308e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 13092: ac 01 movw r20, r24 13094: 61 e0 ldi r22, 0x01 ; 1 13096: 80 e0 ldi r24, 0x00 ; 0 13098: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_putc('?'); 1309c: 8f e3 ldi r24, 0x3F ; 63 1309e: 0e 94 04 70 call 0xe008 ; 0xe008 //! @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); 130a2: 40 e0 ldi r20, 0x00 ; 0 130a4: 60 e0 ldi r22, 0x00 ; 0 130a6: 90 e0 ldi r25, 0x00 ; 0 130a8: 80 e0 ldi r24, 0x00 ; 0 130aa: 0f 94 b3 64 call 0x2c966 ; 0x2c966 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")); 130ae: 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) 130b0: 81 11 cpse r24, r1 130b2: 0a c0 rjmp .+20 ; 0x130c8 { enquecommand_P(PSTR("CRASH_RECOVER")); 130b4: 85 ec ldi r24, 0xC5 ; 197 130b6: 96 e8 ldi r25, 0x86 ; 134 } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 130b8: 0e 94 cb 89 call 0x11396 ; 0x11396 SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 130bc: 81 e0 ldi r24, 0x01 ; 1 130be: 80 93 96 02 sts 0x0296, r24 ; 0x800296 ClearToSend(); 130c2: 0e 94 35 81 call 0x1026a ; 0x1026a 130c6: 5e c3 rjmp .+1724 ; 0x13784 { enquecommand_P(PSTR("CRASH_RECOVER")); } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 130c8: 88 eb ldi r24, 0xB8 ; 184 130ca: 96 e8 ldi r25, 0x86 ; 134 130cc: f5 cf rjmp .-22 ; 0x130b8 crashdet_detected(mask); } // ### CRASH_RECOVER - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_RECOVER"))) 130ce: 85 e3 ldi r24, 0x35 ; 53 130d0: 9a e8 ldi r25, 0x8A ; 138 130d2: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 130d6: 88 23 and r24, r24 130d8: 69 f0 breq .+26 ; 0x130f4 } } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); 130da: 0e 94 ba 68 call 0xd174 ; 0xd174 130de: 81 11 cpse r24, r1 130e0: 06 c0 rjmp .+12 ; 0x130ee 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 130e2: 60 e0 ldi r22, 0x00 ; 0 130e4: 70 e0 ldi r23, 0x00 ; 0 130e6: 80 e8 ldi r24, 0x80 ; 128 130e8: 9f e3 ldi r25, 0x3F ; 63 130ea: 0e 94 79 69 call 0xd2f2 ; 0xd2f2 } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); crashdet_use_eeprom_setting(); 130ee: 0f 94 0b 3b call 0x27616 ; 0x27616 130f2: e4 cf rjmp .-56 ; 0x130bc else if(code_seen_P(PSTR("CRASH_RECOVER"))) crashdet_recover(); // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) 130f4: 88 e2 ldi r24, 0x28 ; 40 130f6: 9a e8 ldi r25, 0x8A ; 138 130f8: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 130fc: 88 23 and r24, r24 130fe: f1 f2 breq .-68 ; 0x130bc } /// Crash detection cancels the print void crashdet_cancel() { // Restore crash detection crashdet_use_eeprom_setting(); 13100: 0f 94 0b 3b call 0x27616 ; 0x27616 // Abort the print print_stop(); 13104: 60 e0 ldi r22, 0x00 ; 0 13106: 80 e0 ldi r24, 0x00 ; 0 13108: 0f 94 12 15 call 0x22a24 ; 0x22a24 1310c: d7 cf rjmp .-82 ; 0x130bc // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) crashdet_cancel(); } else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0) 1310e: 44 e0 ldi r20, 0x04 ; 4 13110: 50 e0 ldi r21, 0x00 ; 0 13112: 63 e2 ldi r22, 0x23 ; 35 13114: 7a e8 ldi r23, 0x8A ; 138 13116: c8 01 movw r24, r16 13118: 0f 94 3a db call 0x3b674 ; 0x3b674 1311c: 89 2b or r24, r25 1311e: 09 f0 breq .+2 ; 0x13122 13120: fc c0 rjmp .+504 ; 0x1331a { // ### TMC_SET_WAVE_ // -------------------- if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) 13122: 85 01 movw r16, r10 13124: 06 57 subi r16, 0x76 ; 118 13126: 1f 4e sbci r17, 0xEF ; 239 13128: 49 e0 ldi r20, 0x09 ; 9 1312a: 50 e0 ldi r21, 0x00 ; 0 1312c: 69 e1 ldi r22, 0x19 ; 25 1312e: 7a e8 ldi r23, 0x8A ; 138 13130: c8 01 movw r24, r16 13132: 0f 94 3a db call 0x3b674 ; 0x3b674 13136: 89 2b or r24, r25 13138: c9 f4 brne .+50 ; 0x1316c { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 1313a: f5 01 movw r30, r10 1313c: ed 56 subi r30, 0x6D ; 109 1313e: ff 4e sbci r31, 0xEF ; 239 13140: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 13142: 15 34 cpi r17, 0x45 ; 69 13144: 89 f0 breq .+34 ; 0x13168 13146: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 13148: 14 30 cpi r17, 0x04 ; 4 1314a: 08 f0 brcs .+2 ; 0x1314e 1314c: b7 cf rjmp .-146 ; 0x130bc { uint8_t fac = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 1314e: 4a e0 ldi r20, 0x0A ; 10 13150: 50 e0 ldi r21, 0x00 ; 0 13152: 70 e0 ldi r23, 0x00 ; 0 13154: 60 e0 ldi r22, 0x00 ; 0 13156: c5 01 movw r24, r10 13158: 8c 56 subi r24, 0x6C ; 108 1315a: 9f 4e sbci r25, 0xEF ; 239 1315c: 0f 94 e6 d8 call 0x3b1cc ; 0x3b1cc tmc2130_set_wave(axis, 247, fac); 13160: 81 2f mov r24, r17 13162: 0f 94 28 88 call 0x31050 ; 0x31050 13166: aa cf rjmp .-172 ; 0x130bc // ### 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'); 13168: 13 e0 ldi r17, 0x03 ; 3 1316a: f1 cf rjmp .-30 ; 0x1314e } } // ### TMC_SET_STEP_ // ------------------ else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) 1316c: 49 e0 ldi r20, 0x09 ; 9 1316e: 50 e0 ldi r21, 0x00 ; 0 13170: 6f e0 ldi r22, 0x0F ; 15 13172: 7a e8 ldi r23, 0x8A ; 138 13174: c8 01 movw r24, r16 13176: 0f 94 3a db call 0x3b674 ; 0x3b674 1317a: 89 2b or r24, r25 1317c: 51 f5 brne .+84 ; 0x131d2 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 1317e: f5 01 movw r30, r10 13180: ed 56 subi r30, 0x6D ; 109 13182: ff 4e sbci r31, 0xEF ; 239 13184: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 13186: 15 34 cpi r17, 0x45 ; 69 13188: 11 f1 breq .+68 ; 0x131ce 1318a: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 1318c: 14 30 cpi r17, 0x04 ; 4 1318e: 08 f0 brcs .+2 ; 0x13192 13190: 95 cf rjmp .-214 ; 0x130bc { uint8_t step = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 13192: 4a e0 ldi r20, 0x0A ; 10 13194: 50 e0 ldi r21, 0x00 ; 0 13196: 70 e0 ldi r23, 0x00 ; 0 13198: 60 e0 ldi r22, 0x00 ; 0 1319a: c5 01 movw r24, r10 1319c: 8c 56 subi r24, 0x6C ; 108 1319e: 9f 4e sbci r25, 0xEF ; 239 131a0: 0f 94 e6 d8 call 0x3b1cc ; 0x3b1cc 131a4: e1 2f mov r30, r17 131a6: f0 e0 ldi r31, 0x00 ; 0 131a8: e8 50 subi r30, 0x08 ; 8 131aa: fb 4f sbci r31, 0xFB ; 251 131ac: 80 81 ld r24, Z 131ae: 40 e0 ldi r20, 0x00 ; 0 131b0: 51 e0 ldi r21, 0x01 ; 1 131b2: 02 c0 rjmp .+4 ; 0x131b8 131b4: 56 95 lsr r21 131b6: 47 95 ror r20 131b8: 8a 95 dec r24 131ba: e2 f7 brpl .-8 ; 0x131b4 uint16_t res = tmc2130_get_res(axis); tmc2130_goto_step(axis, step & (4*res - 1), 2, 1000, res); 131bc: 84 2f mov r24, r20 131be: 88 0f add r24, r24 131c0: 88 0f add r24, r24 131c2: 81 50 subi r24, 0x01 ; 1 131c4: 68 23 and r22, r24 131c6: 81 2f mov r24, r17 131c8: 0f 94 3f 8b call 0x3167e ; 0x3167e 131cc: 77 cf rjmp .-274 ; 0x130bc // ### 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'); 131ce: 13 e0 ldi r17, 0x03 ; 3 131d0: e0 cf rjmp .-64 ; 0x13192 } } // ### TMC_SET_CHOP_ // ------------------- else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) 131d2: 49 e0 ldi r20, 0x09 ; 9 131d4: 50 e0 ldi r21, 0x00 ; 0 131d6: 65 e0 ldi r22, 0x05 ; 5 131d8: 7a e8 ldi r23, 0x8A ; 138 131da: c8 01 movw r24, r16 131dc: 0f 94 3a db call 0x3b674 ; 0x3b674 131e0: 89 2b or r24, r25 131e2: 09 f0 breq .+2 ; 0x131e6 131e4: 6b cf rjmp .-298 ; 0x130bc { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 131e6: f5 01 movw r30, r10 131e8: ed 56 subi r30, 0x6D ; 109 131ea: ff 4e sbci r31, 0xEF ; 239 131ec: 80 81 ld r24, Z axis = (axis == 'E')?3:(axis - 'X'); 131ee: 85 34 cpi r24, 0x45 ; 69 131f0: 09 f4 brne .+2 ; 0x131f4 131f2: 90 c0 rjmp .+288 ; 0x13314 131f4: 18 ea ldi r17, 0xA8 ; 168 131f6: c1 2e mov r12, r17 131f8: c8 0e add r12, r24 if (axis < 4) 131fa: b3 e0 ldi r27, 0x03 ; 3 131fc: bc 15 cp r27, r12 131fe: 08 f4 brcc .+2 ; 0x13202 13200: 5d cf rjmp .-326 ; 0x130bc { uint8_t chop0 = tmc2130_chopper_config[axis].toff; 13202: ec 2c mov r14, r12 13204: f1 2c mov r15, r1 13206: 47 01 movw r8, r14 13208: 88 0c add r8, r8 1320a: 99 1c adc r9, r9 1320c: f4 01 movw r30, r8 1320e: e3 58 subi r30, 0x83 ; 131 13210: fd 4f sbci r31, 0xFD ; 253 13212: 00 81 ld r16, Z 13214: 20 2f mov r18, r16 13216: 2f 70 andi r18, 0x0F ; 15 uint8_t chop1 = tmc2130_chopper_config[axis].hstr; 13218: 10 2f mov r17, r16 1321a: 12 95 swap r17 1321c: 17 70 andi r17, 0x07 ; 7 uint8_t chop2 = tmc2130_chopper_config[axis].hend; 1321e: 00 1f adc r16, r16 13220: 00 27 eor r16, r16 13222: 00 1f adc r16, r16 13224: 61 81 ldd r22, Z+1 ; 0x01 13226: 67 70 andi r22, 0x07 ; 7 13228: 66 0f add r22, r22 1322a: 06 2b or r16, r22 uint8_t chop3 = tmc2130_chopper_config[axis].tbl; 1322c: f4 01 movw r30, r8 1322e: e2 58 subi r30, 0x82 ; 130 13230: fd 4f sbci r31, 0xFD ; 253 13232: d0 80 ld r13, Z 13234: d6 94 lsr r13 13236: d6 94 lsr r13 13238: d6 94 lsr r13 1323a: ed 2d mov r30, r13 1323c: e3 70 andi r30, 0x03 ; 3 1323e: de 2e mov r13, r30 char* str_end = 0; 13240: 1a 82 std Y+2, r1 ; 0x02 13242: 19 82 std Y+1, r1 ; 0x01 if (CMDBUFFER_CURRENT_STRING[14]) 13244: c5 01 movw r24, r10 13246: 8c 56 subi r24, 0x6C ; 108 13248: 9f 4e sbci r25, 0xEF ; 239 1324a: dc 01 movw r26, r24 1324c: 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; 1324e: 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]) 13250: 33 23 and r19, r19 13252: e1 f1 breq .+120 ; 0x132cc { chop0 = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, &str_end, 10) & 15; 13254: 4a e0 ldi r20, 0x0A ; 10 13256: 50 e0 ldi r21, 0x00 ; 0 13258: be 01 movw r22, r28 1325a: 6f 5f subi r22, 0xFF ; 255 1325c: 7f 4f sbci r23, 0xFF ; 255 1325e: 0f 94 e6 d8 call 0x3b1cc ; 0x3b1cc 13262: 6f 70 andi r22, 0x0F ; 15 13264: b6 2e mov r11, r22 if (str_end && *str_end) 13266: 89 81 ldd r24, Y+1 ; 0x01 13268: 9a 81 ldd r25, Y+2 ; 0x02 1326a: 00 97 sbiw r24, 0x00 ; 0 1326c: 79 f1 breq .+94 ; 0x132cc 1326e: fc 01 movw r30, r24 13270: 20 81 ld r18, Z 13272: 22 23 and r18, r18 13274: 59 f1 breq .+86 ; 0x132cc { chop1 = (uint8_t)strtol(str_end, &str_end, 10) & 7; 13276: 4a e0 ldi r20, 0x0A ; 10 13278: 50 e0 ldi r21, 0x00 ; 0 1327a: be 01 movw r22, r28 1327c: 6f 5f subi r22, 0xFF ; 255 1327e: 7f 4f sbci r23, 0xFF ; 255 13280: 0f 94 e6 d8 call 0x3b1cc ; 0x3b1cc 13284: 16 2f mov r17, r22 13286: 17 70 andi r17, 0x07 ; 7 if (str_end && *str_end) 13288: 89 81 ldd r24, Y+1 ; 0x01 1328a: 9a 81 ldd r25, Y+2 ; 0x02 1328c: 00 97 sbiw r24, 0x00 ; 0 1328e: f1 f0 breq .+60 ; 0x132cc 13290: dc 01 movw r26, r24 13292: 2c 91 ld r18, X 13294: 22 23 and r18, r18 13296: d1 f0 breq .+52 ; 0x132cc { chop2 = (uint8_t)strtol(str_end, &str_end, 10) & 15; 13298: 4a e0 ldi r20, 0x0A ; 10 1329a: 50 e0 ldi r21, 0x00 ; 0 1329c: be 01 movw r22, r28 1329e: 6f 5f subi r22, 0xFF ; 255 132a0: 7f 4f sbci r23, 0xFF ; 255 132a2: 0f 94 e6 d8 call 0x3b1cc ; 0x3b1cc 132a6: 06 2f mov r16, r22 132a8: 0f 70 andi r16, 0x0F ; 15 if (str_end && *str_end) 132aa: 89 81 ldd r24, Y+1 ; 0x01 132ac: 9a 81 ldd r25, Y+2 ; 0x02 132ae: 00 97 sbiw r24, 0x00 ; 0 132b0: 69 f0 breq .+26 ; 0x132cc 132b2: fc 01 movw r30, r24 132b4: 20 81 ld r18, Z 132b6: 22 23 and r18, r18 132b8: 49 f0 breq .+18 ; 0x132cc chop3 = (uint8_t)strtol(str_end, &str_end, 10) & 3; 132ba: 4a e0 ldi r20, 0x0A ; 10 132bc: 50 e0 ldi r21, 0x00 ; 0 132be: be 01 movw r22, r28 132c0: 6f 5f subi r22, 0xFF ; 255 132c2: 7f 4f sbci r23, 0xFF ; 255 132c4: 0f 94 e6 d8 call 0x3b1cc ; 0x3b1cc 132c8: 63 70 andi r22, 0x03 ; 3 132ca: d6 2e mov r13, r22 } } } tmc2130_chopper_config[axis].toff = chop0; 132cc: f4 01 movw r30, r8 132ce: e3 58 subi r30, 0x83 ; 131 132d0: fd 4f sbci r31, 0xFD ; 253 tmc2130_chopper_config[axis].hstr = chop1 & 7; 132d2: 17 70 andi r17, 0x07 ; 7 132d4: 12 95 swap r17 132d6: 10 7f andi r17, 0xF0 ; 240 tmc2130_chopper_config[axis].hend = chop2 & 15; 132d8: 60 2f mov r22, r16 132da: 67 95 ror r22 132dc: 66 27 eor r22, r22 132de: 67 95 ror r22 132e0: 1b 29 or r17, r11 132e2: 16 2b or r17, r22 132e4: 10 83 st Z, r17 132e6: 60 2f mov r22, r16 132e8: 66 95 lsr r22 132ea: 01 81 ldd r16, Z+1 ; 0x01 132ec: 00 7e andi r16, 0xE0 ; 224 tmc2130_chopper_config[axis].tbl = chop3 & 3; 132ee: 2d 2d mov r18, r13 132f0: 23 70 andi r18, 0x03 ; 3 132f2: d2 2e mov r13, r18 132f4: dd 0c add r13, r13 132f6: dd 0c add r13, r13 132f8: dd 0c add r13, r13 132fa: 06 2b or r16, r22 132fc: d0 2a or r13, r16 132fe: d1 82 std Z+1, r13 ; 0x01 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 13300: f7 01 movw r30, r14 13302: e8 50 subi r30, 0x08 ; 8 13304: fb 4f sbci r31, 0xFB ; 251 13306: 50 e0 ldi r21, 0x00 ; 0 13308: 40 e0 ldi r20, 0x00 ; 0 1330a: 60 81 ld r22, Z 1330c: 8c 2d mov r24, r12 1330e: 0f 94 45 39 call 0x2728a ; 0x2728a 13312: d4 ce rjmp .-600 ; 0x130bc // ### 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'); 13314: b3 e0 ldi r27, 0x03 ; 3 13316: cb 2e mov r12, r27 13318: 74 cf rjmp .-280 ; 0x13202 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) { 1331a: 45 e0 ldi r20, 0x05 ; 5 1331c: 50 e0 ldi r21, 0x00 ; 0 1331e: 6f ef ldi r22, 0xFF ; 255 13320: 79 e8 ldi r23, 0x89 ; 137 13322: c8 01 movw r24, r16 13324: 0f 94 3a db call 0x3b674 ; 0x3b674 13328: 89 2b or r24, r25 1332a: 09 f0 breq .+2 ; 0x1332e 1332c: 64 c1 rjmp .+712 ; 0x135f6 - `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"))) { 1332e: 85 ef ldi r24, 0xF5 ; 245 13330: 99 e8 ldi r25, 0x89 ; 137 13332: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 13336: 88 23 and r24, r24 13338: 09 f4 brne .+2 ; 0x1333c 1333a: 3c c0 rjmp .+120 ; 0x133b4 //! 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 1333c: 10 92 36 05 sts 0x0536, r1 ; 0x800536 13340: 14 e6 ldi r17, 0x64 ; 100 unsigned long tach1max = 0; 13342: c1 2c mov r12, r1 13344: d1 2c mov r13, r1 13346: 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); 13348: 6f 9a sbi 0x0d, 7 ; 13 WRITE(TACH_1, LOW); 1334a: 77 98 cbi 0x0e, 7 ; 14 _delay(20); // the delay may be lower 1334c: 64 e1 ldi r22, 0x14 ; 20 1334e: 70 e0 ldi r23, 0x00 ; 0 13350: 80 e0 ldi r24, 0x00 ; 0 13352: 90 e0 ldi r25, 0x00 ; 0 13354: 0f 94 8d 3c call 0x2791a ; 0x2791a unsigned long tachMeasure = _micros(); 13358: 0f 94 67 3c call 0x278ce ; 0x278ce 1335c: 4b 01 movw r8, r22 1335e: 5c 01 movw r10, r24 cli(); 13360: f8 94 cli SET_INPUT(TACH_1); 13362: 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 ) ; 13364: 67 9b sbis 0x0c, 7 ; 12 13366: fe cf rjmp .-4 ; 0x13364 sei(); 13368: 78 94 sei tachMeasure = _micros() - tachMeasure; 1336a: 0f 94 67 3c call 0x278ce ; 0x278ce 1336e: dc 01 movw r26, r24 13370: cb 01 movw r24, r22 13372: 88 19 sub r24, r8 13374: 99 09 sbc r25, r9 13376: aa 09 sbc r26, r10 13378: bb 09 sbc r27, r11 1337a: c8 16 cp r12, r24 1337c: d9 06 cpc r13, r25 1337e: ea 06 cpc r14, r26 13380: fb 06 cpc r15, r27 13382: 10 f4 brcc .+4 ; 0x13388 13384: 6c 01 movw r12, r24 13386: 7d 01 movw r14, r26 13388: 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){ 1338a: f1 f6 brne .-68 ; 0x13348 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 "); 1338c: 8d ea ldi r24, 0xAD ; 173 1338e: 96 e8 ldi r25, 0x86 ; 134 13390: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if( tach1max > 500 ){ // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); 13394: 89 ea ldi r24, 0xA9 ; 169 13396: 96 e8 ldi r25, 0x86 ; 134 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 ){ 13398: 35 ef ldi r19, 0xF5 ; 245 1339a: c3 16 cp r12, r19 1339c: 31 e0 ldi r19, 0x01 ; 1 1339e: d3 06 cpc r13, r19 133a0: e1 04 cpc r14, r1 133a2: f1 04 cpc r15, r1 133a4: 10 f4 brcc .+4 ; 0x133aa // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); } else { SERIAL_PROTOCOLLNPGM("OK"); 133a6: 86 ea ldi r24, 0xA6 ; 166 133a8: 96 e8 ldi r25, 0x86 ; 134 133aa: 0e 94 86 7b call 0xf70c ; 0xf70c } // cleanup after the test function SET_INPUT(TACH_1); 133ae: 6f 98 cbi 0x0d, 7 ; 13 WRITE(TACH_1, HIGH); 133b0: 77 9a sbi 0x0e, 7 ; 14 133b2: 84 ce rjmp .-760 ; 0x130bc */ if (farm_prusa_code_seen()) {} else if(code_seen_P(PSTR("FANPINTST"))) { gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 133b4: 81 ef ldi r24, 0xF1 ; 241 133b6: 99 e8 ldi r25, 0x89 ; 137 133b8: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 133bc: 88 23 and r24, r24 133be: 21 f1 breq .+72 ; 0x13408 printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 133c0: 40 91 b3 04 lds r20, 0x04B3 ; 0x8004b3 133c4: 50 91 b4 04 lds r21, 0x04B4 ; 0x8004b4 133c8: 2c e3 ldi r18, 0x3C ; 60 133ca: 24 9f mul r18, r20 133cc: c0 01 movw r24, r0 133ce: 25 9f mul r18, r21 133d0: 90 0d add r25, r0 133d2: 11 24 eor r1, r1 133d4: 9f 93 push r25 133d6: 8f 93 push r24 133d8: 40 91 b1 04 lds r20, 0x04B1 ; 0x8004b1 133dc: 50 91 b2 04 lds r21, 0x04B2 ; 0x8004b2 133e0: 24 9f mul r18, r20 133e2: c0 01 movw r24, r0 133e4: 25 9f mul r18, r21 133e6: 90 0d add r25, r0 133e8: 11 24 eor r1, r1 133ea: 9f 93 push r25 133ec: 8f 93 push r24 133ee: 84 e7 ldi r24, 0x74 ; 116 133f0: 9b e6 ldi r25, 0x6B ; 107 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 133f2: 9f 93 push r25 133f4: 8f 93 push r24 133f6: 0f 94 1d dc call 0x3b83a ; 0x3b83a 133fa: 0f 90 pop r0 133fc: 0f 90 pop r0 133fe: 0f 90 pop r0 13400: 0f 90 pop r0 13402: 0f 90 pop r0 13404: 0f 90 pop r0 13406: 5a ce rjmp .-844 ; 0x130bc 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 13408: 8c ee ldi r24, 0xEC ; 236 1340a: 99 e8 ldi r25, 0x89 ; 137 1340c: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 13410: 88 23 and r24, r24 13412: 11 f1 breq .+68 ; 0x13458 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 13414: 8c e8 ldi r24, 0x8C ; 140 13416: 9f e0 ldi r25, 0x0F ; 15 13418: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1341c: 81 11 cpse r24, r1 1341e: 10 c0 rjmp .+32 ; 0x13440 // M24 - Start SD print enquecommand_P(MSG_M24); 13420: 61 e0 ldi r22, 0x01 ; 1 13422: 8d e8 ldi r24, 0x8D ; 141 13424: 91 e7 ldi r25, 0x71 ; 113 13426: 0e 94 cb 89 call 0x11396 ; 0x11396 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1342a: 60 e0 ldi r22, 0x00 ; 0 1342c: 85 ea ldi r24, 0xA5 ; 165 1342e: 9f e0 ldi r25, 0x0F ; 15 13430: 0f 94 7f dd call 0x3bafe ; 0x3bafe 13434: 60 e0 ldi r22, 0x00 ; 0 13436: 8f e7 ldi r24, 0x7F ; 127 13438: 9c e0 ldi r25, 0x0C ; 12 1343a: 0f 94 7f dd call 0x3bafe ; 0x3bafe 1343e: 3e ce rjmp .-900 ; 0x130bc // 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) { 13440: 81 30 cpi r24, 0x01 ; 1 13442: 09 f0 breq .+2 ; 0x13446 13444: 3b ce rjmp .-906 ; 0x130bc // 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(); 13446: 0f 94 cc 57 call 0x2af98 ; 0x2af98 usb_timer.start(); 1344a: 81 e1 ldi r24, 0x11 ; 17 1344c: 95 e0 ldi r25, 0x05 ; 5 1344e: 0f 94 e7 3e call 0x27dce ; 0x27dce ::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(); 13452: 0f 94 92 3e call 0x27d24 ; 0x27d24 13456: 32 ce rjmp .-924 ; 0x130bc } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 13458: 85 ee ldi r24, 0xE5 ; 229 1345a: 99 e8 ldi r25, 0x89 ; 137 1345c: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 13460: 88 23 and r24, r24 13462: 21 f0 breq .+8 ; 0x1346c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 13464: 80 e0 ldi r24, 0x00 ; 0 13466: 0f 94 b7 1c call 0x2396e ; 0x2396e 1346a: 28 ce rjmp .-944 ; 0x130bc MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 1346c: 8f ed ldi r24, 0xDF ; 223 1346e: 99 e8 ldi r25, 0x89 ; 137 13470: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 13474: 88 23 and r24, r24 13476: 51 f0 breq .+20 ; 0x1348c #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; 13478: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e3> 1347c: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e4> 13480: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e5> 13484: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e6> #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 13488: 0e 94 81 68 call 0xd102 ; 0xd102 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 1348c: 8c ed ldi r24, 0xDC ; 220 1348e: 99 e8 ldi r25, 0x89 ; 137 13490: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 13494: 88 23 and r24, r24 13496: a9 f0 breq .+42 ; 0x134c2 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 13498: 44 e1 ldi r20, 0x14 ; 20 1349a: 50 e0 ldi r21, 0x00 ; 0 1349c: 65 e1 ldi r22, 0x15 ; 21 1349e: 7d e0 ldi r23, 0x0D ; 13 134a0: ce 01 movw r24, r28 134a2: 01 96 adiw r24, 0x01 ; 1 134a4: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 if (SN[19]) 134a8: 8c 89 ldd r24, Y+20 ; 0x14 134aa: 88 23 and r24, r24 134ac: 29 f0 breq .+10 ; 0x134b8 puts_P(PSTR("SN invalid")); 134ae: 81 ed ldi r24, 0xD1 ; 209 134b0: 99 e8 ldi r25, 0x89 ; 137 134b2: 0f 94 44 dc call 0x3b888 ; 0x3b888 134b6: 02 ce rjmp .-1020 ; 0x130bc else puts(SN); 134b8: ce 01 movw r24, r28 134ba: 01 96 adiw r24, 0x01 ; 1 134bc: 0f 94 ea e3 call 0x3c7d4 ; 0x3c7d4 134c0: fd cd rjmp .-1030 ; 0x130bc } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 134c2: 8d ec ldi r24, 0xCD ; 205 134c4: 99 e8 ldi r25, 0x89 ; 137 134c6: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 134ca: 88 23 and r24, r24 134cc: 29 f0 breq .+10 ; 0x134d8 SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 134ce: 81 ec ldi r24, 0xC1 ; 193 134d0: 99 e8 ldi r25, 0x89 ; 137 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 134d2: 0e 94 86 7b call 0xf70c ; 0xf70c 134d6: f2 cd rjmp .-1052 ; 0x130bc 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 134d8: 8d eb ldi r24, 0xBD ; 189 134da: 99 e8 ldi r25, 0x89 ; 137 134dc: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 134e0: 88 23 and r24, r24 134e2: 19 f0 breq .+6 ; 0x134ea SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 134e4: 88 e9 ldi r24, 0x98 ; 152 134e6: 99 e8 ldi r25, 0x89 ; 137 134e8: f4 cf rjmp .-24 ; 0x134d2 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 134ea: 83 e9 ldi r24, 0x93 ; 147 134ec: 99 e8 ldi r25, 0x89 ; 137 134ee: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 134f2: 88 23 and r24, r24 134f4: 19 f0 breq .+6 ; 0x134fc lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 134f6: 0e 94 61 72 call 0xe4c2 ; 0xe4c2 134fa: e0 cd rjmp .-1088 ; 0x130bc 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 134fc: 80 e9 ldi r24, 0x90 ; 144 134fe: 99 e8 ldi r25, 0x89 ; 137 13500: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 13504: 88 23 and r24, r24 13506: 79 f0 breq .+30 ; 0x13526 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 13508: 81 ea ldi r24, 0xA1 ; 161 1350a: 9d e0 ldi r25, 0x0D ; 13 1350c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 13510: 4b e0 ldi r20, 0x0B ; 11 13512: 84 9f mul r24, r20 13514: c0 01 movw r24, r0 13516: 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); 13518: 70 e0 ldi r23, 0x00 ; 0 1351a: 60 e0 ldi r22, 0x00 ; 0 1351c: 80 5b subi r24, 0xB0 ; 176 1351e: 92 4f sbci r25, 0xF2 ; 242 13520: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 13524: cb cd rjmp .-1130 ; 0x130bc } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 13526: 8d e8 ldi r24, 0x8D ; 141 13528: 99 e8 ldi r25, 0x89 ; 137 1352a: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 1352e: 88 23 and r24, r24 13530: 51 f0 breq .+20 ; 0x13546 // 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(); 13532: 0e 94 48 70 call 0xe090 ; 0xe090 Sound_MakeCustom(100,0,false); 13536: 40 e0 ldi r20, 0x00 ; 0 13538: 70 e0 ldi r23, 0x00 ; 0 1353a: 60 e0 ldi r22, 0x00 ; 0 1353c: 84 e6 ldi r24, 0x64 ; 100 1353e: 90 e0 ldi r25, 0x00 ; 0 13540: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc 13544: d8 cf rjmp .-80 ; 0x134f6 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 13546: 89 e8 ldi r24, 0x89 ; 137 13548: 99 e8 ldi r25, 0x89 ; 137 1354a: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 1354e: 88 23 and r24, r24 13550: e1 f0 breq .+56 ; 0x1358a // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 13552: 86 e5 ldi r24, 0x56 ; 86 13554: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 13558: 88 23 and r24, r24 1355a: 09 f4 brne .+2 ; 0x1355e 1355c: af cd rjmp .-1186 ; 0x130bc bool value = code_value_short(); 1355e: 0e 94 9b 5c call 0xb936 ; 0xb936 13562: 11 e0 ldi r17, 0x01 ; 1 13564: 89 2b or r24, r25 13566: 09 f4 brne .+2 ; 0x1356a 13568: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 1356a: 0f 94 27 58 call 0x2b04e ; 0x2b04e if(value != mbl.active) { 1356e: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 13572: 90 e0 ldi r25, 0x00 ; 0 13574: 18 17 cp r17, r24 13576: 19 06 cpc r1, r25 13578: 09 f4 brne .+2 ; 0x1357c 1357a: a0 cd rjmp .-1216 ; 0x130bc mbl.active = value; 1357c: 10 93 a0 13 sts 0x13A0, r17 ; 0x8013a0 // Use plan_set_z_position to reset the physical values plan_set_z_position(current_position[Z_AXIS]); 13580: 8b e4 ldi r24, 0x4B ; 75 13582: 97 e0 ldi r25, 0x07 ; 7 13584: 0f 94 e1 aa call 0x355c2 ; 0x355c2 13588: 99 cd rjmp .-1230 ; 0x130bc } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 1358a: 82 e8 ldi r24, 0x82 ; 130 1358c: 99 e8 ldi r25, 0x89 ; 137 1358e: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 13592: 88 23 and r24, r24 13594: 09 f4 brne .+2 ; 0x13598 13596: 92 cd rjmp .-1244 ; 0x130bc uint16_t nDiameter; if(code_seen('D')) { 13598: 84 e4 ldi r24, 0x44 ; 68 1359a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1359e: 88 23 and r24, r24 135a0: a1 f0 breq .+40 ; 0x135ca nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 135a2: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 135a6: 20 e0 ldi r18, 0x00 ; 0 135a8: 30 e0 ldi r19, 0x00 ; 0 135aa: 4a e7 ldi r20, 0x7A ; 122 135ac: 54 e4 ldi r21, 0x44 ; 68 135ae: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 135b2: 20 e0 ldi r18, 0x00 ; 0 135b4: 30 e0 ldi r19, 0x00 ; 0 135b6: 40 e0 ldi r20, 0x00 ; 0 135b8: 5f e3 ldi r21, 0x3F ; 63 135ba: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 135be: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> nozzle_diameter_check(nDiameter); 135c2: cb 01 movw r24, r22 135c4: 0f 94 a8 15 call 0x22b50 ; 0x22b50 135c8: 79 cd rjmp .-1294 ; 0x130bc } else if(code_seen_P(PSTR("set")) && farm_mode) { 135ca: 8e e7 ldi r24, 0x7E ; 126 135cc: 99 e8 ldi r25, 0x89 ; 137 135ce: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 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); 135d2: 85 ea ldi r24, 0xA5 ; 165 135d4: 9d e0 ldi r25, 0x0D ; 13 135d6: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 135da: bc 01 movw r22, r24 135dc: 90 e0 ldi r25, 0x00 ; 0 135de: 80 e0 ldi r24, 0x00 ; 0 135e0: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 135e4: 20 e0 ldi r18, 0x00 ; 0 135e6: 30 e0 ldi r19, 0x00 ; 0 135e8: 4a e7 ldi r20, 0x7A ; 122 135ea: 54 e4 ldi r21, 0x44 ; 68 135ec: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 135f0: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e 135f4: 63 cd rjmp .-1338 ; 0x130bc } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 135f6: d8 01 movw r26, r16 135f8: 8c 91 ld r24, X 135fa: 87 34 cpi r24, 0x47 ; 71 135fc: 11 f0 breq .+4 ; 0x13602 135fe: 0c 94 96 a6 jmp 0x14d2c ; 0x14d2c { strchr_pointer = CMDBUFFER_CURRENT_STRING; 13602: 10 93 98 03 sts 0x0398, r17 ; 0x800398 13606: 00 93 97 03 sts 0x0397, r16 ; 0x800397 gcode_in_progress = code_value_short(); 1360a: 0e 94 9b 5c call 0xb936 ; 0xb936 1360e: 90 93 96 03 sts 0x0396, r25 ; 0x800396 13612: 80 93 95 03 sts 0x0395, r24 ; 0x800395 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 13616: 8e 31 cpi r24, 0x1E ; 30 13618: 91 05 cpc r25, r1 1361a: 09 f4 brne .+2 ; 0x1361e 1361c: da c6 rjmp .+3508 ; 0x143d2 1361e: 0c f0 brlt .+2 ; 0x13622 13620: 45 c1 rjmp .+650 ; 0x138ac 13622: 84 30 cpi r24, 0x04 ; 4 13624: 91 05 cpc r25, r1 13626: 09 f4 brne .+2 ; 0x1362a 13628: 7e c6 rjmp .+3324 ; 0x14326 1362a: 0c f0 brlt .+2 ; 0x1362e 1362c: c5 c0 rjmp .+394 ; 0x137b8 1362e: 97 fd sbrc r25, 7 13630: cb c0 rjmp .+406 ; 0x137c8 13632: 02 97 sbiw r24, 0x02 ; 2 13634: 0c f0 brlt .+2 ; 0x13638 13636: fc c1 rjmp .+1016 ; 0x13a30 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 13638: 0e 94 99 5b call 0xb732 ; 0xb732 1363c: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 1363e: 0e 94 f9 62 call 0xc5f2 ; 0xc5f2 if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 13642: 60 91 62 06 lds r22, 0x0662 ; 0x800662 13646: 70 91 63 06 lds r23, 0x0663 ; 0x800663 1364a: 80 91 64 06 lds r24, 0x0664 ; 0x800664 1364e: 90 91 65 06 lds r25, 0x0665 ; 0x800665 13652: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 13656: 6b 01 movw r12, r22 13658: 7c 01 movw r14, r24 1365a: 40 90 4f 07 lds r4, 0x074F ; 0x80074f 1365e: 50 90 50 07 lds r5, 0x0750 ; 0x800750 13662: 60 90 51 07 lds r6, 0x0751 ; 0x800751 13666: 70 90 52 07 lds r7, 0x0752 ; 0x800752 1366a: 80 90 60 05 lds r8, 0x0560 ; 0x800560 1366e: 90 90 61 05 lds r9, 0x0561 ; 0x800561 13672: a0 90 62 05 lds r10, 0x0562 ; 0x800562 13676: b0 90 63 05 lds r11, 0x0563 ; 0x800563 1367a: a5 01 movw r20, r10 1367c: 94 01 movw r18, r8 1367e: c3 01 movw r24, r6 13680: b2 01 movw r22, r4 13682: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 13686: 20 e0 ldi r18, 0x00 ; 0 13688: 30 e0 ldi r19, 0x00 ; 0 1368a: 48 ec ldi r20, 0xC8 ; 200 1368c: 52 e4 ldi r21, 0x42 ; 66 1368e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13692: 9b 01 movw r18, r22 13694: ac 01 movw r20, r24 13696: c7 01 movw r24, r14 13698: b6 01 movw r22, r12 1369a: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1369e: 18 16 cp r1, r24 136a0: d4 f4 brge .+52 ; 0x136d6 total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 136a2: a3 01 movw r20, r6 136a4: 92 01 movw r18, r4 136a6: c5 01 movw r24, r10 136a8: b4 01 movw r22, r8 136aa: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 136ae: 20 e0 ldi r18, 0x00 ; 0 136b0: 30 e0 ldi r19, 0x00 ; 0 136b2: 48 ec ldi r20, 0xC8 ; 200 136b4: 52 e4 ldi r21, 0x42 ; 66 136b6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 136ba: a7 01 movw r20, r14 136bc: 96 01 movw r18, r12 136be: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 136c2: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 136c6: 60 93 62 06 sts 0x0662, r22 ; 0x800662 136ca: 70 93 63 06 sts 0x0663, r23 ; 0x800663 136ce: 80 93 64 06 sts 0x0664, r24 ; 0x800664 136d2: 90 93 65 06 sts 0x0665, r25 ; 0x800665 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 136d6: 80 91 f0 06 lds r24, 0x06F0 ; 0x8006f0 136da: 88 23 and r24, r24 136dc: 09 f4 brne .+2 ; 0x136e0 136de: a4 c1 rjmp .+840 ; 0x13a28 if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 136e0: 88 e5 ldi r24, 0x58 ; 88 136e2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 136e6: 81 11 cpse r24, r1 136e8: 9f c1 rjmp .+830 ; 0x13a28 136ea: 89 e5 ldi r24, 0x59 ; 89 136ec: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 136f0: 81 11 cpse r24, r1 136f2: 9a c1 rjmp .+820 ; 0x13a28 136f4: 8a e5 ldi r24, 0x5A ; 90 136f6: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 136fa: 81 11 cpse r24, r1 136fc: 95 c1 rjmp .+810 ; 0x13a28 136fe: 85 e4 ldi r24, 0x45 ; 69 13700: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 13704: 88 23 and r24, r24 13706: 09 f4 brne .+2 ; 0x1370a 13708: 8f c1 rjmp .+798 ; 0x13a28 float echange=destination[E_AXIS]-current_position[E_AXIS]; 1370a: 20 91 4f 07 lds r18, 0x074F ; 0x80074f 1370e: 30 91 50 07 lds r19, 0x0750 ; 0x800750 13712: 40 91 51 07 lds r20, 0x0751 ; 0x800751 13716: 50 91 52 07 lds r21, 0x0752 ; 0x800752 1371a: 60 91 60 05 lds r22, 0x0560 ; 0x800560 1371e: 70 91 61 05 lds r23, 0x0561 ; 0x800561 13722: 80 91 62 05 lds r24, 0x0562 ; 0x800562 13726: 90 91 63 05 lds r25, 0x0563 ; 0x800563 1372a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1372e: 6b 01 movw r12, r22 13730: 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 13732: 2d ec ldi r18, 0xCD ; 205 13734: 3c ec ldi r19, 0xCC ; 204 13736: 4c ec ldi r20, 0xCC ; 204 13738: 5d eb ldi r21, 0xBD ; 189 1373a: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1373e: 87 ff sbrs r24, 7 13740: 65 c1 rjmp .+714 ; 0x13a0c 13742: 80 91 3f 07 lds r24, 0x073F ; 0x80073f 13746: 81 11 cpse r24, r1 13748: 0c 94 4b ce jmp 0x19c96 ; 0x19c96 st_synchronize(); 1374c: 0f 94 27 58 call 0x2b04e ; 0x2b04e current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 13750: 80 91 60 05 lds r24, 0x0560 ; 0x800560 13754: 90 91 61 05 lds r25, 0x0561 ; 0x800561 13758: a0 91 62 05 lds r26, 0x0562 ; 0x800562 1375c: b0 91 63 05 lds r27, 0x0563 ; 0x800563 13760: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 13764: 90 93 50 07 sts 0x0750, r25 ; 0x800750 13768: a0 93 51 07 sts 0x0751, r26 ; 0x800751 1376c: b0 93 52 07 sts 0x0752, r27 ; 0x800752 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 13770: 8f e4 ldi r24, 0x4F ; 79 13772: 97 e0 ldi r25, 0x07 ; 7 13774: 0f 94 ae aa call 0x3555c ; 0x3555c retract(!retracted[active_extruder]); 13778: 90 91 3f 07 lds r25, 0x073F ; 0x80073f 1377c: 81 e0 ldi r24, 0x01 ; 1 1377e: 89 27 eor r24, r25 13780: 0f 94 c4 89 call 0x31388 ; 0x31388 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 13784: c1 57 subi r28, 0x71 ; 113 13786: df 4f sbci r29, 0xFF ; 255 13788: 0f b6 in r0, 0x3f ; 63 1378a: f8 94 cli 1378c: de bf out 0x3e, r29 ; 62 1378e: 0f be out 0x3f, r0 ; 63 13790: cd bf out 0x3d, r28 ; 61 13792: df 91 pop r29 13794: cf 91 pop r28 13796: 1f 91 pop r17 13798: 0f 91 pop r16 1379a: ff 90 pop r15 1379c: ef 90 pop r14 1379e: df 90 pop r13 137a0: cf 90 pop r12 137a2: bf 90 pop r11 137a4: af 90 pop r10 137a6: 9f 90 pop r9 137a8: 8f 90 pop r8 137aa: 7f 90 pop r7 137ac: 6f 90 pop r6 137ae: 5f 90 pop r5 137b0: 4f 90 pop r4 137b2: 3f 90 pop r3 137b4: 2f 90 pop r2 137b6: 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) 137b8: 8b 30 cpi r24, 0x0B ; 11 137ba: 91 05 cpc r25, r1 137bc: 09 f4 brne .+2 ; 0x137c0 137be: 00 c6 rjmp .+3072 ; 0x143c0 137c0: dc f4 brge .+54 ; 0x137f8 137c2: 0a 97 sbiw r24, 0x0a ; 10 137c4: 09 f4 brne .+2 ; 0x137c8 137c6: f8 c5 rjmp .+3056 ; 0x143b8 case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 137c8: 80 91 70 12 lds r24, 0x1270 ; 0x801270 137cc: 90 91 71 12 lds r25, 0x1271 ; 0x801271 137d0: 8a 57 subi r24, 0x7A ; 122 137d2: 9f 4e sbci r25, 0xEF ; 239 137d4: 9f 93 push r25 137d6: 8f 93 push r24 137d8: 1f 92 push r1 137da: 87 e4 ldi r24, 0x47 ; 71 137dc: 8f 93 push r24 137de: 86 e9 ldi r24, 0x96 ; 150 137e0: 9a e6 ldi r25, 0x6A ; 106 137e2: 9f 93 push r25 137e4: 8f 93 push r24 137e6: 0f 94 1d dc call 0x3b83a ; 0x3b83a 137ea: 0f 90 pop r0 137ec: 0f 90 pop r0 137ee: 0f 90 pop r0 137f0: 0f 90 pop r0 137f2: 0f 90 pop r0 137f4: 0f 90 pop r0 137f6: a5 c0 rjmp .+330 ; 0x13942 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) 137f8: 85 31 cpi r24, 0x15 ; 21 137fa: 91 05 cpc r25, r1 137fc: 09 f4 brne .+2 ; 0x13800 137fe: a1 c0 rjmp .+322 ; 0x13942 13800: 4c 97 sbiw r24, 0x1c ; 28 13802: 11 f7 brne .-60 ; 0x137c8 { 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]); 13804: 88 e5 ldi r24, 0x58 ; 88 13806: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1380a: 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; 1380c: 41 2c mov r4, r1 1380e: 51 2c mov r5, r1 13810: 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(); 13812: 88 23 and r24, r24 13814: 21 f0 breq .+8 ; 0x1381e 13816: 0e 94 a8 5c call 0xb950 ; 0xb950 1381a: 2b 01 movw r4, r22 1381c: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 1381e: 89 e5 ldi r24, 0x59 ; 89 13820: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 13824: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 13826: 88 23 and r24, r24 13828: 09 f4 brne .+2 ; 0x1382c 1382a: cc c5 rjmp .+2968 ; 0x143c4 1382c: 0e 94 a8 5c call 0xb950 ; 0xb950 13830: 6e 96 adiw r28, 0x1e ; 30 13832: 6c af std Y+60, r22 ; 0x3c 13834: 7d af std Y+61, r23 ; 0x3d 13836: 8e af std Y+62, r24 ; 0x3e 13838: 9f af std Y+63, r25 ; 0x3f 1383a: 6e 97 sbiw r28, 0x1e ; 30 bool home_z = code_seen(axis_codes[Z_AXIS]); 1383c: 8a e5 ldi r24, 0x5A ; 90 1383e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 13842: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 13844: 81 2c mov r8, r1 13846: 91 2c mov r9, r1 13848: 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(); 1384a: 88 23 and r24, r24 1384c: 21 f0 breq .+8 ; 0x13856 1384e: 0e 94 a8 5c call 0xb950 ; 0xb950 13852: 4b 01 movw r8, r22 13854: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 13856: 87 e5 ldi r24, 0x57 ; 87 13858: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1385c: 67 96 adiw r28, 0x17 ; 23 1385e: 8f af std Y+63, r24 ; 0x3f 13860: 67 97 sbiw r28, 0x17 ; 23 // calibrate? #ifdef TMC2130 bool calib = code_seen('C'); 13862: 83 e4 ldi r24, 0x43 ; 67 13864: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, calib, without_mbl); 13868: 67 96 adiw r28, 0x17 ; 23 1386a: ff ad ldd r31, Y+63 ; 0x3f 1386c: 67 97 sbiw r28, 0x17 ; 23 1386e: ff 93 push r31 13870: 8f 93 push r24 13872: cd 2c mov r12, r13 13874: 6e 96 adiw r28, 0x1e ; 30 13876: ec ac ldd r14, Y+60 ; 0x3c 13878: fd ac ldd r15, Y+61 ; 0x3d 1387a: 0e ad ldd r16, Y+62 ; 0x3e 1387c: 1f ad ldd r17, Y+63 ; 0x3f 1387e: 6e 97 sbiw r28, 0x1e ; 30 13880: 22 2d mov r18, r2 13882: b3 01 movw r22, r6 13884: a2 01 movw r20, r4 13886: 83 2d mov r24, r3 13888: 0e 94 32 7f call 0xfe64 ; 0xfe64 #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) { 1388c: 0f 90 pop r0 1388e: 0f 90 pop r0 13890: 31 10 cpse r3, r1 13892: 57 c0 rjmp .+174 ; 0x13942 13894: 21 10 cpse r2, r1 13896: 55 c0 rjmp .+170 ; 0x13942 13898: 67 96 adiw r28, 0x17 ; 23 1389a: 2f ad ldd r18, Y+63 ; 0x3f 1389c: 67 97 sbiw r28, 0x17 ; 23 1389e: 21 11 cpse r18, r1 138a0: 50 c0 rjmp .+160 ; 0x13942 138a2: d1 10 cpse r13, r1 138a4: 4e c0 rjmp .+156 ; 0x13942 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 138a6: 0e 94 19 90 call 0x12032 ; 0x12032 138aa: 4b c0 rjmp .+150 ; 0x13942 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) 138ac: 86 35 cpi r24, 0x56 ; 86 138ae: 91 05 cpc r25, r1 138b0: 11 f4 brne .+4 ; 0x138b6 138b2: 0c 94 45 a6 jmp 0x14c8a ; 0x14c8a 138b6: b4 f5 brge .+108 ; 0x13924 138b8: 8c 34 cpi r24, 0x4C ; 76 138ba: 91 05 cpc r25, r1 138bc: 09 f4 brne .+2 ; 0x138c0 138be: df c5 rjmp .+3006 ; 0x1447e 138c0: 3c f5 brge .+78 ; 0x13910 138c2: 08 e2 ldi r16, 0x28 ; 40 138c4: 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)); 138c6: 76 e4 ldi r23, 0x46 ; 70 138c8: e7 2e mov r14, r23 138ca: 7b e6 ldi r23, 0x6B ; 107 138cc: f7 2e mov r15, r23 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) 138ce: 8b 34 cpi r24, 0x4B ; 75 138d0: 91 05 cpc r25, r1 138d2: 09 f0 breq .+2 ; 0x138d6 138d4: 79 cf rjmp .-270 ; 0x137c8 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)); 138d6: 60 2f mov r22, r16 138d8: 70 e0 ldi r23, 0x00 ; 0 138da: 90 e0 ldi r25, 0x00 ; 0 138dc: 80 e0 ldi r24, 0x00 ; 0 138de: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 138e2: 0e 94 bf 5d call 0xbb7e ; 0xbb7e 138e6: 9f 93 push r25 138e8: 8f 93 push r24 138ea: 7f 93 push r23 138ec: 6f 93 push r22 138ee: 1f 93 push r17 138f0: 0f 93 push r16 138f2: ff 92 push r15 138f4: ef 92 push r14 138f6: 0f 94 1d dc call 0x3b83a ; 0x3b83a 138fa: 0f 5f subi r16, 0xFF ; 255 138fc: 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++) 138fe: 0f b6 in r0, 0x3f ; 63 13900: f8 94 cli 13902: de bf out 0x3e, r29 ; 62 13904: 0f be out 0x3f, r0 ; 63 13906: cd bf out 0x3d, r28 ; 61 13908: 0f 36 cpi r16, 0x6F ; 111 1390a: 11 05 cpc r17, r1 1390c: 21 f7 brne .-56 ; 0x138d6 1390e: 19 c0 rjmp .+50 ; 0x13942 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) 13910: 80 35 cpi r24, 0x50 ; 80 13912: 91 05 cpc r25, r1 13914: 41 f2 breq .-112 ; 0x138a6 13916: 81 35 cpi r24, 0x51 ; 81 13918: 91 05 cpc r25, r1 1391a: 09 f0 breq .+2 ; 0x1391e 1391c: 55 cf rjmp .-342 ; 0x137c8 /*! ### 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(); 1391e: 0e 94 66 81 call 0x102cc ; 0x102cc 13922: 0f c0 rjmp .+30 ; 0x13942 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) 13924: 8a 35 cpi r24, 0x5A ; 90 13926: 91 05 cpc r25, r1 13928: 11 f4 brne .+4 ; 0x1392e 1392a: 0c 94 4f a6 jmp 0x14c9e ; 0x14c9e 1392e: 74 f4 brge .+28 ; 0x1394c 13930: 87 35 cpi r24, 0x57 ; 87 13932: 91 05 cpc r25, r1 13934: 11 f4 brne .+4 ; 0x1393a 13936: 0c 94 4a a6 jmp 0x14c94 ; 0x14c94 1393a: 88 35 cpi r24, 0x58 ; 88 1393c: 91 05 cpc r25, r1 1393e: 09 f0 breq .+2 ; 0x13942 13940: 43 cf rjmp .-378 ; 0x137c8 #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; 13942: 10 92 96 03 sts 0x0396, r1 ; 0x800396 13946: 10 92 95 03 sts 0x0395, r1 ; 0x800395 1394a: b8 cb rjmp .-2192 ; 0x130bc 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) 1394c: 8b 35 cpi r24, 0x5B ; 91 1394e: 91 05 cpc r25, r1 13950: 11 f4 brne .+4 ; 0x13956 13952: 0c 94 56 a6 jmp 0x14cac ; 0x14cac 13956: 8c 35 cpi r24, 0x5C ; 92 13958: 91 05 cpc r25, r1 1395a: 09 f0 breq .+2 ; 0x1395e 1395c: 35 cf rjmp .-406 ; 0x137c8 1395e: fd ed ldi r31, 0xDD ; 221 13960: cf 2e mov r12, r31 13962: f2 e0 ldi r31, 0x02 ; 2 13964: df 2e mov r13, r31 13966: 8e 01 movw r16, r28 13968: 0f 5b subi r16, 0xBF ; 191 1396a: 1f 4f sbci r17, 0xFF ; 255 1396c: 9e 01 movw r18, r28 1396e: 2f 5f subi r18, 0xFF ; 255 13970: 3f 4f sbci r19, 0xFF ; 255 13972: 79 01 movw r14, r18 13974: a1 ee ldi r26, 0xE1 ; 225 13976: 8a 2e mov r8, r26 13978: a2 e0 ldi r26, 0x02 ; 2 1397a: 9a 2e mov r9, r26 1397c: 58 01 movw r10, r16 1397e: 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]); 13980: d6 01 movw r26, r12 13982: 8d 91 ld r24, X+ 13984: 6d 01 movw r12, r26 13986: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1398a: f5 01 movw r30, r10 1398c: 81 93 st Z+, r24 1398e: 5f 01 movw r10, r30 if(codes[i]) 13990: 88 23 and r24, r24 13992: 41 f0 breq .+16 ; 0x139a4 values[i] = code_value(); 13994: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 13998: d7 01 movw r26, r14 1399a: 6d 93 st X+, r22 1399c: 7d 93 st X+, r23 1399e: 8d 93 st X+, r24 139a0: 9c 93 st X, r25 139a2: 13 97 sbiw r26, 0x03 ; 3 139a4: b4 e0 ldi r27, 0x04 ; 4 139a6: eb 0e add r14, r27 139a8: 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) 139aa: 8c 14 cp r8, r12 139ac: 9d 04 cpc r9, r13 139ae: 41 f7 brne .-48 ; 0x13980 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 139b0: f8 01 movw r30, r16 139b2: d3 80 ldd r13, Z+3 ; 0x03 139b4: dd 20 and r13, r13 139b6: 11 f4 brne .+4 ; 0x139bc 139b8: 0c 94 5a a6 jmp 0x14cb4 ; 0x14cb4 139bc: 20 e0 ldi r18, 0x00 ; 0 139be: 30 e0 ldi r19, 0x00 ; 0 139c0: a9 01 movw r20, r18 139c2: 6d 85 ldd r22, Y+13 ; 0x0d 139c4: 7e 85 ldd r23, Y+14 ; 0x0e 139c6: 8f 85 ldd r24, Y+15 ; 0x0f 139c8: 98 89 ldd r25, Y+16 ; 0x10 139ca: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 139ce: 81 11 cpse r24, r1 139d0: 0c 94 5a a6 jmp 0x14cb4 ; 0x14cb4 139d4: d8 01 movw r26, r16 139d6: 8c 91 ld r24, X 139d8: 81 11 cpse r24, r1 139da: 0c 94 5a a6 jmp 0x14cb4 ; 0x14cb4 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 139de: 11 96 adiw r26, 0x01 ; 1 139e0: 8c 91 ld r24, X 139e2: 11 97 sbiw r26, 0x01 ; 1 139e4: 81 11 cpse r24, r1 139e6: 0c 94 5a a6 jmp 0x14cb4 ; 0x14cb4 139ea: 12 96 adiw r26, 0x02 ; 2 139ec: 8c 91 ld r24, X 139ee: 81 11 cpse r24, r1 139f0: 0c 94 5a a6 jmp 0x14cb4 ; 0x14cb4 { // 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; 139f4: 10 92 4f 07 sts 0x074F, r1 ; 0x80074f 139f8: 10 92 50 07 sts 0x0750, r1 ; 0x800750 139fc: 10 92 51 07 sts 0x0751, r1 ; 0x800751 13a00: 10 92 52 07 sts 0x0752, r1 ; 0x800752 st_set_e_position(position[E_AXIS]); } void plan_reset_next_e() { plan_reset_next_e_queue = true; 13a04: 81 e0 ldi r24, 0x01 ; 1 13a06: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb <_ZL23plan_reset_next_e_queue.lto_priv.503> 13a0a: 9b cf rjmp .-202 ; 0x13942 #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 13a0c: 2d ec ldi r18, 0xCD ; 205 13a0e: 3c ec ldi r19, 0xCC ; 204 13a10: 4c ec ldi r20, 0xCC ; 204 13a12: 5d e3 ldi r21, 0x3D ; 61 13a14: c7 01 movw r24, r14 13a16: b6 01 movw r22, r12 13a18: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 13a1c: 18 16 cp r1, r24 13a1e: 24 f4 brge .+8 ; 0x13a28 13a20: 80 91 3f 07 lds r24, 0x073F ; 0x80073f 13a24: 81 11 cpse r24, r1 13a26: 92 ce rjmp .-732 ; 0x1374c } } } #endif //FWRETRACT prepare_move(start_segment_idx); 13a28: c8 01 movw r24, r16 13a2a: 0e 94 3d 6d call 0xda7a ; 0xda7a 13a2e: 89 cf rjmp .-238 ; 0x13942 */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 13a30: 0e 94 99 5b call 0xb732 ; 0xb732 13a34: e0 96 adiw r28, 0x30 ; 48 13a36: 9f af std Y+63, r25 ; 0x3f 13a38: 8e af std Y+62, r24 ; 0x3e 13a3a: 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 13a3c: 0e 94 f9 62 call 0xc5f2 ; 0xc5f2 #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 13a40: 89 e4 ldi r24, 0x49 ; 73 13a42: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 13a46: 88 23 and r24, r24 13a48: 09 f4 brne .+2 ; 0x13a4c 13a4a: 00 c4 rjmp .+2048 ; 0x1424c 13a4c: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 13a50: 60 93 8d 03 sts 0x038D, r22 ; 0x80038d 13a54: 70 93 8e 03 sts 0x038E, r23 ; 0x80038e 13a58: 80 93 8f 03 sts 0x038F, r24 ; 0x80038f 13a5c: 90 93 90 03 sts 0x0390, r25 ; 0x800390 offset[1] = code_seen('J') ? code_value() : 0.f; 13a60: 8a e4 ldi r24, 0x4A ; 74 13a62: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 13a66: c1 2c mov r12, r1 13a68: d1 2c mov r13, r1 13a6a: 76 01 movw r14, r12 13a6c: 88 23 and r24, r24 13a6e: 21 f0 breq .+8 ; 0x13a78 13a70: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 13a74: 6b 01 movw r12, r22 13a76: 7c 01 movw r14, r24 13a78: c0 92 91 03 sts 0x0391, r12 ; 0x800391 13a7c: d0 92 92 03 sts 0x0392, r13 ; 0x800392 13a80: e0 92 93 03 sts 0x0393, r14 ; 0x800393 13a84: f0 92 94 03 sts 0x0394, r15 ; 0x800394 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 13a88: e0 91 95 03 lds r30, 0x0395 ; 0x800395 13a8c: f0 91 96 03 lds r31, 0x0396 ; 0x800396 13a90: c2 57 subi r28, 0x72 ; 114 13a92: df 4f sbci r29, 0xFF ; 255 13a94: f9 83 std Y+1, r31 ; 0x01 13a96: e8 83 st Y, r30 13a98: ce 58 subi r28, 0x8E ; 142 13a9a: 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 13a9c: 80 90 8d 03 lds r8, 0x038D ; 0x80038d 13aa0: 90 90 8e 03 lds r9, 0x038E ; 0x80038e 13aa4: a0 90 8f 03 lds r10, 0x038F ; 0x80038f 13aa8: b0 90 90 03 lds r11, 0x0390 ; 0x800390 13aac: a7 01 movw r20, r14 13aae: 96 01 movw r18, r12 13ab0: c5 01 movw r24, r10 13ab2: b4 01 movw r22, r8 13ab4: 0f 94 1f e1 call 0x3c23e ; 0x3c23e 13ab8: ae 96 adiw r28, 0x2e ; 46 13aba: 6c af std Y+60, r22 ; 0x3c 13abc: 7d af std Y+61, r23 ; 0x3d 13abe: 8e af std Y+62, r24 ; 0x3e 13ac0: 9f af std Y+63, r25 ; 0x3f 13ac2: 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); 13ac4: 60 91 39 02 lds r22, 0x0239 ; 0x800239 13ac8: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 13acc: 07 2e mov r0, r23 13ace: 00 0c add r0, r0 13ad0: 88 0b sbc r24, r24 13ad2: 99 0b sbc r25, r25 13ad4: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 13ad8: 20 91 90 02 lds r18, 0x0290 ; 0x800290 13adc: 30 91 91 02 lds r19, 0x0291 ; 0x800291 13ae0: 40 91 92 02 lds r20, 0x0292 ; 0x800292 13ae4: 50 91 93 02 lds r21, 0x0293 ; 0x800293 13ae8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13aec: 2e e3 ldi r18, 0x3E ; 62 13aee: 33 ec ldi r19, 0xC3 ; 195 13af0: 4e e2 ldi r20, 0x2E ; 46 13af2: 59 e3 ldi r21, 0x39 ; 57 13af4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13af8: aa 96 adiw r28, 0x2a ; 42 13afa: 6c af std Y+60, r22 ; 0x3c 13afc: 7d af std Y+61, r23 ; 0x3d 13afe: 8e af std Y+62, r24 ; 0x3e 13b00: 9f af std Y+63, r25 ; 0x3f 13b02: 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)); 13b04: 80 e1 ldi r24, 0x10 ; 16 13b06: e3 e4 ldi r30, 0x43 ; 67 13b08: f7 e0 ldi r31, 0x07 ; 7 13b0a: de 01 movw r26, r28 13b0c: 11 96 adiw r26, 0x01 ; 1 13b0e: 01 90 ld r0, Z+ 13b10: 0d 92 st X+, r0 13b12: 8a 95 dec r24 13b14: e1 f7 brne .-8 ; 0x13b0e float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 13b16: a5 01 movw r20, r10 13b18: 94 01 movw r18, r8 13b1a: 50 58 subi r21, 0x80 ; 128 13b1c: 6e 96 adiw r28, 0x1e ; 30 13b1e: 2c af std Y+60, r18 ; 0x3c 13b20: 3d af std Y+61, r19 ; 0x3d 13b22: 4e af std Y+62, r20 ; 0x3e 13b24: 5f af std Y+63, r21 ; 0x3f 13b26: 6e 97 sbiw r28, 0x1e ; 30 float r_axis_y = -offset[Y_AXIS]; 13b28: d7 01 movw r26, r14 13b2a: c6 01 movw r24, r12 13b2c: b0 58 subi r27, 0x80 ; 128 13b2e: 6a 96 adiw r28, 0x1a ; 26 13b30: 8c af std Y+60, r24 ; 0x3c 13b32: 9d af std Y+61, r25 ; 0x3d 13b34: ae af std Y+62, r26 ; 0x3e 13b36: bf af std Y+63, r27 ; 0x3f 13b38: 6a 97 sbiw r28, 0x1a ; 26 float center_axis_x = start_position[X_AXIS] - r_axis_x; 13b3a: 29 81 ldd r18, Y+1 ; 0x01 13b3c: 3a 81 ldd r19, Y+2 ; 0x02 13b3e: 4b 81 ldd r20, Y+3 ; 0x03 13b40: 5c 81 ldd r21, Y+4 ; 0x04 13b42: e6 96 adiw r28, 0x36 ; 54 13b44: 2c af std Y+60, r18 ; 0x3c 13b46: 3d af std Y+61, r19 ; 0x3d 13b48: 4e af std Y+62, r20 ; 0x3e 13b4a: 5f af std Y+63, r21 ; 0x3f 13b4c: e6 97 sbiw r28, 0x36 ; 54 13b4e: c5 01 movw r24, r10 13b50: b4 01 movw r22, r8 13b52: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 13b56: ea 96 adiw r28, 0x3a ; 58 13b58: 6c af std Y+60, r22 ; 0x3c 13b5a: 7d af std Y+61, r23 ; 0x3d 13b5c: 8e af std Y+62, r24 ; 0x3e 13b5e: 9f af std Y+63, r25 ; 0x3f 13b60: ea 97 sbiw r28, 0x3a ; 58 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 13b62: 8d 81 ldd r24, Y+5 ; 0x05 13b64: 9e 81 ldd r25, Y+6 ; 0x06 13b66: af 81 ldd r26, Y+7 ; 0x07 13b68: b8 85 ldd r27, Y+8 ; 0x08 13b6a: ee 96 adiw r28, 0x3e ; 62 13b6c: 8c af std Y+60, r24 ; 0x3c 13b6e: 9d af std Y+61, r25 ; 0x3d 13b70: ae af std Y+62, r26 ; 0x3e 13b72: bf af std Y+63, r27 ; 0x3f 13b74: ee 97 sbiw r28, 0x3e ; 62 13b76: 9c 01 movw r18, r24 13b78: ad 01 movw r20, r26 13b7a: c7 01 movw r24, r14 13b7c: b6 01 movw r22, r12 13b7e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 13b82: ce 57 subi r28, 0x7E ; 126 13b84: df 4f sbci r29, 0xFF ; 255 13b86: 68 83 st Y, r22 13b88: 79 83 std Y+1, r23 ; 0x01 13b8a: 8a 83 std Y+2, r24 ; 0x02 13b8c: 9b 83 std Y+3, r25 ; 0x03 13b8e: c2 58 subi r28, 0x82 ; 130 13b90: d0 40 sbci r29, 0x00 ; 0 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 13b92: 29 85 ldd r18, Y+9 ; 0x09 13b94: 3a 85 ldd r19, Y+10 ; 0x0a 13b96: 4b 85 ldd r20, Y+11 ; 0x0b 13b98: 5c 85 ldd r21, Y+12 ; 0x0c 13b9a: 60 91 5c 05 lds r22, 0x055C ; 0x80055c 13b9e: 70 91 5d 05 lds r23, 0x055D ; 0x80055d 13ba2: 80 91 5e 05 lds r24, 0x055E ; 0x80055e 13ba6: 90 91 5f 05 lds r25, 0x055F ; 0x80055f 13baa: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 13bae: c2 58 subi r28, 0x82 ; 130 13bb0: df 4f sbci r29, 0xFF ; 255 13bb2: 68 83 st Y, r22 13bb4: 79 83 std Y+1, r23 ; 0x01 13bb6: 8a 83 std Y+2, r24 ; 0x02 13bb8: 9b 83 std Y+3, r25 ; 0x03 13bba: ce 57 subi r28, 0x7E ; 126 13bbc: d0 40 sbci r29, 0x00 ; 0 float rt_x = target[X_AXIS] - center_axis_x; 13bbe: 20 91 54 05 lds r18, 0x0554 ; 0x800554 13bc2: 30 91 55 05 lds r19, 0x0555 ; 0x800555 13bc6: 40 91 56 05 lds r20, 0x0556 ; 0x800556 13bca: 50 91 57 05 lds r21, 0x0557 ; 0x800557 13bce: ca 57 subi r28, 0x7A ; 122 13bd0: df 4f sbci r29, 0xFF ; 255 13bd2: 28 83 st Y, r18 13bd4: 39 83 std Y+1, r19 ; 0x01 13bd6: 4a 83 std Y+2, r20 ; 0x02 13bd8: 5b 83 std Y+3, r21 ; 0x03 13bda: c6 58 subi r28, 0x86 ; 134 13bdc: d0 40 sbci r29, 0x00 ; 0 13bde: ea 96 adiw r28, 0x3a ; 58 13be0: 2c ad ldd r18, Y+60 ; 0x3c 13be2: 3d ad ldd r19, Y+61 ; 0x3d 13be4: 4e ad ldd r20, Y+62 ; 0x3e 13be6: 5f ad ldd r21, Y+63 ; 0x3f 13be8: ea 97 sbiw r28, 0x3a ; 58 13bea: ca 57 subi r28, 0x7A ; 122 13bec: df 4f sbci r29, 0xFF ; 255 13bee: 68 81 ld r22, Y 13bf0: 79 81 ldd r23, Y+1 ; 0x01 13bf2: 8a 81 ldd r24, Y+2 ; 0x02 13bf4: 9b 81 ldd r25, Y+3 ; 0x03 13bf6: c6 58 subi r28, 0x86 ; 134 13bf8: d0 40 sbci r29, 0x00 ; 0 13bfa: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 13bfe: 6b 01 movw r12, r22 13c00: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 13c02: 80 91 58 05 lds r24, 0x0558 ; 0x800558 13c06: 90 91 59 05 lds r25, 0x0559 ; 0x800559 13c0a: a0 91 5a 05 lds r26, 0x055A ; 0x80055a 13c0e: b0 91 5b 05 lds r27, 0x055B ; 0x80055b 13c12: c6 57 subi r28, 0x76 ; 118 13c14: df 4f sbci r29, 0xFF ; 255 13c16: 88 83 st Y, r24 13c18: 99 83 std Y+1, r25 ; 0x01 13c1a: aa 83 std Y+2, r26 ; 0x02 13c1c: bb 83 std Y+3, r27 ; 0x03 13c1e: ca 58 subi r28, 0x8A ; 138 13c20: d0 40 sbci r29, 0x00 ; 0 13c22: ce 57 subi r28, 0x7E ; 126 13c24: df 4f sbci r29, 0xFF ; 255 13c26: 28 81 ld r18, Y 13c28: 39 81 ldd r19, Y+1 ; 0x01 13c2a: 4a 81 ldd r20, Y+2 ; 0x02 13c2c: 5b 81 ldd r21, Y+3 ; 0x03 13c2e: c2 58 subi r28, 0x82 ; 130 13c30: d0 40 sbci r29, 0x00 ; 0 13c32: bc 01 movw r22, r24 13c34: cd 01 movw r24, r26 13c36: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 13c3a: 4b 01 movw r8, r22 13c3c: 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; 13c3e: 30 90 32 07 lds r3, 0x0732 ; 0x800732 13c42: 20 90 33 07 lds r2, 0x0733 ; 0x800733 13c46: 90 91 34 07 lds r25, 0x0734 ; 0x800734 13c4a: 6f 96 adiw r28, 0x1f ; 31 13c4c: 9f af std Y+63, r25 ; 0x3f 13c4e: 6f 97 sbiw r28, 0x1f ; 31 13c50: a0 91 35 07 lds r26, 0x0735 ; 0x800735 13c54: a3 96 adiw r28, 0x23 ; 35 13c56: af af std Y+63, r26 ; 0x3f 13c58: 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); 13c5a: a7 01 movw r20, r14 13c5c: 96 01 movw r18, r12 13c5e: 6e 96 adiw r28, 0x1e ; 30 13c60: 6c ad ldd r22, Y+60 ; 0x3c 13c62: 7d ad ldd r23, Y+61 ; 0x3d 13c64: 8e ad ldd r24, Y+62 ; 0x3e 13c66: 9f ad ldd r25, Y+63 ; 0x3f 13c68: 6e 97 sbiw r28, 0x1e ; 30 13c6a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13c6e: 2b 01 movw r4, r22 13c70: 3c 01 movw r6, r24 13c72: a5 01 movw r20, r10 13c74: 94 01 movw r18, r8 13c76: 6a 96 adiw r28, 0x1a ; 26 13c78: 6c ad ldd r22, Y+60 ; 0x3c 13c7a: 7d ad ldd r23, Y+61 ; 0x3d 13c7c: 8e ad ldd r24, Y+62 ; 0x3e 13c7e: 9f ad ldd r25, Y+63 ; 0x3f 13c80: 6a 97 sbiw r28, 0x1a ; 26 13c82: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13c86: 9b 01 movw r18, r22 13c88: ac 01 movw r20, r24 13c8a: c3 01 movw r24, r6 13c8c: b2 01 movw r22, r4 13c8e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 13c92: 2b 01 movw r4, r22 13c94: 3c 01 movw r6, r24 13c96: a5 01 movw r20, r10 13c98: 94 01 movw r18, r8 13c9a: 6e 96 adiw r28, 0x1e ; 30 13c9c: 6c ad ldd r22, Y+60 ; 0x3c 13c9e: 7d ad ldd r23, Y+61 ; 0x3d 13ca0: 8e ad ldd r24, Y+62 ; 0x3e 13ca2: 9f ad ldd r25, Y+63 ; 0x3f 13ca4: 6e 97 sbiw r28, 0x1e ; 30 13ca6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13caa: 4b 01 movw r8, r22 13cac: 5c 01 movw r10, r24 13cae: a7 01 movw r20, r14 13cb0: 96 01 movw r18, r12 13cb2: 6a 96 adiw r28, 0x1a ; 26 13cb4: 6c ad ldd r22, Y+60 ; 0x3c 13cb6: 7d ad ldd r23, Y+61 ; 0x3d 13cb8: 8e ad ldd r24, Y+62 ; 0x3e 13cba: 9f ad ldd r25, Y+63 ; 0x3f 13cbc: 6a 97 sbiw r28, 0x1a ; 26 13cbe: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13cc2: 9b 01 movw r18, r22 13cc4: ac 01 movw r20, r24 13cc6: c5 01 movw r24, r10 13cc8: b4 01 movw r22, r8 13cca: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 13cce: a3 01 movw r20, r6 13cd0: 92 01 movw r18, r4 13cd2: 0f 94 02 df call 0x3be04 ; 0x3be04 13cd6: 6b 01 movw r12, r22 13cd8: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 13cda: 20 e0 ldi r18, 0x00 ; 0 13cdc: 30 e0 ldi r19, 0x00 ; 0 13cde: a9 01 movw r20, r18 13ce0: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 13ce4: 87 ff sbrs r24, 7 13ce6: 0a c0 rjmp .+20 ; 0x13cfc 13ce8: 2b ed ldi r18, 0xDB ; 219 13cea: 3f e0 ldi r19, 0x0F ; 15 13cec: 49 ec ldi r20, 0xC9 ; 201 13cee: 50 e4 ldi r21, 0x40 ; 64 13cf0: c7 01 movw r24, r14 13cf2: b6 01 movw r22, r12 13cf4: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 13cf8: 6b 01 movw r12, r22 13cfa: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 13cfc: 60 91 3b 07 lds r22, 0x073B ; 0x80073b 13d00: 70 91 3c 07 lds r23, 0x073C ; 0x80073c 13d04: 61 15 cp r22, r1 13d06: 71 05 cpc r23, r1 13d08: 09 f4 brne .+2 ; 0x13d0c 13d0a: a4 c2 rjmp .+1352 ; 0x14254 { // 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); 13d0c: 90 e0 ldi r25, 0x00 ; 0 13d0e: 80 e0 ldi r24, 0x00 ; 0 13d10: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 13d14: 9b 01 movw r18, r22 13d16: ac 01 movw r20, r24 13d18: 6b ed ldi r22, 0xDB ; 219 13d1a: 7f e0 ldi r23, 0x0F ; 15 13d1c: 89 ec ldi r24, 0xC9 ; 201 13d1e: 90 e4 ldi r25, 0x40 ; 64 13d20: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 13d24: ae 96 adiw r28, 0x2e ; 46 13d26: 2c ad ldd r18, Y+60 ; 0x3c 13d28: 3d ad ldd r19, Y+61 ; 0x3d 13d2a: 4e ad ldd r20, Y+62 ; 0x3e 13d2c: 5f ad ldd r21, Y+63 ; 0x3f 13d2e: ae 97 sbiw r28, 0x2e ; 46 13d30: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13d34: 5b 01 movw r10, r22 13d36: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 13d38: 60 91 3d 07 lds r22, 0x073D ; 0x80073d 13d3c: 70 91 3e 07 lds r23, 0x073E ; 0x80073e 13d40: 61 15 cp r22, r1 13d42: 71 05 cpc r23, r1 13d44: f1 f0 breq .+60 ; 0x13d82 { // 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)); 13d46: 90 e0 ldi r25, 0x00 ; 0 13d48: 80 e0 ldi r24, 0x00 ; 0 13d4a: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 13d4e: 20 e0 ldi r18, 0x00 ; 0 13d50: 30 e0 ldi r19, 0x00 ; 0 13d52: 40 e7 ldi r20, 0x70 ; 112 13d54: 52 e4 ldi r21, 0x42 ; 66 13d56: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13d5a: 9b 01 movw r18, r22 13d5c: ac 01 movw r20, r24 13d5e: aa 96 adiw r28, 0x2a ; 42 13d60: 6c ad ldd r22, Y+60 ; 0x3c 13d62: 7d ad ldd r23, Y+61 ; 0x3d 13d64: 8e ad ldd r24, Y+62 ; 0x3e 13d66: 9f ad ldd r25, Y+63 ; 0x3f 13d68: aa 97 sbiw r28, 0x2a ; 42 13d6a: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 13d6e: 3b 01 movw r6, r22 13d70: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 13d72: 95 01 movw r18, r10 13d74: a8 01 movw r20, r16 13d76: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 13d7a: 87 ff sbrs r24, 7 13d7c: 02 c0 rjmp .+4 ; 0x13d82 mm_per_arc_segment = mm_per_arc_segment_sec; 13d7e: 53 01 movw r10, r6 13d80: 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) 13d82: 40 90 36 07 lds r4, 0x0736 ; 0x800736 13d86: 50 90 37 07 lds r5, 0x0737 ; 0x800737 13d8a: 60 90 38 07 lds r6, 0x0738 ; 0x800738 13d8e: 70 90 39 07 lds r7, 0x0739 ; 0x800739 13d92: 95 01 movw r18, r10 13d94: a8 01 movw r20, r16 13d96: b2 01 movw r22, r4 13d98: c3 01 movw r24, r6 13d9a: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 13d9e: 18 16 cp r1, r24 13da0: c4 f0 brlt .+48 ; 0x13dd2 { // 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) { 13da2: 95 01 movw r18, r10 13da4: a8 01 movw r20, r16 13da6: 63 2d mov r22, r3 13da8: 72 2d mov r23, r2 13daa: 6f 96 adiw r28, 0x1f ; 31 13dac: 8f ad ldd r24, Y+63 ; 0x3f 13dae: 6f 97 sbiw r28, 0x1f ; 31 13db0: a3 96 adiw r28, 0x23 ; 35 13db2: 9f ad ldd r25, Y+63 ; 0x3f 13db4: a3 97 sbiw r28, 0x23 ; 35 13db6: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 13dba: 25 01 movw r4, r10 13dbc: 38 01 movw r6, r16 13dbe: 87 ff sbrs r24, 7 13dc0: 08 c0 rjmp .+16 ; 0x13dd2 // 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; 13dc2: 43 2c mov r4, r3 13dc4: 52 2c mov r5, r2 13dc6: 6f 96 adiw r28, 0x1f ; 31 13dc8: 6f ac ldd r6, Y+63 ; 0x3f 13dca: 6f 97 sbiw r28, 0x1f ; 31 13dcc: a3 96 adiw r28, 0x23 ; 35 13dce: 7f ac ldd r7, Y+63 ; 0x3f 13dd0: a3 97 sbiw r28, 0x23 ; 35 } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 13dd2: c2 57 subi r28, 0x72 ; 114 13dd4: df 4f sbci r29, 0xFF ; 255 13dd6: e8 81 ld r30, Y 13dd8: f9 81 ldd r31, Y+1 ; 0x01 13dda: ce 58 subi r28, 0x8E ; 142 13ddc: d0 40 sbci r29, 0x00 ; 0 13dde: 32 97 sbiw r30, 0x02 ; 2 13de0: 51 f4 brne .+20 ; 0x13df6 13de2: 2b ed ldi r18, 0xDB ; 219 13de4: 3f e0 ldi r19, 0x0F ; 15 13de6: 49 ec ldi r20, 0xC9 ; 201 13de8: 50 e4 ldi r21, 0x40 ; 64 13dea: c7 01 movw r24, r14 13dec: b6 01 movw r22, r12 13dee: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 13df2: 6b 01 movw r12, r22 13df4: 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) 13df6: ca 57 subi r28, 0x7A ; 122 13df8: df 4f sbci r29, 0xFF ; 255 13dfa: 28 81 ld r18, Y 13dfc: 39 81 ldd r19, Y+1 ; 0x01 13dfe: 4a 81 ldd r20, Y+2 ; 0x02 13e00: 5b 81 ldd r21, Y+3 ; 0x03 13e02: c6 58 subi r28, 0x86 ; 134 13e04: d0 40 sbci r29, 0x00 ; 0 13e06: e6 96 adiw r28, 0x36 ; 54 13e08: 6c ad ldd r22, Y+60 ; 0x3c 13e0a: 7d ad ldd r23, Y+61 ; 0x3d 13e0c: 8e ad ldd r24, Y+62 ; 0x3e 13e0e: 9f ad ldd r25, Y+63 ; 0x3f 13e10: e6 97 sbiw r28, 0x36 ; 54 13e12: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 13e16: 81 11 cpse r24, r1 13e18: 25 c0 rjmp .+74 ; 0x13e64 13e1a: c6 57 subi r28, 0x76 ; 118 13e1c: df 4f sbci r29, 0xFF ; 255 13e1e: 28 81 ld r18, Y 13e20: 39 81 ldd r19, Y+1 ; 0x01 13e22: 4a 81 ldd r20, Y+2 ; 0x02 13e24: 5b 81 ldd r21, Y+3 ; 0x03 13e26: ca 58 subi r28, 0x8A ; 138 13e28: d0 40 sbci r29, 0x00 ; 0 13e2a: ee 96 adiw r28, 0x3e ; 62 13e2c: 6c ad ldd r22, Y+60 ; 0x3c 13e2e: 7d ad ldd r23, Y+61 ; 0x3d 13e30: 8e ad ldd r24, Y+62 ; 0x3e 13e32: 9f ad ldd r25, Y+63 ; 0x3f 13e34: ee 97 sbiw r28, 0x3e ; 62 13e36: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 13e3a: 81 11 cpse r24, r1 13e3c: 13 c0 rjmp .+38 ; 0x13e64 13e3e: 20 e0 ldi r18, 0x00 ; 0 13e40: 30 e0 ldi r19, 0x00 ; 0 13e42: a9 01 movw r20, r18 13e44: c7 01 movw r24, r14 13e46: b6 01 movw r22, r12 13e48: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 13e4c: 81 11 cpse r24, r1 13e4e: 0a c0 rjmp .+20 ; 0x13e64 { angular_travel_total += 2 * M_PI; 13e50: 2b ed ldi r18, 0xDB ; 219 13e52: 3f e0 ldi r19, 0x0F ; 15 13e54: 49 ec ldi r20, 0xC9 ; 201 13e56: 50 e4 ldi r21, 0x40 ; 64 13e58: c7 01 movw r24, r14 13e5a: b6 01 movw r22, r12 13e5c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 13e60: 6b 01 movw r12, r22 13e62: 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)); 13e64: a7 01 movw r20, r14 13e66: 96 01 movw r18, r12 13e68: ae 96 adiw r28, 0x2e ; 46 13e6a: 6c ad ldd r22, Y+60 ; 0x3c 13e6c: 7d ad ldd r23, Y+61 ; 0x3d 13e6e: 8e ad ldd r24, Y+62 ; 0x3e 13e70: 9f ad ldd r25, Y+63 ; 0x3f 13e72: ae 97 sbiw r28, 0x2e ; 46 13e74: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13e78: c2 58 subi r28, 0x82 ; 130 13e7a: df 4f sbci r29, 0xFF ; 255 13e7c: 28 81 ld r18, Y 13e7e: 39 81 ldd r19, Y+1 ; 0x01 13e80: 4a 81 ldd r20, Y+2 ; 0x02 13e82: 5b 81 ldd r21, Y+3 ; 0x03 13e84: ce 57 subi r28, 0x7E ; 126 13e86: d0 40 sbci r29, 0x00 ; 0 13e88: 0f 94 1f e1 call 0x3c23e ; 0x3c23e 13e8c: 4b 01 movw r8, r22 13e8e: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 13e90: 2f e6 ldi r18, 0x6F ; 111 13e92: 32 e1 ldi r19, 0x12 ; 18 13e94: 43 e8 ldi r20, 0x83 ; 131 13e96: 5a e3 ldi r21, 0x3A ; 58 13e98: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 13e9c: 87 fd sbrc r24, 7 13e9e: cf c1 rjmp .+926 ; 0x1423e // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 13ea0: 92 01 movw r18, r4 13ea2: a3 01 movw r20, r6 13ea4: c5 01 movw r24, r10 13ea6: b4 01 movw r22, r8 13ea8: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 13eac: 0f 94 61 df call 0x3bec2 ; 0x3bec2 13eb0: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 13eb4: a4 96 adiw r28, 0x24 ; 36 13eb6: 7f af std Y+63, r23 ; 0x3f 13eb8: 6e af std Y+62, r22 ; 0x3e 13eba: 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) 13ebc: 62 30 cpi r22, 0x02 ; 2 13ebe: 71 05 cpc r23, r1 13ec0: 08 f4 brcc .+2 ; 0x13ec4 13ec2: 8b c1 rjmp .+790 ; 0x141da 13ec4: e0 96 adiw r28, 0x30 ; 48 13ec6: 4e ad ldd r20, Y+62 ; 0x3e 13ec8: 5f ad ldd r21, Y+63 ; 0x3f 13eca: e0 97 sbiw r28, 0x30 ; 48 13ecc: 45 2b or r20, r21 13ece: 09 f4 brne .+2 ; 0x13ed2 13ed0: 84 c1 rjmp .+776 ; 0x141da 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; 13ed2: 50 91 3a 07 lds r21, 0x073A ; 0x80073a 13ed6: 6f 96 adiw r28, 0x1f ; 31 13ed8: 5f af std Y+63, r21 ; 0x3f 13eda: 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, 13edc: 90 e0 ldi r25, 0x00 ; 0 13ede: 80 e0 ldi r24, 0x00 ; 0 13ee0: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 13ee4: 4b 01 movw r8, r22 13ee6: 5c 01 movw r10, r24 13ee8: ac 01 movw r20, r24 13eea: 9b 01 movw r18, r22 13eec: c7 01 movw r24, r14 13eee: b6 01 movw r22, r12 13ef0: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 13ef4: 2b 01 movw r4, r22 13ef6: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 13ef8: a5 01 movw r20, r10 13efa: 94 01 movw r18, r8 13efc: c2 58 subi r28, 0x82 ; 130 13efe: df 4f sbci r29, 0xFF ; 255 13f00: 68 81 ld r22, Y 13f02: 79 81 ldd r23, Y+1 ; 0x01 13f04: 8a 81 ldd r24, Y+2 ; 0x02 13f06: 9b 81 ldd r25, Y+3 ; 0x03 13f08: ce 57 subi r28, 0x7E ; 126 13f0a: d0 40 sbci r29, 0x00 ; 0 13f0c: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 13f10: ee 96 adiw r28, 0x3e ; 62 13f12: 6c af std Y+60, r22 ; 0x3c 13f14: 7d af std Y+61, r23 ; 0x3d 13f16: 8e af std Y+62, r24 ; 0x3e 13f18: 9f af std Y+63, r25 ; 0x3f 13f1a: ee 97 sbiw r28, 0x3e ; 62 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 13f1c: 2d 85 ldd r18, Y+13 ; 0x0d 13f1e: 3e 85 ldd r19, Y+14 ; 0x0e 13f20: 4f 85 ldd r20, Y+15 ; 0x0f 13f22: 58 89 ldd r21, Y+16 ; 0x10 13f24: 60 91 60 05 lds r22, 0x0560 ; 0x800560 13f28: 70 91 61 05 lds r23, 0x0561 ; 0x800561 13f2c: 80 91 62 05 lds r24, 0x0562 ; 0x800562 13f30: 90 91 63 05 lds r25, 0x0563 ; 0x800563 13f34: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 13f38: a5 01 movw r20, r10 13f3a: 94 01 movw r18, r8 13f3c: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 13f40: c2 58 subi r28, 0x82 ; 130 13f42: df 4f sbci r29, 0xFF ; 255 13f44: 68 83 st Y, r22 13f46: 79 83 std Y+1, r23 ; 0x01 13f48: 8a 83 std Y+2, r24 ; 0x02 13f4a: 9b 83 std Y+3, r25 ; 0x03 13f4c: ce 57 subi r28, 0x7E ; 126 13f4e: d0 40 sbci r29, 0x00 ; 0 sq_theta_per_segment = theta_per_segment * theta_per_segment, 13f50: a3 01 movw r20, r6 13f52: 92 01 movw r18, r4 13f54: c3 01 movw r24, r6 13f56: b2 01 movw r22, r4 13f58: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13f5c: 6b 01 movw r12, r22 13f5e: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 13f60: ac 01 movw r20, r24 13f62: 9b 01 movw r18, r22 13f64: c3 01 movw r24, r6 13f66: b2 01 movw r22, r4 13f68: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13f6c: 20 e0 ldi r18, 0x00 ; 0 13f6e: 30 e0 ldi r19, 0x00 ; 0 13f70: 40 ec ldi r20, 0xC0 ; 192 13f72: 50 e4 ldi r21, 0x40 ; 64 13f74: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 13f78: 9b 01 movw r18, r22 13f7a: ac 01 movw r20, r24 13f7c: c3 01 movw r24, r6 13f7e: b2 01 movw r22, r4 13f80: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 13f84: ae 96 adiw r28, 0x2e ; 46 13f86: 6c af std Y+60, r22 ; 0x3c 13f88: 7d af std Y+61, r23 ; 0x3d 13f8a: 8e af std Y+62, r24 ; 0x3e 13f8c: 9f af std Y+63, r25 ; 0x3f 13f8e: ae 97 sbiw r28, 0x2e ; 46 cos_T = 1 - 0.5f * sq_theta_per_segment; 13f90: 20 e0 ldi r18, 0x00 ; 0 13f92: 30 e0 ldi r19, 0x00 ; 0 13f94: 40 e0 ldi r20, 0x00 ; 0 13f96: 5f e3 ldi r21, 0x3F ; 63 13f98: c7 01 movw r24, r14 13f9a: b6 01 movw r22, r12 13f9c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13fa0: 9b 01 movw r18, r22 13fa2: ac 01 movw r20, r24 13fa4: 60 e0 ldi r22, 0x00 ; 0 13fa6: 70 e0 ldi r23, 0x00 ; 0 13fa8: 80 e8 ldi r24, 0x80 ; 128 13faa: 9f e3 ldi r25, 0x3F ; 63 13fac: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 13fb0: e6 96 adiw r28, 0x36 ; 54 13fb2: 6c af std Y+60, r22 ; 0x3c 13fb4: 7d af std Y+61, r23 ; 0x3d 13fb6: 8e af std Y+62, r24 ; 0x3e 13fb8: 9f af std Y+63, r25 ; 0x3f 13fba: 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++) { 13fbc: 22 24 eor r2, r2 13fbe: 23 94 inc r2 13fc0: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 13fc2: 6f 96 adiw r28, 0x1f ; 31 13fc4: 8f ad ldd r24, Y+63 ; 0x3f 13fc6: 6f 97 sbiw r28, 0x1f ; 31 13fc8: 81 11 cpse r24, r1 13fca: 4d c1 rjmp .+666 ; 0x14266 // 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); 13fcc: b1 01 movw r22, r2 13fce: 90 e0 ldi r25, 0x00 ; 0 13fd0: 80 e0 ldi r24, 0x00 ; 0 13fd2: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 13fd6: a3 01 movw r20, r6 13fd8: 92 01 movw r18, r4 13fda: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 13fde: 6b 01 movw r12, r22 13fe0: 7c 01 movw r14, r24 13fe2: 0f 94 7d df call 0x3befa ; 0x3befa 13fe6: 6a 96 adiw r28, 0x1a ; 26 13fe8: 6c af std Y+60, r22 ; 0x3c 13fea: 7d af std Y+61, r23 ; 0x3d 13fec: 8e af std Y+62, r24 ; 0x3e 13fee: 9f af std Y+63, r25 ; 0x3f 13ff0: 6a 97 sbiw r28, 0x1a ; 26 13ff2: c7 01 movw r24, r14 13ff4: b6 01 movw r22, r12 13ff6: 0f 94 43 e2 call 0x3c486 ; 0x3c486 13ffa: 4b 01 movw r8, r22 13ffc: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 13ffe: c0 90 8d 03 lds r12, 0x038D ; 0x80038d 14002: d0 90 8e 03 lds r13, 0x038E ; 0x80038e 14006: e0 90 8f 03 lds r14, 0x038F ; 0x80038f 1400a: f0 90 90 03 lds r15, 0x0390 ; 0x800390 1400e: f7 fa bst r15, 7 14010: f0 94 com r15 14012: f7 f8 bld r15, 7 14014: f0 94 com r15 14016: 20 91 91 03 lds r18, 0x0391 ; 0x800391 1401a: 30 91 92 03 lds r19, 0x0392 ; 0x800392 1401e: 40 91 93 03 lds r20, 0x0393 ; 0x800393 14022: 50 91 94 03 lds r21, 0x0394 ; 0x800394 14026: a2 96 adiw r28, 0x22 ; 34 14028: 2c af std Y+60, r18 ; 0x3c 1402a: 3d af std Y+61, r19 ; 0x3d 1402c: 4e af std Y+62, r20 ; 0x3e 1402e: 5f af std Y+63, r21 ; 0x3f 14030: a2 97 sbiw r28, 0x22 ; 34 14032: a7 01 movw r20, r14 14034: 96 01 movw r18, r12 14036: 6a 96 adiw r28, 0x1a ; 26 14038: 6c ad ldd r22, Y+60 ; 0x3c 1403a: 7d ad ldd r23, Y+61 ; 0x3d 1403c: 8e ad ldd r24, Y+62 ; 0x3e 1403e: 9f ad ldd r25, Y+63 ; 0x3f 14040: 6a 97 sbiw r28, 0x1a ; 26 14042: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 14046: 6e 96 adiw r28, 0x1e ; 30 14048: 6c af std Y+60, r22 ; 0x3c 1404a: 7d af std Y+61, r23 ; 0x3d 1404c: 8e af std Y+62, r24 ; 0x3e 1404e: 9f af std Y+63, r25 ; 0x3f 14050: 6e 97 sbiw r28, 0x1e ; 30 14052: a2 96 adiw r28, 0x22 ; 34 14054: 2c ad ldd r18, Y+60 ; 0x3c 14056: 3d ad ldd r19, Y+61 ; 0x3d 14058: 4e ad ldd r20, Y+62 ; 0x3e 1405a: 5f ad ldd r21, Y+63 ; 0x3f 1405c: a2 97 sbiw r28, 0x22 ; 34 1405e: c5 01 movw r24, r10 14060: b4 01 movw r22, r8 14062: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 14066: 9b 01 movw r18, r22 14068: ac 01 movw r20, r24 1406a: 6e 96 adiw r28, 0x1e ; 30 1406c: 6c ad ldd r22, Y+60 ; 0x3c 1406e: 7d ad ldd r23, Y+61 ; 0x3d 14070: 8e ad ldd r24, Y+62 ; 0x3e 14072: 9f ad ldd r25, Y+63 ; 0x3f 14074: 6e 97 sbiw r28, 0x1e ; 30 14076: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1407a: 6e 96 adiw r28, 0x1e ; 30 1407c: 6c af std Y+60, r22 ; 0x3c 1407e: 7d af std Y+61, r23 ; 0x3d 14080: 8e af std Y+62, r24 ; 0x3e 14082: 9f af std Y+63, r25 ; 0x3f 14084: 6e 97 sbiw r28, 0x1e ; 30 r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 14086: a7 01 movw r20, r14 14088: 96 01 movw r18, r12 1408a: c5 01 movw r24, r10 1408c: b4 01 movw r22, r8 1408e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 14092: 6b 01 movw r12, r22 14094: 7c 01 movw r14, r24 14096: a2 96 adiw r28, 0x22 ; 34 14098: 2c ad ldd r18, Y+60 ; 0x3c 1409a: 3d ad ldd r19, Y+61 ; 0x3d 1409c: 4e ad ldd r20, Y+62 ; 0x3e 1409e: 5f ad ldd r21, Y+63 ; 0x3f 140a0: a2 97 sbiw r28, 0x22 ; 34 140a2: 6a 96 adiw r28, 0x1a ; 26 140a4: 6c ad ldd r22, Y+60 ; 0x3c 140a6: 7d ad ldd r23, Y+61 ; 0x3d 140a8: 8e ad ldd r24, Y+62 ; 0x3e 140aa: 9f ad ldd r25, Y+63 ; 0x3f 140ac: 6a 97 sbiw r28, 0x1a ; 26 140ae: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 140b2: 9b 01 movw r18, r22 140b4: ac 01 movw r20, r24 140b6: c7 01 movw r24, r14 140b8: b6 01 movw r22, r12 140ba: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 140be: 6a 96 adiw r28, 0x1a ; 26 140c0: 6c af std Y+60, r22 ; 0x3c 140c2: 7d af std Y+61, r23 ; 0x3d 140c4: 8e af std Y+62, r24 ; 0x3e 140c6: 9f af std Y+63, r25 ; 0x3f 140c8: 6a 97 sbiw r28, 0x1a ; 26 // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 140ca: 30 91 3a 07 lds r19, 0x073A ; 0x80073a 140ce: 6f 96 adiw r28, 0x1f ; 31 140d0: 3f af std Y+63, r19 ; 0x3f 140d2: 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; 140d4: 6e 96 adiw r28, 0x1e ; 30 140d6: 2c ad ldd r18, Y+60 ; 0x3c 140d8: 3d ad ldd r19, Y+61 ; 0x3d 140da: 4e ad ldd r20, Y+62 ; 0x3e 140dc: 5f ad ldd r21, Y+63 ; 0x3f 140de: 6e 97 sbiw r28, 0x1e ; 30 140e0: ea 96 adiw r28, 0x3a ; 58 140e2: 6c ad ldd r22, Y+60 ; 0x3c 140e4: 7d ad ldd r23, Y+61 ; 0x3d 140e6: 8e ad ldd r24, Y+62 ; 0x3e 140e8: 9f ad ldd r25, Y+63 ; 0x3f 140ea: ea 97 sbiw r28, 0x3a ; 58 140ec: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 140f0: 69 83 std Y+1, r22 ; 0x01 140f2: 7a 83 std Y+2, r23 ; 0x02 140f4: 8b 83 std Y+3, r24 ; 0x03 140f6: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 140f8: 6a 96 adiw r28, 0x1a ; 26 140fa: 2c ad ldd r18, Y+60 ; 0x3c 140fc: 3d ad ldd r19, Y+61 ; 0x3d 140fe: 4e ad ldd r20, Y+62 ; 0x3e 14100: 5f ad ldd r21, Y+63 ; 0x3f 14102: 6a 97 sbiw r28, 0x1a ; 26 14104: ce 57 subi r28, 0x7E ; 126 14106: df 4f sbci r29, 0xFF ; 255 14108: 68 81 ld r22, Y 1410a: 79 81 ldd r23, Y+1 ; 0x01 1410c: 8a 81 ldd r24, Y+2 ; 0x02 1410e: 9b 81 ldd r25, Y+3 ; 0x03 14110: c2 58 subi r28, 0x82 ; 130 14112: d0 40 sbci r29, 0x00 ; 0 14114: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 14118: 6d 83 std Y+5, r22 ; 0x05 1411a: 7e 83 std Y+6, r23 ; 0x06 1411c: 8f 83 std Y+7, r24 ; 0x07 1411e: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 14120: ee 96 adiw r28, 0x3e ; 62 14122: 2c ad ldd r18, Y+60 ; 0x3c 14124: 3d ad ldd r19, Y+61 ; 0x3d 14126: 4e ad ldd r20, Y+62 ; 0x3e 14128: 5f ad ldd r21, Y+63 ; 0x3f 1412a: ee 97 sbiw r28, 0x3e ; 62 1412c: 69 85 ldd r22, Y+9 ; 0x09 1412e: 7a 85 ldd r23, Y+10 ; 0x0a 14130: 8b 85 ldd r24, Y+11 ; 0x0b 14132: 9c 85 ldd r25, Y+12 ; 0x0c 14134: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 14138: 69 87 std Y+9, r22 ; 0x09 1413a: 7a 87 std Y+10, r23 ; 0x0a 1413c: 8b 87 std Y+11, r24 ; 0x0b 1413e: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 14140: c2 58 subi r28, 0x82 ; 130 14142: df 4f sbci r29, 0xFF ; 255 14144: 28 81 ld r18, Y 14146: 39 81 ldd r19, Y+1 ; 0x01 14148: 4a 81 ldd r20, Y+2 ; 0x02 1414a: 5b 81 ldd r21, Y+3 ; 0x03 1414c: ce 57 subi r28, 0x7E ; 126 1414e: d0 40 sbci r29, 0x00 ; 0 14150: 6d 85 ldd r22, Y+13 ; 0x0d 14152: 7e 85 ldd r23, Y+14 ; 0x0e 14154: 8f 85 ldd r24, Y+15 ; 0x0f 14156: 98 89 ldd r25, Y+16 ; 0x10 14158: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1415c: 6d 87 std Y+13, r22 ; 0x0d 1415e: 7e 87 std Y+14, r23 ; 0x0e 14160: 8f 87 std Y+15, r24 ; 0x0f 14162: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 14164: ce 01 movw r24, r28 14166: 01 96 adiw r24, 0x01 ; 1 14168: 0e 94 fe 6c call 0xd9fc ; 0xd9fc // Insert the segment into the buffer if (i >= start_segment_idx) 1416c: e0 96 adiw r28, 0x30 ; 48 1416e: 8e ad ldd r24, Y+62 ; 0x3e 14170: 9f ad ldd r25, Y+63 ; 0x3f 14172: e0 97 sbiw r28, 0x30 ; 48 14174: 28 16 cp r2, r24 14176: 39 06 cpc r3, r25 14178: 08 f1 brcs .+66 ; 0x141bc plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 1417a: e9 84 ldd r14, Y+9 ; 0x09 1417c: fa 84 ldd r15, Y+10 ; 0x0a 1417e: 0b 85 ldd r16, Y+11 ; 0x0b 14180: 1c 85 ldd r17, Y+12 ; 0x0c 14182: 2d 81 ldd r18, Y+5 ; 0x05 14184: 3e 81 ldd r19, Y+6 ; 0x06 14186: 4f 81 ldd r20, Y+7 ; 0x07 14188: 58 85 ldd r21, Y+8 ; 0x08 1418a: 69 81 ldd r22, Y+1 ; 0x01 1418c: 7a 81 ldd r23, Y+2 ; 0x02 1418e: 8b 81 ldd r24, Y+3 ; 0x03 14190: 9c 81 ldd r25, Y+4 ; 0x04 14192: 3f 92 push r3 14194: 2f 92 push r2 14196: a3 e4 ldi r26, 0x43 ; 67 14198: b7 e0 ldi r27, 0x07 ; 7 1419a: bf 93 push r27 1419c: af 93 push r26 1419e: aa 96 adiw r28, 0x2a ; 42 141a0: 8c ac ldd r8, Y+60 ; 0x3c 141a2: 9d ac ldd r9, Y+61 ; 0x3d 141a4: ae ac ldd r10, Y+62 ; 0x3e 141a6: bf ac ldd r11, Y+63 ; 0x3f 141a8: aa 97 sbiw r28, 0x2a ; 42 141aa: de 01 movw r26, r28 141ac: 1d 96 adiw r26, 0x0d ; 13 141ae: 6d 01 movw r12, r26 141b0: 0f 94 08 ab call 0x35610 ; 0x35610 141b4: 0f 90 pop r0 141b6: 0f 90 pop r0 141b8: 0f 90 pop r0 141ba: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 141bc: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 141c0: 81 11 cpse r24, r1 141c2: 3d c0 rjmp .+122 ; 0x1423e 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++) { 141c4: bf ef ldi r27, 0xFF ; 255 141c6: 2b 1a sub r2, r27 141c8: 3b 0a sbc r3, r27 141ca: a4 96 adiw r28, 0x24 ; 36 141cc: ee ad ldd r30, Y+62 ; 0x3e 141ce: ff ad ldd r31, Y+63 ; 0x3f 141d0: a4 97 sbiw r28, 0x24 ; 36 141d2: e2 15 cp r30, r2 141d4: f3 05 cpc r31, r3 141d6: 09 f0 breq .+2 ; 0x141da 141d8: f4 ce rjmp .-536 ; 0x13fc2 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 141da: 84 e5 ldi r24, 0x54 ; 84 141dc: 95 e0 ldi r25, 0x05 ; 5 141de: 0e 94 fe 6c call 0xd9fc ; 0xd9fc // 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); 141e2: e0 90 5c 05 lds r14, 0x055C ; 0x80055c 141e6: f0 90 5d 05 lds r15, 0x055D ; 0x80055d 141ea: 00 91 5e 05 lds r16, 0x055E ; 0x80055e 141ee: 10 91 5f 05 lds r17, 0x055F ; 0x80055f 141f2: 20 91 58 05 lds r18, 0x0558 ; 0x800558 141f6: 30 91 59 05 lds r19, 0x0559 ; 0x800559 141fa: 40 91 5a 05 lds r20, 0x055A ; 0x80055a 141fe: 50 91 5b 05 lds r21, 0x055B ; 0x80055b 14202: 60 91 54 05 lds r22, 0x0554 ; 0x800554 14206: 70 91 55 05 lds r23, 0x0555 ; 0x800555 1420a: 80 91 56 05 lds r24, 0x0556 ; 0x800556 1420e: 90 91 57 05 lds r25, 0x0557 ; 0x800557 14212: 1f 92 push r1 14214: 1f 92 push r1 14216: e3 e4 ldi r30, 0x43 ; 67 14218: f7 e0 ldi r31, 0x07 ; 7 1421a: ff 93 push r31 1421c: ef 93 push r30 1421e: aa 96 adiw r28, 0x2a ; 42 14220: 8c ac ldd r8, Y+60 ; 0x3c 14222: 9d ac ldd r9, Y+61 ; 0x3d 14224: ae ac ldd r10, Y+62 ; 0x3e 14226: bf ac ldd r11, Y+63 ; 0x3f 14228: aa 97 sbiw r28, 0x2a ; 42 1422a: e0 e6 ldi r30, 0x60 ; 96 1422c: ce 2e mov r12, r30 1422e: e5 e0 ldi r30, 0x05 ; 5 14230: de 2e mov r13, r30 14232: 0f 94 08 ab call 0x35610 ; 0x35610 14236: 0f 90 pop r0 14238: 0f 90 pop r0 1423a: 0f 90 pop r0 1423c: 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(); 1423e: 0e 94 25 5c call 0xb84a ; 0xb84a previous_millis_cmd.start(); 14242: 88 e8 ldi r24, 0x88 ; 136 14244: 93 e0 ldi r25, 0x03 ; 3 14246: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> 1424a: 7b cb rjmp .-2314 ; 0x13942 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; 1424c: 60 e0 ldi r22, 0x00 ; 0 1424e: 70 e0 ldi r23, 0x00 ; 0 14250: cb 01 movw r24, r22 14252: fe cb rjmp .-2052 ; 0x13a50 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; 14254: a3 2c mov r10, r3 14256: b2 2c mov r11, r2 14258: 6f 96 adiw r28, 0x1f ; 31 1425a: 0f ad ldd r16, Y+63 ; 0x3f 1425c: 6f 97 sbiw r28, 0x1f ; 31 1425e: a3 96 adiw r28, 0x23 ; 35 14260: 1f ad ldd r17, Y+63 ; 0x3f 14262: a3 97 sbiw r28, 0x23 ; 35 14264: 69 cd rjmp .-1326 ; 0x13d38 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) { 14266: 6f 96 adiw r28, 0x1f ; 31 14268: 4f ad ldd r20, Y+63 ; 0x3f 1426a: 6f 97 sbiw r28, 0x1f ; 31 1426c: 41 50 subi r20, 0x01 ; 1 1426e: 6f 96 adiw r28, 0x1f ; 31 14270: 4f af std Y+63, r20 ; 0x3f 14272: 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; 14274: ae 96 adiw r28, 0x2e ; 46 14276: 2c ad ldd r18, Y+60 ; 0x3c 14278: 3d ad ldd r19, Y+61 ; 0x3d 1427a: 4e ad ldd r20, Y+62 ; 0x3e 1427c: 5f ad ldd r21, Y+63 ; 0x3f 1427e: ae 97 sbiw r28, 0x2e ; 46 14280: 6e 96 adiw r28, 0x1e ; 30 14282: 6c ad ldd r22, Y+60 ; 0x3c 14284: 7d ad ldd r23, Y+61 ; 0x3d 14286: 8e ad ldd r24, Y+62 ; 0x3e 14288: 9f ad ldd r25, Y+63 ; 0x3f 1428a: 6e 97 sbiw r28, 0x1e ; 30 1428c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 14290: 6b 01 movw r12, r22 14292: 7c 01 movw r14, r24 14294: e6 96 adiw r28, 0x36 ; 54 14296: 2c ad ldd r18, Y+60 ; 0x3c 14298: 3d ad ldd r19, Y+61 ; 0x3d 1429a: 4e ad ldd r20, Y+62 ; 0x3e 1429c: 5f ad ldd r21, Y+63 ; 0x3f 1429e: e6 97 sbiw r28, 0x36 ; 54 142a0: 6a 96 adiw r28, 0x1a ; 26 142a2: 6c ad ldd r22, Y+60 ; 0x3c 142a4: 7d ad ldd r23, Y+61 ; 0x3d 142a6: 8e ad ldd r24, Y+62 ; 0x3e 142a8: 9f ad ldd r25, Y+63 ; 0x3f 142aa: 6a 97 sbiw r28, 0x1a ; 26 142ac: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 142b0: 9b 01 movw r18, r22 142b2: ac 01 movw r20, r24 142b4: c7 01 movw r24, r14 142b6: b6 01 movw r22, r12 142b8: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 142bc: 7b 01 movw r14, r22 142be: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 142c0: e6 96 adiw r28, 0x36 ; 54 142c2: 2c ad ldd r18, Y+60 ; 0x3c 142c4: 3d ad ldd r19, Y+61 ; 0x3d 142c6: 4e ad ldd r20, Y+62 ; 0x3e 142c8: 5f ad ldd r21, Y+63 ; 0x3f 142ca: e6 97 sbiw r28, 0x36 ; 54 142cc: 6e 96 adiw r28, 0x1e ; 30 142ce: 6c ad ldd r22, Y+60 ; 0x3c 142d0: 7d ad ldd r23, Y+61 ; 0x3d 142d2: 8e ad ldd r24, Y+62 ; 0x3e 142d4: 9f ad ldd r25, Y+63 ; 0x3f 142d6: 6e 97 sbiw r28, 0x1e ; 30 142d8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 142dc: 4b 01 movw r8, r22 142de: 5c 01 movw r10, r24 142e0: ae 96 adiw r28, 0x2e ; 46 142e2: 2c ad ldd r18, Y+60 ; 0x3c 142e4: 3d ad ldd r19, Y+61 ; 0x3d 142e6: 4e ad ldd r20, Y+62 ; 0x3e 142e8: 5f ad ldd r21, Y+63 ; 0x3f 142ea: ae 97 sbiw r28, 0x2e ; 46 142ec: 6a 96 adiw r28, 0x1a ; 26 142ee: 6c ad ldd r22, Y+60 ; 0x3c 142f0: 7d ad ldd r23, Y+61 ; 0x3d 142f2: 8e ad ldd r24, Y+62 ; 0x3e 142f4: 9f ad ldd r25, Y+63 ; 0x3f 142f6: 6a 97 sbiw r28, 0x1a ; 26 142f8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 142fc: 9b 01 movw r18, r22 142fe: ac 01 movw r20, r24 14300: c5 01 movw r24, r10 14302: b4 01 movw r22, r8 14304: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 14308: 6e 96 adiw r28, 0x1e ; 30 1430a: 6c af std Y+60, r22 ; 0x3c 1430c: 7d af std Y+61, r23 ; 0x3d 1430e: 8e af std Y+62, r24 ; 0x3e 14310: 9f af std Y+63, r25 ; 0x3f 14312: 6e 97 sbiw r28, 0x1e ; 30 r_axis_y = r_axisi; 14314: c7 01 movw r24, r14 14316: d8 01 movw r26, r16 14318: 6a 96 adiw r28, 0x1a ; 26 1431a: 8c af std Y+60, r24 ; 0x3c 1431c: 9d af std Y+61, r25 ; 0x3d 1431e: ae af std Y+62, r26 ; 0x3e 14320: bf af std Y+63, r27 ; 0x3f 14322: 6a 97 sbiw r28, 0x1a ; 26 14324: d7 ce rjmp .-594 ; 0x140d4 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 14326: 80 e5 ldi r24, 0x50 ; 80 14328: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 1432c: c1 2c mov r12, r1 1432e: d1 2c mov r13, r1 14330: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 14332: 88 23 and r24, r24 14334: 31 f0 breq .+12 ; 0x14342 14336: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 1433a: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 1433e: 6b 01 movw r12, r22 14340: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 14342: 83 e5 ldi r24, 0x53 ; 83 14344: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 14348: 88 23 and r24, r24 1434a: 61 f0 breq .+24 ; 0x14364 1434c: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 14350: 20 e0 ldi r18, 0x00 ; 0 14352: 30 e0 ldi r19, 0x00 ; 0 14354: 4a e7 ldi r20, 0x7A ; 122 14356: 54 e4 ldi r21, 0x44 ; 68 14358: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1435c: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 14360: 6b 01 movw r12, r22 14362: 7c 01 movw r14, r24 if(codenum != 0) 14364: c1 14 cp r12, r1 14366: d1 04 cpc r13, r1 14368: e1 04 cpc r14, r1 1436a: f1 04 cpc r15, r1 1436c: 41 f0 breq .+16 ; 0x1437e { if(custom_message_type != CustomMsg::M117) 1436e: 80 91 75 07 lds r24, 0x0775 ; 0x800775 14372: 87 30 cpi r24, 0x07 ; 7 14374: 21 f0 breq .+8 ; 0x1437e { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 14376: 8b e6 ldi r24, 0x6B ; 107 14378: 9b e6 ldi r25, 0x6B ; 107 1437a: 0f 94 0c 0b call 0x21618 ; 0x21618 } } st_synchronize(); 1437e: 0f 94 27 58 call 0x2b04e ; 0x2b04e codenum += _millis(); // keep track of when we started waiting 14382: 0f 94 86 3e call 0x27d0c ; 0x27d0c 14386: c6 0e add r12, r22 14388: d7 1e adc r13, r23 1438a: e8 1e adc r14, r24 1438c: f9 1e adc r15, r25 previous_millis_cmd.start(); 1438e: 88 e8 ldi r24, 0x88 ; 136 14390: 93 e0 ldi r25, 0x03 ; 3 14392: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> while(_millis() < codenum) { 14396: 0f 94 86 3e call 0x27d0c ; 0x27d0c 1439a: 6c 15 cp r22, r12 1439c: 7d 05 cpc r23, r13 1439e: 8e 05 cpc r24, r14 143a0: 9f 05 cpc r25, r15 143a2: 08 f0 brcs .+2 ; 0x143a6 143a4: ce ca rjmp .-2660 ; 0x13942 manage_heater(); 143a6: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(); 143aa: 80 e0 ldi r24, 0x00 ; 0 143ac: 0e 94 5a 8c call 0x118b4 ; 0x118b4 lcd_update(0); 143b0: 80 e0 ldi r24, 0x00 ; 0 143b2: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 143b6: ef cf rjmp .-34 ; 0x14396 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); 143b8: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 143ba: 0f 94 c4 89 call 0x31388 ; 0x31388 143be: c1 ca rjmp .-2686 ; 0x13942 143c0: 80 e0 ldi r24, 0x00 ; 0 143c2: fb cf rjmp .-10 ; 0x143ba - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 143c4: 6e 96 adiw r28, 0x1e ; 30 143c6: 1c ae std Y+60, r1 ; 0x3c 143c8: 1d ae std Y+61, r1 ; 0x3d 143ca: 1e ae std Y+62, r1 ; 0x3e 143cc: 1f ae std Y+63, r1 ; 0x3f 143ce: 6e 97 sbiw r28, 0x1e ; 30 143d0: 35 ca rjmp .-2966 ; 0x1383c Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 143d2: 0f 94 27 58 call 0x2b04e ; 0x2b04e homing_flag = true; 143d6: 81 e0 ldi r24, 0x01 ; 1 143d8: 80 93 58 0e sts 0x0E58, r24 ; 0x800e58 // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly int l_feedmultiply = setup_for_endstop_move(); 143dc: 0e 94 1d 68 call 0xd03a ; 0xd03a 143e0: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 143e2: 80 e0 ldi r24, 0x00 ; 0 143e4: 90 e0 ldi r25, 0x00 ; 0 143e6: a8 e4 ldi r26, 0x48 ; 72 143e8: b4 e4 ldi r27, 0x44 ; 68 143ea: 80 93 90 02 sts 0x0290, r24 ; 0x800290 143ee: 90 93 91 02 sts 0x0291, r25 ; 0x800291 143f2: a0 93 92 02 sts 0x0292, r26 ; 0x800292 143f6: b0 93 93 02 sts 0x0293, r27 ; 0x800293 find_bed_induction_sensor_point_z(-10.f, 3); 143fa: 43 e0 ldi r20, 0x03 ; 3 143fc: 60 e0 ldi r22, 0x00 ; 0 143fe: 70 e0 ldi r23, 0x00 ; 0 14400: 80 e2 ldi r24, 0x20 ; 32 14402: 91 ec ldi r25, 0xC1 ; 193 14404: 0f 94 f3 8b call 0x317e6 ; 0x317e6 printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 14408: 70 90 4b 07 lds r7, 0x074B ; 0x80074b 1440c: 60 90 4c 07 lds r6, 0x074C ; 0x80074c 14410: 50 90 4d 07 lds r5, 0x074D ; 0x80074d 14414: 40 90 4e 07 lds r4, 0x074E ; 0x80074e 14418: b0 90 47 07 lds r11, 0x0747 ; 0x800747 1441c: a0 90 48 07 lds r10, 0x0748 ; 0x800748 14420: 90 90 49 07 lds r9, 0x0749 ; 0x800749 14424: 80 90 4a 07 lds r8, 0x074A ; 0x80074a 14428: f0 90 43 07 lds r15, 0x0743 ; 0x800743 1442c: e0 90 44 07 lds r14, 0x0744 ; 0x800744 14430: d0 90 45 07 lds r13, 0x0745 ; 0x800745 14434: c0 90 46 07 lds r12, 0x0746 ; 0x800746 14438: 88 ee ldi r24, 0xE8 ; 232 1443a: 97 e5 ldi r25, 0x57 ; 87 1443c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 14440: 4f 92 push r4 14442: 5f 92 push r5 14444: 6f 92 push r6 14446: 7f 92 push r7 14448: 8f 92 push r8 1444a: 9f 92 push r9 1444c: af 92 push r10 1444e: bf 92 push r11 14450: cf 92 push r12 14452: df 92 push r13 14454: ef 92 push r14 14456: ff 92 push r15 14458: 9f 93 push r25 1445a: 8f 93 push r24 1445c: 8f e4 ldi r24, 0x4F ; 79 1445e: 9b e6 ldi r25, 0x6B ; 107 14460: 9f 93 push r25 14462: 8f 93 push r24 14464: 0f 94 1d dc call 0x3b83a ; 0x3b83a clean_up_after_endstop_move(l_feedmultiply); 14468: c8 01 movw r24, r16 1446a: 0e 94 03 68 call 0xd006 ; 0xd006 homing_flag = false; 1446e: 10 92 58 0e sts 0x0E58, r1 ; 0x800e58 14472: 0f b6 in r0, 0x3f ; 63 14474: f8 94 cli 14476: de bf out 0x3e, r29 ; 62 14478: 0f be out 0x3f, r0 ; 63 1447a: cd bf out 0x3d, r28 ; 61 1447c: 62 ca rjmp .-2876 ; 0x13942 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 1447e: 20 e0 ldi r18, 0x00 ; 0 14480: 30 e0 ldi r19, 0x00 ; 0 14482: 40 e2 ldi r20, 0x20 ; 32 14484: 51 e4 ldi r21, 0x41 ; 65 14486: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1448a: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 1448e: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 14492: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 14496: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1449a: 87 ff sbrs r24, 7 1449c: 05 c0 rjmp .+10 ; 0x144a8 { SERIAL_ECHOLNPGM("No PINDA thermistor"); 1449e: 8a e6 ldi r24, 0x6A ; 106 144a0: 99 e8 ldi r25, 0x89 ; 137 144a2: 0e 94 86 7b call 0xf70c ; 0xf70c 144a6: 4d ca rjmp .-2918 ; 0x13942 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 144a8: 82 e0 ldi r24, 0x02 ; 2 144aa: 0e 94 6d f8 call 0x1f0da ; 0x1f0da 144ae: 81 11 cpse r24, r1 144b0: 07 c0 rjmp .+14 ; 0x144c0 //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)); 144b2: 8f e5 ldi r24, 0x5F ; 95 144b4: 9a e3 ldi r25, 0x3A ; 58 144b6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 144ba: 0f 94 07 35 call 0x26a0e ; 0x26a0e 144be: 41 ca rjmp .-2942 ; 0x13942 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 144c0: 80 91 40 07 lds r24, 0x0740 ; 0x800740 144c4: 88 23 and r24, r24 144c6: 41 f0 breq .+16 ; 0x144d8 144c8: 80 91 41 07 lds r24, 0x0741 ; 0x800741 144cc: 88 23 and r24, r24 144ce: 21 f0 breq .+8 ; 0x144d8 144d0: 10 91 42 07 lds r17, 0x0742 ; 0x800742 144d4: 11 11 cpse r17, r1 144d6: 08 c0 rjmp .+16 ; 0x144e8 144d8: 81 e0 ldi r24, 0x01 ; 1 144da: 80 93 80 10 sts 0x1080, r24 ; 0x801080 { // 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); 144de: 85 ec ldi r24, 0xC5 ; 197 144e0: 9c e6 ldi r25, 0x6C ; 108 144e2: 0f 94 e8 75 call 0x2ebd0 ; 0x2ebd0 144e6: 2d ca rjmp .-2982 ; 0x13942 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 144e8: 86 e1 ldi r24, 0x16 ; 22 144ea: 9a e3 ldi r25, 0x3A ; 58 144ec: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 144f0: 0f 94 07 35 call 0x26a0e ; 0x26a0e uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 144f4: 82 ec ldi r24, 0xC2 ; 194 144f6: 92 e5 ldi r25, 0x52 ; 82 144f8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 144fc: 41 e0 ldi r20, 0x01 ; 1 144fe: 60 e0 ldi r22, 0x00 ; 0 14500: 0f 94 b3 64 call 0x2c966 ; 0x2c966 if (result == LCD_LEFT_BUTTON_CHOICE) 14504: 81 11 cpse r24, r1 14506: 61 c0 rjmp .+194 ; 0x145ca { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14508: 80 e0 ldi r24, 0x00 ; 0 1450a: 90 e0 ldi r25, 0x00 ; 0 1450c: a0 ea ldi r26, 0xA0 ; 160 1450e: b0 e4 ldi r27, 0x40 ; 64 14510: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 14514: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 14518: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 1451c: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 14520: 60 e0 ldi r22, 0x00 ; 0 14522: 70 e0 ldi r23, 0x00 ; 0 14524: 88 e4 ldi r24, 0x48 ; 72 14526: 92 e4 ldi r25, 0x42 ; 66 14528: 0f 94 5d ba call 0x374ba ; 0x374ba current_position[Z_AXIS] = 50; 1452c: 80 e0 ldi r24, 0x00 ; 0 1452e: 90 e0 ldi r25, 0x00 ; 0 14530: a8 e4 ldi r26, 0x48 ; 72 14532: b2 e4 ldi r27, 0x42 ; 66 14534: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 14538: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 1453c: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 14540: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e current_position[Y_AXIS] = 180; 14544: 80 e0 ldi r24, 0x00 ; 0 14546: 90 e0 ldi r25, 0x00 ; 0 14548: a4 e3 ldi r26, 0x34 ; 52 1454a: b3 e4 ldi r27, 0x43 ; 67 1454c: 80 93 47 07 sts 0x0747, r24 ; 0x800747 14550: 90 93 48 07 sts 0x0748, r25 ; 0x800748 14554: a0 93 49 07 sts 0x0749, r26 ; 0x800749 14558: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(3000 / 60); 1455c: 60 e0 ldi r22, 0x00 ; 0 1455e: 70 e0 ldi r23, 0x00 ; 0 14560: 88 e4 ldi r24, 0x48 ; 72 14562: 92 e4 ldi r25, 0x42 ; 66 14564: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 14568: 0f 94 27 58 call 0x2b04e ; 0x2b04e lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 1456c: 88 e9 ldi r24, 0x98 ; 152 1456e: 92 e5 ldi r25, 0x52 ; 82 14570: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 14574: 0f 94 07 35 call 0x26a0e ; 0x26a0e current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 14578: e0 e1 ldi r30, 0x10 ; 16 1457a: f3 e9 ldi r31, 0x93 ; 147 1457c: 85 91 lpm r24, Z+ 1457e: 95 91 lpm r25, Z+ 14580: a5 91 lpm r26, Z+ 14582: b4 91 lpm r27, Z 14584: 80 93 47 07 sts 0x0747, r24 ; 0x800747 14588: 90 93 48 07 sts 0x0748, r25 ; 0x800748 1458c: a0 93 49 07 sts 0x0749, r26 ; 0x800749 14590: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 14594: ec e0 ldi r30, 0x0C ; 12 14596: f3 e9 ldi r31, 0x93 ; 147 14598: 85 91 lpm r24, Z+ 1459a: 95 91 lpm r25, Z+ 1459c: a5 91 lpm r26, Z+ 1459e: b4 91 lpm r27, Z 145a0: 80 93 43 07 sts 0x0743, r24 ; 0x800743 145a4: 90 93 44 07 sts 0x0744, r25 ; 0x800744 145a8: a0 93 45 07 sts 0x0745, r26 ; 0x800745 145ac: b0 93 46 07 sts 0x0746, r27 ; 0x800746 plan_buffer_line_curposXYZE(3000 / 60); 145b0: 60 e0 ldi r22, 0x00 ; 0 145b2: 70 e0 ldi r23, 0x00 ; 0 145b4: 88 e4 ldi r24, 0x48 ; 72 145b6: 92 e4 ldi r25, 0x42 ; 66 145b8: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 145bc: 0f 94 27 58 call 0x2b04e ; 0x2b04e gcode_G28(false, false, true); 145c0: 41 e0 ldi r20, 0x01 ; 1 145c2: 60 e0 ldi r22, 0x00 ; 0 145c4: 80 e0 ldi r24, 0x00 ; 0 145c6: 0e 94 10 81 call 0x10220 ; 0x10220 } if ((current_temperature_pinda > 35) && (farm_mode == false)) { 145ca: 20 e0 ldi r18, 0x00 ; 0 145cc: 30 e0 ldi r19, 0x00 ; 0 145ce: 4c e0 ldi r20, 0x0C ; 12 145d0: 52 e4 ldi r21, 0x42 ; 66 145d2: 60 91 99 03 lds r22, 0x0399 ; 0x800399 145d6: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 145da: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 145de: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 145e2: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 145e6: 18 16 cp r1, r24 145e8: 0c f0 brlt .+2 ; 0x145ec 145ea: 73 c0 rjmp .+230 ; 0x146d2 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 145ec: 80 e0 ldi r24, 0x00 ; 0 145ee: 90 e0 ldi r25, 0x00 ; 0 145f0: a8 ec ldi r26, 0xC8 ; 200 145f2: b2 e4 ldi r27, 0x42 ; 66 145f4: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 145f8: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 145fc: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 14600: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 14604: 60 e0 ldi r22, 0x00 ; 0 14606: 70 e0 ldi r23, 0x00 ; 0 14608: 88 e4 ldi r24, 0x48 ; 72 1460a: 92 e4 ldi r25, 0x42 ; 66 1460c: 0f 94 5d ba call 0x374ba ; 0x374ba } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 14610: 0f 94 52 44 call 0x288a4 ; 0x288a4 LongTimer pinda_timeout; 14614: 19 82 std Y+1, r1 ; 0x01 14616: 1a 82 std Y+2, r1 ; 0x02 14618: 1b 82 std Y+3, r1 ; 0x03 1461a: 1c 82 std Y+4, r1 ; 0x04 1461c: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 1461e: ce 01 movw r24, r28 14620: 01 96 adiw r24, 0x01 ; 1 14622: 0f 94 29 41 call 0x28252 ; 0x28252 ::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); 14626: 03 e2 ldi r16, 0x23 ; 35 14628: 6e e9 ldi r22, 0x9E ; 158 1462a: e6 2e mov r14, r22 1462c: 66 e8 ldi r22, 0x86 ; 134 1462e: f6 2e mov r15, r22 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 14630: 20 e0 ldi r18, 0x00 ; 0 14632: 30 e0 ldi r19, 0x00 ; 0 14634: 4c e0 ldi r20, 0x0C ; 12 14636: 52 e4 ldi r21, 0x42 ; 66 14638: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1463c: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 14640: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 14644: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 14648: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1464c: 18 16 cp r1, r24 1464e: c4 f5 brge .+112 ; 0x146c0 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 14650: 88 ec ldi r24, 0xC8 ; 200 14652: 99 e3 ldi r25, 0x39 ; 57 14654: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 14658: 0f 94 80 34 call 0x26900 ; 0x26900 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1465c: 42 e8 ldi r20, 0x82 ; 130 1465e: 64 e0 ldi r22, 0x04 ; 4 14660: 80 e0 ldi r24, 0x00 ; 0 14662: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 14666: 1f 92 push r1 14668: 0f 93 push r16 1466a: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1466e: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 14672: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 14676: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1467a: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 1467e: 7f 93 push r23 14680: 6f 93 push r22 14682: ff 92 push r15 14684: ef 92 push r14 14686: 0e 94 ee 6f call 0xdfdc ; 0xdfdc lcd_putc(LCD_STR_DEGREE[0]); 1468a: 81 e8 ldi r24, 0x81 ; 129 1468c: 0e 94 04 70 call 0xe008 ; 0xe008 delay_keep_alive(1000); 14690: 88 ee ldi r24, 0xE8 ; 232 14692: 93 e0 ldi r25, 0x03 ; 3 14694: 0e 94 ff 8e call 0x11dfe ; 0x11dfe serialecho_temperatures(); 14698: 0e 94 69 79 call 0xf2d2 ; 0xf2d2 if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 1469c: 40 e0 ldi r20, 0x00 ; 0 1469e: 53 e5 ldi r21, 0x53 ; 83 146a0: 67 e0 ldi r22, 0x07 ; 7 146a2: 70 e0 ldi r23, 0x00 ; 0 146a4: ce 01 movw r24, r28 146a6: 01 96 adiw r24, 0x01 ; 1 146a8: 0f 94 6a 3f call 0x27ed4 ; 0x27ed4 ::expired(unsigned long)> 146ac: 0f 90 pop r0 146ae: 0f 90 pop r0 146b0: 0f 90 pop r0 146b2: 0f 90 pop r0 146b4: 0f 90 pop r0 146b6: 0f 90 pop r0 146b8: 88 23 and r24, r24 146ba: 09 f4 brne .+2 ; 0x146be 146bc: b9 cf rjmp .-142 ; 0x14630 target_temp_reached = false; 146be: 10 e0 ldi r17, 0x00 ; 0 break; } } lcd_update_enable(true); 146c0: 81 e0 ldi r24, 0x01 ; 1 146c2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 146c6: 11 11 cpse r17, r1 146c8: 04 c0 rjmp .+8 ; 0x146d2 lcd_temp_cal_show_result(false); 146ca: 80 e0 ldi r24, 0x00 ; 0 146cc: 0f 94 98 35 call 0x26b30 ; 0x26b30 146d0: 38 c9 rjmp .-3472 ; 0x13942 break; } } st_synchronize(); 146d2: 0f 94 27 58 call 0x2b04e ; 0x2b04e homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 146d6: 81 e0 ldi r24, 0x01 ; 1 146d8: 80 93 58 0e sts 0x0E58, r24 ; 0x800e58 lcd_update_enable(true); 146dc: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNPGM("PINDA probe calibration start"); 146e0: 8c e4 ldi r24, 0x4C ; 76 146e2: 99 e8 ldi r25, 0x89 ; 137 146e4: 0e 94 86 7b call 0xf70c ; 0xf70c float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 146e8: 80 90 99 03 lds r8, 0x0399 ; 0x800399 146ec: 90 90 9a 03 lds r9, 0x039A ; 0x80039a 146f0: a0 90 9b 03 lds r10, 0x039B ; 0x80039b 146f4: b0 90 9c 03 lds r11, 0x039C ; 0x80039c 146f8: 20 e0 ldi r18, 0x00 ; 0 146fa: 30 e0 ldi r19, 0x00 ; 0 146fc: 40 ea ldi r20, 0xA0 ; 160 146fe: 50 e4 ldi r21, 0x40 ; 64 14700: c5 01 movw r24, r10 14702: b4 01 movw r22, r8 14704: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 14708: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 1470c: 25 e0 ldi r18, 0x05 ; 5 1470e: 26 9f mul r18, r22 14710: a0 01 movw r20, r0 14712: 27 9f mul r18, r23 14714: 50 0d add r21, r0 14716: 11 24 eor r1, r1 14718: ba 01 movw r22, r20 1471a: 55 0f add r21, r21 1471c: 88 0b sbc r24, r24 1471e: 99 0b sbc r25, r25 14720: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 14724: 1b 01 movw r2, r22 14726: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 14728: 20 e0 ldi r18, 0x00 ; 0 1472a: 30 e0 ldi r19, 0x00 ; 0 1472c: 4c e0 ldi r20, 0x0C ; 12 1472e: 52 e4 ldi r21, 0x42 ; 66 14730: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 14734: 87 ff sbrs r24, 7 14736: 06 c0 rjmp .+12 ; 0x14744 14738: 21 2c mov r2, r1 1473a: 31 2c mov r3, r1 1473c: 4c e0 ldi r20, 0x0C ; 12 1473e: e4 2e mov r14, r20 14740: 52 e4 ldi r21, 0x42 ; 66 14742: f5 2e mov r15, r21 if (start_temp < current_temperature_pinda) start_temp += 5; 14744: 22 2d mov r18, r2 14746: 33 2d mov r19, r3 14748: 4e 2d mov r20, r14 1474a: 5f 2d mov r21, r15 1474c: c5 01 movw r24, r10 1474e: b4 01 movw r22, r8 14750: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 14754: 18 16 cp r1, r24 14756: 64 f4 brge .+24 ; 0x14770 14758: 20 e0 ldi r18, 0x00 ; 0 1475a: 30 e0 ldi r19, 0x00 ; 0 1475c: 40 ea ldi r20, 0xA0 ; 160 1475e: 50 e4 ldi r21, 0x40 ; 64 14760: 62 2d mov r22, r2 14762: 73 2d mov r23, r3 14764: 8e 2d mov r24, r14 14766: 9f 2d mov r25, r15 14768: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1476c: 1b 01 movw r2, r22 1476e: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 14770: ff 92 push r15 14772: ef 92 push r14 14774: 3f 92 push r3 14776: 2f 92 push r2 14778: 8d e2 ldi r24, 0x2D ; 45 1477a: 9b e6 ldi r25, 0x6B ; 107 1477c: 9f 93 push r25 1477e: 8f 93 push r24 14780: 0f 94 1d dc call 0x3b83a ; 0x3b83a setTargetBed(70 + (start_temp - 30)); 14784: 20 e0 ldi r18, 0x00 ; 0 14786: 30 e0 ldi r19, 0x00 ; 0 14788: 40 ef ldi r20, 0xF0 ; 240 1478a: 51 e4 ldi r21, 0x41 ; 65 1478c: 62 2d mov r22, r2 1478e: 73 2d mov r23, r3 14790: 8e 2d mov r24, r14 14792: 9f 2d mov r25, r15 14794: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 14798: 20 e0 ldi r18, 0x00 ; 0 1479a: 30 e0 ldi r19, 0x00 ; 0 1479c: 4c e8 ldi r20, 0x8C ; 140 1479e: 52 e4 ldi r21, 0x42 ; 66 147a0: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 147a4: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 147a8: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 147ac: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b custom_message_type = CustomMsg::TempCal; 147b0: 84 e0 ldi r24, 0x04 ; 4 147b2: 80 93 75 07 sts 0x0775, r24 ; 0x800775 custom_message_state = 1; 147b6: 81 e0 ldi r24, 0x01 ; 1 147b8: 80 93 f3 03 sts 0x03F3, r24 ; 0x8003f3 lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 147bc: 83 e8 ldi r24, 0x83 ; 131 147be: 9a e3 ldi r25, 0x3A ; 58 147c0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 147c4: 0f 94 0c 0b call 0x21618 ; 0x21618 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 147c8: 80 e0 ldi r24, 0x00 ; 0 147ca: 90 e0 ldi r25, 0x00 ; 0 147cc: a0 ea ldi r26, 0xA0 ; 160 147ce: b0 e4 ldi r27, 0x40 ; 64 147d0: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 147d4: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 147d8: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 147dc: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 147e0: 60 e0 ldi r22, 0x00 ; 0 147e2: 70 e0 ldi r23, 0x00 ; 0 147e4: 88 e4 ldi r24, 0x48 ; 72 147e6: 92 e4 ldi r25, 0x42 ; 66 147e8: 0f 94 5d ba call 0x374ba ; 0x374ba current_position[X_AXIS] = PINDA_PREHEAT_X; 147ec: 80 e0 ldi r24, 0x00 ; 0 147ee: 90 e0 ldi r25, 0x00 ; 0 147f0: a0 ea ldi r26, 0xA0 ; 160 147f2: b1 e4 ldi r27, 0x41 ; 65 147f4: 80 93 43 07 sts 0x0743, r24 ; 0x800743 147f8: 90 93 44 07 sts 0x0744, r25 ; 0x800744 147fc: a0 93 45 07 sts 0x0745, r26 ; 0x800745 14800: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 14804: 80 e0 ldi r24, 0x00 ; 0 14806: 90 e0 ldi r25, 0x00 ; 0 14808: a0 e7 ldi r26, 0x70 ; 112 1480a: b2 e4 ldi r27, 0x42 ; 66 1480c: 80 93 47 07 sts 0x0747, r24 ; 0x800747 14810: 90 93 48 07 sts 0x0748, r25 ; 0x800748 14814: a0 93 49 07 sts 0x0749, r26 ; 0x800749 14818: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(3000 / 60); 1481c: 60 e0 ldi r22, 0x00 ; 0 1481e: 70 e0 ldi r23, 0x00 ; 0 14820: 88 e4 ldi r24, 0x48 ; 72 14822: 92 e4 ldi r25, 0x42 ; 66 14824: 0f 94 5d ba call 0x374ba ; 0x374ba current_position[Z_AXIS] = PINDA_PREHEAT_Z; 14828: 8a e9 ldi r24, 0x9A ; 154 1482a: 99 e9 ldi r25, 0x99 ; 153 1482c: a9 e1 ldi r26, 0x19 ; 25 1482e: be e3 ldi r27, 0x3E ; 62 14830: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 14834: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 14838: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 1483c: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 14840: 60 e0 ldi r22, 0x00 ; 0 14842: 70 e0 ldi r23, 0x00 ; 0 14844: 88 e4 ldi r24, 0x48 ; 72 14846: 92 e4 ldi r25, 0x42 ; 66 14848: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 1484c: 0f 94 27 58 call 0x2b04e ; 0x2b04e 14850: 0f 90 pop r0 14852: 0f 90 pop r0 14854: 0f 90 pop r0 14856: 0f 90 pop r0 14858: 0f 90 pop r0 1485a: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 1485c: 20 91 99 03 lds r18, 0x0399 ; 0x800399 14860: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 14864: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 14868: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 1486c: 62 2d mov r22, r2 1486e: 73 2d mov r23, r3 14870: 8e 2d mov r24, r14 14872: 9f 2d mov r25, r15 14874: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 14878: 18 16 cp r1, r24 1487a: 3c f4 brge .+14 ; 0x1488a { delay_keep_alive(1000); 1487c: 88 ee ldi r24, 0xE8 ; 232 1487e: 93 e0 ldi r25, 0x03 ; 3 14880: 0e 94 ff 8e call 0x11dfe ; 0x11dfe serialecho_temperatures(); 14884: 0e 94 69 79 call 0xf2d2 ; 0xf2d2 14888: e9 cf rjmp .-46 ; 0x1485c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1488a: 60 e0 ldi r22, 0x00 ; 0 1488c: 86 ea ldi r24, 0xA6 ; 166 1488e: 9f e0 ldi r25, 0x0F ; 15 14890: 0f 94 7f dd call 0x3bafe ; 0x3bafe } 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; 14894: 80 e0 ldi r24, 0x00 ; 0 14896: 90 e0 ldi r25, 0x00 ; 0 14898: a0 ea ldi r26, 0xA0 ; 160 1489a: b0 e4 ldi r27, 0x40 ; 64 1489c: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 148a0: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 148a4: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 148a8: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 148ac: 60 e0 ldi r22, 0x00 ; 0 148ae: 70 e0 ldi r23, 0x00 ; 0 148b0: 88 e4 ldi r24, 0x48 ; 72 148b2: 92 e4 ldi r25, 0x42 ; 66 148b4: 0f 94 5d ba call 0x374ba ; 0x374ba current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 148b8: ec e0 ldi r30, 0x0C ; 12 148ba: f3 e9 ldi r31, 0x93 ; 147 148bc: 85 91 lpm r24, Z+ 148be: 95 91 lpm r25, Z+ 148c0: a5 91 lpm r26, Z+ 148c2: b4 91 lpm r27, Z 148c4: 80 93 43 07 sts 0x0743, r24 ; 0x800743 148c8: 90 93 44 07 sts 0x0744, r25 ; 0x800744 148cc: a0 93 45 07 sts 0x0745, r26 ; 0x800745 148d0: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 148d4: e0 e1 ldi r30, 0x10 ; 16 148d6: f3 e9 ldi r31, 0x93 ; 147 148d8: 85 91 lpm r24, Z+ 148da: 95 91 lpm r25, Z+ 148dc: a5 91 lpm r26, Z+ 148de: b4 91 lpm r27, Z 148e0: 80 93 47 07 sts 0x0747, r24 ; 0x800747 148e4: 90 93 48 07 sts 0x0748, r25 ; 0x800748 148e8: a0 93 49 07 sts 0x0749, r26 ; 0x800749 148ec: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(3000 / 60); 148f0: 60 e0 ldi r22, 0x00 ; 0 148f2: 70 e0 ldi r23, 0x00 ; 0 148f4: 88 e4 ldi r24, 0x48 ; 72 148f6: 92 e4 ldi r25, 0x42 ; 66 148f8: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 148fc: 0f 94 27 58 call 0x2b04e ; 0x2b04e bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 14900: 43 e0 ldi r20, 0x03 ; 3 14902: 60 e0 ldi r22, 0x00 ; 0 14904: 70 e0 ldi r23, 0x00 ; 0 14906: 80 e8 ldi r24, 0x80 ; 128 14908: 9f eb ldi r25, 0xBF ; 191 1490a: 0f 94 f3 8b call 0x317e6 ; 0x317e6 if (find_z_result == false) { 1490e: 81 11 cpse r24, r1 14910: 06 c0 rjmp .+12 ; 0x1491e 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); 14912: 0f 94 98 35 call 0x26b30 ; 0x26b30 homing_flag = false; 14916: 10 92 58 0e sts 0x0E58, r1 ; 0x800e58 1491a: 0c 94 a1 9c jmp 0x13942 ; 0x13942 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 1491e: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 14922: 67 96 adiw r28, 0x17 ; 23 14924: 9f af std Y+63, r25 ; 0x3f 14926: 67 97 sbiw r28, 0x17 ; 23 14928: a0 91 4c 07 lds r26, 0x074C ; 0x80074c 1492c: 6b 96 adiw r28, 0x1b ; 27 1492e: af af std Y+63, r26 ; 0x3f 14930: 6b 97 sbiw r28, 0x1b ; 27 14932: b0 91 4d 07 lds r27, 0x074D ; 0x80074d 14936: 6f 96 adiw r28, 0x1f ; 31 14938: bf af std Y+63, r27 ; 0x3f 1493a: 6f 97 sbiw r28, 0x1f ; 31 1493c: e0 91 4e 07 lds r30, 0x074E ; 0x80074e 14940: a7 96 adiw r28, 0x27 ; 39 14942: ef af std Y+63, r30 ; 0x3f 14944: a7 97 sbiw r28, 0x27 ; 39 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 14946: ef 93 push r30 14948: bf 93 push r27 1494a: af 93 push r26 1494c: 9f 93 push r25 1494e: 80 e2 ldi r24, 0x20 ; 32 14950: 9b e6 ldi r25, 0x6B ; 107 14952: 9f 93 push r25 14954: 8f 93 push r24 14956: 0f 94 1d dc call 0x3b83a ; 0x3b83a 1495a: 0f 90 pop r0 1495c: 0f 90 pop r0 1495e: 0f 90 pop r0 14960: 0f 90 pop r0 14962: 0f 90 pop r0 14964: 0f 90 pop r0 14966: 2e ea ldi r18, 0xAE ; 174 14968: 82 2e mov r8, r18 1496a: 2f e0 ldi r18, 0x0F ; 15 1496c: 92 2e mov r9, r18 1496e: 33 e2 ldi r19, 0x23 ; 35 14970: c3 2e mov r12, r19 14972: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 14974: 0f ef ldi r16, 0xFF ; 255 14976: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 14978: b6 01 movw r22, r12 1497a: 0d 2c mov r0, r13 1497c: 00 0c add r0, r0 1497e: 88 0b sbc r24, r24 14980: 99 0b sbc r25, r25 14982: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 14986: 2b 01 movw r4, r22 14988: 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)); 1498a: df 92 push r13 1498c: cf 92 push r12 1498e: c8 01 movw r24, r16 14990: 02 96 adiw r24, 0x02 ; 2 14992: 9f 93 push r25 14994: 8f 93 push r24 14996: 24 ee ldi r18, 0xE4 ; 228 14998: 3a e6 ldi r19, 0x6A ; 106 1499a: 3f 93 push r19 1499c: 2f 93 push r18 1499e: 0f 94 1d dc call 0x3b83a ; 0x3b83a 149a2: 58 01 movw r10, r16 149a4: 5f ef ldi r21, 0xFF ; 255 149a6: a5 1a sub r10, r21 149a8: b5 0a sbc r11, r21 if (i >= 0) { 149aa: 0f 90 pop r0 149ac: 0f 90 pop r0 149ae: 0f 90 pop r0 149b0: 0f 90 pop r0 149b2: 0f 90 pop r0 149b4: 0f 90 pop r0 149b6: 11 f4 brne .+4 ; 0x149bc 149b8: 0c 94 59 ce jmp 0x19cb2 ; 0x19cb2 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 149bc: 70 e0 ldi r23, 0x00 ; 0 149be: 60 e0 ldi r22, 0x00 ; 0 149c0: c4 01 movw r24, r8 149c2: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 149c6: a3 01 movw r20, r6 149c8: 92 01 movw r18, r4 149ca: 62 2d mov r22, r2 149cc: 73 2d mov r23, r3 149ce: 8e 2d mov r24, r14 149d0: 9f 2d mov r25, r15 149d2: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 149d6: 18 16 cp r1, r24 149d8: 44 f4 brge .+16 ; 0x149ea } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 149da: 85 e0 ldi r24, 0x05 ; 5 149dc: a8 16 cp r10, r24 149de: b1 04 cpc r11, r1 149e0: 11 f0 breq .+4 ; 0x149e6 149e2: 0c 94 65 ce jmp 0x19cca ; 0x19cca 149e6: 05 e0 ldi r16, 0x05 ; 5 149e8: 10 e0 ldi r17, 0x00 ; 0 149ea: 58 01 movw r10, r16 149ec: 97 e2 ldi r25, 0x27 ; 39 149ee: a9 1a sub r10, r25 149f0: 98 ef ldi r25, 0xF8 ; 248 149f2: b9 0a sbc r11, r25 149f4: aa 0c add r10, r10 149f6: bb 1c adc r11, r11 149f8: 85 e0 ldi r24, 0x05 ; 5 149fa: 80 9f mul r24, r16 149fc: 10 01 movw r2, r0 149fe: 81 9f mul r24, r17 14a00: 30 0c add r3, r0 14a02: 11 24 eor r1, r1 14a04: 0d 5f subi r16, 0xFD ; 253 14a06: 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; 14a08: 8a e9 ldi r24, 0x9A ; 154 14a0a: 48 2e mov r4, r24 14a0c: 89 e9 ldi r24, 0x99 ; 153 14a0e: 58 2e mov r5, r24 14a10: 89 e1 ldi r24, 0x19 ; 25 14a12: 68 2e mov r6, r24 14a14: 8e e3 ldi r24, 0x3E ; 62 14a16: 78 2e mov r7, r24 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); 14a18: 9b ea ldi r25, 0xAB ; 171 14a1a: 89 2e mov r8, r25 14a1c: 9a e6 ldi r25, 0x6A ; 106 14a1e: 99 2e mov r9, r25 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; } for (i++; i < 5; i++) 14a20: c8 01 movw r24, r16 14a22: 02 97 sbiw r24, 0x02 ; 2 14a24: 05 97 sbiw r24, 0x05 ; 5 14a26: 0c f0 brlt .+2 ; 0x14a2a 14a28: d4 c0 rjmp .+424 ; 0x14bd2 { float temp = (40 + i * 5); 14a2a: b1 01 movw r22, r2 14a2c: 63 5d subi r22, 0xD3 ; 211 14a2e: 7f 4f sbci r23, 0xFF ; 255 14a30: 07 2e mov r0, r23 14a32: 00 0c add r0, r0 14a34: 88 0b sbc r24, r24 14a36: 99 0b sbc r25, r25 14a38: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 14a3c: 6b 01 movw r12, r22 14a3e: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 14a40: 1f 93 push r17 14a42: 0f 93 push r16 14a44: a7 ed ldi r26, 0xD7 ; 215 14a46: ba e6 ldi r27, 0x6A ; 106 14a48: bf 93 push r27 14a4a: af 93 push r26 14a4c: 0f 94 1d dc call 0x3b83a ; 0x3b83a custom_message_state = i + 2; 14a50: 00 93 f3 03 sts 0x03F3, r16 ; 0x8003f3 setTargetBed(50 + 10 * (temp - 30) / 5); 14a54: 20 e0 ldi r18, 0x00 ; 0 14a56: 30 e0 ldi r19, 0x00 ; 0 14a58: 40 ef ldi r20, 0xF0 ; 240 14a5a: 51 e4 ldi r21, 0x41 ; 65 14a5c: c7 01 movw r24, r14 14a5e: b6 01 movw r22, r12 14a60: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 14a64: 20 e0 ldi r18, 0x00 ; 0 14a66: 30 e0 ldi r19, 0x00 ; 0 14a68: 40 e2 ldi r20, 0x20 ; 32 14a6a: 51 e4 ldi r21, 0x41 ; 65 14a6c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 14a70: 20 e0 ldi r18, 0x00 ; 0 14a72: 30 e0 ldi r19, 0x00 ; 0 14a74: 40 ea ldi r20, 0xA0 ; 160 14a76: 50 e4 ldi r21, 0x40 ; 64 14a78: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 14a7c: 20 e0 ldi r18, 0x00 ; 0 14a7e: 30 e0 ldi r19, 0x00 ; 0 14a80: 48 e4 ldi r20, 0x48 ; 72 14a82: 52 e4 ldi r21, 0x42 ; 66 14a84: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 14a88: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 14a8c: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 14a90: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14a94: 80 e0 ldi r24, 0x00 ; 0 14a96: 90 e0 ldi r25, 0x00 ; 0 14a98: a0 ea ldi r26, 0xA0 ; 160 14a9a: b0 e4 ldi r27, 0x40 ; 64 14a9c: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 14aa0: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 14aa4: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 14aa8: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 14aac: 60 e0 ldi r22, 0x00 ; 0 14aae: 70 e0 ldi r23, 0x00 ; 0 14ab0: 88 e4 ldi r24, 0x48 ; 72 14ab2: 92 e4 ldi r25, 0x42 ; 66 14ab4: 0f 94 5d ba call 0x374ba ; 0x374ba current_position[X_AXIS] = PINDA_PREHEAT_X; 14ab8: 20 e0 ldi r18, 0x00 ; 0 14aba: 30 e0 ldi r19, 0x00 ; 0 14abc: 40 ea ldi r20, 0xA0 ; 160 14abe: 51 e4 ldi r21, 0x41 ; 65 14ac0: 20 93 43 07 sts 0x0743, r18 ; 0x800743 14ac4: 30 93 44 07 sts 0x0744, r19 ; 0x800744 14ac8: 40 93 45 07 sts 0x0745, r20 ; 0x800745 14acc: 50 93 46 07 sts 0x0746, r21 ; 0x800746 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 14ad0: 80 e0 ldi r24, 0x00 ; 0 14ad2: 90 e0 ldi r25, 0x00 ; 0 14ad4: a0 e7 ldi r26, 0x70 ; 112 14ad6: b2 e4 ldi r27, 0x42 ; 66 14ad8: 80 93 47 07 sts 0x0747, r24 ; 0x800747 14adc: 90 93 48 07 sts 0x0748, r25 ; 0x800748 14ae0: a0 93 49 07 sts 0x0749, r26 ; 0x800749 14ae4: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(3000 / 60); 14ae8: 60 e0 ldi r22, 0x00 ; 0 14aea: 70 e0 ldi r23, 0x00 ; 0 14aec: 88 e4 ldi r24, 0x48 ; 72 14aee: 92 e4 ldi r25, 0x42 ; 66 14af0: 0f 94 5d ba call 0x374ba ; 0x374ba current_position[Z_AXIS] = PINDA_PREHEAT_Z; 14af4: 40 92 4b 07 sts 0x074B, r4 ; 0x80074b 14af8: 50 92 4c 07 sts 0x074C, r5 ; 0x80074c 14afc: 60 92 4d 07 sts 0x074D, r6 ; 0x80074d 14b00: 70 92 4e 07 sts 0x074E, r7 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 14b04: 60 e0 ldi r22, 0x00 ; 0 14b06: 70 e0 ldi r23, 0x00 ; 0 14b08: 88 e4 ldi r24, 0x48 ; 72 14b0a: 92 e4 ldi r25, 0x42 ; 66 14b0c: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 14b10: 0f 94 27 58 call 0x2b04e ; 0x2b04e 14b14: 0f 90 pop r0 14b16: 0f 90 pop r0 14b18: 0f 90 pop r0 14b1a: 0f 90 pop r0 while (current_temperature_pinda < temp) 14b1c: 20 91 99 03 lds r18, 0x0399 ; 0x800399 14b20: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 14b24: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 14b28: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 14b2c: c7 01 movw r24, r14 14b2e: b6 01 movw r22, r12 14b30: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 14b34: 18 16 cp r1, r24 14b36: 3c f4 brge .+14 ; 0x14b46 { delay_keep_alive(1000); 14b38: 88 ee ldi r24, 0xE8 ; 232 14b3a: 93 e0 ldi r25, 0x03 ; 3 14b3c: 0e 94 ff 8e call 0x11dfe ; 0x11dfe serialecho_temperatures(); 14b40: 0e 94 69 79 call 0xf2d2 ; 0xf2d2 14b44: eb cf rjmp .-42 ; 0x14b1c } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14b46: 80 e0 ldi r24, 0x00 ; 0 14b48: 90 e0 ldi r25, 0x00 ; 0 14b4a: a0 ea ldi r26, 0xA0 ; 160 14b4c: b0 e4 ldi r27, 0x40 ; 64 14b4e: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 14b52: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 14b56: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 14b5a: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 14b5e: 60 e0 ldi r22, 0x00 ; 0 14b60: 70 e0 ldi r23, 0x00 ; 0 14b62: 88 e4 ldi r24, 0x48 ; 72 14b64: 92 e4 ldi r25, 0x42 ; 66 14b66: 0f 94 5d ba call 0x374ba ; 0x374ba current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 14b6a: ec e0 ldi r30, 0x0C ; 12 14b6c: f3 e9 ldi r31, 0x93 ; 147 14b6e: 85 91 lpm r24, Z+ 14b70: 95 91 lpm r25, Z+ 14b72: a5 91 lpm r26, Z+ 14b74: b4 91 lpm r27, Z 14b76: 80 93 43 07 sts 0x0743, r24 ; 0x800743 14b7a: 90 93 44 07 sts 0x0744, r25 ; 0x800744 14b7e: a0 93 45 07 sts 0x0745, r26 ; 0x800745 14b82: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 14b86: e0 e1 ldi r30, 0x10 ; 16 14b88: f3 e9 ldi r31, 0x93 ; 147 14b8a: 85 91 lpm r24, Z+ 14b8c: 95 91 lpm r25, Z+ 14b8e: a5 91 lpm r26, Z+ 14b90: b4 91 lpm r27, Z 14b92: 80 93 47 07 sts 0x0747, r24 ; 0x800747 14b96: 90 93 48 07 sts 0x0748, r25 ; 0x800748 14b9a: a0 93 49 07 sts 0x0749, r26 ; 0x800749 14b9e: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(3000 / 60); 14ba2: 60 e0 ldi r22, 0x00 ; 0 14ba4: 70 e0 ldi r23, 0x00 ; 0 14ba6: 88 e4 ldi r24, 0x48 ; 72 14ba8: 92 e4 ldi r25, 0x42 ; 66 14baa: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 14bae: 0f 94 27 58 call 0x2b04e ; 0x2b04e find_z_result = find_bed_induction_sensor_point_z(-1.f); 14bb2: 43 e0 ldi r20, 0x03 ; 3 14bb4: 60 e0 ldi r22, 0x00 ; 0 14bb6: 70 e0 ldi r23, 0x00 ; 0 14bb8: 80 e8 ldi r24, 0x80 ; 128 14bba: 9f eb ldi r25, 0xBF ; 191 14bbc: 0f 94 f3 8b call 0x317e6 ; 0x317e6 14bc0: 95 e0 ldi r25, 0x05 ; 5 14bc2: 29 0e add r2, r25 14bc4: 31 1c adc r3, r1 14bc6: 0f 5f subi r16, 0xFF ; 255 14bc8: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 14bca: 81 11 cpse r24, r1 14bcc: 04 c0 rjmp .+8 ; 0x14bd6 lcd_temp_cal_show_result(find_z_result); 14bce: 0f 94 98 35 call 0x26b30 ; 0x26b30 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); 14bd2: 81 e0 ldi r24, 0x01 ; 1 14bd4: 9e ce rjmp .-708 ; 0x14912 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]); 14bd6: 67 96 adiw r28, 0x17 ; 23 14bd8: 7f ad ldd r23, Y+63 ; 0x3f 14bda: 67 97 sbiw r28, 0x17 ; 23 14bdc: 6b 96 adiw r28, 0x1b ; 27 14bde: 6f ad ldd r22, Y+63 ; 0x3f 14be0: 6b 97 sbiw r28, 0x1b ; 27 14be2: 6f 96 adiw r28, 0x1f ; 31 14be4: 9f ad ldd r25, Y+63 ; 0x3f 14be6: 6f 97 sbiw r28, 0x1f ; 31 14be8: a7 96 adiw r28, 0x27 ; 39 14bea: 8f ad ldd r24, Y+63 ; 0x3f 14bec: a7 97 sbiw r28, 0x27 ; 39 14bee: 27 2f mov r18, r23 14bf0: 36 2f mov r19, r22 14bf2: 49 2f mov r20, r25 14bf4: 58 2f mov r21, r24 14bf6: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 14bfa: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 14bfe: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 14c02: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 14c06: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 14c0a: f6 2e mov r15, r22 14c0c: e7 2e mov r14, r23 14c0e: d8 2e mov r13, r24 14c10: c9 2e mov r12, r25 14c12: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 14c16: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 14c1a: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 14c1e: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 14c22: d7 01 movw r26, r14 14c24: f6 01 movw r30, r12 14c26: 6b 2f mov r22, r27 14c28: 7a 2f mov r23, r26 14c2a: 8f 2f mov r24, r31 14c2c: 9e 2f mov r25, r30 14c2e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 14c32: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 14c36: a6 96 adiw r28, 0x26 ; 38 14c38: 6c af std Y+60, r22 ; 0x3c 14c3a: 7d af std Y+61, r23 ; 0x3d 14c3c: 8e af std Y+62, r24 ; 0x3e 14c3e: 9f af std Y+63, r25 ; 0x3f 14c40: 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); 14c42: cf 92 push r12 14c44: df 92 push r13 14c46: ef 92 push r14 14c48: ff 92 push r15 14c4a: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 14c4e: 8f 93 push r24 14c50: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 14c54: 8f 93 push r24 14c56: 80 91 9a 03 lds r24, 0x039A ; 0x80039a 14c5a: 8f 93 push r24 14c5c: 80 91 99 03 lds r24, 0x0399 ; 0x800399 14c60: 8f 93 push r24 14c62: 9f 92 push r9 14c64: 8f 92 push r8 14c66: 0f 94 1d dc call 0x3b83a ; 0x3b83a 14c6a: a4 96 adiw r28, 0x24 ; 36 14c6c: 6e ad ldd r22, Y+62 ; 0x3e 14c6e: 7f ad ldd r23, Y+63 ; 0x3f 14c70: a4 97 sbiw r28, 0x24 ; 36 14c72: c5 01 movw r24, r10 14c74: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 14c78: a2 e0 ldi r26, 0x02 ; 2 14c7a: aa 0e add r10, r26 14c7c: b1 1c adc r11, r1 14c7e: 0f b6 in r0, 0x3f ; 63 14c80: f8 94 cli 14c82: de bf out 0x3e, r29 ; 62 14c84: 0f be out 0x3f, r0 ; 63 14c86: cd bf out 0x3d, r28 ; 61 14c88: cb ce rjmp .-618 ; 0x14a20 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 14c8a: 80 e1 ldi r24, 0x10 ; 16 14c8c: 0e 94 33 e6 call 0x1cc66 ; 0x1cc66 14c90: 0c 94 a1 9c jmp 0x13942 ; 0x13942 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 14c94: 80 e1 ldi r24, 0x10 ; 16 14c96: 0e 94 88 e6 call 0x1cd10 ; 0x1cd10 14c9a: 0c 94 a1 9c jmp 0x13942 ; 0x13942 /*! ### 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); 14c9e: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 14ca2: 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; 14ca4: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 14ca8: 0c 94 a1 9c jmp 0x13942 ; 0x13942 14cac: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 14cb0: 87 60 ori r24, 0x07 ; 7 14cb2: f8 cf rjmp .-16 ; 0x14ca4 plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 14cb4: 0f 94 27 58 call 0x2b04e ; 0x2b04e 14cb8: f1 2c mov r15, r1 14cba: e1 2c mov r14, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 14cbc: f8 01 movw r30, r16 14cbe: 81 91 ld r24, Z+ 14cc0: 8f 01 movw r16, r30 14cc2: 88 23 and r24, r24 14cc4: d1 f0 breq .+52 ; 0x14cfa current_position[i] = values[i] + cs.add_homing[i]; 14cc6: 97 01 movw r18, r14 14cc8: 2d 5b subi r18, 0xBD ; 189 14cca: 38 4f sbci r19, 0xF8 ; 248 14ccc: 59 01 movw r10, r18 14cce: f3 01 movw r30, r6 14cd0: ee 0d add r30, r14 14cd2: ff 1d adc r31, r15 14cd4: 20 81 ld r18, Z 14cd6: 31 81 ldd r19, Z+1 ; 0x01 14cd8: 42 81 ldd r20, Z+2 ; 0x02 14cda: 53 81 ldd r21, Z+3 ; 0x03 14cdc: f7 01 movw r30, r14 14cde: ea 53 subi r30, 0x3A ; 58 14ce0: f9 4f sbci r31, 0xF9 ; 249 14ce2: 60 81 ld r22, Z 14ce4: 71 81 ldd r23, Z+1 ; 0x01 14ce6: 82 81 ldd r24, Z+2 ; 0x02 14ce8: 93 81 ldd r25, Z+3 ; 0x03 14cea: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 14cee: d5 01 movw r26, r10 14cf0: 6d 93 st X+, r22 14cf2: 7d 93 st X+, r23 14cf4: 8d 93 st X+, r24 14cf6: 9c 93 st X, r25 14cf8: 13 97 sbiw r26, 0x03 ; 3 14cfa: b4 e0 ldi r27, 0x04 ; 4 14cfc: eb 0e add r14, r27 14cfe: 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) 14d00: ec e0 ldi r30, 0x0C ; 12 14d02: ee 16 cp r14, r30 14d04: f1 04 cpc r15, r1 14d06: d1 f6 brne .-76 ; 0x14cbc { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 14d08: dd 20 and r13, r13 14d0a: 61 f0 breq .+24 ; 0x14d24 current_position[E_AXIS] = values[E_AXIS]; 14d0c: 8d 85 ldd r24, Y+13 ; 0x0d 14d0e: 9e 85 ldd r25, Y+14 ; 0x0e 14d10: af 85 ldd r26, Y+15 ; 0x0f 14d12: b8 89 ldd r27, Y+16 ; 0x10 14d14: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 14d18: 90 93 50 07 sts 0x0750, r25 ; 0x800750 14d1c: a0 93 51 07 sts 0x0751, r26 ; 0x800751 14d20: b0 93 52 07 sts 0x0752, r27 ; 0x800752 // Set all at once plan_set_position_curposXYZE(); 14d24: 0f 94 1d b9 call 0x3723a ; 0x3723a 14d28: 0c 94 a1 9c jmp 0x13942 ; 0x13942 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 14d2c: 8d 34 cpi r24, 0x4D ; 77 14d2e: 11 f0 breq .+4 ; 0x14d34 14d30: 0c 94 ca cc jmp 0x19994 ; 0x19994 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 14d34: 10 93 98 03 sts 0x0398, r17 ; 0x800398 14d38: 00 93 97 03 sts 0x0397, r16 ; 0x800397 14d3c: f8 01 movw r30, r16 14d3e: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 14d40: 81 91 ld r24, Z+ 14d42: 80 32 cpi r24, 0x20 ; 32 14d44: e9 f3 breq .-6 ; 0x14d40 14d46: 89 30 cpi r24, 0x09 ; 9 14d48: d9 f3 breq .-10 ; 0x14d40 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 14d4a: 80 53 subi r24, 0x30 ; 48 14d4c: 8a 30 cpi r24, 0x0A ; 10 14d4e: 70 f0 brcs .+28 ; 0x14d6c printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 14d50: 1f 93 push r17 14d52: 0f 93 push r16 14d54: 88 e3 ldi r24, 0x38 ; 56 14d56: 99 e8 ldi r25, 0x89 ; 137 14d58: 9f 93 push r25 14d5a: 8f 93 push r24 14d5c: 0f 94 1d dc call 0x3b83a ; 0x3b83a 14d60: 0f 90 pop r0 14d62: 0f 90 pop r0 14d64: 0f 90 pop r0 14d66: 0f 90 pop r0 14d68: 0c 94 5e 98 jmp 0x130bc ; 0x130bc } else { mcode_in_progress = code_value_short(); 14d6c: 0e 94 9b 5c call 0xb936 ; 0xb936 14d70: 90 93 5c 0e sts 0x0E5C, r25 ; 0x800e5c <_ZL17mcode_in_progress.lto_priv.549+0x1> 14d74: 80 93 5b 0e sts 0x0E5B, r24 ; 0x800e5b <_ZL17mcode_in_progress.lto_priv.549> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d78: 89 3c cpi r24, 0xC9 ; 201 14d7a: 91 05 cpc r25, r1 14d7c: 11 f4 brne .+4 ; 0x14d82 14d7e: 0c 94 96 b4 jmp 0x1692c ; 0x1692c 14d82: 0c f0 brlt .+2 ; 0x14d86 14d84: 08 c3 rjmp .+1552 ; 0x15396 14d86: 8e 34 cpi r24, 0x4E ; 78 14d88: 91 05 cpc r25, r1 14d8a: 11 f4 brne .+4 ; 0x14d90 14d8c: 0c 94 4e b0 jmp 0x1609c ; 0x1609c 14d90: 0c f0 brlt .+2 ; 0x14d94 14d92: 0e c2 rjmp .+1052 ; 0x151b0 14d94: 8c 31 cpi r24, 0x1C ; 28 14d96: 91 05 cpc r25, r1 14d98: 09 f4 brne .+2 ; 0x14d9c 14d9a: e2 c7 rjmp .+4036 ; 0x15d60 14d9c: 0c f0 brlt .+2 ; 0x14da0 14d9e: f1 c0 rjmp .+482 ; 0x14f82 14da0: 85 31 cpi r24, 0x15 ; 21 14da2: 91 05 cpc r25, r1 14da4: 09 f4 brne .+2 ; 0x14da8 14da6: f5 c6 rjmp .+3562 ; 0x15b92 14da8: 0c f0 brlt .+2 ; 0x14dac 14daa: 5a c0 rjmp .+180 ; 0x14e60 14dac: 81 31 cpi r24, 0x11 ; 17 14dae: 91 05 cpc r25, r1 14db0: 09 f4 brne .+2 ; 0x14db4 14db2: e4 c6 rjmp .+3528 ; 0x15b7c 14db4: dc f4 brge .+54 ; 0x14dec 14db6: 02 97 sbiw r24, 0x02 ; 2 14db8: 08 f4 brcc .+2 ; 0x14dbc 14dba: 54 c6 rjmp .+3240 ; 0x15a64 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 14dbc: 80 91 70 12 lds r24, 0x1270 ; 0x801270 14dc0: 90 91 71 12 lds r25, 0x1271 ; 0x801271 14dc4: 8a 57 subi r24, 0x7A ; 122 14dc6: 9f 4e sbci r25, 0xEF ; 239 14dc8: 9f 93 push r25 14dca: 8f 93 push r24 14dcc: 1f 92 push r1 14dce: 8d e4 ldi r24, 0x4D ; 77 14dd0: 8f 93 push r24 14dd2: 86 e9 ldi r24, 0x96 ; 150 14dd4: 9a e6 ldi r25, 0x6A ; 106 14dd6: 9f 93 push r25 14dd8: 8f 93 push r24 14dda: 0f 94 1d dc call 0x3b83a ; 0x3b83a 14dde: 0f 90 pop r0 14de0: 0f 90 pop r0 14de2: 0f 90 pop r0 14de4: 0f 90 pop r0 14de6: 0f 90 pop r0 14de8: 0f 90 pop r0 14dea: 21 c6 rjmp .+3138 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14dec: 82 31 cpi r24, 0x12 ; 18 14dee: 91 05 cpc r25, r1 14df0: 11 f4 brne .+4 ; 0x14df6 14df2: 0c 94 b1 b1 jmp 0x16362 ; 0x16362 14df6: 44 97 sbiw r24, 0x14 ; 20 14df8: 09 f7 brne .-62 ; 0x14dbc #### 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() 14dfa: 81 e0 ldi r24, 0x01 ; 1 14dfc: 80 93 96 02 sts 0x0296, r24 ; 0x800296 SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 14e00: 86 e8 ldi r24, 0x86 ; 134 14e02: 9a e6 ldi r25, 0x6A ; 106 14e04: 0e 94 86 7b call 0xf70c ; 0xf70c card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 14e08: 84 e5 ldi r24, 0x54 ; 84 14e0a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 14e0e: 18 2f mov r17, r24 14e10: 8c e4 ldi r24, 0x4C ; 76 14e12: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 14e16: 00 e0 ldi r16, 0x00 ; 0 14e18: 80 fb bst r24, 0 14e1a: 00 f9 bld r16, 0 14e1c: 10 fb bst r17, 0 14e1e: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 14e20: 84 ef ldi r24, 0xF4 ; 244 14e22: 94 e1 ldi r25, 0x14 ; 20 14e24: 0e 94 37 79 call 0xf26e ; 0xf26e lsDive("",root, NULL, LS_SerialPrint, params); 14e28: 83 e2 ldi r24, 0x23 ; 35 14e2a: e4 ef ldi r30, 0xF4 ; 244 14e2c: f4 e1 ldi r31, 0x14 ; 20 14e2e: de 01 movw r26, r28 14e30: 11 96 adiw r26, 0x01 ; 1 14e32: 01 90 ld r0, Z+ 14e34: 0d 92 st X+, r0 14e36: 8a 95 dec r24 14e38: e1 f7 brne .-8 ; 0x14e32 14e3a: 20 e0 ldi r18, 0x00 ; 0 14e3c: 50 e0 ldi r21, 0x00 ; 0 14e3e: 40 e0 ldi r20, 0x00 ; 0 14e40: be 01 movw r22, r28 14e42: 6f 5f subi r22, 0xFF ; 255 14e44: 7f 4f sbci r23, 0xFF ; 255 14e46: 84 ef ldi r24, 0xF4 ; 244 14e48: 92 e0 ldi r25, 0x02 ; 2 14e4a: 0f 94 fa 77 call 0x2eff4 ; 0x2eff4 14e4e: ce 01 movw r24, r28 14e50: 01 96 adiw r24, 0x01 ; 1 14e52: 0e 94 3c 79 call 0xf278 ; 0xf278 SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 14e56: 88 e7 ldi r24, 0x78 ; 120 14e58: 9a e6 ldi r25, 0x6A ; 106 14e5a: 0e 94 86 7b call 0xf70c ; 0xf70c 14e5e: e7 c5 rjmp .+3022 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e60: 88 31 cpi r24, 0x18 ; 24 14e62: 91 05 cpc r25, r1 14e64: 09 f4 brne .+2 ; 0x14e68 14e66: a6 c6 rjmp .+3404 ; 0x15bb4 14e68: 84 f4 brge .+32 ; 0x14e8a 14e6a: 86 31 cpi r24, 0x16 ; 22 14e6c: 91 05 cpc r25, r1 14e6e: 09 f4 brne .+2 ; 0x14e72 14e70: 94 c6 rjmp .+3368 ; 0x15b9a 14e72: 47 97 sbiw r24, 0x17 ; 23 14e74: 09 f0 breq .+2 ; 0x14e78 14e76: a2 cf rjmp .-188 ; 0x14dbc M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 14e78: 80 91 97 03 lds r24, 0x0397 ; 0x800397 14e7c: 90 91 98 03 lds r25, 0x0398 ; 0x800398 14e80: 61 e0 ldi r22, 0x01 ; 1 14e82: 04 96 adiw r24, 0x04 ; 4 14e84: 0f 94 c8 7e call 0x2fd90 ; 0x2fd90 14e88: d2 c5 rjmp .+2980 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e8a: 8a 31 cpi r24, 0x1A ; 26 14e8c: 91 05 cpc r25, r1 14e8e: 09 f4 brne .+2 ; 0x14e92 14e90: d7 c6 rjmp .+3502 ; 0x15c40 14e92: 0c f0 brlt .+2 ; 0x14e96 14e94: f7 c6 rjmp .+3566 ; 0x15c84 14e96: 0d ed ldi r16, 0xDD ; 221 14e98: 12 e0 ldi r17, 0x02 ; 2 14e9a: ff e3 ldi r31, 0x3F ; 63 14e9c: af 2e mov r10, r31 14e9e: f2 e0 ldi r31, 0x02 ; 2 14ea0: bf 2e mov r11, r31 14ea2: a1 e2 ldi r26, 0x21 ; 33 14ea4: ca 2e mov r12, r26 14ea6: a2 e0 ldi r26, 0x02 ; 2 14ea8: da 2e mov r13, r26 14eaa: b5 e1 ldi r27, 0x15 ; 21 14eac: eb 2e mov r14, r27 14eae: b2 e0 ldi r27, 0x02 ; 2 14eb0: 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])) { 14eb2: f8 01 movw r30, r16 14eb4: 81 91 ld r24, Z+ 14eb6: 8f 01 movw r16, r30 14eb8: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 14ebc: 88 23 and r24, r24 14ebe: 21 f1 breq .+72 ; 0x14f08 //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 14ec0: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 14ec4: d6 01 movw r26, r12 14ec6: 4d 90 ld r4, X+ 14ec8: 5d 90 ld r5, X+ 14eca: 6d 90 ld r6, X+ 14ecc: 7c 90 ld r7, X 14ece: a3 01 movw r20, r6 14ed0: 92 01 movw r18, r4 14ed2: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 14ed6: 87 fd sbrc r24, 7 14ed8: 11 c0 rjmp .+34 ; 0x14efc 14eda: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 14ede: f7 01 movw r30, r14 14ee0: 40 80 ld r4, Z 14ee2: 51 80 ldd r5, Z+1 ; 0x01 14ee4: 62 80 ldd r6, Z+2 ; 0x02 14ee6: 73 80 ldd r7, Z+3 ; 0x03 14ee8: a3 01 movw r20, r6 14eea: 92 01 movw r18, r4 14eec: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 14ef0: 18 16 cp r1, r24 14ef2: 24 f0 brlt .+8 ; 0x14efc 14ef4: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 14ef8: 2b 01 movw r4, r22 14efa: 3c 01 movw r6, r24 14efc: d5 01 movw r26, r10 14efe: 4d 92 st X+, r4 14f00: 5d 92 st X+, r5 14f02: 6d 92 st X+, r6 14f04: 7c 92 st X, r7 14f06: 13 97 sbiw r26, 0x03 ; 3 14f08: b4 e0 ldi r27, 0x04 ; 4 14f0a: ab 0e add r10, r27 14f0c: b1 1c adc r11, r1 14f0e: e4 e0 ldi r30, 0x04 ; 4 14f10: ce 0e add r12, r30 14f12: d1 1c adc r13, r1 14f14: f4 e0 ldi r31, 0x04 ; 4 14f16: ef 0e add r14, r31 14f18: 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++) { 14f1a: 22 e0 ldi r18, 0x02 ; 2 14f1c: 00 3e cpi r16, 0xE0 ; 224 14f1e: 12 07 cpc r17, r18 14f20: 41 f6 brne .-112 ; 0x14eb2 //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')) { 14f22: 83 e5 ldi r24, 0x53 ; 83 14f24: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 14f28: 88 23 and r24, r24 14f2a: 11 f4 brne .+4 ; 0x14f30 14f2c: 0c 94 4f c5 jmp 0x18a9e ; 0x18a9e if ( code_value_uint8() == 0 ) { 14f30: 0e 94 8e 5c call 0xb91c ; 0xb91c 14f34: 81 11 cpse r24, r1 14f36: 7b c5 rjmp .+2806 ; 0x15a2e pause_position[X_AXIS] = X_PAUSE_POS; 14f38: 80 e0 ldi r24, 0x00 ; 0 14f3a: 90 e0 ldi r25, 0x00 ; 0 14f3c: a8 e4 ldi r26, 0x48 ; 72 14f3e: b2 e4 ldi r27, 0x42 ; 66 14f40: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f <_ZL14pause_position.lto_priv.495> 14f44: 90 93 40 02 sts 0x0240, r25 ; 0x800240 <_ZL14pause_position.lto_priv.495+0x1> 14f48: a0 93 41 02 sts 0x0241, r26 ; 0x800241 <_ZL14pause_position.lto_priv.495+0x2> 14f4c: b0 93 42 02 sts 0x0242, r27 ; 0x800242 <_ZL14pause_position.lto_priv.495+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 14f50: 80 e0 ldi r24, 0x00 ; 0 14f52: 90 e0 ldi r25, 0x00 ; 0 14f54: ae e3 ldi r26, 0x3E ; 62 14f56: b3 e4 ldi r27, 0x43 ; 67 14f58: 80 93 43 02 sts 0x0243, r24 ; 0x800243 <_ZL14pause_position.lto_priv.495+0x4> 14f5c: 90 93 44 02 sts 0x0244, r25 ; 0x800244 <_ZL14pause_position.lto_priv.495+0x5> 14f60: a0 93 45 02 sts 0x0245, r26 ; 0x800245 <_ZL14pause_position.lto_priv.495+0x6> 14f64: b0 93 46 02 sts 0x0246, r27 ; 0x800246 <_ZL14pause_position.lto_priv.495+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 14f68: 80 e0 ldi r24, 0x00 ; 0 14f6a: 90 e0 ldi r25, 0x00 ; 0 14f6c: a0 ea ldi r26, 0xA0 ; 160 14f6e: b1 e4 ldi r27, 0x41 ; 65 14f70: 80 93 47 02 sts 0x0247, r24 ; 0x800247 <_ZL14pause_position.lto_priv.495+0x8> 14f74: 90 93 48 02 sts 0x0248, r25 ; 0x800248 <_ZL14pause_position.lto_priv.495+0x9> 14f78: a0 93 49 02 sts 0x0249, r26 ; 0x800249 <_ZL14pause_position.lto_priv.495+0xa> 14f7c: b0 93 4a 02 sts 0x024A, r27 ; 0x80024a <_ZL14pause_position.lto_priv.495+0xb> 14f80: 56 c5 rjmp .+2732 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14f82: 8d 32 cpi r24, 0x2D ; 45 14f84: 91 05 cpc r25, r1 14f86: 09 f4 brne .+2 ; 0x14f8a 14f88: 8d c7 rjmp .+3866 ; 0x15ea4 14f8a: 0c f0 brlt .+2 ; 0x14f8e 14f8c: e3 c0 rjmp .+454 ; 0x15154 14f8e: 8f 31 cpi r24, 0x1F ; 31 14f90: 91 05 cpc r25, r1 14f92: 09 f4 brne .+2 ; 0x14f96 14f94: 14 c7 rjmp .+3624 ; 0x15dbe 14f96: 0c f0 brlt .+2 ; 0x14f9a 14f98: 63 c0 rjmp .+198 ; 0x15060 14f9a: 8d 31 cpi r24, 0x1D ; 29 14f9c: 91 05 cpc r25, r1 14f9e: 09 f4 brne .+2 ; 0x14fa2 14fa0: 46 c5 rjmp .+2700 ; 0x15a2e 14fa2: 4e 97 sbiw r24, 0x1e ; 30 14fa4: 09 f0 breq .+2 ; 0x14fa8 14fa6: 0a cf rjmp .-492 ; 0x14dbc M30 [filename] */ case 30: if (card.mounted){ 14fa8: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 14fac: 88 23 and r24, r24 14fae: 09 f4 brne .+2 ; 0x14fb2 14fb0: 3e c5 rjmp .+2684 ; 0x15a2e lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 14fb2: 8e ef ldi r24, 0xFE ; 254 14fb4: 96 e1 ldi r25, 0x16 ; 22 14fb6: 0f 94 41 6d call 0x2da82 ; 0x2da82 file.close(); 14fba: 8e ef ldi r24, 0xFE ; 254 14fbc: 96 e1 ldi r25, 0x16 ; 22 14fbe: 0f 94 3e a4 call 0x3487c ; 0x3487c saving = false; 14fc2: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c logging = false; 14fc6: 10 92 6d 14 sts 0x146D, r1 ; 0x80146d card.closefile(); card.removeFile(strchr_pointer + 4); 14fca: 00 91 97 03 lds r16, 0x0397 ; 0x800397 14fce: 10 91 98 03 lds r17, 0x0398 ; 0x800398 14fd2: 0c 5f subi r16, 0xFC ; 252 14fd4: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 14fd6: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 14fda: 88 23 and r24, r24 14fdc: 09 f4 brne .+2 ; 0x14fe0 14fde: 27 c5 rjmp .+2638 ; 0x15a2e file.close(); 14fe0: 8e ef ldi r24, 0xFE ; 254 14fe2: 96 e1 ldi r25, 0x16 ; 22 14fe4: 0f 94 3e a4 call 0x3487c ; 0x3487c sdprinting = false; 14fe8: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e const char *fname=name; 14fec: 23 96 adiw r28, 0x03 ; 3 14fee: 1f af std Y+63, r17 ; 0x3f 14ff0: 0e af std Y+62, r16 ; 0x3e 14ff2: 23 97 sbiw r28, 0x03 ; 3 if (!diveSubfolder(fname)) 14ff4: ce 01 movw r24, r28 14ff6: 8f 5b subi r24, 0xBF ; 191 14ff8: 9f 4f sbci r25, 0xFF ; 255 14ffa: 0f 94 43 7e call 0x2fc86 ; 0x2fc86 14ffe: 88 23 and r24, r24 15000: 09 f4 brne .+2 ; 0x15004 15002: 15 c5 rjmp .+2602 ; 0x15a2e return; if (file.remove(curDir, fname)) 15004: 23 96 adiw r28, 0x03 ; 3 15006: 4e ad ldd r20, Y+62 ; 0x3e 15008: 5f ad ldd r21, Y+63 ; 0x3f 1500a: 23 97 sbiw r28, 0x03 ; 3 1500c: 60 91 17 15 lds r22, 0x1517 ; 0x801517 15010: 70 91 18 15 lds r23, 0x1518 ; 0x801518 * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 15014: 19 82 std Y+1, r1 ; 0x01 15016: 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; 15018: 22 e0 ldi r18, 0x02 ; 2 1501a: ce 01 movw r24, r28 1501c: 01 96 adiw r24, 0x01 ; 1 1501e: 0f 94 08 d7 call 0x3ae10 ; 0x3ae10 15022: 81 11 cpse r24, r1 15024: a5 c6 rjmp .+3402 ; 0x15d70 return file.remove(); fail: // can't set iostate - static function return false; 15026: 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; 15028: ce 01 movw r24, r28 1502a: 01 96 adiw r24, 0x01 ; 1 1502c: 0e 94 3c 79 call 0xf278 ; 0xf278 15030: 11 23 and r17, r17 15032: 09 f4 brne .+2 ; 0x15036 15034: b4 c6 rjmp .+3432 ; 0x15d9e { SERIAL_PROTOCOLPGM("File deleted:"); 15036: 84 e6 ldi r24, 0x64 ; 100 15038: 96 e8 ldi r25, 0x86 ; 134 1503a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOLLN(fname); 1503e: 23 96 adiw r28, 0x03 ; 3 15040: 8e ad ldd r24, Y+62 ; 0x3e 15042: 9f ad ldd r25, Y+63 ; 0x3f 15044: 23 97 sbiw r28, 0x03 ; 3 15046: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 sdpos = 0; 1504a: 10 92 82 17 sts 0x1782, r1 ; 0x801782 1504e: 10 92 83 17 sts 0x1783, r1 ; 0x801783 15052: 10 92 84 17 sts 0x1784, r1 ; 0x801784 15056: 10 92 85 17 sts 0x1785, r1 ; 0x801785 #ifdef SDCARD_SORT_ALPHA presort(); 1505a: 0f 94 0f 7c call 0x2f81e ; 0x2f81e 1505e: e7 c4 rjmp .+2510 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15060: 8a 32 cpi r24, 0x2A ; 42 15062: 91 05 cpc r25, r1 15064: 09 f4 brne .+2 ; 0x15068 15066: d2 c6 rjmp .+3492 ; 0x15e0c 15068: 8c 32 cpi r24, 0x2C ; 44 1506a: 91 05 cpc r25, r1 1506c: 09 f4 brne .+2 ; 0x15070 1506e: 01 c7 rjmp .+3586 ; 0x15e72 15070: 80 97 sbiw r24, 0x20 ; 32 15072: 09 f0 breq .+2 ; 0x15076 15074: a3 ce rjmp .-698 ; 0x14dbc - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 15076: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 1507a: 81 11 cpse r24, r1 st_synchronize(); 1507c: 0f 94 27 58 call 0x2b04e ; 0x2b04e } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 15080: 00 91 97 03 lds r16, 0x0397 ; 0x800397 15084: 10 91 98 03 lds r17, 0x0398 ; 0x800398 15088: 0c 5f subi r16, 0xFC ; 252 1508a: 1f 4f sbci r17, 0xFF ; 255 1508c: 61 e2 ldi r22, 0x21 ; 33 1508e: 70 e0 ldi r23, 0x00 ; 0 15090: c8 01 movw r24, r16 15092: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 if(namestartpos==NULL) 15096: 00 97 sbiw r24, 0x00 ; 0 15098: 19 f0 breq .+6 ; 0x150a0 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 1509a: 8c 01 movw r16, r24 1509c: 0f 5f subi r16, 0xFF ; 255 1509e: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 150a0: 80 e5 ldi r24, 0x50 ; 80 150a2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 150a6: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 150a8: 80 91 97 03 lds r24, 0x0397 ; 0x800397 150ac: 90 91 98 03 lds r25, 0x0398 ; 0x800398 150b0: 08 17 cp r16, r24 150b2: 19 07 cpc r17, r25 150b4: 08 f4 brcc .+2 ; 0x150b8 call_procedure=false; //false alert, 'P' found within filename 150b6: f1 2c mov r15, r1 if( card.mounted ) 150b8: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 150bc: 88 23 and r24, r24 150be: 09 f4 brne .+2 ; 0x150c2 150c0: b6 c4 rjmp .+2412 ; 0x15a2e { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 150c2: 61 e0 ldi r22, 0x01 ; 1 150c4: 6f 25 eor r22, r15 150c6: c8 01 movw r24, r16 150c8: 0f 94 c8 7e call 0x2fd90 ; 0x2fd90 if(code_seen('S')) 150cc: 83 e5 ldi r24, 0x53 ; 83 150ce: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 150d2: 88 23 and r24, r24 150d4: 99 f0 breq .+38 ; 0x150fc if(strchr_pointer 150da: 90 91 98 03 lds r25, 0x0398 ; 0x800398 150de: 80 17 cp r24, r16 150e0: 91 07 cpc r25, r17 150e2: 60 f4 brcc .+24 ; 0x150fc card.setIndex(code_value_long()); 150e4: 0e 94 a8 5c call 0xb950 ; 0xb950 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; 150e8: 60 93 82 17 sts 0x1782, r22 ; 0x801782 150ec: 70 93 83 17 sts 0x1783, r23 ; 0x801783 150f0: 80 93 84 17 sts 0x1784, r24 ; 0x801784 150f4: 90 93 85 17 sts 0x1785, r25 ; 0x801785 150f8: 0f 94 87 76 call 0x2ed0e ; 0x2ed0e SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 150fc: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 15100: 88 23 and r24, r24 15102: 31 f0 breq .+12 ; 0x15110 { sdprinting = true; 15104: 81 e0 ldi r24, 0x01 ; 1 15106: 80 93 6e 14 sts 0x146E, r24 ; 0x80146e 1510a: 85 e0 ldi r24, 0x05 ; 5 1510c: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.395> card.startFileprint(); if(!call_procedure) 15110: f1 10 cpse r15, r1 15112: 8d c4 rjmp .+2330 ; 0x15a2e 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); }; 15114: 80 91 01 17 lds r24, 0x1701 ; 0x801701 15118: 88 23 and r24, r24 1511a: 61 f0 breq .+24 ; 0x15134 { if(!card.get_sdpos()) 1511c: 80 91 82 17 lds r24, 0x1782 ; 0x801782 15120: 90 91 83 17 lds r25, 0x1783 ; 0x801783 15124: a0 91 84 17 lds r26, 0x1784 ; 0x801784 15128: b0 91 85 17 lds r27, 0x1785 ; 0x801785 1512c: 89 2b or r24, r25 1512e: 8a 2b or r24, r26 15130: 8b 2b or r24, r27 15132: 69 f4 brne .+26 ; 0x1514e { // A new print has started from scratch, reset stats failstats_reset_print(); 15134: 0e 94 4a 5d call 0xba94 ; 0xba94 sdpos_atomic = 0; 15138: 10 92 84 03 sts 0x0384, r1 ; 0x800384 1513c: 10 92 85 03 sts 0x0385, r1 ; 0x800385 15140: 10 92 86 03 sts 0x0386, r1 ; 0x800386 15144: 10 92 87 03 sts 0x0387, r1 ; 0x800387 15148: 80 e0 ldi r24, 0x00 ; 0 1514a: 0e 94 c2 83 call 0x10784 ; 0x10784 #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 1514e: 0f 94 cc 57 call 0x2af98 ; 0x2af98 15152: 6d c4 rjmp .+2266 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15154: 89 34 cpi r24, 0x49 ; 73 15156: 91 05 cpc r25, r1 15158: 09 f4 brne .+2 ; 0x1515c 1515a: e8 c6 rjmp .+3536 ; 0x15f2c 1515c: cc f4 brge .+50 ; 0x15190 1515e: 8e 32 cpi r24, 0x2E ; 46 15160: 91 05 cpc r25, r1 15162: 09 f4 brne .+2 ; 0x15166 15164: a5 c6 rjmp .+3402 ; 0x15eb0 15166: 88 34 cpi r24, 0x48 ; 72 15168: 91 05 cpc r25, r1 1516a: 09 f0 breq .+2 ; 0x1516e 1516c: 27 ce rjmp .-946 ; 0x14dbc #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 1516e: 83 e5 ldi r24, 0x53 ; 83 15170: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15174: 88 23 and r24, r24 15176: 09 f4 brne .+2 ; 0x1517a 15178: ca c6 rjmp .+3476 ; 0x15f0e switch (code_value_uint8()){ 1517a: 0e 94 8e 5c call 0xb91c ; 0xb91c 1517e: 88 23 and r24, r24 15180: 09 f4 brne .+2 ; 0x15184 15182: c2 c6 rjmp .+3460 ; 0x15f08 15184: 81 30 cpi r24, 0x01 ; 1 15186: 09 f0 breq .+2 ; 0x1518a 15188: 52 c4 rjmp .+2212 ; 0x15a2e 1518a: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.395> 1518e: 4f c4 rjmp .+2206 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15190: 8c 34 cpi r24, 0x4C ; 76 15192: 91 05 cpc r25, r1 15194: 09 f4 brne .+2 ; 0x15198 15196: 6a c7 rjmp .+3796 ; 0x1606c 15198: 0c f0 brlt .+2 ; 0x1519c 1519a: 7b c7 rjmp .+3830 ; 0x16092 1519c: 8b 34 cpi r24, 0x4B ; 75 1519e: 91 05 cpc r25, r1 151a0: 09 f0 breq .+2 ; 0x151a4 151a2: 0c ce rjmp .-1000 ; 0x14dbc /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 151a4: 0f 94 7a 15 call 0x22af4 ; 0x22af4 151a8: 88 23 and r24, r24 151aa: 09 f4 brne .+2 ; 0x151ae 151ac: 40 c4 rjmp .+2176 ; 0x15a2e 151ae: cf cf rjmp .-98 ; 0x1514e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151b0: 8e 36 cpi r24, 0x6E ; 110 151b2: 91 05 cpc r25, r1 151b4: 11 f4 brne .+4 ; 0x151ba 151b6: 0c 94 a6 b2 jmp 0x1654c ; 0x1654c 151ba: 0c f0 brlt .+2 ; 0x151be 151bc: 7d c0 rjmp .+250 ; 0x152b8 151be: 86 35 cpi r24, 0x56 ; 86 151c0: 91 05 cpc r25, r1 151c2: 11 f4 brne .+4 ; 0x151c8 151c4: 0c 94 01 b2 jmp 0x16402 ; 0x16402 151c8: b4 f5 brge .+108 ; 0x15236 151ca: 83 35 cpi r24, 0x53 ; 83 151cc: 91 05 cpc r25, r1 151ce: 11 f4 brne .+4 ; 0x151d4 151d0: 0c 94 ab b1 jmp 0x16356 ; 0x16356 151d4: 74 f4 brge .+28 ; 0x151f2 151d6: 8f 34 cpi r24, 0x4F ; 79 151d8: 91 05 cpc r25, r1 151da: 09 f4 brne .+2 ; 0x151de 151dc: 7a c7 rjmp .+3828 ; 0x160d2 151de: 82 35 cpi r24, 0x52 ; 82 151e0: 91 05 cpc r25, r1 151e2: 09 f0 breq .+2 ; 0x151e6 151e4: eb cd rjmp .-1066 ; 0x14dbc /*! ### 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; 151e6: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 151ea: 87 7f andi r24, 0xF7 ; 247 151ec: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 151f0: 1e c4 rjmp .+2108 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151f2: 84 35 cpi r24, 0x54 ; 84 151f4: 91 05 cpc r25, r1 151f6: 11 f4 brne .+4 ; 0x151fc 151f8: 0c 94 b1 b1 jmp 0x16362 ; 0x16362 151fc: 85 35 cpi r24, 0x55 ; 85 151fe: 91 05 cpc r25, r1 15200: 09 f0 breq .+2 ; 0x15204 15202: dc cd rjmp .-1096 ; 0x14dbc #### 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')) { 15204: 83 e5 ldi r24, 0x53 ; 83 15206: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1520a: 88 23 and r24, r24 1520c: 09 f4 brne .+2 ; 0x15210 1520e: 0f c4 rjmp .+2078 ; 0x15a2e max_inactive_time = code_value() * 1000; 15210: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15214: 20 e0 ldi r18, 0x00 ; 0 15216: 30 e0 ldi r19, 0x00 ; 0 15218: 4a e7 ldi r20, 0x7A ; 122 1521a: 54 e4 ldi r21, 0x44 ; 68 1521c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 15220: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 15224: 60 93 80 03 sts 0x0380, r22 ; 0x800380 15228: 70 93 81 03 sts 0x0381, r23 ; 0x800381 1522c: 80 93 82 03 sts 0x0382, r24 ; 0x800382 15230: 90 93 83 03 sts 0x0383, r25 ; 0x800383 15234: fc c3 rjmp .+2040 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15236: 89 36 cpi r24, 0x69 ; 105 15238: 91 05 cpc r25, r1 1523a: 09 f4 brne .+2 ; 0x1523e 1523c: a6 c7 rjmp .+3916 ; 0x1618a 1523e: c4 f4 brge .+48 ; 0x15270 15240: 8c 35 cpi r24, 0x5C ; 92 15242: 91 05 cpc r25, r1 15244: 11 f4 brne .+4 ; 0x1524a 15246: 0c 94 1e b2 jmp 0x1643c ; 0x1643c 1524a: 88 36 cpi r24, 0x68 ; 104 1524c: 91 05 cpc r25, r1 1524e: 09 f0 breq .+2 ; 0x15252 15250: b5 cd rjmp .-1174 ; 0x14dbc #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 15252: 83 e5 ldi r24, 0x53 ; 83 15254: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15258: 88 23 and r24, r24 1525a: 09 f4 brne .+2 ; 0x1525e 1525c: e8 c3 rjmp .+2000 ; 0x15a2e { setTargetHotend(code_value()); 1525e: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 15262: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 15266: 70 93 6e 0e sts 0x0E6E, r23 ; 0x800e6e 1526a: 60 93 6d 0e sts 0x0E6D, r22 ; 0x800e6d 1526e: df c3 rjmp .+1982 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15270: 8b 36 cpi r24, 0x6B ; 107 15272: 91 05 cpc r25, r1 15274: 11 f4 brne .+4 ; 0x1527a 15276: 0c 94 a8 b1 jmp 0x16350 ; 0x16350 1527a: 14 f4 brge .+4 ; 0x15280 1527c: 0c 94 9a b1 jmp 0x16334 ; 0x16334 15280: 8d 36 cpi r24, 0x6D ; 109 15282: 91 05 cpc r25, r1 15284: 09 f0 breq .+2 ; 0x15288 15286: 9a cd rjmp .-1228 ; 0x14dbc 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)); 15288: 85 e9 ldi r24, 0x95 ; 149 1528a: 9a e4 ldi r25, 0x4A ; 74 1528c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 15290: 0f 94 0c 0b call 0x21618 ; 0x21618 heating_status = HeatingStatus::EXTRUDER_HEATING; 15294: 81 e0 ldi r24, 0x01 ; 1 15296: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df prusa_statistics(1); #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 1529a: 83 e5 ldi r24, 0x53 ; 83 1529c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 152a0: 88 23 and r24, r24 152a2: 09 f4 brne .+2 ; 0x152a6 152a4: 85 c7 rjmp .+3850 ; 0x161b0 setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 152a6: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 152aa: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 152ae: 70 93 6e 0e sts 0x0E6E, r23 ; 0x800e6e 152b2: 60 93 6d 0e sts 0x0E6D, r22 ; 0x800e6d 152b6: 81 c7 rjmp .+3842 ; 0x161ba } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 152b8: 87 37 cpi r24, 0x77 ; 119 152ba: 91 05 cpc r25, r1 152bc: 11 f4 brne .+4 ; 0x152c2 152be: 0c 94 eb b3 jmp 0x167d6 ; 0x167d6 152c2: 94 f5 brge .+100 ; 0x15328 152c4: 82 37 cpi r24, 0x72 ; 114 152c6: 91 05 cpc r25, r1 152c8: 11 f4 brne .+4 ; 0x152ce 152ca: 0c 94 a0 b3 jmp 0x16740 ; 0x16740 152ce: a4 f4 brge .+40 ; 0x152f8 152d0: 80 37 cpi r24, 0x70 ; 112 152d2: 91 05 cpc r25, r1 152d4: 09 f4 brne .+2 ; 0x152d8 152d6: 46 c7 rjmp .+3724 ; 0x16164 152d8: 81 37 cpi r24, 0x71 ; 113 152da: 91 05 cpc r25, r1 152dc: 09 f0 breq .+2 ; 0x152e0 152de: 6e cd rjmp .-1316 ; 0x14dbc #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 152e0: 83 e5 ldi r24, 0x53 ; 83 152e2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 152e6: 88 23 and r24, r24 152e8: 11 f4 brne .+4 ; 0x152ee 152ea: 0c 94 b7 b2 jmp 0x1656e ; 0x1656e host_keepalive_interval = code_value_uint8(); 152ee: 0e 94 8e 5c call 0xb91c ; 0xb91c 152f2: 80 93 2f 02 sts 0x022F, r24 ; 0x80022f 152f6: 9b c3 rjmp .+1846 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 152f8: 85 37 cpi r24, 0x75 ; 117 152fa: 91 05 cpc r25, r1 152fc: 11 f4 brne .+4 ; 0x15302 152fe: 0c 94 a3 b3 jmp 0x16746 ; 0x16746 15302: 14 f0 brlt .+4 ; 0x15308 15304: 0c 94 b3 b3 jmp 0x16766 ; 0x16766 15308: 83 37 cpi r24, 0x73 ; 115 1530a: 91 05 cpc r25, r1 1530c: 09 f0 breq .+2 ; 0x15310 1530e: 56 cd rjmp .-1364 ; 0x14dbc #### 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')) { 15310: 86 e5 ldi r24, 0x56 ; 86 15312: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15316: 88 23 and r24, r24 15318: 11 f4 brne .+4 ; 0x1531e 1531a: 0c 94 cc b2 jmp 0x16598 ; 0x16598 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 1531e: 85 e4 ldi r24, 0x45 ; 69 15320: 96 e8 ldi r25, 0x86 ; 134 15322: 0e 94 86 7b call 0xf70c ; 0xf70c 15326: 83 c3 rjmp .+1798 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15328: 8c 38 cpi r24, 0x8C ; 140 1532a: 91 05 cpc r25, r1 1532c: 09 f4 brne .+2 ; 0x15330 1532e: 1e c7 rjmp .+3644 ; 0x1616c 15330: 54 f4 brge .+20 ; 0x15346 15332: 8b 37 cpi r24, 0x7B ; 123 15334: 91 05 cpc r25, r1 15336: 11 f4 brne .+4 ; 0x1533c 15338: 0c 94 50 b4 jmp 0x168a0 ; 0x168a0 1533c: 8d 37 cpi r24, 0x7D ; 125 1533e: 91 05 cpc r25, r1 15340: 09 f4 brne .+2 ; 0x15344 15342: a9 cd rjmp .-1198 ; 0x14e96 15344: 3b cd rjmp .-1418 ; 0x14dbc 15346: 8e 3b cpi r24, 0xBE ; 190 15348: 91 05 cpc r25, r1 1534a: 09 f4 brne .+2 ; 0x1534e 1534c: 66 c7 rjmp .+3788 ; 0x1621a 1534e: 88 3c cpi r24, 0xC8 ; 200 15350: 91 05 cpc r25, r1 15352: 11 f4 brne .+4 ; 0x15358 15354: 0c 94 53 b4 jmp 0x168a6 ; 0x168a6 15358: 8b 39 cpi r24, 0x9B ; 155 1535a: 91 05 cpc r25, r1 1535c: 09 f0 breq .+2 ; 0x15360 1535e: 2e cd rjmp .-1444 ; 0x14dbc bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 15360: 83 e5 ldi r24, 0x53 ; 83 15362: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15366: 88 23 and r24, r24 15368: 59 f0 breq .+22 ; 0x15380 autoReportFeatures.SetPeriod( code_value_uint8() ); 1536a: 0e 94 8e 5c call 0xb91c ; 0xb91c 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; 1536e: 80 93 66 14 sts 0x1466, r24 ; 0x801466 if (auto_report_period != 0){ 15372: 88 23 and r24, r24 15374: 09 f4 brne .+2 ; 0x15378 15376: 15 c7 rjmp .+3626 ; 0x161a2 auto_report_timer.start(); 15378: 87 e6 ldi r24, 0x67 ; 103 1537a: 94 e1 ldi r25, 0x14 ; 20 1537c: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 15380: 83 e4 ldi r24, 0x43 ; 67 15382: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15386: 88 23 and r24, r24 15388: 09 f4 brne .+2 ; 0x1538c 1538a: 0e c7 rjmp .+3612 ; 0x161a8 autoReportFeatures.SetMask(code_value_uint8()); 1538c: 0e 94 8e 5c call 0xb91c ; 0xb91c 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; } 15390: 80 93 65 14 sts 0x1465, r24 ; 0x801465 15394: 4c c3 rjmp .+1688 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15396: 86 3f cpi r24, 0xF6 ; 246 15398: f1 e0 ldi r31, 0x01 ; 1 1539a: 9f 07 cpc r25, r31 1539c: 11 f4 brne .+4 ; 0x153a2 1539e: 0c 94 0a be jmp 0x17c14 ; 0x17c14 153a2: 0c f0 brlt .+2 ; 0x153a6 153a4: f7 c1 rjmp .+1006 ; 0x15794 153a6: 8c 32 cpi r24, 0x2C ; 44 153a8: 31 e0 ldi r19, 0x01 ; 1 153aa: 93 07 cpc r25, r19 153ac: 11 f4 brne .+4 ; 0x153b2 153ae: 0c 94 16 b7 jmp 0x16e2c ; 0x16e2c 153b2: 0c f0 brlt .+2 ; 0x153b6 153b4: 1b c1 rjmp .+566 ; 0x155ec 153b6: 80 3d cpi r24, 0xD0 ; 208 153b8: 91 05 cpc r25, r1 153ba: 11 f4 brne .+4 ; 0x153c0 153bc: 0c 94 05 b6 jmp 0x16c0a ; 0x16c0a 153c0: 0c f0 brlt .+2 ; 0x153c4 153c2: 73 c0 rjmp .+230 ; 0x154aa 153c4: 8d 3c cpi r24, 0xCD ; 205 153c6: 91 05 cpc r25, r1 153c8: 11 f4 brne .+4 ; 0x153ce 153ca: 0c 94 6c b5 jmp 0x16ad8 ; 0x16ad8 153ce: 9c f5 brge .+102 ; 0x15436 153d0: 8b 3c cpi r24, 0xCB ; 203 153d2: 91 05 cpc r25, r1 153d4: 11 f4 brne .+4 ; 0x153da 153d6: 0c 94 e3 b4 jmp 0x169c6 ; 0x169c6 153da: 8c 3c cpi r24, 0xCC ; 204 153dc: 91 05 cpc r25, r1 153de: 09 f0 breq .+2 ; 0x153e2 153e0: ed cc rjmp .-1574 ; 0x14dbc - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 153e2: 83 e5 ldi r24, 0x53 ; 83 153e4: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 153e8: 88 23 and r24, r24 153ea: 11 f4 brne .+4 ; 0x153f0 153ec: 0c 94 3b b5 jmp 0x16a76 ; 0x16a76 // 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(); 153f0: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 153f4: 60 93 2e 07 sts 0x072E, r22 ; 0x80072e 153f8: 70 93 2f 07 sts 0x072F, r23 ; 0x80072f 153fc: 80 93 30 07 sts 0x0730, r24 ; 0x800730 15400: 90 93 31 07 sts 0x0731, r25 ; 0x800731 15404: 60 93 a2 06 sts 0x06A2, r22 ; 0x8006a2 15408: 70 93 a3 06 sts 0x06A3, r23 ; 0x8006a3 1540c: 80 93 a4 06 sts 0x06A4, r24 ; 0x8006a4 15410: 90 93 a5 06 sts 0x06A5, r25 ; 0x8006a5 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 15414: 84 e5 ldi r24, 0x54 ; 84 15416: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1541a: 88 23 and r24, r24 1541c: 09 f4 brne .+2 ; 0x15420 1541e: 07 c3 rjmp .+1550 ; 0x15a2e cs.retract_acceleration = code_value(); 15420: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15424: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 15428: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 1542c: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 15430: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 15434: fc c2 rjmp .+1528 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15436: 8e 3c cpi r24, 0xCE ; 206 15438: 91 05 cpc r25, r1 1543a: 11 f4 brne .+4 ; 0x15440 1543c: 0c 94 e5 b5 jmp 0x16bca ; 0x16bca 15440: 8f 3c cpi r24, 0xCF ; 207 15442: 91 05 cpc r25, r1 15444: 09 f0 breq .+2 ; 0x15448 15446: ba cc rjmp .-1676 ; 0x14dbc - `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')) 15448: 83 e5 ldi r24, 0x53 ; 83 1544a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1544e: 88 23 and r24, r24 15450: 51 f0 breq .+20 ; 0x15466 { cs.retract_length = code_value() ; 15452: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15456: 60 93 f1 06 sts 0x06F1, r22 ; 0x8006f1 1545a: 70 93 f2 06 sts 0x06F2, r23 ; 0x8006f2 1545e: 80 93 f3 06 sts 0x06F3, r24 ; 0x8006f3 15462: 90 93 f4 06 sts 0x06F4, r25 ; 0x8006f4 } if(code_seen('F')) 15466: 86 e4 ldi r24, 0x46 ; 70 15468: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1546c: 88 23 and r24, r24 1546e: 61 f0 breq .+24 ; 0x15488 { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 15470: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15474: 0e 94 fc 67 call 0xcff8 ; 0xcff8 15478: 60 93 f5 06 sts 0x06F5, r22 ; 0x8006f5 1547c: 70 93 f6 06 sts 0x06F6, r23 ; 0x8006f6 15480: 80 93 f7 06 sts 0x06F7, r24 ; 0x8006f7 15484: 90 93 f8 06 sts 0x06F8, r25 ; 0x8006f8 } if(code_seen('Z')) 15488: 8a e5 ldi r24, 0x5A ; 90 1548a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1548e: 88 23 and r24, r24 15490: 09 f4 brne .+2 ; 0x15494 15492: cd c2 rjmp .+1434 ; 0x15a2e { cs.retract_zlift = code_value() ; 15494: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15498: 60 93 f9 06 sts 0x06F9, r22 ; 0x8006f9 1549c: 70 93 fa 06 sts 0x06FA, r23 ; 0x8006fa 154a0: 80 93 fb 06 sts 0x06FB, r24 ; 0x8006fb 154a4: 90 93 fc 06 sts 0x06FC, r25 ; 0x8006fc 154a8: c2 c2 rjmp .+1412 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 154aa: 8c 3d cpi r24, 0xDC ; 220 154ac: 91 05 cpc r25, r1 154ae: 11 f4 brne .+4 ; 0x154b4 154b0: 0c 94 6c b6 jmp 0x16cd8 ; 0x16cd8 154b4: 0c f0 brlt .+2 ; 0x154b8 154b6: 7d c0 rjmp .+250 ; 0x155b2 154b8: 81 3d cpi r24, 0xD1 ; 209 154ba: 91 05 cpc r25, r1 154bc: 11 f4 brne .+4 ; 0x154c2 154be: 0c 94 29 b6 jmp 0x16c52 ; 0x16c52 154c2: 86 3d cpi r24, 0xD6 ; 214 154c4: 91 05 cpc r25, r1 154c6: 09 f0 breq .+2 ; 0x154ca 154c8: 79 cc rjmp .-1806 ; 0x14dbc 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; 154ca: 80 e5 ldi r24, 0x50 ; 80 154cc: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 154d0: 88 23 and r24, r24 154d2: 11 f4 brne .+4 ; 0x154d8 154d4: 0c 94 58 b6 jmp 0x16cb0 ; 0x16cb0 154d8: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 154dc: 2b 01 movw r4, r22 154de: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 154e0: 83 e5 ldi r24, 0x53 ; 83 154e2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 154e6: 88 23 and r24, r24 154e8: 11 f4 brne .+4 ; 0x154ee 154ea: 0c 94 62 b6 jmp 0x16cc4 ; 0x16cc4 154ee: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 154f2: 4b 01 movw r8, r22 154f4: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 154f6: 8e e4 ldi r24, 0x4E ; 78 154f8: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 154fc: d0 90 3a 07 lds r13, 0x073A ; 0x80073a 15500: 88 23 and r24, r24 15502: 29 f0 breq .+10 ; 0x1550e 15504: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15508: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 1550c: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 1550e: 82 e5 ldi r24, 0x52 ; 82 15510: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15514: e0 90 3b 07 lds r14, 0x073B ; 0x80073b 15518: f0 90 3c 07 lds r15, 0x073C ; 0x80073c 1551c: 88 23 and r24, r24 1551e: 29 f0 breq .+10 ; 0x1552a 15520: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15524: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 15528: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 1552a: 86 e4 ldi r24, 0x46 ; 70 1552c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15530: 00 91 3d 07 lds r16, 0x073D ; 0x80073d 15534: 10 91 3e 07 lds r17, 0x073E ; 0x80073e 15538: 88 23 and r24, r24 1553a: 29 f0 breq .+10 ; 0x15546 1553c: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15540: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 15544: 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) 15546: 20 e0 ldi r18, 0x00 ; 0 15548: 30 e0 ldi r19, 0x00 ; 0 1554a: a9 01 movw r20, r18 1554c: c3 01 movw r24, r6 1554e: b2 01 movw r22, r4 15550: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 15554: 18 16 cp r1, r24 15556: 0c f0 brlt .+2 ; 0x1555a 15558: 6a c2 rjmp .+1236 ; 0x15a2e 1555a: 20 e0 ldi r18, 0x00 ; 0 1555c: 30 e0 ldi r19, 0x00 ; 0 1555e: a9 01 movw r20, r18 15560: c5 01 movw r24, r10 15562: b4 01 movw r22, r8 15564: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 15568: 87 fd sbrc r24, 7 1556a: 61 c2 rjmp .+1218 ; 0x15a2e 1556c: a5 01 movw r20, r10 1556e: 94 01 movw r18, r8 15570: c3 01 movw r24, r6 15572: b2 01 movw r22, r4 15574: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 15578: 87 fd sbrc r24, 7 1557a: 59 c2 rjmp .+1202 ; 0x15a2e { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 1557c: 40 92 32 07 sts 0x0732, r4 ; 0x800732 15580: 50 92 33 07 sts 0x0733, r5 ; 0x800733 15584: 60 92 34 07 sts 0x0734, r6 ; 0x800734 15588: 70 92 35 07 sts 0x0735, r7 ; 0x800735 cs.min_mm_per_arc_segment = s; 1558c: 80 92 36 07 sts 0x0736, r8 ; 0x800736 15590: 90 92 37 07 sts 0x0737, r9 ; 0x800737 15594: a0 92 38 07 sts 0x0738, r10 ; 0x800738 15598: b0 92 39 07 sts 0x0739, r11 ; 0x800739 cs.n_arc_correction = n; 1559c: d0 92 3a 07 sts 0x073A, r13 ; 0x80073a cs.min_arc_segments = r; 155a0: f0 92 3c 07 sts 0x073C, r15 ; 0x80073c 155a4: e0 92 3b 07 sts 0x073B, r14 ; 0x80073b cs.arc_segments_per_sec = f; 155a8: 10 93 3e 07 sts 0x073E, r17 ; 0x80073e 155ac: 00 93 3d 07 sts 0x073D, r16 ; 0x80073d 155b0: 3e c2 rjmp .+1148 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 155b2: 82 3e cpi r24, 0xE2 ; 226 155b4: 91 05 cpc r25, r1 155b6: 11 f4 brne .+4 ; 0x155bc 155b8: 0c 94 bd b6 jmp 0x16d7a ; 0x16d7a 155bc: 80 3f cpi r24, 0xF0 ; 240 155be: 91 05 cpc r25, r1 155c0: 09 f4 brne .+2 ; 0x155c4 155c2: 35 c2 rjmp .+1130 ; 0x15a2e 155c4: 8d 3d cpi r24, 0xDD ; 221 155c6: 91 05 cpc r25, r1 155c8: 09 f0 breq .+2 ; 0x155cc 155ca: f8 cb rjmp .-2064 ; 0x14dbc #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 155cc: 83 e5 ldi r24, 0x53 ; 83 155ce: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 155d2: 88 23 and r24, r24 155d4: 11 f4 brne .+4 ; 0x155da 155d6: 0c 94 ab b6 jmp 0x16d56 ; 0x16d56 { extrudemultiply = code_value_short(); 155da: 0e 94 9b 5c call 0xb936 ; 0xb936 155de: 90 93 95 02 sts 0x0295, r25 ; 0x800295 155e2: 80 93 94 02 sts 0x0294, r24 ; 0x800294 calculate_extruder_multipliers(); 155e6: 0e 94 ee 66 call 0xcddc ; 0xcddc 155ea: 21 c2 rjmp .+1090 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 155ec: 80 39 cpi r24, 0x90 ; 144 155ee: 51 e0 ldi r21, 0x01 ; 1 155f0: 95 07 cpc r25, r21 155f2: 11 f4 brne .+4 ; 0x155f8 155f4: 0c 94 db bd jmp 0x17bb6 ; 0x17bb6 155f8: 0c f0 brlt .+2 ; 0x155fc 155fa: a7 c0 rjmp .+334 ; 0x1574a 155fc: 8f 32 cpi r24, 0x2F ; 47 155fe: b1 e0 ldi r27, 0x01 ; 1 15600: 9b 07 cpc r25, r27 15602: 11 f4 brne .+4 ; 0x15608 15604: 0c 94 ba b7 jmp 0x16f74 ; 0x16f74 15608: c4 f4 brge .+48 ; 0x1563a 1560a: 8d 32 cpi r24, 0x2D ; 45 1560c: f1 e0 ldi r31, 0x01 ; 1 1560e: 9f 07 cpc r25, r31 15610: 11 f4 brne .+4 ; 0x15616 15612: 0c 94 3d b7 jmp 0x16e7a ; 0x16e7a 15616: 8e 32 cpi r24, 0x2E ; 46 15618: 91 40 sbci r25, 0x01 ; 1 1561a: 09 f0 breq .+2 ; 0x1561e 1561c: cf cb rjmp .-2146 ; 0x14dbc - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 1561e: 83 e5 ldi r24, 0x53 ; 83 15620: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15624: 88 23 and r24, r24 15626: 11 f4 brne .+4 ; 0x1562c 15628: 0c 94 b6 b7 jmp 0x16f6c ; 0x16f6c 1562c: 0e 94 9b 5c call 0xb936 ; 0xb936 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 15630: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 15634: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 15638: fa c1 rjmp .+1012 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1563a: 86 33 cpi r24, 0x36 ; 54 1563c: 31 e0 ldi r19, 0x01 ; 1 1563e: 93 07 cpc r25, r19 15640: 11 f4 brne .+4 ; 0x15646 15642: 0c 94 ed b7 jmp 0x16fda ; 0x16fda 15646: 8e 35 cpi r24, 0x5E ; 94 15648: 41 e0 ldi r20, 0x01 ; 1 1564a: 94 07 cpc r25, r20 1564c: 11 f4 brne .+4 ; 0x15652 1564e: 0c 94 e3 ca jmp 0x195c6 ; 0x195c6 15652: 80 33 cpi r24, 0x30 ; 48 15654: 91 40 sbci r25, 0x01 ; 1 15656: 09 f0 breq .+2 ; 0x1565a 15658: b1 cb rjmp .-2206 ; 0x14dbc - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 1565a: 80 e5 ldi r24, 0x50 ; 80 1565c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15660: 88 23 and r24, r24 15662: 51 f0 breq .+20 ; 0x15678 15664: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15668: 60 93 e2 06 sts 0x06E2, r22 ; 0x8006e2 1566c: 70 93 e3 06 sts 0x06E3, r23 ; 0x8006e3 15670: 80 93 e4 06 sts 0x06E4, r24 ; 0x8006e4 15674: 90 93 e5 06 sts 0x06E5, r25 ; 0x8006e5 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 15678: 89 e4 ldi r24, 0x49 ; 73 1567a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1567e: 88 23 and r24, r24 15680: 81 f0 breq .+32 ; 0x156a2 15682: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15686: 2c ea ldi r18, 0xAC ; 172 15688: 35 ec ldi r19, 0xC5 ; 197 1568a: 47 e2 ldi r20, 0x27 ; 39 1568c: 5e e3 ldi r21, 0x3E ; 62 1568e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 15692: 60 93 e6 06 sts 0x06E6, r22 ; 0x8006e6 15696: 70 93 e7 06 sts 0x06E7, r23 ; 0x8006e7 1569a: 80 93 e8 06 sts 0x06E8, r24 ; 0x8006e8 1569e: 90 93 e9 06 sts 0x06E9, r25 ; 0x8006e9 if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 156a2: 84 e4 ldi r24, 0x44 ; 68 156a4: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 156a8: 88 23 and r24, r24 156aa: 81 f0 breq .+32 ; 0x156cc 156ac: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 } float unscalePID_i(float i) { return i/PID_dT; 156b0: 2c ea ldi r18, 0xAC ; 172 156b2: 35 ec ldi r19, 0xC5 ; 197 156b4: 47 e2 ldi r20, 0x27 ; 39 156b6: 5e e3 ldi r21, 0x3E ; 62 156b8: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 156bc: 60 93 ea 06 sts 0x06EA, r22 ; 0x8006ea 156c0: 70 93 eb 06 sts 0x06EB, r23 ; 0x8006eb 156c4: 80 93 ec 06 sts 0x06EC, r24 ; 0x8006ec 156c8: 90 93 ed 06 sts 0x06ED, r25 ; 0x8006ed updatePID(); 156cc: 0f 94 12 50 call 0x2a024 ; 0x2a024 SERIAL_PROTOCOLRPGM(MSG_OK); 156d0: 8e ea ldi r24, 0xAE ; 174 156d2: 9e e6 ldi r25, 0x6E ; 110 156d4: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOLPGM(" p:"); 156d8: 87 ef ldi r24, 0xF7 ; 247 156da: 97 e8 ldi r25, 0x87 ; 135 156dc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 156e0: 60 91 e2 06 lds r22, 0x06E2 ; 0x8006e2 156e4: 70 91 e3 06 lds r23, 0x06E3 ; 0x8006e3 156e8: 80 91 e4 06 lds r24, 0x06E4 ; 0x8006e4 156ec: 90 91 e5 06 lds r25, 0x06E5 ; 0x8006e5 156f0: 42 e0 ldi r20, 0x02 ; 2 156f2: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 156f6: 83 ef ldi r24, 0xF3 ; 243 156f8: 97 e8 ldi r25, 0x87 ; 135 156fa: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 156fe: 2c ea ldi r18, 0xAC ; 172 15700: 35 ec ldi r19, 0xC5 ; 197 15702: 47 e2 ldi r20, 0x27 ; 39 15704: 5e e3 ldi r21, 0x3E ; 62 15706: 60 91 e6 06 lds r22, 0x06E6 ; 0x8006e6 1570a: 70 91 e7 06 lds r23, 0x06E7 ; 0x8006e7 1570e: 80 91 e8 06 lds r24, 0x06E8 ; 0x8006e8 15712: 90 91 e9 06 lds r25, 0x06E9 ; 0x8006e9 15716: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1571a: 42 e0 ldi r20, 0x02 ; 2 1571c: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 15720: 8f ee ldi r24, 0xEF ; 239 15722: 97 e8 ldi r25, 0x87 ; 135 15724: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15728: 2c ea ldi r18, 0xAC ; 172 1572a: 35 ec ldi r19, 0xC5 ; 197 1572c: 47 e2 ldi r20, 0x27 ; 39 1572e: 5e e3 ldi r21, 0x3E ; 62 15730: 60 91 ea 06 lds r22, 0x06EA ; 0x8006ea 15734: 70 91 eb 06 lds r23, 0x06EB ; 0x8006eb 15738: 80 91 ec 06 lds r24, 0x06EC ; 0x8006ec 1573c: 90 91 ed 06 lds r25, 0x06ED ; 0x8006ed 15740: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 15744: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e 15748: 72 c1 rjmp .+740 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1574a: 86 39 cpi r24, 0x96 ; 150 1574c: a1 e0 ldi r26, 0x01 ; 1 1574e: 9a 07 cpc r25, r26 15750: 11 f4 brne .+4 ; 0x15756 15752: 0c 94 fd bd jmp 0x17bfa ; 0x17bfa 15756: 74 f4 brge .+28 ; 0x15774 15758: 83 39 cpi r24, 0x93 ; 147 1575a: e1 e0 ldi r30, 0x01 ; 1 1575c: 9e 07 cpc r25, r30 1575e: 11 f4 brne .+4 ; 0x15764 15760: 0c 94 df bd jmp 0x17bbe ; 0x17bbe 15764: 85 39 cpi r24, 0x95 ; 149 15766: 91 40 sbci r25, 0x01 ; 1 15768: 09 f0 breq .+2 ; 0x1576c 1576a: 28 cb rjmp .-2480 ; 0x14dbc */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 1576c: 81 e0 ldi r24, 0x01 ; 1 1576e: 0e 94 34 76 call 0xec68 ; 0xec68 15772: 5d c1 rjmp .+698 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15774: 84 3f cpi r24, 0xF4 ; 244 15776: 21 e0 ldi r18, 0x01 ; 1 15778: 92 07 cpc r25, r18 1577a: 11 f4 brne .+4 ; 0x15780 1577c: 0c 94 02 be jmp 0x17c04 ; 0x17c04 15780: 14 f0 brlt .+4 ; 0x15786 15782: 0c 94 06 be jmp 0x17c0c ; 0x17c0c 15786: 84 3a cpi r24, 0xA4 ; 164 15788: 91 40 sbci r25, 0x01 ; 1 1578a: 09 f0 breq .+2 ; 0x1578e 1578c: 17 cb rjmp .-2514 ; 0x14dbc M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 1578e: 0e 94 66 81 call 0x102cc ; 0x102cc 15792: 4d c1 rjmp .+666 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15794: 83 3c cpi r24, 0xC3 ; 195 15796: 52 e0 ldi r21, 0x02 ; 2 15798: 95 07 cpc r25, r21 1579a: 11 f4 brne .+4 ; 0x157a0 1579c: 0c 94 60 cc jmp 0x198c0 ; 0x198c0 157a0: 0c f0 brlt .+2 ; 0x157a4 157a2: 95 c0 rjmp .+298 ; 0x158ce 157a4: 8a 35 cpi r24, 0x5A ; 90 157a6: b2 e0 ldi r27, 0x02 ; 2 157a8: 9b 07 cpc r25, r27 157aa: 11 f4 brne .+4 ; 0x157b0 157ac: 0c 94 5e c5 jmp 0x18abc ; 0x18abc 157b0: 3c f5 brge .+78 ; 0x15800 157b2: 88 32 cpi r24, 0x28 ; 40 157b4: f2 e0 ldi r31, 0x02 ; 2 157b6: 9f 07 cpc r25, r31 157b8: 11 f4 brne .+4 ; 0x157be 157ba: 0c 94 21 c1 jmp 0x18242 ; 0x18242 157be: ac f4 brge .+42 ; 0x157ea 157c0: 87 3f cpi r24, 0xF7 ; 247 157c2: 31 e0 ldi r19, 0x01 ; 1 157c4: 93 07 cpc r25, r19 157c6: 11 f4 brne .+4 ; 0x157cc 157c8: 0c 94 0e be jmp 0x17c1c ; 0x17c1c 157cc: 8d 3f cpi r24, 0xFD ; 253 157ce: 91 40 sbci r25, 0x01 ; 1 157d0: 09 f0 breq .+2 ; 0x157d4 157d2: f4 ca rjmp .-2584 ; 0x14dbc M509 */ case 509: { lang_reset(); 157d4: 0e 94 61 72 call 0xe4c2 ; 0xe4c2 SERIAL_ECHO_START; 157d8: 82 ef ldi r24, 0xF2 ; 242 157da: 9a ea ldi r25, 0xAA ; 170 157dc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 157e0: 8f ed ldi r24, 0xDF ; 223 157e2: 97 e8 ldi r25, 0x87 ; 135 157e4: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 157e8: 22 c1 rjmp .+580 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 157ea: 88 35 cpi r24, 0x58 ; 88 157ec: 52 e0 ldi r21, 0x02 ; 2 157ee: 95 07 cpc r25, r21 157f0: 11 f4 brne .+4 ; 0x157f6 157f2: 0c 94 56 c1 jmp 0x182ac ; 0x182ac 157f6: 89 35 cpi r24, 0x59 ; 89 157f8: 92 40 sbci r25, 0x02 ; 2 157fa: 09 f4 brne .+2 ; 0x157fe 157fc: 4c cb rjmp .-2408 ; 0x14e96 157fe: de ca rjmp .-2628 ; 0x14dbc 15800: 8e 3b cpi r24, 0xBE ; 190 15802: b2 e0 ldi r27, 0x02 ; 2 15804: 9b 07 cpc r25, r27 15806: 11 f4 brne .+4 ; 0x1580c 15808: 0c 94 20 cc jmp 0x19840 ; 0x19840 1580c: 0c f0 brlt .+2 ; 0x15810 1580e: 4d c0 rjmp .+154 ; 0x158aa 15810: 8b 35 cpi r24, 0x5B ; 91 15812: f2 e0 ldi r31, 0x02 ; 2 15814: 9f 07 cpc r25, r31 15816: 11 f4 brne .+4 ; 0x1581c 15818: 0c 94 66 c5 jmp 0x18acc ; 0x18acc 1581c: 8d 3b cpi r24, 0xBD ; 189 1581e: 92 40 sbci r25, 0x02 ; 2 15820: 09 f0 breq .+2 ; 0x15824 15822: cc ca rjmp .-2664 ; 0x14dbc case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 15824: 80 91 98 13 lds r24, 0x1398 ; 0x801398 15828: 81 30 cpi r24, 0x01 ; 1 1582a: 11 f4 brne .+4 ; 0x15830 1582c: 0c 94 c1 cb jmp 0x19782 ; 0x19782 - `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; 15830: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15832: 8c e4 ldi r24, 0x4C ; 76 15834: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 - `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 15838: c1 2c mov r12, r1 1583a: d1 2c mov r13, r1 1583c: 6c e8 ldi r22, 0x8C ; 140 1583e: e6 2e mov r14, r22 15840: 62 e4 ldi r22, 0x42 ; 66 15842: f6 2e mov r15, r22 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15844: 88 23 and r24, r24 15846: 21 f0 breq .+8 ; 0x15850 15848: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 1584c: 6b 01 movw r12, r22 1584e: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15850: 8a e5 ldi r24, 0x5A ; 90 15852: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15856: 88 23 and r24, r24 15858: 11 f4 brne .+4 ; 0x1585e 1585a: 0c 94 d2 cb jmp 0x197a4 ; 0x197a4 1585e: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15862: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 15864: 0e 94 16 6f call 0xde2c ; 0xde2c 15868: 4b 01 movw r8, r22 1586a: 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 1586c: 8a e5 ldi r24, 0x5A ; 90 1586e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15872: 08 2f mov r16, r24 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 15874: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 15878: 10 92 89 17 sts 0x1789, r1 ; 0x801789 void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex, bool raise_z_axis = false){ FSensorBlockRunout fsBlockRunout; prusa_statistics(22); if (MMU2::mmu2.Enabled()) { 1587c: 80 91 98 13 lds r24, 0x1398 ; 0x801398 15880: 81 30 cpi r24, 0x01 ; 1 15882: 11 f0 breq .+4 ; 0x15888 15884: 0c 94 d7 cb jmp 0x197ae ; 0x197ae if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 15888: 15 30 cpi r17, 0x05 ; 5 1588a: 18 f4 brcc .+6 ; 0x15892 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 1588c: 81 2f mov r24, r17 1588e: 0f 94 33 1c call 0x23866 ; 0x23866 lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 15892: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 15896: 88 e8 ldi r24, 0x88 ; 136 15898: 97 e1 ldi r25, 0x17 ; 23 1589a: 0e 94 04 76 call 0xec08 ; 0xec08 // 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); 1589e: c5 01 movw r24, r10 158a0: b4 01 movw r22, r8 158a2: 90 58 subi r25, 0x80 ; 128 158a4: 0e 94 16 6f call 0xde2c ; 0xde2c 158a8: c2 c0 rjmp .+388 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 158aa: 81 3c cpi r24, 0xC1 ; 193 158ac: 32 e0 ldi r19, 0x02 ; 2 158ae: 93 07 cpc r25, r19 158b0: 11 f4 brne .+4 ; 0x158b6 158b2: 0c 94 54 cc jmp 0x198a8 ; 0x198a8 158b6: 14 f0 brlt .+4 ; 0x158bc 158b8: 0c 94 5a cc jmp 0x198b4 ; 0x198b4 158bc: 80 3c cpi r24, 0xC0 ; 192 158be: 92 40 sbci r25, 0x02 ; 2 158c0: 09 f0 breq .+2 ; 0x158c4 158c2: 7c ca rjmp .-2824 ; 0x14dbc #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 158c4: 80 ec ldi r24, 0xC0 ; 192 158c6: 92 e0 ldi r25, 0x02 ; 2 158c8: 0e 94 84 61 call 0xc308 ; 0xc308 158cc: b0 c0 rjmp .+352 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 158ce: 84 38 cpi r24, 0x84 ; 132 158d0: a3 e0 ldi r26, 0x03 ; 3 158d2: 9a 07 cpc r25, r26 158d4: 11 f4 brne .+4 ; 0x158da 158d6: 0c 94 10 c9 jmp 0x19220 ; 0x19220 158da: 0c f0 brlt .+2 ; 0x158de 158dc: 97 c0 rjmp .+302 ; 0x15a0c 158de: 82 35 cpi r24, 0x52 ; 82 158e0: e3 e0 ldi r30, 0x03 ; 3 158e2: 9e 07 cpc r25, r30 158e4: 11 f4 brne .+4 ; 0x158ea 158e6: 0c 94 6c c5 jmp 0x18ad8 ; 0x18ad8 158ea: 94 f5 brge .+100 ; 0x15950 158ec: 84 3c cpi r24, 0xC4 ; 196 158ee: 22 e0 ldi r18, 0x02 ; 2 158f0: 92 07 cpc r25, r18 158f2: 11 f4 brne .+4 ; 0x158f8 158f4: 0c 94 7d cc jmp 0x198fa ; 0x198fa 158f8: 85 3c cpi r24, 0xC5 ; 197 158fa: 92 40 sbci r25, 0x02 ; 2 158fc: 09 f0 breq .+2 ; 0x15900 158fe: 5e ca rjmp .-2884 ; 0x14dbc M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 15900: 83 e5 ldi r24, 0x53 ; 83 15902: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15906: 88 23 and r24, r24 15908: 51 f0 breq .+20 ; 0x1591e { switch (code_value_uint8()) 1590a: 0e 94 8e 5c call 0xb91c ; 0xb91c 1590e: 88 23 and r24, r24 15910: 11 f4 brne .+4 ; 0x15916 15912: 0c 94 a9 cc jmp 0x19952 ; 0x19952 15916: 81 30 cpi r24, 0x01 ; 1 15918: 11 f4 brne .+4 ; 0x1591e 1591a: 0c 94 b6 cc jmp 0x1996c ; 0x1996c break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 1591e: 80 91 98 13 lds r24, 0x1398 ; 0x801398 15922: 81 30 cpi r24, 0x01 ; 1 15924: 91 f4 brne .+36 ; 0x1594a 15926: 88 e5 ldi r24, 0x58 ; 88 15928: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1592c: 88 23 and r24, r24 1592e: 69 f0 breq .+26 ; 0x1594a { switch (code_value_uint8()) 15930: 0e 94 8e 5c call 0xb91c ; 0xb91c 15934: 81 30 cpi r24, 0x01 ; 1 15936: 11 f4 brne .+4 ; 0x1593c 15938: 0c 94 c4 cc jmp 0x19988 ; 0x19988 1593c: 10 f4 brcc .+4 ; 0x15942 1593e: 0c 94 bf cc jmp 0x1997e ; 0x1997e 15942: 8a 32 cpi r24, 0x2A ; 42 15944: 11 f4 brne .+4 ; 0x1594a 15946: 0c 94 c8 cc jmp 0x19990 ; 0x19990 break; default: break; } } MMU2::mmu2.Status(); 1594a: 0f 94 ce 75 call 0x2eb9c ; 0x2eb9c 1594e: 6f c0 rjmp .+222 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15950: 8d 35 cpi r24, 0x5D ; 93 15952: 43 e0 ldi r20, 0x03 ; 3 15954: 94 07 cpc r25, r20 15956: 11 f4 brne .+4 ; 0x1595c 15958: 0c 94 e2 c6 jmp 0x18dc4 ; 0x18dc4 1595c: 8e 35 cpi r24, 0x5E ; 94 1595e: 53 e0 ldi r21, 0x03 ; 3 15960: 95 07 cpc r25, r21 15962: 11 f4 brne .+4 ; 0x15968 15964: 0c 94 7a c7 jmp 0x18ef4 ; 0x18ef4 15968: 8c 35 cpi r24, 0x5C ; 92 1596a: 93 40 sbci r25, 0x03 ; 3 1596c: 09 f0 breq .+2 ; 0x15970 1596e: 26 ca rjmp .-2996 ; 0x14dbc */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 15970: 83 e5 ldi r24, 0x53 ; 83 15972: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15976: 88 23 and r24, r24 15978: 09 f4 brne .+2 ; 0x1597c 1597a: 59 c0 rjmp .+178 ; 0x15a2e set_target_pinda = code_value_short(); 1597c: 0e 94 9b 5c call 0xb936 ; 0xb936 15980: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 15982: 8a ee ldi r24, 0xEA ; 234 15984: 99 e3 ldi r25, 0x39 ; 57 15986: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1598a: 0f 94 0c 0b call 0x21618 ; 0x21618 SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 1598e: 88 e5 ldi r24, 0x58 ; 88 15990: 97 e8 ldi r25, 0x87 ; 135 15992: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOLLN(set_target_pinda); 15996: c8 01 movw r24, r16 15998: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 codenum = _millis(); 1599c: 0f 94 86 3e call 0x27d0c ; 0x27d0c 159a0: 4b 01 movw r8, r22 159a2: 5c 01 movw r10, r24 cancel_heatup = false; 159a4: 10 92 66 0e sts 0x0E66, r1 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.402> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 159a8: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 159ac: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 159b0: 89 2b or r24, r25 159b2: 41 f4 brne .+16 ; 0x159c4 159b4: ff 24 eor r15, r15 159b6: f3 94 inc r15 159b8: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 159bc: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 159c0: 89 2b or r24, r25 159c2: 09 f0 breq .+2 ; 0x159c6 SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 159c4: 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)) ) { 159c6: 28 01 movw r4, r16 159c8: 01 2e mov r0, r17 159ca: 00 0c add r0, r0 159cc: 66 08 sbc r6, r6 159ce: 77 08 sbc r7, r7 159d0: f1 10 cpse r15, r1 159d2: 0c 94 a2 c6 jmp 0x18d44 ; 0x18d44 159d6: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.402> 159da: 81 11 cpse r24, r1 159dc: 12 c0 rjmp .+36 ; 0x15a02 159de: c3 01 movw r24, r6 159e0: b2 01 movw r22, r4 159e2: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 159e6: 20 91 99 03 lds r18, 0x0399 ; 0x800399 159ea: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 159ee: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 159f2: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 159f6: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 159fa: 18 16 cp r1, r24 159fc: 14 f4 brge .+4 ; 0x15a02 159fe: 0c 94 b4 c6 jmp 0x18d68 ; 0x18d68 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 15a02: 8e ea ldi r24, 0xAE ; 174 15a04: 9e e6 ldi r25, 0x6E ; 110 15a06: 0f 94 0c 0b call 0x21618 ; 0x21618 15a0a: 11 c0 rjmp .+34 ; 0x15a2e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15a0c: 81 39 cpi r24, 0x91 ; 145 15a0e: b3 e0 ldi r27, 0x03 ; 3 15a10: 9b 07 cpc r25, r27 15a12: 11 f4 brne .+4 ; 0x15a18 15a14: 0c 94 43 ca jmp 0x19486 ; 0x19486 15a18: 84 f4 brge .+32 ; 0x15a3a 15a1a: 8b 38 cpi r24, 0x8B ; 139 15a1c: f3 e0 ldi r31, 0x03 ; 3 15a1e: 9f 07 cpc r25, r31 15a20: 11 f4 brne .+4 ; 0x15a26 15a22: 0c 94 bf c9 jmp 0x1937e ; 0x1937e 15a26: 8c 38 cpi r24, 0x8C ; 140 15a28: 93 40 sbci r25, 0x03 ; 3 15a2a: 09 f0 breq .+2 ; 0x15a2e 15a2c: c7 c9 rjmp .-3186 ; 0x14dbc */ 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; 15a2e: 10 92 5c 0e sts 0x0E5C, r1 ; 0x800e5c <_ZL17mcode_in_progress.lto_priv.549+0x1> 15a32: 10 92 5b 0e sts 0x0E5B, r1 ; 0x800e5b <_ZL17mcode_in_progress.lto_priv.549> 15a36: 0c 94 5e 98 jmp 0x130bc ; 0x130bc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15a3a: 84 39 cpi r24, 0x94 ; 148 15a3c: 33 e0 ldi r19, 0x03 ; 3 15a3e: 93 07 cpc r25, r19 15a40: 14 f4 brge .+4 ; 0x15a46 15a42: 0c 94 92 ca jmp 0x19524 ; 0x19524 15a46: 80 3a cpi r24, 0xA0 ; 160 15a48: 93 40 sbci r25, 0x03 ; 3 15a4a: 09 f0 breq .+2 ; 0x15a4e 15a4c: b7 c9 rjmp .-3218 ; 0x14dbc M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 15a4e: 80 91 97 03 lds r24, 0x0397 ; 0x800397 15a52: 90 91 98 03 lds r25, 0x0398 ; 0x800398 } } void CardReader::openLogFile(const char* name) { logging = true; 15a56: 21 e0 ldi r18, 0x01 ; 1 15a58: 20 93 6d 14 sts 0x146D, r18 ; 0x80146d openFileWrite(name); 15a5c: 05 96 adiw r24, 0x05 ; 5 15a5e: 0f 94 e3 84 call 0x309c6 ; 0x309c6 15a62: e5 cf rjmp .-54 ; 0x15a2e - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 15a64: 00 91 97 03 lds r16, 0x0397 ; 0x800397 15a68: 10 91 98 03 lds r17, 0x0398 ; 0x800398 15a6c: 0e 5f subi r16, 0xFE ; 254 15a6e: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 15a70: 80 e5 ldi r24, 0x50 ; 80 15a72: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 15a76: c1 2c mov r12, r1 15a78: d1 2c mov r13, r1 15a7a: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 15a7c: 88 23 and r24, r24 15a7e: 21 f0 breq .+8 ; 0x15a88 15a80: 0e 94 a8 5c call 0xb950 ; 0xb950 15a84: 6b 01 movw r12, r22 15a86: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 15a88: 83 e5 ldi r24, 0x53 ; 83 15a8a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15a8e: 88 23 and r24, r24 15a90: 51 f0 breq .+20 ; 0x15aa6 15a92: 0e 94 a8 5c call 0xb950 ; 0xb950 15a96: 9b 01 movw r18, r22 15a98: ac 01 movw r20, r24 15a9a: a8 ee ldi r26, 0xE8 ; 232 15a9c: b3 e0 ldi r27, 0x03 ; 3 15a9e: 0f 94 f0 dd call 0x3bbe0 ; 0x3bbe0 <__muluhisi3> 15aa2: 6b 01 movw r12, r22 15aa4: 7c 01 movw r14, r24 15aa6: c8 01 movw r24, r16 15aa8: 0f 5f subi r16, 0xFF ; 255 15aaa: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 15aac: dc 01 movw r26, r24 15aae: 4c 91 ld r20, X 15ab0: 40 32 cpi r20, 0x20 ; 32 15ab2: c9 f3 breq .-14 ; 0x15aa6 custom_message_type = CustomMsg::M0Wait; 15ab4: 26 e0 ldi r18, 0x06 ; 6 15ab6: 20 93 75 07 sts 0x0775, r18 ; 0x800775 if (!expiration_time_set && *src != '\0') { 15aba: c1 14 cp r12, r1 15abc: d1 04 cpc r13, r1 15abe: e1 04 cpc r14, r1 15ac0: f1 04 cpc r15, r1 15ac2: a1 f5 brne .+104 ; 0x15b2c 15ac4: 2c 91 ld r18, X 15ac6: 22 23 and r18, r18 15ac8: 89 f1 breq .+98 ; 0x15b2c lcd_setstatus(src); 15aca: 0f 94 51 14 call 0x228a2 ; 0x228a2 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(); 15ace: 0f 94 27 58 call 0x2b04e ; 0x2b04e menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 15ad2: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 15ad6: 84 60 ori r24, 0x04 ; 4 15ad8: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 previous_millis_cmd.start(); 15adc: 88 e8 ldi r24, 0x88 ; 136 15ade: 93 e0 ldi r25, 0x03 ; 3 15ae0: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> if (expiration_time_set) { 15ae4: c1 14 cp r12, r1 15ae6: d1 04 cpc r13, r1 15ae8: e1 04 cpc r14, r1 15aea: f1 04 cpc r15, r1 15aec: 79 f1 breq .+94 ; 0x15b4c codenum += _millis(); // keep track of when we started waiting 15aee: 0f 94 86 3e call 0x27d0c ; 0x27d0c 15af2: c6 0e add r12, r22 15af4: d7 1e adc r13, r23 15af6: e8 1e adc r14, r24 15af8: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 15afa: 84 e0 ldi r24, 0x04 ; 4 15afc: 80 93 96 02 sts 0x0296, r24 ; 0x800296 while(_millis() < codenum && !lcd_clicked()) { 15b00: 0f 94 86 3e call 0x27d0c ; 0x27d0c 15b04: 6c 15 cp r22, r12 15b06: 7d 05 cpc r23, r13 15b08: 8e 05 cpc r24, r14 15b0a: 9f 05 cpc r25, r15 15b0c: b0 f0 brcs .+44 ; 0x15b3a delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 15b0e: 82 e0 ldi r24, 0x02 ; 2 15b10: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 15b14: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 15b18: 8b 7f andi r24, 0xFB ; 251 15b1a: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 if (IS_SD_PRINTING) 15b1e: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 15b22: 88 23 and r24, r24 15b24: 31 f1 breq .+76 ; 0x15b72 custom_message_type = CustomMsg::Status; 15b26: 10 92 75 07 sts 0x0775, r1 ; 0x800775 15b2a: 81 cf rjmp .-254 ; 0x15a2e } 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)); 15b2c: 83 e0 ldi r24, 0x03 ; 3 15b2e: 9a e3 ldi r25, 0x3A ; 58 15b30: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 15b34: 0f 94 0c 0b call 0x21618 ; 0x21618 15b38: ca cf rjmp .-108 ; 0x15ace 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()) { 15b3a: 0e 94 32 72 call 0xe464 ; 0xe464 15b3e: 81 11 cpse r24, r1 15b40: e6 cf rjmp .-52 ; 0x15b0e delay_keep_alive(0); 15b42: 90 e0 ldi r25, 0x00 ; 0 15b44: 80 e0 ldi r24, 0x00 ; 0 15b46: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 15b4a: da cf rjmp .-76 ; 0x15b00 //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 15b4c: 10 91 96 02 lds r17, 0x0296 ; 0x800296 KEEPALIVE_STATE(PAUSED_FOR_USER); 15b50: 84 e0 ldi r24, 0x04 ; 4 15b52: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_consume_click(); 15b56: 0e 94 2d 72 call 0xe45a ; 0xe45a while(!lcd_clicked()) 15b5a: 0e 94 32 72 call 0xe464 ; 0xe464 15b5e: 81 11 cpse r24, r1 15b60: 05 c0 rjmp .+10 ; 0x15b6c { delay_keep_alive(0); 15b62: 90 e0 ldi r25, 0x00 ; 0 15b64: 80 e0 ldi r24, 0x00 ; 0 15b66: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 15b6a: f7 cf rjmp .-18 ; 0x15b5a } KEEPALIVE_STATE(busy_state_backup); 15b6c: 10 93 96 02 sts 0x0296, r17 ; 0x800296 15b70: d1 cf rjmp .-94 ; 0x15b14 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 15b72: 8e e0 ldi r24, 0x0E ; 14 15b74: 91 e7 ldi r25, 0x71 ; 113 15b76: 0f 94 0c 0b call 0x21618 ; 0x21618 15b7a: 59 cf rjmp .-334 ; 0x15a2e /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 15b7c: 88 ef ldi r24, 0xF8 ; 248 15b7e: 99 e3 ldi r25, 0x39 ; 57 15b80: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 15b84: 0f 94 0c 0b call 0x21618 ; 0x21618 enable_x(); 15b88: 17 98 cbi 0x02, 7 ; 2 enable_y(); 15b8a: 16 98 cbi 0x02, 6 ; 2 enable_z(); 15b8c: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 15b8e: 14 98 cbi 0x02, 4 ; 2 15b90: 4e cf rjmp .-356 ; 0x15a2e /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 15b92: 81 e0 ldi r24, 0x01 ; 1 15b94: 0f 94 3f 80 call 0x3007e ; 0x3007e 15b98: 4a cf rjmp .-364 ; 0x15a2e presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 15b9a: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e mounted = false; 15b9e: 10 92 6f 14 sts 0x146F, r1 ; 0x80146f SERIAL_ECHO_START; 15ba2: 82 ef ldi r24, 0xF2 ; 242 15ba4: 9a ea ldi r25, 0xAA ; 170 15ba6: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 15baa: 8d e6 ldi r24, 0x6D ; 109 15bac: 9c e6 ldi r25, 0x6C ; 108 15bae: 0e 94 86 7b call 0xf70c ; 0xf70c 15bb2: 3d cf rjmp .-390 ; 0x15a2e /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 15bb4: 0e 94 ba 68 call 0xd174 ; 0xd174 15bb8: 88 23 and r24, r24 15bba: 19 f0 breq .+6 ; 0x15bc2 lcd_resume_print(); 15bbc: 0f 94 25 14 call 0x2284a ; 0x2284a 15bc0: 36 cf rjmp .-404 ; 0x15a2e else { if (!filament_presence_check()) { 15bc2: 0f 94 7a 15 call 0x22af4 ; 0x22af4 15bc6: 88 23 and r24, r24 15bc8: 09 f4 brne .+2 ; 0x15bcc 15bca: 31 cf rjmp .-414 ; 0x15a2e 15bcc: 80 91 01 17 lds r24, 0x1701 ; 0x801701 15bd0: 88 23 and r24, r24 15bd2: 61 f0 breq .+24 ; 0x15bec // Print was aborted break; } if (!card.get_sdpos()) 15bd4: 80 91 82 17 lds r24, 0x1782 ; 0x801782 15bd8: 90 91 83 17 lds r25, 0x1783 ; 0x801783 15bdc: a0 91 84 17 lds r26, 0x1784 ; 0x801784 15be0: b0 91 85 17 lds r27, 0x1785 ; 0x801785 15be4: 89 2b or r24, r25 15be6: 8a 2b or r24, r26 15be8: 8b 2b or r24, r27 15bea: 69 f4 brne .+26 ; 0x15c06 { // A new print has started from scratch, reset stats failstats_reset_print(); 15bec: 0e 94 4a 5d call 0xba94 ; 0xba94 sdpos_atomic = 0; 15bf0: 10 92 84 03 sts 0x0384, r1 ; 0x800384 15bf4: 10 92 85 03 sts 0x0385, r1 ; 0x800385 15bf8: 10 92 86 03 sts 0x0386, r1 ; 0x800386 15bfc: 10 92 87 03 sts 0x0387, r1 ; 0x800387 15c00: 80 e0 ldi r24, 0x00 ; 0 15c02: 0e 94 c2 83 call 0x10784 ; 0x10784 } void CardReader::startFileprint() { if(mounted) 15c06: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 15c0a: 88 23 and r24, r24 15c0c: 31 f0 breq .+12 ; 0x15c1a { sdprinting = true; 15c0e: 81 e0 ldi r24, 0x01 ; 1 15c10: 80 93 6e 14 sts 0x146E, r24 ; 0x80146e 15c14: 85 e0 ldi r24, 0x05 ; 5 15c16: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.395> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 15c1a: 0f 94 cc 57 call 0x2af98 ; 0x2af98 if (MMU2::mmu2.Enabled()) 15c1e: 80 91 98 13 lds r24, 0x1398 ; 0x801398 15c22: 81 30 cpi r24, 0x01 ; 1 15c24: 09 f0 breq .+2 ; 0x15c28 15c26: 03 cf rjmp .-506 ; 0x15a2e { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 15c28: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 15c2c: 88 23 and r24, r24 15c2e: 09 f4 brne .+2 ; 0x15c32 15c30: fe ce rjmp .-516 ; 0x15a2e 15c32: 0e 94 df e3 call 0x1c7be ; 0x1c7be 15c36: 81 11 cpse r24, r1 15c38: fa ce rjmp .-524 ; 0x15a2e { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 15c3a: 0f 94 37 a0 call 0x3406e ; 0x3406e 15c3e: f7 ce rjmp .-530 ; 0x15a2e #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 15c40: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 15c44: 88 23 and r24, r24 15c46: 09 f4 brne .+2 ; 0x15c4a 15c48: f2 ce rjmp .-540 ; 0x15a2e 15c4a: 83 e5 ldi r24, 0x53 ; 83 15c4c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15c50: 88 23 and r24, r24 15c52: 09 f4 brne .+2 ; 0x15c56 15c54: ec ce rjmp .-552 ; 0x15a2e long index = code_value_long(); 15c56: 0e 94 a8 5c call 0xb950 ; 0xb950 15c5a: 6b 01 movw r12, r22 15c5c: 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);}; 15c5e: c0 92 82 17 sts 0x1782, r12 ; 0x801782 15c62: d0 92 83 17 sts 0x1783, r13 ; 0x801783 15c66: e0 92 84 17 sts 0x1784, r14 ; 0x801784 15c6a: f0 92 85 17 sts 0x1785, r15 ; 0x801785 15c6e: 0f 94 87 76 call 0x2ed0e ; 0x2ed0e 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; 15c72: c0 92 84 03 sts 0x0384, r12 ; 0x800384 15c76: d0 92 85 03 sts 0x0385, r13 ; 0x800385 15c7a: e0 92 86 03 sts 0x0386, r14 ; 0x800386 15c7e: f0 92 87 03 sts 0x0387, r15 ; 0x800387 15c82: d5 ce rjmp .-598 ; 0x15a2e #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 15c84: 80 e5 ldi r24, 0x50 ; 80 15c86: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15c8a: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 15c8c: 0e 94 ba 68 call 0xd174 ; 0xd174 15c90: 88 23 and r24, r24 15c92: 91 f0 breq .+36 ; 0x15cb8 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 15c94: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 15c98: 88 23 and r24, r24 15c9a: 49 f0 breq .+18 ; 0x15cae 15c9c: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 15ca0: 81 11 cpse r24, r1 15ca2: 05 c0 rjmp .+10 ; 0x15cae SERIAL_PROTOCOLLNPGM("SD print paused"); 15ca4: 8e e8 ldi r24, 0x8E ; 142 15ca6: 96 e8 ldi r25, 0x86 ; 134 15ca8: 0e 94 86 7b call 0xf70c ; 0xf70c 15cac: c0 ce rjmp .-640 ; 0x15a2e else SERIAL_PROTOCOLLNPGM("Print saved"); 15cae: 82 e8 ldi r24, 0x82 ; 130 15cb0: 96 e8 ldi r25, 0x86 ; 134 15cb2: 0e 94 86 7b call 0xf70c ; 0xf70c 15cb6: bb ce rjmp .-650 ; 0x15a2e } else if (sdprinting) 15cb8: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 15cbc: 88 23 and r24, r24 15cbe: 09 f4 brne .+2 ; 0x15cc2 15cc0: 4a c0 rjmp .+148 ; 0x15d56 { if (arg_P) 15cc2: 11 23 and r17, r17 15cc4: e1 f1 breq .+120 ; 0x15d3e { printAbsFilenameFast(); 15cc6: 0f 94 0c 7b call 0x2f618 ; 0x2f618 SERIAL_PROTOCOLLN(); 15cca: 0f 94 5d d6 call 0x3acba ; 0x3acba } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 15cce: 85 e1 ldi r24, 0x15 ; 21 15cd0: 99 e6 ldi r25, 0x69 ; 105 15cd2: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 15cd6: 60 91 82 17 lds r22, 0x1782 ; 0x801782 15cda: 70 91 83 17 lds r23, 0x1783 ; 0x801783 15cde: 80 91 84 17 lds r24, 0x1784 ; 0x801784 15ce2: 90 91 85 17 lds r25, 0x1785 ; 0x801785 15ce6: 4a e0 ldi r20, 0x0A ; 10 15ce8: 0f 94 4a d2 call 0x3a494 ; 0x3a494 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15cec: 8f e2 ldi r24, 0x2F ; 47 15cee: 0e 94 42 79 call 0xf284 ; 0xf284 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 15cf2: 60 91 7b 17 lds r22, 0x177B ; 0x80177b 15cf6: 70 91 7c 17 lds r23, 0x177C ; 0x80177c 15cfa: 80 91 7d 17 lds r24, 0x177D ; 0x80177d 15cfe: 90 91 7e 17 lds r25, 0x177E ; 0x80177e 15d02: 4a e0 ldi r20, 0x0A ; 10 15d04: 0f 94 4a d2 call 0x3a494 ; 0x3a494 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 15d08: 0f 94 5d d6 call 0x3acba ; 0x3acba SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 15d0c: 0f 94 e2 53 call 0x2a7c4 ; 0x2a7c4 15d10: 2c e3 ldi r18, 0x3C ; 60 15d12: 30 e0 ldi r19, 0x00 ; 0 15d14: 40 e0 ldi r20, 0x00 ; 0 15d16: 50 e0 ldi r21, 0x00 ; 0 15d18: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 15d1c: c9 01 movw r24, r18 15d1e: 6c e3 ldi r22, 0x3C ; 60 15d20: 70 e0 ldi r23, 0x00 ; 0 15d22: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 15d26: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 15d28: 90 e0 ldi r25, 0x00 ; 0 15d2a: 80 e0 ldi r24, 0x00 ; 0 15d2c: 0f 94 af d2 call 0x3a55e ; 0x3a55e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15d30: 8a e3 ldi r24, 0x3A ; 58 15d32: 0e 94 42 79 call 0xf284 ; 0xf284 SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 15d36: c8 01 movw r24, r16 15d38: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 15d3c: 78 ce rjmp .-784 ; 0x15a2e { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 15d3e: 80 91 85 14 lds r24, 0x1485 ; 0x801485 15d42: 88 23 and r24, r24 15d44: 29 f0 breq .+10 ; 0x15d50 15d46: 85 e8 ldi r24, 0x85 ; 133 15d48: 94 e1 ldi r25, 0x14 ; 20 15d4a: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 15d4e: bf cf rjmp .-130 ; 0x15cce 15d50: 80 e7 ldi r24, 0x70 ; 112 15d52: 94 e1 ldi r25, 0x14 ; 20 15d54: fa cf rjmp .-12 ; 0x15d4a SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 15d56: 82 e7 ldi r24, 0x72 ; 114 15d58: 96 e8 ldi r25, 0x86 ; 134 15d5a: 0e 94 86 7b call 0xf70c ; 0xf70c 15d5e: 67 ce rjmp .-818 ; 0x15a2e /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 15d60: 80 91 97 03 lds r24, 0x0397 ; 0x800397 15d64: 90 91 98 03 lds r25, 0x0398 ; 0x800398 15d68: 04 96 adiw r24, 0x04 ; 4 15d6a: 0f 94 e3 84 call 0x309c6 ; 0x309c6 15d6e: 5f ce rjmp .-834 ; 0x15a2e * 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; 15d70: ce 01 movw r24, r28 15d72: 01 96 adiw r24, 0x01 ; 1 15d74: 0f 94 68 77 call 0x2eed0 ; 0x2eed0 15d78: 88 23 and r24, r24 15d7a: 09 f4 brne .+2 ; 0x15d7e 15d7c: 54 c9 rjmp .-3416 ; 0x15026 // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 15d7e: 61 e0 ldi r22, 0x01 ; 1 15d80: ce 01 movw r24, r28 15d82: 01 96 adiw r24, 0x01 ; 1 15d84: 0f 94 47 a4 call 0x3488e ; 0x3488e if (!d) goto fail; 15d88: 00 97 sbiw r24, 0x00 ; 0 15d8a: 09 f4 brne .+2 ; 0x15d8e 15d8c: 4c c9 rjmp .-3432 ; 0x15026 // mark entry deleted d->name[0] = DIR_NAME_DELETED; 15d8e: 25 ee ldi r18, 0xE5 ; 229 15d90: fc 01 movw r30, r24 15d92: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 15d94: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 15d96: 0f 94 65 6a call 0x2d4ca ; 0x2d4ca 15d9a: 18 2f mov r17, r24 15d9c: 45 c9 rjmp .-3446 ; 0x15028 presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 15d9e: 8c e4 ldi r24, 0x4C ; 76 15da0: 96 e8 ldi r25, 0x86 ; 134 15da2: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 15da6: 23 96 adiw r28, 0x03 ; 3 15da8: 8e ad ldd r24, Y+62 ; 0x3e 15daa: 9f ad ldd r25, Y+63 ; 0x3f 15dac: 23 97 sbiw r28, 0x03 ; 3 15dae: 0e 94 bf 89 call 0x1137e ; 0x1137e 15db2: 8e e2 ldi r24, 0x2E ; 46 15db4: 0e 94 42 79 call 0xf284 ; 0xf284 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 15db8: 0f 94 5d d6 call 0x3acba ; 0x3acba 15dbc: 38 ce rjmp .-912 ; 0x15a2e ### 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(); 15dbe: 0f 94 e2 53 call 0x2a7c4 ; 0x2a7c4 int16_t sec, min; min = t / 60; sec = t % 60; 15dc2: 2c e3 ldi r18, 0x3C ; 60 15dc4: 30 e0 ldi r19, 0x00 ; 0 15dc6: 40 e0 ldi r20, 0x00 ; 0 15dc8: 50 e0 ldi r21, 0x00 ; 0 15dca: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 15dce: 7f 93 push r23 15dd0: 6f 93 push r22 15dd2: 3f 93 push r19 15dd4: 2f 93 push r18 15dd6: 89 e2 ldi r24, 0x29 ; 41 15dd8: 99 e8 ldi r25, 0x89 ; 137 15dda: 9f 93 push r25 15ddc: 8f 93 push r24 15dde: 8e 01 movw r16, r28 15de0: 0f 5f subi r16, 0xFF ; 255 15de2: 1f 4f sbci r17, 0xFF ; 255 15de4: 1f 93 push r17 15de6: 0f 93 push r16 15de8: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 SERIAL_ECHO_START; 15dec: 82 ef ldi r24, 0xF2 ; 242 15dee: 9a ea ldi r25, 0xAA ; 170 15df0: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN(time); 15df4: c8 01 movw r24, r16 15df6: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 lcd_setstatus(time); 15dfa: c8 01 movw r24, r16 15dfc: 0f 94 51 14 call 0x228a2 ; 0x228a2 autotempShutdown(); 15e00: 0f b6 in r0, 0x3f ; 63 15e02: f8 94 cli 15e04: de bf out 0x3e, r29 ; 62 15e06: 0f be out 0x3f, r0 ; 63 15e08: cd bf out 0x3d, r28 ; 61 15e0a: 11 ce rjmp .-990 ; 0x15a2e #### 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')) 15e0c: 83 e5 ldi r24, 0x53 ; 83 15e0e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15e12: 88 23 and r24, r24 15e14: 09 f4 brne .+2 ; 0x15e18 15e16: 0b ce rjmp .-1002 ; 0x15a2e { uint8_t pin_status = code_value_uint8(); 15e18: 0e 94 8e 5c call 0xb91c ; 0xb91c 15e1c: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 15e1e: 80 e5 ldi r24, 0x50 ; 80 15e20: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 15e24: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 15e26: 88 23 and r24, r24 15e28: 19 f0 breq .+6 ; 0x15e30 pin_number = code_value_uint8(); 15e2a: 0e 94 8e 5c call 0xb91c ; 0xb91c 15e2e: 18 2f mov r17, r24 15e30: ed e0 ldi r30, 0x0D ; 13 15e32: f9 e8 ldi r31, 0x89 ; 137 15e34: 89 e2 ldi r24, 0x29 ; 41 15e36: 99 e8 ldi r25, 0x89 ; 137 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) 15e38: 24 91 lpm r18, Z 15e3a: 21 17 cp r18, r17 15e3c: 09 f4 brne .+2 ; 0x15e40 15e3e: f7 cd rjmp .-1042 ; 0x15a2e 15e40: 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++) 15e42: 8e 17 cp r24, r30 15e44: 9f 07 cpc r25, r31 15e46: c1 f7 brne .-16 ; 0x15e38 pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 15e48: 16 30 cpi r17, 0x06 ; 6 15e4a: 81 f4 brne .+32 ; 0x15e6c fanSpeed = pin_status; 15e4c: 00 93 e3 03 sts 0x03E3, r16 ; 0x8003e3 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 15e50: 61 e0 ldi r22, 0x01 ; 1 15e52: 81 2f mov r24, r17 15e54: 0e 94 87 de call 0x1bd0e ; 0x1bd0e digitalWrite(pin_number, pin_status); 15e58: 60 2f mov r22, r16 15e5a: 81 2f mov r24, r17 15e5c: 0e 94 59 de call 0x1bcb2 ; 0x1bcb2 analogWrite(pin_number, pin_status); 15e60: 60 2f mov r22, r16 15e62: 70 e0 ldi r23, 0x00 ; 0 15e64: 81 2f mov r24, r17 15e66: 0e 94 b8 de call 0x1bd70 ; 0x1bd70 15e6a: e1 cd rjmp .-1086 ; 0x15a2e } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 15e6c: 17 fd sbrc r17, 7 15e6e: df cd rjmp .-1090 ; 0x15a2e 15e70: ef cf rjmp .-34 ; 0x15e50 ### 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); 15e72: 80 e1 ldi r24, 0x10 ; 16 15e74: 0e 94 33 e6 call 0x1cc66 ; 0x1cc66 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 15e78: 81 ea ldi r24, 0xA1 ; 161 15e7a: 9d e0 ldi r25, 0x0D ; 13 15e7c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 15e80: 3b e0 ldi r19, 0x0B ; 11 15e82: 83 9f mul r24, r19 15e84: c0 01 movw r24, r0 15e86: 11 24 eor r1, r1 15e88: 70 e0 ldi r23, 0x00 ; 0 15e8a: 60 e0 ldi r22, 0x00 ; 0 15e8c: 80 5b subi r24, 0xB0 ; 176 15e8e: 92 4f sbci r25, 0xF2 ; 242 15e90: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 15e94: 82 e0 ldi r24, 0x02 ; 2 15e96: 0e 94 33 e6 call 0x1cc66 ; 0x1cc66 reset_bed_offset_and_skew(); 15e9a: 0f 94 99 cb call 0x39732 ; 0x39732 // 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(); 15e9e: 0f 94 7a cb call 0x396f4 ; 0x396f4 15ea2: c5 cd rjmp .-1142 ; 0x15a2e */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 15ea4: 8a e5 ldi r24, 0x5A ; 90 15ea6: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 // 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); 15eaa: 0e 94 95 e6 call 0x1cd2a ; 0x1cd2a 15eae: bf cd rjmp .-1154 ; 0x15a2e ### 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()) { 15eb0: 80 91 df 16 lds r24, 0x16DF ; 0x8016df 15eb4: 88 23 and r24, r24 15eb6: 19 f1 breq .+70 ; 0x15efe uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 15eb8: ce 01 movw r24, r28 15eba: 01 96 adiw r24, 0x01 ; 1 15ebc: 0f 94 4b 85 call 0x30a96 ; 0x30a96 15ec0: 88 23 and r24, r24 15ec2: c1 f0 breq .+48 ; 0x15ef4 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15ec4: 89 81 ldd r24, Y+1 ; 0x01 15ec6: 0e 94 42 79 call 0xf284 ; 0xf284 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15eca: 8e e2 ldi r24, 0x2E ; 46 15ecc: 0e 94 42 79 call 0xf284 ; 0xf284 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15ed0: 8a 81 ldd r24, Y+2 ; 0x02 15ed2: 0e 94 42 79 call 0xf284 ; 0xf284 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15ed6: 8e e2 ldi r24, 0x2E ; 46 15ed8: 0e 94 42 79 call 0xf284 ; 0xf284 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15edc: 8b 81 ldd r24, Y+3 ; 0x03 15ede: 0e 94 42 79 call 0xf284 ; 0xf284 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15ee2: 8e e2 ldi r24, 0x2E ; 46 15ee4: 0e 94 42 79 call 0xf284 ; 0xf284 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15ee8: 8c 81 ldd r24, Y+4 ; 0x04 15eea: 0e 94 42 79 call 0xf284 ; 0xf284 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 15eee: 0f 94 5d d6 call 0x3acba ; 0x3acba 15ef2: 9d cd rjmp .-1222 ; 0x15a2e SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 15ef4: 8d ee ldi r24, 0xED ; 237 15ef6: 98 e8 ldi r25, 0x88 ; 136 15ef8: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 15efc: 98 cd rjmp .-1232 ; 0x15a2e } } else { SERIAL_PROTOCOLLNPGM("n/a"); 15efe: 89 ee ldi r24, 0xE9 ; 233 15f00: 98 e8 ldi r25, 0x88 ; 136 15f02: 0e 94 86 7b call 0xf70c ; 0xf70c 15f06: 93 cd rjmp .-1242 ; 0x15a2e 15f08: 10 92 67 0e sts 0x0E67, r1 ; 0x800e67 <_ZL13printer_state.lto_priv.395> 15f0c: 90 cd rjmp .-1248 ; 0x15a2e break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 15f0e: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 <_ZL13printer_state.lto_priv.395> 15f12: 1f 92 push r1 15f14: 8f 93 push r24 15f16: 86 e6 ldi r24, 0x66 ; 102 15f18: 9a e6 ldi r25, 0x6A ; 106 15f1a: 9f 93 push r25 15f1c: 8f 93 push r24 15f1e: 0f 94 1d dc call 0x3b83a ; 0x3b83a 15f22: 0f 90 pop r0 15f24: 0f 90 pop r0 15f26: 0f 90 pop r0 15f28: 0f 90 pop r0 15f2a: 81 cd rjmp .-1278 ; 0x15a2e - `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(); 15f2c: 80 e5 ldi r24, 0x50 ; 80 15f2e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15f32: 88 23 and r24, r24 15f34: 21 f0 breq .+8 ; 0x15f3e 15f36: 0e 94 8e 5c call 0xb91c ; 0xb91c 15f3a: 80 93 86 02 sts 0x0286, r24 ; 0x800286 if(code_seen('R')) print_time_remaining_normal = code_value(); 15f3e: 82 e5 ldi r24, 0x52 ; 82 15f40: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15f44: 88 23 and r24, r24 15f46: 41 f0 breq .+16 ; 0x15f58 15f48: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15f4c: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 15f50: 70 93 8a 02 sts 0x028A, r23 ; 0x80028a 15f54: 60 93 89 02 sts 0x0289, r22 ; 0x800289 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 15f58: 81 e5 ldi r24, 0x51 ; 81 15f5a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15f5e: 88 23 and r24, r24 15f60: 21 f0 breq .+8 ; 0x15f6a 15f62: 0e 94 8e 5c call 0xb91c ; 0xb91c 15f66: 80 93 85 02 sts 0x0285, r24 ; 0x800285 if(code_seen('S')) print_time_remaining_silent = code_value(); 15f6a: 83 e5 ldi r24, 0x53 ; 83 15f6c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15f70: 88 23 and r24, r24 15f72: 41 f0 breq .+16 ; 0x15f84 15f74: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15f78: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 15f7c: 70 93 8e 02 sts 0x028E, r23 ; 0x80028e 15f80: 60 93 8d 02 sts 0x028D, r22 ; 0x80028d if(code_seen('C')){ 15f84: 83 e4 ldi r24, 0x43 ; 67 15f86: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15f8a: 88 23 and r24, r24 15f8c: a9 f0 breq .+42 ; 0x15fb8 float print_time_to_change_normal_f = code_value(); 15f8e: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15f92: 6b 01 movw r12, r22 15f94: 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; 15f96: 20 e0 ldi r18, 0x00 ; 0 15f98: 30 e0 ldi r19, 0x00 ; 0 15f9a: a9 01 movw r20, r18 15f9c: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 15fa0: 6f ef ldi r22, 0xFF ; 255 15fa2: 7f ef ldi r23, 0xFF ; 255 15fa4: 18 16 cp r1, r24 15fa6: 24 f4 brge .+8 ; 0x15fb0 15fa8: c7 01 movw r24, r14 15faa: b6 01 movw r22, r12 15fac: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 15fb0: 70 93 88 02 sts 0x0288, r23 ; 0x800288 15fb4: 60 93 87 02 sts 0x0287, r22 ; 0x800287 } if(code_seen('D')){ 15fb8: 84 e4 ldi r24, 0x44 ; 68 15fba: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 15fbe: 88 23 and r24, r24 15fc0: a9 f0 breq .+42 ; 0x15fec float print_time_to_change_silent_f = code_value(); 15fc2: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 15fc6: 6b 01 movw r12, r22 15fc8: 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; 15fca: 20 e0 ldi r18, 0x00 ; 0 15fcc: 30 e0 ldi r19, 0x00 ; 0 15fce: a9 01 movw r20, r18 15fd0: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 15fd4: 6f ef ldi r22, 0xFF ; 255 15fd6: 7f ef ldi r23, 0xFF ; 255 15fd8: 18 16 cp r1, r24 15fda: 24 f4 brge .+8 ; 0x15fe4 15fdc: c7 01 movw r24, r14 15fde: b6 01 movw r22, r12 15fe0: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 15fe4: 70 93 8c 02 sts 0x028C, r23 ; 0x80028c 15fe8: 60 93 8b 02 sts 0x028B, r22 ; 0x80028b } { 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); 15fec: 80 91 88 02 lds r24, 0x0288 ; 0x800288 15ff0: 8f 93 push r24 15ff2: 80 91 87 02 lds r24, 0x0287 ; 0x800287 15ff6: 8f 93 push r24 15ff8: 80 91 8a 02 lds r24, 0x028A ; 0x80028a 15ffc: 8f 93 push r24 15ffe: 80 91 89 02 lds r24, 0x0289 ; 0x800289 16002: 8f 93 push r24 16004: 80 91 86 02 lds r24, 0x0286 ; 0x800286 16008: 28 2f mov r18, r24 1600a: 08 2e mov r0, r24 1600c: 00 0c add r0, r0 1600e: 33 0b sbc r19, r19 16010: 3f 93 push r19 16012: 8f 93 push r24 16014: 8c e0 ldi r24, 0x0C ; 12 16016: 9a e6 ldi r25, 0x6A ; 106 16018: 9f 93 push r25 1601a: 8f 93 push r24 1601c: 03 e1 ldi r16, 0x13 ; 19 1601e: 1a e6 ldi r17, 0x6A ; 106 16020: 1f 93 push r17 16022: 0f 93 push r16 16024: 0f 94 1d dc call 0x3b83a ; 0x3b83a printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 16028: 80 91 8c 02 lds r24, 0x028C ; 0x80028c 1602c: 8f 93 push r24 1602e: 80 91 8b 02 lds r24, 0x028B ; 0x80028b 16032: 8f 93 push r24 16034: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 16038: 8f 93 push r24 1603a: 80 91 8d 02 lds r24, 0x028D ; 0x80028d 1603e: 8f 93 push r24 16040: 80 91 85 02 lds r24, 0x0285 ; 0x800285 16044: 28 2f mov r18, r24 16046: 08 2e mov r0, r24 16048: 00 0c add r0, r0 1604a: 33 0b sbc r19, r19 1604c: 3f 93 push r19 1604e: 8f 93 push r24 16050: 85 e0 ldi r24, 0x05 ; 5 16052: 9a e6 ldi r25, 0x6A ; 106 16054: 9f 93 push r25 16056: 8f 93 push r24 16058: 1f 93 push r17 1605a: 0f 93 push r16 1605c: 0f 94 1d dc call 0x3b83a ; 0x3b83a 16060: 0f b6 in r0, 0x3f ; 63 16062: f8 94 cli 16064: de bf out 0x3e, r29 ; 62 16066: 0f be out 0x3f, r0 ; 63 16068: cd bf out 0x3d, r28 ; 61 1606a: e1 cc rjmp .-1598 ; 0x15a2e } else return false; } bool Stopwatch::pause() { if (isRunning()) { 1606c: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 16070: 81 30 cpi r24, 0x01 ; 1 16072: 09 f0 breq .+2 ; 0x16076 16074: dc cc rjmp .-1608 ; 0x15a2e state = PAUSED; 16076: 82 e0 ldi r24, 0x02 ; 2 16078: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d stopTimestamp = _millis(); 1607c: 0f 94 86 3e call 0x27d0c ; 0x27d0c 16080: 60 93 4f 06 sts 0x064F, r22 ; 0x80064f 16084: 70 93 50 06 sts 0x0650, r23 ; 0x800650 16088: 80 93 51 06 sts 0x0651, r24 ; 0x800651 1608c: 90 93 52 06 sts 0x0652, r25 ; 0x800652 16090: ce cc rjmp .-1636 ; 0x15a2e /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 16092: 0f 94 f0 57 call 0x2afe0 ; 0x2afe0 save_statistics(); 16096: 0e 94 54 67 call 0xcea8 ; 0xcea8 1609a: c9 cc rjmp .-1646 ; 0x15a2e ### 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 "); 1609c: 82 ee ldi r24, 0xE2 ; 226 1609e: 98 e8 ldi r25, 0x88 ; 136 160a0: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME)); 160a4: 8d ee ldi r24, 0xED ; 237 160a6: 9f e0 ldi r25, 0x0F ; 15 160a8: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 160ac: 4a e0 ldi r20, 0x0A ; 10 160ae: 0f 94 4a d2 call 0x3a494 ; 0x3a494 SERIAL_ECHOPGM(" min "); 160b2: 8c ed ldi r24, 0xDC ; 220 160b4: 98 e8 ldi r25, 0x88 ; 136 160b6: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED)); 160ba: 81 ef ldi r24, 0xF1 ; 241 160bc: 9f e0 ldi r25, 0x0F ; 15 160be: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 160c2: 4a e0 ldi r20, 0x0A ; 10 160c4: 0f 94 4a d2 call 0x3a494 ; 0x3a494 SERIAL_ECHOLNPGM(" cm."); 160c8: 87 ed ldi r24, 0xD7 ; 215 160ca: 98 e8 ldi r25, 0x88 ; 136 160cc: 0e 94 86 7b call 0xf70c ; 0xf70c 160d0: ae cc rjmp .-1700 ; 0x15a2e void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 160d2: 8e e9 ldi r24, 0x9E ; 158 160d4: 93 e0 ldi r25, 0x03 ; 3 160d6: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 160da: 83 e5 ldi r24, 0x53 ; 83 160dc: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 160e0: 88 23 and r24, r24 160e2: 09 f1 breq .+66 ; 0x16126 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 160e4: 62 e2 ldi r22, 0x22 ; 34 160e6: 70 e0 ldi r23, 0x00 ; 0 160e8: 80 91 97 03 lds r24, 0x0397 ; 0x800397 160ec: 90 91 98 03 lds r25, 0x0398 ; 0x800398 160f0: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 160f4: 8c 01 movw r16, r24 if (!this->ptr) { 160f6: 89 2b or r24, r25 160f8: b1 f0 breq .+44 ; 0x16126 // First quote not found return; } // Skip the leading quote this->ptr++; 160fa: 0f 5f subi r16, 0xFF ; 255 160fc: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 160fe: 62 e2 ldi r22, 0x22 ; 34 16100: 70 e0 ldi r23, 0x00 ; 0 16102: c8 01 movw r24, r16 16104: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 if(!pStrEnd) { 16108: 89 2b or r24, r25 1610a: 69 f0 breq .+26 ; 0x16126 char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 1610c: e9 e4 ldi r30, 0x49 ; 73 1610e: f6 e0 ldi r31, 0x06 ; 6 16110: 83 e0 ldi r24, 0x03 ; 3 16112: df 01 movw r26, r30 16114: 1d 92 st X+, r1 16116: 8a 95 dec r24 16118: e9 f7 brne .-6 ; 0x16114 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 1611a: 42 e0 ldi r20, 0x02 ; 2 1611c: 50 e0 ldi r21, 0x00 ; 0 1611e: b8 01 movw r22, r16 16120: cf 01 movw r24, r30 16122: 0f 94 db e3 call 0x3c7b6 ; 0x3c7b6 } #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 16126: 8c e8 ldi r24, 0x8C ; 140 16128: 9f e0 ldi r25, 0x0F ; 15 1612a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 && printer_recovering() && printingIsPaused()) { 1612e: 81 30 cpi r24, 0x01 ; 1 16130: 09 f0 breq .+2 ; 0x16134 16132: 7d cc rjmp .-1798 ; 0x15a2e #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() 16134: 0e 94 b0 68 call 0xd160 ; 0xd160 16138: 88 23 and r24, r24 1613a: 09 f4 brne .+2 ; 0x1613e 1613c: 78 cc rjmp .-1808 ; 0x15a2e && printingIsPaused()) { 1613e: 0e 94 ba 68 call 0xd174 ; 0xd174 16142: 88 23 and r24, r24 16144: 09 f4 brne .+2 ; 0x16148 16146: 73 cc rjmp .-1818 ; 0x15a2e // 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) { 16148: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 <_ZL24uvlo_auto_recovery_ready.lto_priv.550> 1614c: 88 23 and r24, r24 1614e: 29 f0 breq .+10 ; 0x1615a SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY); 16150: 83 ee ldi r24, 0xE3 ; 227 16152: 99 e6 ldi r25, 0x69 ; 105 16154: 0e 94 86 7b call 0xf70c ; 0xf70c 16158: 6a cc rjmp .-1836 ; 0x15a2e } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); 1615a: 86 ec ldi r24, 0xC6 ; 198 1615c: 99 e6 ldi r25, 0x69 ; 105 1615e: 0e 94 86 7b call 0xf70c ; 0xf70c 16162: 65 cc rjmp .-1846 ; 0x15a2e /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 16164: 89 ea ldi r24, 0xA9 ; 169 16166: 99 e6 ldi r25, 0x69 ; 105 16168: 0e 94 15 7c call 0xf82a ; 0xf82a #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 1616c: 83 e5 ldi r24, 0x53 ; 83 1616e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16172: 88 23 and r24, r24 16174: 09 f4 brne .+2 ; 0x16178 16176: 5b cc rjmp .-1866 ; 0x15a2e 16178: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1617c: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 16180: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 16184: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b 16188: 52 cc rjmp .-1884 ; 0x15a2e 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 "); 1618a: 83 ed ldi r24, 0xD3 ; 211 1618c: 98 e8 ldi r25, 0x88 ; 136 1618e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 gcode_M105(); 16192: 0e 94 cd 7a call 0xf59a ; 0xf59a cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 16196: 0e 94 c7 78 call 0xf18e ; 0xf18e cmdbuffer_front_already_processed = true; 1619a: 81 e0 ldi r24, 0x01 ; 1 1619c: 80 93 80 10 sts 0x1080, r24 ; 0x801080 161a0: 46 cc rjmp .-1908 ; 0x15a2e 161a2: 10 92 67 14 sts 0x1467, r1 ; 0x801467 161a6: ec c8 rjmp .-3624 ; 0x15380 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; } 161a8: 81 e0 ldi r24, 0x01 ; 1 161aa: 80 93 65 14 sts 0x1465, r24 ; 0x801465 161ae: 3f cc rjmp .-1922 ; 0x15a2e #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 161b0: 82 e5 ldi r24, 0x52 ; 82 161b2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 161b6: 81 11 cpse r24, r1 161b8: 76 c8 rjmp .-3860 ; 0x152a6 autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 161ba: 0f 94 86 3e call 0x27d0c ; 0x27d0c 161be: 6b 01 movw r12, r22 161c0: 7c 01 movw r14, r24 }; FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ return target_temperature[extruder] > current_temperature[extruder]; 161c2: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 161c6: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 161ca: 07 2e mov r0, r23 161cc: 00 0c add r0, r0 161ce: 88 0b sbc r24, r24 161d0: 99 0b sbc r25, r25 161d2: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 161d6: 11 e0 ldi r17, 0x01 ; 1 161d8: 20 91 61 0e lds r18, 0x0E61 ; 0x800e61 161dc: 30 91 62 0e lds r19, 0x0E62 ; 0x800e62 161e0: 40 91 63 0e lds r20, 0x0E63 ; 0x800e63 161e4: 50 91 64 0e lds r21, 0x0E64 ; 0x800e64 161e8: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 161ec: 18 16 cp r1, r24 161ee: 0c f0 brlt .+2 ; 0x161f2 161f0: 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 161f2: 10 93 60 0e sts 0x0E60, r17 ; 0x800e60 <_ZL16target_direction.lto_priv.551> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 161f6: c7 01 movw r24, r14 161f8: b6 01 movw r22, r12 161fa: 0f 94 5e 81 call 0x302bc ; 0x302bc LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 161fe: 85 e8 ldi r24, 0x85 ; 133 16200: 9a e4 ldi r25, 0x4A ; 74 16202: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 16206: 0f 94 0c 0b call 0x21618 ; 0x21618 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 1620a: 82 e0 ldi r24, 0x02 ; 2 1620c: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df prusa_statistics(2); previous_millis_cmd.start(); 16210: 88 e8 ldi r24, 0x88 ; 136 16212: 93 e0 ldi r25, 0x03 ; 3 16214: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> 16218: 0a cc rjmp .-2028 ; 0x15a2e */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 1621a: 87 e7 ldi r24, 0x77 ; 119 1621c: 9a e4 ldi r25, 0x4A ; 74 1621e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 16222: 0f 94 0c 0b call 0x21618 ; 0x21618 heating_status = HeatingStatus::BED_HEATING; 16226: 83 e0 ldi r24, 0x03 ; 3 16228: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df prusa_statistics(1); if (code_seen('S')) 1622c: 83 e5 ldi r24, 0x53 ; 83 1622e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16232: 18 2f mov r17, r24 16234: 88 23 and r24, r24 16236: 49 f0 breq .+18 ; 0x1624a setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 16238: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1623c: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 16240: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 16244: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b 16248: 05 c0 rjmp .+10 ; 0x16254 if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 1624a: 82 e5 ldi r24, 0x52 ; 82 1624c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16250: 81 11 cpse r24, r1 16252: f2 cf rjmp .-28 ; 0x16238 { setTargetBed(code_value()); } codenum = _millis(); 16254: 0f 94 86 3e call 0x27d0c ; 0x27d0c 16258: 6b 01 movw r12, r22 1625a: 7c 01 movw r14, r24 cancel_heatup = false; 1625c: 10 92 66 0e sts 0x0E66, r1 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.402> 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; 16260: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 16264: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 16268: 07 2e mov r0, r23 1626a: 00 0c add r0, r0 1626c: 88 0b sbc r24, r24 1626e: 99 0b sbc r25, r25 16270: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 16274: 01 e0 ldi r16, 0x01 ; 1 16276: 20 91 f1 04 lds r18, 0x04F1 ; 0x8004f1 1627a: 30 91 f2 04 lds r19, 0x04F2 ; 0x8004f2 1627e: 40 91 f3 04 lds r20, 0x04F3 ; 0x8004f3 16282: 50 91 f4 04 lds r21, 0x04F4 ; 0x8004f4 16286: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1628a: 18 16 cp r1, r24 1628c: 0c f0 brlt .+2 ; 0x16290 1628e: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 16290: 00 93 60 0e sts 0x0E60, r16 ; 0x800e60 <_ZL16target_direction.lto_priv.551> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 16294: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.402> 16298: 81 11 cpse r24, r1 1629a: 1a c0 rjmp .+52 ; 0x162d0 1629c: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 162a0: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 162a4: 07 2e mov r0, r23 162a6: 00 0c add r0, r0 162a8: 88 0b sbc r24, r24 162aa: 99 0b sbc r25, r25 162ac: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 162b0: 20 91 f1 04 lds r18, 0x04F1 ; 0x8004f1 162b4: 30 91 f2 04 lds r19, 0x04F2 ; 0x8004f2 162b8: 40 91 f3 04 lds r20, 0x04F3 ; 0x8004f3 162bc: 50 91 f4 04 lds r21, 0x04F4 ; 0x8004f4 162c0: e0 91 60 0e lds r30, 0x0E60 ; 0x800e60 <_ZL16target_direction.lto_priv.551> 162c4: ee 23 and r30, r30 162c6: 91 f0 breq .+36 ; 0x162ec 162c8: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 162cc: 18 16 cp r1, r24 162ce: a4 f0 brlt .+40 ; 0x162f8 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 162d0: 8c e6 ldi r24, 0x6C ; 108 162d2: 9a e4 ldi r25, 0x4A ; 74 162d4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 162d8: 0f 94 0c 0b call 0x21618 ; 0x21618 heating_status = HeatingStatus::BED_HEATING_COMPLETE; 162dc: 84 e0 ldi r24, 0x04 ; 4 162de: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df previous_millis_cmd.start(); 162e2: 88 e8 ldi r24, 0x88 ; 136 162e4: 93 e0 ldi r25, 0x03 ; 3 162e6: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> 162ea: a1 cb rjmp .-2238 ; 0x15a2e codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 162ec: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 162f0: 87 ff sbrs r24, 7 162f2: ee cf rjmp .-36 ; 0x162d0 162f4: 11 11 cpse r17, r1 162f6: ec cf rjmp .-40 ; 0x162d0 { if (lcd_commands_type == LcdCommands::LongPause) { 162f8: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 162fc: 82 30 cpi r24, 0x02 ; 2 162fe: 41 f3 breq .-48 ; 0x162d0 // 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. 16300: 0f 94 86 3e call 0x27d0c ; 0x27d0c 16304: 6c 19 sub r22, r12 16306: 7d 09 sbc r23, r13 16308: 8e 09 sbc r24, r14 1630a: 9f 09 sbc r25, r15 1630c: 69 3e cpi r22, 0xE9 ; 233 1630e: 73 40 sbci r23, 0x03 ; 3 16310: 81 05 cpc r24, r1 16312: 91 05 cpc r25, r1 16314: 30 f0 brcs .+12 ; 0x16322 { if (!farm_mode) { serialecho_temperatures(); 16316: 0e 94 69 79 call 0xf2d2 ; 0xf2d2 } codenum = _millis(); 1631a: 0f 94 86 3e call 0x27d0c ; 0x27d0c 1631e: 6b 01 movw r12, r22 16320: 7c 01 movw r14, r24 } manage_heater(); 16322: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(); 16326: 80 e0 ldi r24, 0x00 ; 0 16328: 0e 94 5a 8c call 0x118b4 ; 0x118b4 lcd_update(0); 1632c: 80 e0 ldi r24, 0x00 ; 0 1632e: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 16332: b0 cf rjmp .-160 ; 0x16294 #### 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')){ 16334: 83 e5 ldi r24, 0x53 ; 83 16336: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1633a: 88 23 and r24, r24 1633c: 29 f0 breq .+10 ; 0x16348 fanSpeed = code_value_uint8(); 1633e: 0e 94 8e 5c call 0xb91c ; 0xb91c 16342: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 16346: 73 cb rjmp .-2330 ; 0x15a2e } else { fanSpeed = 255; 16348: 8f ef ldi r24, 0xFF ; 255 1634a: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 1634e: 6f cb rjmp .-2338 ; 0x15a2e /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 16350: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 16354: 6c cb rjmp .-2344 ; 0x15a2e /*! ### 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; 16356: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 1635a: 88 60 ori r24, 0x08 ; 8 1635c: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 16360: 66 cb rjmp .-2356 ; 0x15a2e ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 16362: 83 e5 ldi r24, 0x53 ; 83 16364: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16368: 88 23 and r24, r24 1636a: 99 f0 breq .+38 ; 0x16392 stepper_inactive_time = code_value() * 1000; 1636c: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16370: 20 e0 ldi r18, 0x00 ; 0 16372: 30 e0 ldi r19, 0x00 ; 0 16374: 4a e7 ldi r20, 0x7A ; 122 16376: 54 e4 ldi r21, 0x44 ; 68 16378: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1637c: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 16380: 60 93 34 02 sts 0x0234, r22 ; 0x800234 16384: 70 93 35 02 sts 0x0235, r23 ; 0x800235 16388: 80 93 36 02 sts 0x0236, r24 ; 0x800236 1638c: 90 93 37 02 sts 0x0237, r25 ; 0x800237 16390: 4e cb rjmp .-2404 ; 0x15a2e } 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]))); 16392: 88 e5 ldi r24, 0x58 ; 88 16394: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16398: 88 23 and r24, r24 1639a: d1 f0 breq .+52 ; 0x163d0 disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 1639c: 0f 94 27 58 call 0x2b04e ; 0x2b04e if (code_seen('X')) disable_x(); 163a0: 88 e5 ldi r24, 0x58 ; 88 163a2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 163a6: 81 11 cpse r24, r1 163a8: 28 c0 rjmp .+80 ; 0x163fa if (code_seen('Y')) disable_y(); 163aa: 89 e5 ldi r24, 0x59 ; 89 163ac: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 163b0: 88 23 and r24, r24 163b2: 19 f0 breq .+6 ; 0x163ba 163b4: 16 9a sbi 0x02, 6 ; 2 163b6: 10 92 41 07 sts 0x0741, r1 ; 0x800741 if (code_seen('Z')) disable_z(); 163ba: 8a e5 ldi r24, 0x5A ; 90 163bc: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 163c0: 85 e4 ldi r24, 0x45 ; 69 163c2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 163c6: 88 23 and r24, r24 163c8: 09 f4 brne .+2 ; 0x163cc 163ca: 31 cb rjmp .-2462 ; 0x15a2e 163cc: 14 9a sbi 0x02, 4 ; 2 163ce: 2f cb rjmp .-2466 ; 0x15a2e 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]))); 163d0: 89 e5 ldi r24, 0x59 ; 89 163d2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 163d6: 81 11 cpse r24, r1 163d8: e1 cf rjmp .-62 ; 0x1639c 163da: 8a e5 ldi r24, 0x5A ; 90 163dc: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 163e0: 81 11 cpse r24, r1 163e2: dc cf rjmp .-72 ; 0x1639c 163e4: 85 e4 ldi r24, 0x45 ; 69 163e6: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 163ea: 81 11 cpse r24, r1 163ec: d7 cf rjmp .-82 ; 0x1639c if(all_axis) { st_synchronize(); 163ee: 0f 94 27 58 call 0x2b04e ; 0x2b04e disable_e0(); 163f2: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 163f4: 0e 94 13 84 call 0x10826 ; 0x10826 163f8: 1a cb rjmp .-2508 ; 0x15a2e } else { st_synchronize(); if (code_seen('X')) disable_x(); 163fa: 17 9a sbi 0x02, 7 ; 2 163fc: 10 92 40 07 sts 0x0740, r1 ; 0x800740 16400: d4 cf rjmp .-88 ; 0x163aa #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 16402: 83 e5 ldi r24, 0x53 ; 83 16404: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16408: 88 23 and r24, r24 1640a: 09 f4 brne .+2 ; 0x1640e 1640c: 10 cb rjmp .-2528 ; 0x15a2e safetytimer_inactive_time = code_value() * 1000; 1640e: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16412: 20 e0 ldi r18, 0x00 ; 0 16414: 30 e0 ldi r19, 0x00 ; 0 16416: 4a e7 ldi r20, 0x7A ; 122 16418: 54 e4 ldi r21, 0x44 ; 68 1641a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1641e: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 16422: 60 93 30 02 sts 0x0230, r22 ; 0x800230 16426: 70 93 31 02 sts 0x0231, r23 ; 0x800231 1642a: 80 93 32 02 sts 0x0232, r24 ; 0x800232 1642e: 90 93 33 02 sts 0x0233, r25 ; 0x800233 safetyTimer.start(); 16432: 8b ed ldi r24, 0xDB ; 219 16434: 95 e0 ldi r25, 0x05 ; 5 16436: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> 1643a: f9 ca rjmp .-2574 ; 0x15a2e 1643c: 7d ed ldi r23, 0xDD ; 221 1643e: c7 2e mov r12, r23 16440: 72 e0 ldi r23, 0x02 ; 2 16442: d7 2e mov r13, r23 16444: ee e6 ldi r30, 0x6E ; 110 16446: ee 2e mov r14, r30 16448: e6 e0 ldi r30, 0x06 ; 6 1644a: fe 2e mov r15, r30 - `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++) 1644c: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 1644e: f6 01 movw r30, r12 16450: 81 91 ld r24, Z+ 16452: 6f 01 movw r12, r30 16454: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16458: 88 23 and r24, r24 1645a: 09 f4 brne .+2 ; 0x1645e 1645c: 65 c0 rjmp .+202 ; 0x16528 { float value = code_value(); 1645e: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16462: 2b 01 movw r4, r22 16464: 3c 01 movw r6, r24 if(i == E_AXIS) { // E 16466: 13 30 cpi r17, 0x03 ; 3 16468: 09 f0 breq .+2 ; 0x1646c 1646a: 68 c0 rjmp .+208 ; 0x1653c if(value < 20.0) { 1646c: 20 e0 ldi r18, 0x00 ; 0 1646e: 30 e0 ldi r19, 0x00 ; 0 16470: 40 ea ldi r20, 0xA0 ; 160 16472: 51 e4 ldi r21, 0x41 ; 65 16474: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 16478: 87 ff sbrs r24, 7 1647a: 4e c0 rjmp .+156 ; 0x16518 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 1647c: a3 01 movw r20, r6 1647e: 92 01 movw r18, r4 16480: 60 91 7e 06 lds r22, 0x067E ; 0x80067e 16484: 70 91 7f 06 lds r23, 0x067F ; 0x80067f 16488: 80 91 80 06 lds r24, 0x0680 ; 0x800680 1648c: 90 91 81 06 lds r25, 0x0681 ; 0x800681 16490: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 16494: 4b 01 movw r8, r22 16496: 5c 01 movw r10, r24 cs.max_jerk[E_AXIS] *= factor; 16498: ac 01 movw r20, r24 1649a: 9b 01 movw r18, r22 1649c: 60 91 c2 06 lds r22, 0x06C2 ; 0x8006c2 164a0: 70 91 c3 06 lds r23, 0x06C3 ; 0x8006c3 164a4: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 164a8: 90 91 c5 06 lds r25, 0x06C5 ; 0x8006c5 164ac: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 164b0: 60 93 c2 06 sts 0x06C2, r22 ; 0x8006c2 164b4: 70 93 c3 06 sts 0x06C3, r23 ; 0x8006c3 164b8: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 164bc: 90 93 c5 06 sts 0x06C5, r25 ; 0x8006c5 max_feedrate[E_AXIS] *= factor; 164c0: 20 90 99 02 lds r2, 0x0299 ; 0x800299 164c4: 30 90 9a 02 lds r3, 0x029A ; 0x80029a 164c8: a5 01 movw r20, r10 164ca: 94 01 movw r18, r8 164cc: d1 01 movw r26, r2 164ce: 1c 96 adiw r26, 0x0c ; 12 164d0: 6d 91 ld r22, X+ 164d2: 7d 91 ld r23, X+ 164d4: 8d 91 ld r24, X+ 164d6: 9c 91 ld r25, X 164d8: 1f 97 sbiw r26, 0x0f ; 15 164da: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 164de: f1 01 movw r30, r2 164e0: 64 87 std Z+12, r22 ; 0x0c 164e2: 75 87 std Z+13, r23 ; 0x0d 164e4: 86 87 std Z+14, r24 ; 0x0e 164e6: 97 87 std Z+15, r25 ; 0x0f max_acceleration_steps_per_s2[E_AXIS] *= factor; 164e8: 60 91 fc 17 lds r22, 0x17FC ; 0x8017fc 164ec: 70 91 fd 17 lds r23, 0x17FD ; 0x8017fd 164f0: 80 91 fe 17 lds r24, 0x17FE ; 0x8017fe 164f4: 90 91 ff 17 lds r25, 0x17FF ; 0x8017ff 164f8: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 164fc: a5 01 movw r20, r10 164fe: 94 01 movw r18, r8 16500: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 16504: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 16508: 60 93 fc 17 sts 0x17FC, r22 ; 0x8017fc 1650c: 70 93 fd 17 sts 0x17FD, r23 ; 0x8017fd 16510: 80 93 fe 17 sts 0x17FE, r24 ; 0x8017fe 16514: 90 93 ff 17 sts 0x17FF, r25 ; 0x8017ff } cs.axis_steps_per_mm[E_AXIS] = value; 16518: 40 92 7e 06 sts 0x067E, r4 ; 0x80067e 1651c: 50 92 7f 06 sts 0x067F, r5 ; 0x80067f 16520: 60 92 80 06 sts 0x0680, r6 ; 0x800680 16524: 70 92 81 06 sts 0x0681, r7 ; 0x800681 16528: b4 e0 ldi r27, 0x04 ; 4 1652a: eb 0e add r14, r27 1652c: f1 1c adc r15, r1 1652e: 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++) 16530: 14 30 cpi r17, 0x04 ; 4 16532: 09 f0 breq .+2 ; 0x16536 16534: 8c cf rjmp .-232 ; 0x1644e } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 16536: 0f 94 4f aa call 0x3549e ; 0x3549e 1653a: 79 ca rjmp .-2830 ; 0x15a2e 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; 1653c: d7 01 movw r26, r14 1653e: 14 96 adiw r26, 0x04 ; 4 16540: 4d 92 st X+, r4 16542: 5d 92 st X+, r5 16544: 6d 92 st X+, r6 16546: 7c 92 st X, r7 16548: 17 97 sbiw r26, 0x07 ; 7 1654a: ee cf rjmp .-36 ; 0x16528 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 1654c: 8e e4 ldi r24, 0x4E ; 78 1654e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16552: 88 23 and r24, r24 16554: 09 f4 brne .+2 ; 0x16558 16556: 6b ca rjmp .-2858 ; 0x15a2e gcode_LastN = code_value_long(); 16558: 0e 94 a8 5c call 0xb950 ; 0xb950 1655c: 60 93 7c 03 sts 0x037C, r22 ; 0x80037c 16560: 70 93 7d 03 sts 0x037D, r23 ; 0x80037d 16564: 80 93 7e 03 sts 0x037E, r24 ; 0x80037e 16568: 90 93 7f 03 sts 0x037F, r25 ; 0x80037f 1656c: 60 ca rjmp .-2880 ; 0x15a2e case 113: if (code_seen('S')) { host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; 1656e: 82 ef ldi r24, 0xF2 ; 242 16570: 9a ea ldi r25, 0xAA ; 170 16572: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 16576: c0 90 2f 02 lds r12, 0x022F ; 0x80022f 1657a: d1 2c mov r13, r1 1657c: f1 2c mov r15, r1 1657e: 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); } 16580: 8c ec ldi r24, 0xCC ; 204 16582: 98 e8 ldi r25, 0x88 ; 136 16584: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 16588: 4a e0 ldi r20, 0x0A ; 10 1658a: c7 01 movw r24, r14 1658c: b6 01 movw r22, r12 1658e: 0f 94 4a d2 call 0x3a494 ; 0x3a494 host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 16592: 0f 94 5d d6 call 0x3acba ; 0x3acba 16596: 4b ca rjmp .-2922 ; 0x15a2e */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 16598: 85 e5 ldi r24, 0x55 ; 85 1659a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1659e: 88 23 and r24, r24 165a0: 09 f4 brne .+2 ; 0x165a4 165a2: 5a c0 rjmp .+180 ; 0x16658 // 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); 165a4: 00 91 97 03 lds r16, 0x0397 ; 0x800397 165a8: 10 91 98 03 lds r17, 0x0398 ; 0x800398 165ac: 0f 5f subi r16, 0xFF ; 255 165ae: 1f 4f sbci r17, 0xFF ; 255 165b0: 10 93 98 03 sts 0x0398, r17 ; 0x800398 165b4: 00 93 97 03 sts 0x0397, r16 ; 0x800397 return false; } bool show_upgrade_dialog_if_version_newer(const char *version_string) { if(oCheckVersion == ClCheckMode::_None) 165b8: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec 165bc: 88 23 and r24, r24 165be: 09 f4 brne .+2 ; 0x165c2 165c0: 36 ca rjmp .-2964 ; 0x15a2e // 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)) 165c2: be 01 movw r22, r28 165c4: 6f 5f subi r22, 0xFF ; 255 165c6: 7f 4f sbci r23, 0xFF ; 255 165c8: c8 01 movw r24, r16 165ca: 0e 94 7a f8 call 0x1f0f4 ; 0x1f0f4 165ce: 88 23 and r24, r24 165d0: 09 f4 brne .+2 ; 0x165d4 165d2: 2d ca rjmp .-2982 ; 0x15a2e 165d4: 86 e7 ldi r24, 0x76 ; 118 165d6: 90 e9 ldi r25, 0x90 ; 144 165d8: de 01 movw r26, r28 165da: 11 96 adiw r26, 0x01 ; 1 165dc: be 01 movw r22, r28 165de: 67 5f subi r22, 0xF7 ; 247 165e0: 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]); 165e2: fc 01 movw r30, r24 165e4: 45 91 lpm r20, Z+ 165e6: 54 91 lpm r21, Z if (ver_gcode[i] > v) 165e8: 2d 91 ld r18, X+ 165ea: 3d 91 ld r19, X+ 165ec: 42 17 cp r20, r18 165ee: 53 07 cpc r21, r19 165f0: 10 f4 brcc .+4 ; 0x165f6 165f2: 0c 94 7b ce jmp 0x19cf6 ; 0x19cf6 return 1; else if (ver_gcode[i] < v) 165f6: 24 17 cp r18, r20 165f8: 35 07 cpc r19, r21 165fa: 08 f4 brcc .+2 ; 0x165fe 165fc: 18 ca rjmp .-3024 ; 0x15a2e 165fe: 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) 16600: a6 17 cp r26, r22 16602: b7 07 cpc r27, r23 16604: 71 f7 brne .-36 ; 0x165e2 16606: 13 ca rjmp .-3034 ; 0x15a2e 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)); 16608: 84 e9 ldi r24, 0x94 ; 148 1660a: 99 e3 ldi r25, 0x39 ; 57 1660c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 16610: ac 01 movw r20, r24 16612: 63 e0 ldi r22, 0x03 ; 3 16614: 80 e0 ldi r24, 0x00 ; 0 16616: 0e 94 29 70 call 0xe052 ; 0xe052 Sound_MakeCustom(50,1000,false); 1661a: 40 e0 ldi r20, 0x00 ; 0 1661c: 68 ee ldi r22, 0xE8 ; 232 1661e: 73 e0 ldi r23, 0x03 ; 3 16620: 82 e3 ldi r24, 0x32 ; 50 16622: 90 e0 ldi r25, 0x00 ; 0 16624: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc delay_keep_alive(500); 16628: 84 ef ldi r24, 0xF4 ; 244 1662a: 91 e0 ldi r25, 0x01 ; 1 1662c: 0e 94 ff 8e call 0x11dfe ; 0x11dfe Sound_MakeCustom(50,1000,false); 16630: 40 e0 ldi r20, 0x00 ; 0 16632: 68 ee ldi r22, 0xE8 ; 232 16634: 73 e0 ldi r23, 0x03 ; 3 16636: 82 e3 ldi r24, 0x32 ; 50 16638: 90 e0 ldi r25, 0x00 ; 0 1663a: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc lcd_wait_for_click_delay(30); 1663e: 8e e1 ldi r24, 0x1E ; 30 16640: 90 e0 ldi r25, 0x00 ; 0 16642: 0f 94 6e 4f call 0x29edc ; 0x29edc lcd_update_enable(true); 16646: 81 e0 ldi r24, 0x01 ; 1 16648: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_clear(); 1664c: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_update(0); 16650: 80 e0 ldi r24, 0x00 ; 0 16652: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 16656: eb c9 rjmp .-3114 ; 0x15a2e } 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); 16658: 41 e1 ldi r20, 0x11 ; 17 1665a: 50 e0 ldi r21, 0x00 ; 0 1665c: 60 e8 ldi r22, 0x80 ; 128 1665e: 7c e0 ldi r23, 0x0C ; 12 16660: ce 01 movw r24, r28 16662: 01 96 adiw r24, 0x01 ; 1 16664: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 16668: 8e ea ldi r24, 0xAE ; 174 1666a: 98 e8 ldi r25, 0x88 ; 136 1666c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 16670: 85 e4 ldi r24, 0x45 ; 69 16672: 96 e8 ldi r25, 0x86 ; 134 16674: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOPGM("+"); 16678: 8c ea ldi r24, 0xAC ; 172 1667a: 98 e8 ldi r25, 0x88 ; 136 1667c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOPGM(STR(FW_COMMITNR)); 16680: 87 ea ldi r24, 0xA7 ; 167 16682: 98 e8 ldi r25, 0x88 ; 136 16684: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOPGM("_"); 16688: 85 ea ldi r24, 0xA5 ; 165 1668a: 98 e8 ldi r25, 0x88 ; 136 1668c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOPGM(FW_COMMIT_HASH); 16690: 8b e9 ldi r24, 0x9B ; 155 16692: 98 e8 ldi r25, 0x88 ; 136 16694: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 16698: 81 e4 ldi r24, 0x41 ; 65 1669a: 98 e8 ldi r25, 0x88 ; 136 1669c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOPGM(PROTOCOL_VERSION); 166a0: 8d e3 ldi r24, 0x3D ; 61 166a2: 98 e8 ldi r25, 0x88 ; 136 166a4: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOPGM(" MACHINE_TYPE:"); 166a8: 8e e2 ldi r24, 0x2E ; 46 166aa: 98 e8 ldi r25, 0x88 ; 136 166ac: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 166b0: ce 01 movw r24, r28 166b2: 01 96 adiw r24, 0x01 ; 1 166b4: 0e 94 bf 89 call 0x1137e ; 0x1137e SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 166b8: 8c e1 ldi r24, 0x1C ; 28 166ba: 98 e8 ldi r25, 0x88 ; 136 166bc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 166c0: 8b e1 ldi r24, 0x1B ; 27 166c2: 98 e8 ldi r25, 0x88 ; 136 166c4: 0e 94 86 7b call 0xf70c ; 0xf70c } #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'); 166c8: 1f 92 push r1 166ca: 61 e3 ldi r22, 0x31 ; 49 166cc: f6 2e mov r15, r22 166ce: ff 92 push r15 166d0: 84 e3 ldi r24, 0x34 ; 52 166d2: 96 e8 ldi r25, 0x86 ; 134 166d4: 9f 93 push r25 166d6: 8f 93 push r24 166d8: 0d ee ldi r16, 0xED ; 237 166da: 15 e8 ldi r17, 0x85 ; 133 166dc: 1f 93 push r17 166de: 0f 93 push r16 166e0: 0f 94 1d dc call 0x3b83a ; 0x3b83a 166e4: 1f 92 push r1 166e6: ff 92 push r15 166e8: 84 e2 ldi r24, 0x24 ; 36 166ea: 96 e8 ldi r25, 0x86 ; 134 166ec: 9f 93 push r25 166ee: 8f 93 push r24 166f0: 1f 93 push r17 166f2: 0f 93 push r16 166f4: 0f 94 1d dc call 0x3b83a ; 0x3b83a 166f8: 1f 92 push r1 166fa: ff 92 push r15 166fc: 80 e1 ldi r24, 0x10 ; 16 166fe: 96 e8 ldi r25, 0x86 ; 134 16700: 9f 93 push r25 16702: 8f 93 push r24 16704: 1f 93 push r17 16706: 0f 93 push r16 16708: 0f 94 1d dc call 0x3b83a ; 0x3b83a 1670c: 1f 92 push r1 1670e: ff 92 push r15 16710: 83 e0 ldi r24, 0x03 ; 3 16712: 96 e8 ldi r25, 0x86 ; 134 16714: 9f 93 push r25 16716: 8f 93 push r24 16718: 1f 93 push r17 1671a: 0f 93 push r16 1671c: 0f 94 1d dc call 0x3b83a ; 0x3b83a 16720: 1f 92 push r1 16722: ff 92 push r15 16724: 88 ef ldi r24, 0xF8 ; 248 16726: 95 e8 ldi r25, 0x85 ; 133 16728: 9f 93 push r25 1672a: 8f 93 push r24 1672c: 1f 93 push r17 1672e: 0f 93 push r16 16730: 0f 94 1d dc call 0x3b83a ; 0x3b83a 16734: 0f b6 in r0, 0x3f ; 63 16736: f8 94 cli 16738: de bf out 0x3e, r29 ; 62 1673a: 0f be out 0x3f, r0 ; 63 1673c: cd bf out 0x3d, r28 ; 61 1673e: 77 c9 rjmp .-3346 ; 0x15a2e /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 16740: 0e 94 52 7a call 0xf4a4 ; 0xf4a4 16744: 74 c9 rjmp .-3352 ; 0x15a2e /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 16746: e0 91 97 03 lds r30, 0x0397 ; 0x800397 1674a: f0 91 98 03 lds r31, 0x0398 ; 0x800398 1674e: cf 01 movw r24, r30 16750: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 16752: 24 81 ldd r18, Z+4 ; 0x04 16754: 20 32 cpi r18, 0x20 ; 32 16756: 09 f4 brne .+2 ; 0x1675a 16758: 01 96 adiw r24, 0x01 ; 1 1675a: 0f 94 51 14 call 0x228a2 ; 0x228a2 custom_message_type = CustomMsg::M117; 1675e: 87 e0 ldi r24, 0x07 ; 7 16760: 80 93 75 07 sts 0x0775, r24 ; 0x800775 16764: 64 c9 rjmp .-3384 ; 0x15a2e - `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; 16766: 00 91 97 03 lds r16, 0x0397 ; 0x800397 1676a: 10 91 98 03 lds r17, 0x0398 ; 0x800398 1676e: 0b 5f subi r16, 0xFB ; 251 16770: 1f 4f sbci r17, 0xFF ; 255 16772: 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; 16774: f1 2c mov r15, r1 16776: 40 e0 ldi r20, 0x00 ; 0 16778: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 1677a: e9 f0 breq .+58 ; 0x167b6 // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 1677c: d8 01 movw r26, r16 1677e: 9c 91 ld r25, X 16780: 29 2f mov r18, r25 16782: 2b 7f andi r18, 0xFB ; 251 16784: 21 34 cpi r18, 0x41 ; 65 16786: b9 f4 brne .+46 ; 0x167b6 16788: 11 96 adiw r26, 0x01 ; 1 1678a: 2c 91 ld r18, X 1678c: 21 33 cpi r18, 0x31 ; 49 1678e: 99 f4 brne .+38 ; 0x167b6 switch (p[0]) { 16790: 91 34 cpi r25, 0x41 ; 65 16792: 71 f0 breq .+28 ; 0x167b0 16794: 95 34 cpi r25, 0x45 ; 69 16796: 09 f4 brne .+2 ; 0x1679a case 'A': hasA = true; break; case 'E': hasE = true; break; 16798: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 1679a: 98 01 movw r18, r16 1679c: 2e 5f subi r18, 0xFE ; 254 1679e: 3f 4f sbci r19, 0xFF ; 255 167a0: 89 01 movw r16, r18 167a2: 2f 5f subi r18, 0xFF ; 255 167a4: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 167a6: f8 01 movw r30, r16 167a8: 90 81 ld r25, Z 167aa: 90 32 cpi r25, 0x20 ; 32 167ac: c9 f3 breq .-14 ; 0x167a0 167ae: e4 cf rjmp .-56 ; 0x16778 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; 167b0: ff 24 eor r15, r15 167b2: f3 94 inc r15 167b4: f2 cf rjmp .-28 ; 0x1679a } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 167b6: 44 23 and r20, r20 167b8: 21 f0 breq .+8 ; 0x167c2 167ba: 82 ef ldi r24, 0xF2 ; 242 167bc: 9a ea ldi r25, 0xAA ; 170 167be: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if (hasA) SERIAL_ECHOPGM("//"); 167c2: ff 20 and r15, r15 167c4: 21 f0 breq .+8 ; 0x167ce 167c6: 88 e1 ldi r24, 0x18 ; 24 167c8: 98 e8 ldi r25, 0x88 ; 136 167ca: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN(p); 167ce: c8 01 movw r24, r16 167d0: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 167d4: 2c c9 rjmp .-3496 ; 0x15a2e /*! ### 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 167d6: 80 e9 ldi r24, 0x90 ; 144 167d8: 99 e6 ldi r25, 0x69 ; 105 167da: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOLLN(); 167de: 0f 94 5d d6 call 0x3acba ; 0x3acba #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 167e2: 88 e8 ldi r24, 0x88 ; 136 167e4: 99 e6 ldi r25, 0x69 ; 105 167e6: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 167ea: 1e 99 sbic 0x03, 6 ; 3 167ec: 47 c0 rjmp .+142 ; 0x1687c SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 167ee: 83 e8 ldi r24, 0x83 ; 131 167f0: 99 e6 ldi r25, 0x69 ; 105 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); 167f2: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 167f6: 0f 94 5d d6 call 0x3acba ; 0x3acba #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX 167fa: 81 e7 ldi r24, 0x71 ; 113 167fc: 99 e6 ldi r25, 0x69 ; 105 167fe: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ 16802: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 16806: 82 fd sbrc r24, 2 16808: 3c c0 rjmp .+120 ; 0x16882 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1680a: 83 e8 ldi r24, 0x83 ; 131 1680c: 99 e6 ldi r25, 0x69 ; 105 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); 1680e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16812: 0f 94 5d d6 call 0x3acba ; 0x3acba #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN 16816: 89 e6 ldi r24, 0x69 ; 105 16818: 99 e6 ldi r25, 0x69 ; 105 1681a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 1681e: 1d 99 sbic 0x03, 5 ; 3 16820: 33 c0 rjmp .+102 ; 0x16888 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16822: 83 e8 ldi r24, 0x83 ; 131 16824: 99 e6 ldi r25, 0x69 ; 105 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); 16826: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1682a: 0f 94 5d d6 call 0x3acba ; 0x3acba #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX 1682e: 81 e6 ldi r24, 0x61 ; 97 16830: 99 e6 ldi r25, 0x69 ; 105 16832: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ 16836: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 1683a: 87 fd sbrc r24, 7 1683c: 28 c0 rjmp .+80 ; 0x1688e SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1683e: 83 e8 ldi r24, 0x83 ; 131 16840: 99 e6 ldi r25, 0x69 ; 105 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); 16842: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16846: 0f 94 5d d6 call 0x3acba ; 0x3acba #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 1684a: 89 e5 ldi r24, 0x59 ; 89 1684c: 99 e6 ldi r25, 0x69 ; 105 1684e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 16852: 1c 99 sbic 0x03, 4 ; 3 16854: 1f c0 rjmp .+62 ; 0x16894 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16856: 83 e8 ldi r24, 0x83 ; 131 16858: 99 e6 ldi r25, 0x69 ; 105 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); 1685a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1685e: 0f 94 5d d6 call 0x3acba ; 0x3acba #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 16862: 81 e5 ldi r24, 0x51 ; 81 16864: 99 e6 ldi r25, 0x69 ; 105 16866: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 1686a: 01 9b sbis 0x00, 1 ; 0 1686c: 16 c0 rjmp .+44 ; 0x1689a SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1686e: 83 e8 ldi r24, 0x83 ; 131 16870: 99 e6 ldi r25, 0x69 ; 105 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); 16872: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16876: 0f 94 5d d6 call 0x3acba ; 0x3acba 1687a: d9 c8 rjmp .-3662 ; 0x15a2e 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); 1687c: 89 e7 ldi r24, 0x79 ; 121 1687e: 99 e6 ldi r25, 0x69 ; 105 16880: b8 cf rjmp .-144 ; 0x167f2 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); 16882: 89 e7 ldi r24, 0x79 ; 121 16884: 99 e6 ldi r25, 0x69 ; 105 16886: c3 cf rjmp .-122 ; 0x1680e 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); 16888: 89 e7 ldi r24, 0x79 ; 121 1688a: 99 e6 ldi r25, 0x69 ; 105 1688c: cc cf rjmp .-104 ; 0x16826 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); 1688e: 89 e7 ldi r24, 0x79 ; 121 16890: 99 e6 ldi r25, 0x69 ; 105 16892: d7 cf rjmp .-82 ; 0x16842 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); 16894: 89 e7 ldi r24, 0x79 ; 121 16896: 99 e6 ldi r25, 0x69 ; 105 16898: e0 cf rjmp .-64 ; 0x1685a 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); 1689a: 89 e7 ldi r24, 0x79 ; 121 1689c: 99 e6 ldi r25, 0x69 ; 105 1689e: e9 cf rjmp .-46 ; 0x16872 E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 168a0: 0e 94 b9 67 call 0xcf72 ; 0xcf72 168a4: c4 c8 rjmp .-3704 ; 0x15a2e */ 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')) { 168a6: 84 e5 ldi r24, 0x54 ; 84 168a8: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 168ac: 88 23 and r24, r24 168ae: 69 f0 breq .+26 ; 0x168ca extruder = code_value_uint8(); 168b0: 0e 94 8e 5c call 0xb91c ; 0xb91c if(extruder >= EXTRUDERS) { 168b4: 88 23 and r24, r24 168b6: 49 f0 breq .+18 ; 0x168ca SERIAL_ECHO_START; 168b8: 82 ef ldi r24, 0xF2 ; 242 168ba: 9a ea ldi r25, 0xAA ; 170 168bc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 168c0: 8a e3 ldi r24, 0x3A ; 58 168c2: 99 e6 ldi r25, 0x69 ; 105 168c4: 0e 94 bf 89 call 0x1137e ; 0x1137e 168c8: b2 c8 rjmp .-3740 ; 0x15a2e SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 168ca: 84 e4 ldi r24, 0x44 ; 68 168cc: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 168d0: 88 23 and r24, r24 168d2: 09 f4 brne .+2 ; 0x168d6 168d4: ac c8 rjmp .-3752 ; 0x15a2e float diameter = code_value(); 168d6: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 if (diameter == 0.0) { 168da: 20 e0 ldi r18, 0x00 ; 0 168dc: 30 e0 ldi r19, 0x00 ; 0 168de: a9 01 movw r20, r18 168e0: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 168e4: 81 11 cpse r24, r1 168e6: 05 c0 rjmp .+10 ; 0x168f2 // 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; 168e8: 10 92 05 07 sts 0x0705, r1 ; 0x800705 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 168ec: 0e 94 ee 66 call 0xcddc ; 0xcddc 168f0: 9e c8 rjmp .-3780 ; 0x15a2e // 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(); 168f2: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 168f6: 6b 01 movw r12, r22 168f8: 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]); 168fa: 20 e0 ldi r18, 0x00 ; 0 168fc: 30 e0 ldi r19, 0x00 ; 0 168fe: a9 01 movw r20, r18 16900: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 16904: 81 11 cpse r24, r1 16906: 06 c0 rjmp .+12 ; 0x16914 16908: c1 2c mov r12, r1 1690a: d1 2c mov r13, r1 1690c: 50 ee ldi r21, 0xE0 ; 224 1690e: e5 2e mov r14, r21 16910: 5f e3 ldi r21, 0x3F ; 63 16912: f5 2e mov r15, r21 16914: c0 92 06 07 sts 0x0706, r12 ; 0x800706 16918: d0 92 07 07 sts 0x0707, r13 ; 0x800707 1691c: e0 92 08 07 sts 0x0708, r14 ; 0x800708 16920: f0 92 09 07 sts 0x0709, r15 ; 0x800709 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; 16924: 81 e0 ldi r24, 0x01 ; 1 16926: 80 93 05 07 sts 0x0705, r24 ; 0x800705 1692a: e0 cf rjmp .-64 ; 0x168ec 1692c: 3d ed ldi r19, 0xDD ; 221 1692e: c3 2e mov r12, r19 16930: 32 e0 ldi r19, 0x02 ; 2 16932: d3 2e mov r13, r19 16934: 4e e6 ldi r20, 0x6E ; 110 16936: e4 2e mov r14, r20 16938: 46 e0 ldi r20, 0x06 ; 6 1693a: f4 2e mov r15, r20 - `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++) 1693c: 10 e0 ldi r17, 0x00 ; 0 { if (code_seen(axis_codes[i])) 1693e: d6 01 movw r26, r12 16940: 8d 91 ld r24, X+ 16942: 6d 01 movw r12, r26 16944: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16948: 88 23 and r24, r24 1694a: 41 f1 breq .+80 ; 0x1699c { unsigned long val = code_value(); 1694c: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16950: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> #ifdef TMC2130 unsigned long val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 16954: 12 30 cpi r17, 0x02 ; 2 16956: 4c f5 brge .+82 ; 0x169aa { if (val > NORMAL_MAX_ACCEL_XY) 16958: 65 3c cpi r22, 0xC5 ; 197 1695a: b9 e0 ldi r27, 0x09 ; 9 1695c: 7b 07 cpc r23, r27 1695e: 81 05 cpc r24, r1 16960: 91 05 cpc r25, r1 16962: 40 f5 brcc .+80 ; 0x169b4 16964: 56 2f mov r21, r22 16966: 47 2f mov r20, r23 16968: 38 2f mov r19, r24 1696a: 29 2f mov r18, r25 1696c: 61 3c cpi r22, 0xC1 ; 193 1696e: e3 e0 ldi r30, 0x03 ; 3 16970: 7e 07 cpc r23, r30 16972: 81 05 cpc r24, r1 16974: 91 05 cpc r25, r1 16976: 20 f0 brcs .+8 ; 0x16980 16978: 50 ec ldi r21, 0xC0 ; 192 1697a: 43 e0 ldi r20, 0x03 ; 3 1697c: 30 e0 ldi r19, 0x00 ; 0 1697e: 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; 16980: d7 01 movw r26, r14 16982: 94 96 adiw r26, 0x24 ; 36 16984: 6d 93 st X+, r22 16986: 7d 93 st X+, r23 16988: 8d 93 st X+, r24 1698a: 9c 93 st X, r25 1698c: 97 97 sbiw r26, 0x27 ; 39 cs.max_acceleration_mm_per_s2_silent[i] = val_silent; 1698e: f7 01 movw r30, r14 16990: e4 55 subi r30, 0x54 ; 84 16992: ff 4f sbci r31, 0xFF ; 255 16994: 50 83 st Z, r21 16996: 41 83 std Z+1, r20 ; 0x01 16998: 32 83 std Z+2, r19 ; 0x02 1699a: 23 83 std Z+3, r18 ; 0x03 1699c: b4 e0 ldi r27, 0x04 ; 4 1699e: eb 0e add r14, r27 169a0: f1 1c adc r15, r1 169a2: 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++) 169a4: 14 30 cpi r17, 0x04 ; 4 169a6: 59 f6 brne .-106 ; 0x1693e 169a8: c6 cd rjmp .-1140 ; 0x16536 { if (code_seen(axis_codes[i])) { unsigned long val = code_value(); 169aa: 56 2f mov r21, r22 169ac: 47 2f mov r20, r23 169ae: 38 2f mov r19, r24 169b0: 29 2f mov r18, r25 169b2: e6 cf rjmp .-52 ; 0x16980 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; 169b4: 50 ec ldi r21, 0xC0 ; 192 169b6: 43 e0 ldi r20, 0x03 ; 3 169b8: 30 e0 ldi r19, 0x00 ; 0 169ba: 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; 169bc: 64 ec ldi r22, 0xC4 ; 196 169be: 79 e0 ldi r23, 0x09 ; 9 169c0: 80 e0 ldi r24, 0x00 ; 0 169c2: 90 e0 ldi r25, 0x00 ; 0 169c4: dd cf rjmp .-70 ; 0x16980 169c6: 9d ed ldi r25, 0xDD ; 221 169c8: a9 2e mov r10, r25 169ca: 92 e0 ldi r25, 0x02 ; 2 169cc: b9 2e mov r11, r25 169ce: 2e e6 ldi r18, 0x6E ; 110 169d0: c2 2e mov r12, r18 169d2: 26 e0 ldi r18, 0x06 ; 6 169d4: d2 2e mov r13, r18 - `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++) 169d6: 91 2c mov r9, r1 { if (code_seen(axis_codes[i])) 169d8: f5 01 movw r30, r10 169da: 81 91 ld r24, Z+ 169dc: 5f 01 movw r10, r30 169de: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 169e2: 88 23 and r24, r24 169e4: 71 f1 breq .+92 ; 0x16a42 { float val = code_value(); 169e6: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 169ea: 7b 01 movw r14, r22 169ec: 8c 01 movw r16, r24 #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 169ee: f1 e0 ldi r31, 0x01 ; 1 169f0: f9 15 cp r31, r9 169f2: b8 f1 brcs .+110 ; 0x16a62 { if (val > NORMAL_MAX_FEEDRATE_XY) 169f4: 20 e0 ldi r18, 0x00 ; 0 169f6: 30 e0 ldi r19, 0x00 ; 0 169f8: 48 e4 ldi r20, 0x48 ; 72 169fa: 53 e4 ldi r21, 0x43 ; 67 169fc: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 16a00: 18 16 cp r1, r24 16a02: 44 f1 brlt .+80 ; 0x16a54 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(); 16a04: 5e 2c mov r5, r14 16a06: 6f 2c mov r6, r15 16a08: 70 2e mov r7, r16 16a0a: 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) 16a0c: 20 e0 ldi r18, 0x00 ; 0 16a0e: 30 e0 ldi r19, 0x00 ; 0 16a10: 48 ec ldi r20, 0xC8 ; 200 16a12: 52 e4 ldi r21, 0x42 ; 66 16a14: b7 01 movw r22, r14 16a16: c8 01 movw r24, r16 16a18: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 16a1c: 18 16 cp r1, r24 16a1e: 34 f1 brlt .+76 ; 0x16a6c val_silent = SILENT_MAX_FEEDRATE_XY; } cs.max_feedrate_normal[i] = val; 16a20: 85 2d mov r24, r5 16a22: 96 2d mov r25, r6 16a24: a7 2d mov r26, r7 16a26: b8 2d mov r27, r8 16a28: f6 01 movw r30, r12 16a2a: 84 8b std Z+20, r24 ; 0x14 16a2c: 95 8b std Z+21, r25 ; 0x15 16a2e: a6 8b std Z+22, r26 ; 0x16 16a30: b7 8b std Z+23, r27 ; 0x17 cs.max_feedrate_silent[i] = val_silent; 16a32: c7 01 movw r24, r14 16a34: d8 01 movw r26, r16 16a36: e4 56 subi r30, 0x64 ; 100 16a38: ff 4f sbci r31, 0xFF ; 255 16a3a: 80 83 st Z, r24 16a3c: 91 83 std Z+1, r25 ; 0x01 16a3e: a2 83 std Z+2, r26 ; 0x02 16a40: 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++) 16a42: 93 94 inc r9 16a44: f4 e0 ldi r31, 0x04 ; 4 16a46: cf 0e add r12, r31 16a48: d1 1c adc r13, r1 16a4a: 24 e0 ldi r18, 0x04 ; 4 16a4c: 92 12 cpse r9, r18 16a4e: c4 cf rjmp .-120 ; 0x169d8 16a50: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_FEEDRATE_XY) val = NORMAL_MAX_FEEDRATE_XY; 16a54: 51 2c mov r5, r1 16a56: 61 2c mov r6, r1 16a58: b8 e4 ldi r27, 0x48 ; 72 16a5a: 7b 2e mov r7, r27 16a5c: 83 e4 ldi r24, 0x43 ; 67 16a5e: 88 2e mov r8, r24 16a60: d5 cf rjmp .-86 ; 0x16a0c 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(); 16a62: 56 2e mov r5, r22 16a64: 6f 2c mov r6, r15 16a66: 78 2e mov r7, r24 16a68: 81 2e mov r8, r17 16a6a: da cf rjmp .-76 ; 0x16a20 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; 16a6c: e1 2c mov r14, r1 16a6e: f1 2c mov r15, r1 16a70: 08 ec ldi r16, 0xC8 ; 200 16a72: 12 e4 ldi r17, 0x42 ; 66 16a74: d5 cf rjmp .-86 ; 0x16a20 // 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')) 16a76: 80 e5 ldi r24, 0x50 ; 80 16a78: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16a7c: 88 23 and r24, r24 16a7e: 51 f0 breq .+20 ; 0x16a94 cs.acceleration = code_value(); 16a80: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16a84: 60 93 a2 06 sts 0x06A2, r22 ; 0x8006a2 16a88: 70 93 a3 06 sts 0x06A3, r23 ; 0x8006a3 16a8c: 80 93 a4 06 sts 0x06A4, r24 ; 0x8006a4 16a90: 90 93 a5 06 sts 0x06A5, r25 ; 0x8006a5 if(code_seen('R')) 16a94: 82 e5 ldi r24, 0x52 ; 82 16a96: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16a9a: 88 23 and r24, r24 16a9c: 51 f0 breq .+20 ; 0x16ab2 cs.retract_acceleration = code_value(); 16a9e: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16aa2: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 16aa6: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 16aaa: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 16aae: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 if(code_seen('T')) 16ab2: 84 e5 ldi r24, 0x54 ; 84 16ab4: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16ab8: 88 23 and r24, r24 16aba: 11 f4 brne .+4 ; 0x16ac0 16abc: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e cs.travel_acceleration = code_value(); 16ac0: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16ac4: 60 93 2e 07 sts 0x072E, r22 ; 0x80072e 16ac8: 70 93 2f 07 sts 0x072F, r23 ; 0x80072f 16acc: 80 93 30 07 sts 0x0730, r24 ; 0x800730 16ad0: 90 93 31 07 sts 0x0731, r25 ; 0x800731 16ad4: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 16ad8: 83 e5 ldi r24, 0x53 ; 83 16ada: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16ade: 88 23 and r24, r24 16ae0: 51 f0 breq .+20 ; 0x16af6 16ae2: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16ae6: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 16aea: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 16aee: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 16af2: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad if(code_seen('T')) cs.mintravelfeedrate = code_value(); 16af6: 84 e5 ldi r24, 0x54 ; 84 16af8: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16afc: 88 23 and r24, r24 16afe: 51 f0 breq .+20 ; 0x16b14 16b00: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16b04: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 16b08: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 16b0c: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 16b10: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 16b14: 82 e4 ldi r24, 0x42 ; 66 16b16: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16b1a: 88 23 and r24, r24 16b1c: 61 f0 breq .+24 ; 0x16b36 16b1e: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16b22: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 16b26: 60 93 b2 06 sts 0x06B2, r22 ; 0x8006b2 16b2a: 70 93 b3 06 sts 0x06B3, r23 ; 0x8006b3 16b2e: 80 93 b4 06 sts 0x06B4, r24 ; 0x8006b4 16b32: 90 93 b5 06 sts 0x06B5, r25 ; 0x8006b5 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 16b36: 88 e5 ldi r24, 0x58 ; 88 16b38: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16b3c: 88 23 and r24, r24 16b3e: 91 f0 breq .+36 ; 0x16b64 16b40: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16b44: 60 93 ba 06 sts 0x06BA, r22 ; 0x8006ba 16b48: 70 93 bb 06 sts 0x06BB, r23 ; 0x8006bb 16b4c: 80 93 bc 06 sts 0x06BC, r24 ; 0x8006bc 16b50: 90 93 bd 06 sts 0x06BD, r25 ; 0x8006bd 16b54: 60 93 b6 06 sts 0x06B6, r22 ; 0x8006b6 16b58: 70 93 b7 06 sts 0x06B7, r23 ; 0x8006b7 16b5c: 80 93 b8 06 sts 0x06B8, r24 ; 0x8006b8 16b60: 90 93 b9 06 sts 0x06B9, r25 ; 0x8006b9 if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 16b64: 89 e5 ldi r24, 0x59 ; 89 16b66: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16b6a: 88 23 and r24, r24 16b6c: 51 f0 breq .+20 ; 0x16b82 16b6e: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16b72: 60 93 ba 06 sts 0x06BA, r22 ; 0x8006ba 16b76: 70 93 bb 06 sts 0x06BB, r23 ; 0x8006bb 16b7a: 80 93 bc 06 sts 0x06BC, r24 ; 0x8006bc 16b7e: 90 93 bd 06 sts 0x06BD, r25 ; 0x8006bd if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 16b82: 8a e5 ldi r24, 0x5A ; 90 16b84: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16b88: 88 23 and r24, r24 16b8a: 51 f0 breq .+20 ; 0x16ba0 16b8c: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16b90: 60 93 be 06 sts 0x06BE, r22 ; 0x8006be 16b94: 70 93 bf 06 sts 0x06BF, r23 ; 0x8006bf 16b98: 80 93 c0 06 sts 0x06C0, r24 ; 0x8006c0 16b9c: 90 93 c1 06 sts 0x06C1, r25 ; 0x8006c1 if(code_seen('E')) 16ba0: 85 e4 ldi r24, 0x45 ; 69 16ba2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16ba6: 88 23 and r24, r24 16ba8: 11 f4 brne .+4 ; 0x16bae 16baa: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e { float e = code_value(); 16bae: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 #ifndef LA_NOCOMPAT e = la10c_jerk(e); 16bb2: 0e 94 5d 83 call 0x106ba ; 0x106ba #endif cs.max_jerk[E_AXIS] = e; 16bb6: 60 93 c2 06 sts 0x06C2, r22 ; 0x8006c2 16bba: 70 93 c3 06 sts 0x06C3, r23 ; 0x8006c3 16bbe: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 16bc2: 90 93 c5 06 sts 0x06C5, r25 ; 0x8006c5 16bc6: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 16bca: 0d ed ldi r16, 0xDD ; 221 16bcc: 12 e0 ldi r17, 0x02 ; 2 16bce: f6 ec ldi r31, 0xC6 ; 198 16bd0: ef 2e mov r14, r31 16bd2: f6 e0 ldi r31, 0x06 ; 6 16bd4: ff 2e mov r15, r31 16bd6: a0 ee ldi r26, 0xE0 ; 224 16bd8: ca 2e mov r12, r26 16bda: a2 e0 ldi r26, 0x02 ; 2 16bdc: da 2e mov r13, r26 - `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(); 16bde: d8 01 movw r26, r16 16be0: 8d 91 ld r24, X+ 16be2: 8d 01 movw r16, r26 16be4: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16be8: 88 23 and r24, r24 16bea: 39 f0 breq .+14 ; 0x16bfa 16bec: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16bf0: f7 01 movw r30, r14 16bf2: 60 83 st Z, r22 16bf4: 71 83 std Z+1, r23 ; 0x01 16bf6: 82 83 std Z+2, r24 ; 0x02 16bf8: 93 83 std Z+3, r25 ; 0x03 16bfa: f4 e0 ldi r31, 0x04 ; 4 16bfc: ef 0e add r14, r31 16bfe: 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++) 16c00: c0 16 cp r12, r16 16c02: d1 06 cpc r13, r17 16c04: 61 f7 brne .-40 ; 0x16bde 16c06: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e - `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')) 16c0a: 83 e5 ldi r24, 0x53 ; 83 16c0c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16c10: 88 23 and r24, r24 16c12: 51 f0 breq .+20 ; 0x16c28 { cs.retract_recover_length = code_value() ; 16c14: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16c18: 60 93 fd 06 sts 0x06FD, r22 ; 0x8006fd 16c1c: 70 93 fe 06 sts 0x06FE, r23 ; 0x8006fe 16c20: 80 93 ff 06 sts 0x06FF, r24 ; 0x8006ff 16c24: 90 93 00 07 sts 0x0700, r25 ; 0x800700 } if(code_seen('F')) 16c28: 86 e4 ldi r24, 0x46 ; 70 16c2a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16c2e: 88 23 and r24, r24 16c30: 11 f4 brne .+4 ; 0x16c36 16c32: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 16c36: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16c3a: 0e 94 fc 67 call 0xcff8 ; 0xcff8 16c3e: 60 93 01 07 sts 0x0701, r22 ; 0x800701 16c42: 70 93 02 07 sts 0x0702, r23 ; 0x800702 16c46: 80 93 03 07 sts 0x0703, r24 ; 0x800703 16c4a: 90 93 04 07 sts 0x0704, r25 ; 0x800704 16c4e: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e #### 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')) 16c52: 83 e5 ldi r24, 0x53 ; 83 16c54: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16c58: 88 23 and r24, r24 16c5a: 11 f4 brne .+4 ; 0x16c60 16c5c: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e { switch(code_value_uint8()) 16c60: 0e 94 8e 5c call 0xb91c ; 0xb91c 16c64: 88 23 and r24, r24 16c66: c1 f0 breq .+48 ; 0x16c98 16c68: 81 30 cpi r24, 0x01 ; 1 16c6a: e1 f0 breq .+56 ; 0x16ca4 #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 16c6c: 82 ef ldi r24, 0xF2 ; 242 16c6e: 9a ea ldi r25, 0xAA ; 170 16c70: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 16c74: 87 e2 ldi r24, 0x27 ; 39 16c76: 99 e6 ldi r25, 0x69 ; 105 16c78: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 16c7c: 80 91 70 12 lds r24, 0x1270 ; 0x801270 16c80: 90 91 71 12 lds r25, 0x1271 ; 0x801271 16c84: 8a 57 subi r24, 0x7A ; 122 16c86: 9f 4e sbci r25, 0xEF ; 239 16c88: 0e 94 bf 89 call 0x1137e ; 0x1137e SERIAL_ECHOLNPGM("\"(1)"); 16c8c: 83 e1 ldi r24, 0x13 ; 19 16c8e: 98 e8 ldi r25, 0x88 ; 136 16c90: 0e 94 86 7b call 0xf70c ; 0xf70c 16c94: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 16c98: 10 92 f0 06 sts 0x06F0, r1 ; 0x8006f0 retracted[0]=false; 16c9c: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f 16ca0: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 16ca4: 80 93 f0 06 sts 0x06F0, r24 ; 0x8006f0 retracted[0]=false; 16ca8: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f 16cac: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 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; 16cb0: 40 90 32 07 lds r4, 0x0732 ; 0x800732 16cb4: 50 90 33 07 lds r5, 0x0733 ; 0x800733 16cb8: 60 90 34 07 lds r6, 0x0734 ; 0x800734 16cbc: 70 90 35 07 lds r7, 0x0735 ; 0x800735 16cc0: 0c 94 70 aa jmp 0x154e0 ; 0x154e0 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 16cc4: 80 90 36 07 lds r8, 0x0736 ; 0x800736 16cc8: 90 90 37 07 lds r9, 0x0737 ; 0x800737 16ccc: a0 90 38 07 lds r10, 0x0738 ; 0x800738 16cd0: b0 90 39 07 lds r11, 0x0739 ; 0x800739 16cd4: 0c 94 7b aa jmp 0x154f6 ; 0x154f6 - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 16cd8: 82 e4 ldi r24, 0x42 ; 66 16cda: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16cde: 18 2f mov r17, r24 16ce0: 88 23 and r24, r24 16ce2: 41 f0 breq .+16 ; 0x16cf4 { saved_feedmultiply_mm = feedmultiply; 16ce4: 80 91 39 02 lds r24, 0x0239 ; 0x800239 16ce8: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 16cec: 90 93 2e 02 sts 0x022E, r25 ; 0x80022e 16cf0: 80 93 2d 02 sts 0x022D, r24 ; 0x80022d codesWereSeen = true; } if (code_seen('S')) 16cf4: 83 e5 ldi r24, 0x53 ; 83 16cf6: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16cfa: 08 2f mov r16, r24 16cfc: 88 23 and r24, r24 16cfe: 39 f0 breq .+14 ; 0x16d0e { feedmultiply = code_value_short(); 16d00: 0e 94 9b 5c call 0xb936 ; 0xb936 16d04: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 16d08: 80 93 39 02 sts 0x0239, r24 ; 0x800239 codesWereSeen = true; 16d0c: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 16d0e: 82 e5 ldi r24, 0x52 ; 82 16d10: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16d14: 88 23 and r24, r24 16d16: 51 f0 breq .+20 ; 0x16d2c { feedmultiply = saved_feedmultiply_mm; 16d18: 80 91 2d 02 lds r24, 0x022D ; 0x80022d 16d1c: 90 91 2e 02 lds r25, 0x022E ; 0x80022e 16d20: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 16d24: 80 93 39 02 sts 0x0239, r24 ; 0x800239 16d28: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e codesWereSeen = true; } if (!codesWereSeen) 16d2c: 11 11 cpse r17, r1 16d2e: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e { printf_P(PSTR("%i%%\n"), feedmultiply); 16d32: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 16d36: 8f 93 push r24 16d38: 80 91 39 02 lds r24, 0x0239 ; 0x800239 16d3c: 8f 93 push r24 16d3e: 8d e0 ldi r24, 0x0D ; 13 16d40: 98 e8 ldi r25, 0x88 ; 136 16d42: 9f 93 push r25 16d44: 8f 93 push r24 16d46: 0f 94 1d dc call 0x3b83a ; 0x3b83a 16d4a: 0f 90 pop r0 16d4c: 0f 90 pop r0 16d4e: 0f 90 pop r0 16d50: 0f 90 pop r0 16d52: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e extrudemultiply = code_value_short(); calculate_extruder_multipliers(); } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 16d56: 80 91 95 02 lds r24, 0x0295 ; 0x800295 16d5a: 8f 93 push r24 16d5c: 80 91 94 02 lds r24, 0x0294 ; 0x800294 16d60: 8f 93 push r24 16d62: 87 e0 ldi r24, 0x07 ; 7 16d64: 98 e8 ldi r25, 0x88 ; 136 16d66: 9f 93 push r25 16d68: 8f 93 push r24 16d6a: 0f 94 1d dc call 0x3b83a ; 0x3b83a 16d6e: 0f 90 pop r0 16d70: 0f 90 pop r0 16d72: 0f 90 pop r0 16d74: 0f 90 pop r0 16d76: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 16d7a: 80 e5 ldi r24, 0x50 ; 80 16d7c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16d80: 88 23 and r24, r24 16d82: 11 f4 brne .+4 ; 0x16d88 16d84: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e int pin_number = code_value_short(); // pin number 16d88: 0e 94 9b 5c call 0xb936 ; 0xb936 16d8c: 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 16d8e: 83 e5 ldi r24, 0x53 ; 83 16d90: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 16d94: 0f ef ldi r16, 0xFF ; 255 16d96: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 16d98: 88 23 and r24, r24 16d9a: 19 f0 breq .+6 ; 0x16da2 16d9c: 0e 94 9b 5c call 0xb936 ; 0xb936 16da0: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 16da2: c8 01 movw r24, r16 16da4: 01 96 adiw r24, 0x01 ; 1 16da6: 03 97 sbiw r24, 0x03 ; 3 16da8: 10 f0 brcs .+4 ; 0x16dae 16daa: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 16dae: ed e0 ldi r30, 0x0D ; 13 16db0: f9 e8 ldi r31, 0x89 ; 137 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)) 16db2: 84 91 lpm r24, Z 16db4: 08 2e mov r0, r24 16db6: 00 0c add r0, r0 16db8: 99 0b sbc r25, r25 16dba: e8 16 cp r14, r24 16dbc: f9 06 cpc r15, r25 16dbe: 11 f4 brne .+4 ; 0x16dc4 16dc0: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 16dc4: 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++) 16dc6: 29 e8 ldi r18, 0x89 ; 137 16dc8: e9 32 cpi r30, 0x29 ; 41 16dca: f2 07 cpc r31, r18 16dcc: 91 f7 brne .-28 ; 0x16db2 pin_number = -1; break; } } if (pin_number > -1) 16dce: f7 fe sbrs r15, 7 16dd0: 02 c0 rjmp .+4 ; 0x16dd6 16dd2: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e { int target = LOW; st_synchronize(); 16dd6: 0f 94 27 58 call 0x2b04e ; 0x2b04e pinMode(pin_number, INPUT); 16dda: de 2c mov r13, r14 16ddc: 60 e0 ldi r22, 0x00 ; 0 16dde: 8e 2d mov r24, r14 16de0: 0e 94 87 de call 0x1bd0e ; 0x1bd0e switch(pin_state){ 16de4: 0f 3f cpi r16, 0xFF ; 255 16de6: 10 07 cpc r17, r16 16de8: b1 f0 breq .+44 ; 0x16e16 16dea: 01 30 cpi r16, 0x01 ; 1 16dec: 11 05 cpc r17, r1 16dee: 11 f0 breq .+4 ; 0x16df4 } } if (pin_number > -1) { int target = LOW; 16df0: 10 e0 ldi r17, 0x00 ; 0 16df2: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 16df4: 8d 2d mov r24, r13 16df6: 0e 94 30 de call 0x1bc60 ; 0x1bc60 16dfa: 80 17 cp r24, r16 16dfc: 91 07 cpc r25, r17 16dfe: 11 f4 brne .+4 ; 0x16e04 16e00: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e manage_heater(); 16e04: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(); 16e08: 80 e0 ldi r24, 0x00 ; 0 16e0a: 0e 94 5a 8c call 0x118b4 ; 0x118b4 lcd_update(0); 16e0e: 80 e0 ldi r24, 0x00 ; 0 16e10: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 16e14: ef cf rjmp .-34 ; 0x16df4 case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 16e16: 8e 2d mov r24, r14 16e18: 0e 94 30 de call 0x1bc60 ; 0x1bc60 16e1c: 31 e0 ldi r19, 0x01 ; 1 16e1e: 20 e0 ldi r18, 0x00 ; 0 16e20: 89 2b or r24, r25 16e22: 09 f0 breq .+2 ; 0x16e26 16e24: 30 e0 ldi r19, 0x00 ; 0 16e26: 03 2f mov r16, r19 16e28: 12 2f mov r17, r18 16e2a: e4 cf rjmp .-56 ; 0x16df4 - `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; 16e2c: 80 e5 ldi r24, 0x50 ; 80 16e2e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16e32: 08 ee ldi r16, 0xE8 ; 232 16e34: 13 e0 ldi r17, 0x03 ; 3 16e36: 88 23 and r24, r24 16e38: 29 f0 breq .+10 ; 0x16e44 16e3a: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16e3e: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 16e42: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 16e44: 83 e5 ldi r24, 0x53 ; 83 16e46: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16e4a: 88 23 and r24, r24 16e4c: 71 f0 breq .+28 ; 0x16e6a beepS = 0; else { beepS = code_value(); 16e4e: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16e52: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> if (!beepS) { 16e56: 61 15 cp r22, r1 16e58: 71 05 cpc r23, r1 16e5a: 49 f4 brne .+18 ; 0x16e6e // handle S0 as a pause _delay(beepP); 16e5c: b8 01 movw r22, r16 16e5e: 90 e0 ldi r25, 0x00 ; 0 16e60: 80 e0 ldi r24, 0x00 ; 0 16e62: 0f 94 8d 3c call 0x2791a ; 0x2791a 16e66: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e case 300: // M300 { uint16_t beepP = code_seen('P') ? code_value() : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 16e6a: 70 e0 ldi r23, 0x00 ; 0 16e6c: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 16e6e: 40 e0 ldi r20, 0x00 ; 0 16e70: c8 01 movw r24, r16 16e72: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc 16e76: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 16e7a: 80 e5 ldi r24, 0x50 ; 80 16e7c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16e80: 88 23 and r24, r24 16e82: 51 f0 breq .+20 ; 0x16e98 16e84: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16e88: 60 93 d6 06 sts 0x06D6, r22 ; 0x8006d6 16e8c: 70 93 d7 06 sts 0x06D7, r23 ; 0x8006d7 16e90: 80 93 d8 06 sts 0x06D8, r24 ; 0x8006d8 16e94: 90 93 d9 06 sts 0x06D9, r25 ; 0x8006d9 if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 16e98: 89 e4 ldi r24, 0x49 ; 73 16e9a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16e9e: 88 23 and r24, r24 16ea0: 81 f0 breq .+32 ; 0x16ec2 16ea2: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16ea6: 2c ea ldi r18, 0xAC ; 172 16ea8: 35 ec ldi r19, 0xC5 ; 197 16eaa: 47 e2 ldi r20, 0x27 ; 39 16eac: 5e e3 ldi r21, 0x3E ; 62 16eae: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 16eb2: 60 93 da 06 sts 0x06DA, r22 ; 0x8006da 16eb6: 70 93 db 06 sts 0x06DB, r23 ; 0x8006db 16eba: 80 93 dc 06 sts 0x06DC, r24 ; 0x8006dc 16ebe: 90 93 dd 06 sts 0x06DD, r25 ; 0x8006dd if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 16ec2: 84 e4 ldi r24, 0x44 ; 68 16ec4: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16ec8: 88 23 and r24, r24 16eca: 81 f0 breq .+32 ; 0x16eec 16ecc: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 } float unscalePID_i(float i) { return i/PID_dT; 16ed0: 2c ea ldi r18, 0xAC ; 172 16ed2: 35 ec ldi r19, 0xC5 ; 197 16ed4: 47 e2 ldi r20, 0x27 ; 39 16ed6: 5e e3 ldi r21, 0x3E ; 62 16ed8: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 16edc: 60 93 de 06 sts 0x06DE, r22 ; 0x8006de 16ee0: 70 93 df 06 sts 0x06DF, r23 ; 0x8006df 16ee4: 80 93 e0 06 sts 0x06E0, r24 ; 0x8006e0 16ee8: 90 93 e1 06 sts 0x06E1, r25 ; 0x8006e1 updatePID(); 16eec: 0f 94 12 50 call 0x2a024 ; 0x2a024 SERIAL_PROTOCOLRPGM(MSG_OK); 16ef0: 8e ea ldi r24, 0xAE ; 174 16ef2: 9e e6 ldi r25, 0x6E ; 110 16ef4: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOLPGM(" p:"); 16ef8: 83 e0 ldi r24, 0x03 ; 3 16efa: 98 e8 ldi r25, 0x88 ; 136 16efc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 16f00: 60 91 d6 06 lds r22, 0x06D6 ; 0x8006d6 16f04: 70 91 d7 06 lds r23, 0x06D7 ; 0x8006d7 16f08: 80 91 d8 06 lds r24, 0x06D8 ; 0x8006d8 16f0c: 90 91 d9 06 lds r25, 0x06D9 ; 0x8006d9 16f10: 42 e0 ldi r20, 0x02 ; 2 16f12: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 16f16: 8f ef ldi r24, 0xFF ; 255 16f18: 97 e8 ldi r25, 0x87 ; 135 16f1a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 16f1e: 2c ea ldi r18, 0xAC ; 172 16f20: 35 ec ldi r19, 0xC5 ; 197 16f22: 47 e2 ldi r20, 0x27 ; 39 16f24: 5e e3 ldi r21, 0x3E ; 62 16f26: 60 91 da 06 lds r22, 0x06DA ; 0x8006da 16f2a: 70 91 db 06 lds r23, 0x06DB ; 0x8006db 16f2e: 80 91 dc 06 lds r24, 0x06DC ; 0x8006dc 16f32: 90 91 dd 06 lds r25, 0x06DD ; 0x8006dd 16f36: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 16f3a: 42 e0 ldi r20, 0x02 ; 2 16f3c: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 16f40: 8b ef ldi r24, 0xFB ; 251 16f42: 97 e8 ldi r25, 0x87 ; 135 16f44: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 16f48: 2c ea ldi r18, 0xAC ; 172 16f4a: 35 ec ldi r19, 0xC5 ; 197 16f4c: 47 e2 ldi r20, 0x27 ; 39 16f4e: 5e e3 ldi r21, 0x3E ; 62 16f50: 60 91 de 06 lds r22, 0x06DE ; 0x8006de 16f54: 70 91 df 06 lds r23, 0x06DF ; 0x8006df 16f58: 80 91 e0 06 lds r24, 0x06E0 ; 0x8006e0 16f5c: 90 91 e1 06 lds r25, 0x06E1 ; 0x8006e1 16f60: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 16f64: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e 16f68: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 16f6c: 90 e0 ldi r25, 0x00 ; 0 16f6e: 80 e0 ldi r24, 0x00 ; 0 16f70: 0c 94 18 ab jmp 0x15630 ; 0x15630 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 16f74: 85 e4 ldi r24, 0x45 ; 69 16f76: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 16f7a: 10 e0 ldi r17, 0x00 ; 0 16f7c: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 16f7e: 88 23 and r24, r24 16f80: 59 f0 breq .+22 ; 0x16f98 16f82: 0e 94 9b 5c call 0xb936 ; 0xb936 16f86: 8c 01 movw r16, r24 if (e < 0) temp = 70; 16f88: c1 2c mov r12, r1 16f8a: d1 2c mov r13, r1 16f8c: 7c e8 ldi r23, 0x8C ; 140 16f8e: e7 2e mov r14, r23 16f90: 72 e4 ldi r23, 0x42 ; 66 16f92: f7 2e mov r15, r23 { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); if (e < 0) 16f94: 97 fd sbrc r25, 7 16f96: 06 c0 rjmp .+12 ; 0x16fa4 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 16f98: c1 2c mov r12, r1 16f9a: d1 2c mov r13, r1 16f9c: e6 e1 ldi r30, 0x16 ; 22 16f9e: ee 2e mov r14, r30 16fa0: e3 e4 ldi r30, 0x43 ; 67 16fa2: fe 2e mov r15, r30 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(); 16fa4: 83 e5 ldi r24, 0x53 ; 83 16fa6: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16faa: 88 23 and r24, r24 16fac: 21 f0 breq .+8 ; 0x16fb6 16fae: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 16fb2: 6b 01 movw r12, r22 16fb4: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 16fb6: 83 e4 ldi r24, 0x43 ; 67 16fb8: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16fbc: 88 23 and r24, r24 16fbe: 51 f0 breq .+20 ; 0x16fd4 16fc0: 0e 94 9b 5c call 0xb936 ; 0xb936 PID_autotune(temp, e, c); 16fc4: 9c 01 movw r18, r24 16fc6: a8 01 movw r20, r16 16fc8: c7 01 movw r24, r14 16fca: b6 01 movw r22, r12 16fcc: 0f 94 3f 50 call 0x2a07e ; 0x2a07e 16fd0: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e */ case 303: { float temp = 150.0; int e = 0; int c = 5; 16fd4: 85 e0 ldi r24, 0x05 ; 5 16fd6: 90 e0 ldi r25, 0x00 ; 0 16fd8: f5 cf rjmp .-22 ; 0x16fc4 { // 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(); 16fda: 89 e4 ldi r24, 0x49 ; 73 16fdc: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16fe0: 88 23 and r24, r24 16fe2: 09 f4 brne .+2 ; 0x16fe6 16fe4: 30 c2 rjmp .+1120 ; 0x17446 16fe6: 0e 94 9b 5c call 0xb936 ; 0xb936 16fea: ab 96 adiw r28, 0x2b ; 43 16fec: 8f af std Y+63, r24 ; 0x3f 16fee: ab 97 sbiw r28, 0x2b ; 43 if(code_seen('R')) R = code_value(); 16ff0: 82 e5 ldi r24, 0x52 ; 82 16ff2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 16ff6: 88 23 and r24, r24 16ff8: 09 f4 brne .+2 ; 0x16ffc 16ffa: 2a c2 rjmp .+1108 ; 0x17450 16ffc: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 17000: e2 96 adiw r28, 0x32 ; 50 17002: 6c af std Y+60, r22 ; 0x3c 17004: 7d af std Y+61, r23 ; 0x3d 17006: 8e af std Y+62, r24 ; 0x3e 17008: 9f af std Y+63, r25 ; 0x3f 1700a: e2 97 sbiw r28, 0x32 ; 50 if(code_seen('P')) P = code_value(); 1700c: 80 e5 ldi r24, 0x50 ; 80 1700e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 - `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; 17012: c1 2c mov r12, r1 17014: d1 2c mov r13, r1 17016: 60 ec ldi r22, 0xC0 ; 192 17018: e6 2e mov r14, r22 1701a: 6f e7 ldi r22, 0x7F ; 127 1701c: f6 2e mov r15, r22 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(); 1701e: 88 23 and r24, r24 17020: 21 f0 breq .+8 ; 0x1702a 17022: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 17026: 6b 01 movw r12, r22 17028: 7c 01 movw r14, r24 if(code_seen('U')) U = code_value(); 1702a: 85 e5 ldi r24, 0x55 ; 85 1702c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 17030: 88 23 and r24, r24 17032: 09 f4 brne .+2 ; 0x17036 17034: 18 c2 rjmp .+1072 ; 0x17466 17036: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 1703a: 6e 96 adiw r28, 0x1e ; 30 1703c: 6c af std Y+60, r22 ; 0x3c 1703e: 7d af std Y+61, r23 ; 0x3d 17040: 8e af std Y+62, r24 ; 0x3e 17042: 9f af std Y+63, r25 ; 0x3f 17044: 6e 97 sbiw r28, 0x1e ; 30 if(code_seen('V')) V = code_value(); 17046: 86 e5 ldi r24, 0x56 ; 86 17048: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1704c: 88 23 and r24, r24 1704e: 09 f4 brne .+2 ; 0x17052 17050: 15 c2 rjmp .+1066 ; 0x1747c 17052: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 17056: a2 96 adiw r28, 0x22 ; 34 17058: 6c af std Y+60, r22 ; 0x3c 1705a: 7d af std Y+61, r23 ; 0x3d 1705c: 8e af std Y+62, r24 ; 0x3e 1705e: 9f af std Y+63, r25 ; 0x3f 17060: a2 97 sbiw r28, 0x22 ; 34 if(code_seen('C')) C = code_value(); 17062: 83 e4 ldi r24, 0x43 ; 67 17064: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 17068: 88 23 and r24, r24 1706a: 09 f4 brne .+2 ; 0x1706e 1706c: 12 c2 rjmp .+1060 ; 0x17492 1706e: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 17072: 6a 96 adiw r28, 0x1a ; 26 17074: 6c af std Y+60, r22 ; 0x3c 17076: 7d af std Y+61, r23 ; 0x3d 17078: 8e af std Y+62, r24 ; 0x3e 1707a: 9f af std Y+63, r25 ; 0x3f 1707c: 6a 97 sbiw r28, 0x1a ; 26 if(code_seen('D')) D = code_value(); 1707e: 84 e4 ldi r24, 0x44 ; 68 17080: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 17084: 88 23 and r24, r24 17086: 09 f4 brne .+2 ; 0x1708a 17088: 0f c2 rjmp .+1054 ; 0x174a8 1708a: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 1708e: aa 96 adiw r28, 0x2a ; 42 17090: 6c af std Y+60, r22 ; 0x3c 17092: 7d af std Y+61, r23 ; 0x3d 17094: 8e af std Y+62, r24 ; 0x3e 17096: 9f af std Y+63, r25 ; 0x3f 17098: aa 97 sbiw r28, 0x2a ; 42 if(code_seen('L')) L = code_value_short(); 1709a: 8c e4 ldi r24, 0x4C ; 76 1709c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 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; 170a0: 0f ef ldi r16, 0xFF ; 255 170a2: 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(); 170a4: 88 23 and r24, r24 170a6: 19 f0 breq .+6 ; 0x170ae 170a8: 0e 94 9b 5c call 0xb936 ; 0xb936 170ac: 8c 01 movw r16, r24 if(code_seen('S')) S = code_value_short(); 170ae: 83 e5 ldi r24, 0x53 ; 83 170b0: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 170b4: 88 23 and r24, r24 170b6: 09 f4 brne .+2 ; 0x170ba 170b8: 02 c2 rjmp .+1028 ; 0x174be 170ba: 0e 94 9b 5c call 0xb936 ; 0xb936 170be: e3 96 adiw r28, 0x33 ; 51 170c0: 8f af std Y+63, r24 ; 0x3f 170c2: e3 97 sbiw r28, 0x33 ; 51 if(code_seen('B')) B = code_value_short(); 170c4: 82 e4 ldi r24, 0x42 ; 66 170c6: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 170ca: 88 23 and r24, r24 170cc: 09 f4 brne .+2 ; 0x170d0 170ce: fc c1 rjmp .+1016 ; 0x174c8 170d0: 0e 94 9b 5c call 0xb936 ; 0xb936 170d4: e7 96 adiw r28, 0x37 ; 55 170d6: 8f af std Y+63, r24 ; 0x3f 170d8: e7 97 sbiw r28, 0x37 ; 55 if(code_seen('T')) T = code_value(); 170da: 84 e5 ldi r24, 0x54 ; 84 170dc: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 170e0: 88 23 and r24, r24 170e2: 09 f4 brne .+2 ; 0x170e6 170e4: f6 c1 rjmp .+1004 ; 0x174d2 170e6: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 170ea: a6 96 adiw r28, 0x26 ; 38 170ec: 6c af std Y+60, r22 ; 0x3c 170ee: 7d af std Y+61, r23 ; 0x3d 170f0: 8e af std Y+62, r24 ; 0x3e 170f2: 9f af std Y+63, r25 ; 0x3f 170f4: a6 97 sbiw r28, 0x26 ; 38 if(code_seen('E')) E = code_value(); 170f6: 85 e4 ldi r24, 0x45 ; 69 170f8: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 - `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; 170fc: 41 2c mov r4, r1 170fe: 51 2c mov r5, r1 17100: 50 ec ldi r21, 0xC0 ; 192 17102: 65 2e mov r6, r21 17104: 5f e7 ldi r21, 0x7F ; 127 17106: 75 2e mov r7, r21 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(); 17108: 88 23 and r24, r24 1710a: 21 f0 breq .+8 ; 0x17114 1710c: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 17110: 2b 01 movw r4, r22 17112: 3c 01 movw r6, r24 if(code_seen('W')) W = code_value(); 17114: 87 e5 ldi r24, 0x57 ; 87 17116: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 - `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; 1711a: 81 2c mov r8, r1 1711c: 91 2c mov r9, r1 1711e: 40 ec ldi r20, 0xC0 ; 192 17120: a4 2e mov r10, r20 17122: 4f e7 ldi r20, 0x7F ; 127 17124: b4 2e mov r11, r20 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(); 17126: 88 23 and r24, r24 17128: 21 f0 breq .+8 ; 0x17132 1712a: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 1712e: 4b 01 movw r8, r22 17130: 5c 01 movw r10, r24 if(code_seen('A')) A = code_value_short(); 17132: 81 e4 ldi r24, 0x41 ; 65 17134: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 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; 17138: 22 24 eor r2, r2 1713a: 2a 94 dec r2 1713c: 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(); 1713e: 88 23 and r24, r24 17140: 19 f0 breq .+6 ; 0x17148 17142: 0e 94 9b 5c call 0xb936 ; 0xb936 17146: 1c 01 movw r2, r24 if(code_seen('F')) F = code_value_short(); 17148: 86 e4 ldi r24, 0x46 ; 70 1714a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1714e: 88 23 and r24, r24 17150: 09 f4 brne .+2 ; 0x17154 17152: ca c1 rjmp .+916 ; 0x174e8 17154: 0e 94 9b 5c call 0xb936 ; 0xb936 17158: eb 96 adiw r28, 0x3b ; 59 1715a: 8f af std Y+63, r24 ; 0x3f 1715c: 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) 1715e: e2 96 adiw r28, 0x32 ; 50 17160: 2c ad ldd r18, Y+60 ; 0x3c 17162: 3d ad ldd r19, Y+61 ; 0x3d 17164: 4e ad ldd r20, Y+62 ; 0x3e 17166: 5f ad ldd r21, Y+63 ; 0x3f 17168: e2 97 sbiw r28, 0x32 ; 50 1716a: ca 01 movw r24, r20 1716c: b9 01 movw r22, r18 1716e: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 17172: 88 23 and r24, r24 17174: 09 f4 brne .+2 ; 0x17178 17176: c1 c1 rjmp .+898 ; 0x174fa 17178: a7 01 movw r20, r14 1717a: 96 01 movw r18, r12 1717c: c7 01 movw r24, r14 1717e: b6 01 movw r22, r12 17180: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 17184: 88 23 and r24, r24 17186: 09 f4 brne .+2 ; 0x1718a 17188: b8 c1 rjmp .+880 ; 0x174fa 1718a: 6e 96 adiw r28, 0x1e ; 30 1718c: 2c ad ldd r18, Y+60 ; 0x3c 1718e: 3d ad ldd r19, Y+61 ; 0x3d 17190: 4e ad ldd r20, Y+62 ; 0x3e 17192: 5f ad ldd r21, Y+63 ; 0x3f 17194: 6e 97 sbiw r28, 0x1e ; 30 17196: ca 01 movw r24, r20 17198: b9 01 movw r22, r18 1719a: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 1719e: 88 23 and r24, r24 171a0: 09 f4 brne .+2 ; 0x171a4 171a2: ab c1 rjmp .+854 ; 0x174fa 171a4: a2 96 adiw r28, 0x22 ; 34 171a6: 2c ad ldd r18, Y+60 ; 0x3c 171a8: 3d ad ldd r19, Y+61 ; 0x3d 171aa: 4e ad ldd r20, Y+62 ; 0x3e 171ac: 5f ad ldd r21, Y+63 ; 0x3f 171ae: a2 97 sbiw r28, 0x22 ; 34 171b0: ca 01 movw r24, r20 171b2: b9 01 movw r22, r18 171b4: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 171b8: 88 23 and r24, r24 171ba: 09 f4 brne .+2 ; 0x171be 171bc: 9e c1 rjmp .+828 ; 0x174fa 171be: 6a 96 adiw r28, 0x1a ; 26 171c0: 2c ad ldd r18, Y+60 ; 0x3c 171c2: 3d ad ldd r19, Y+61 ; 0x3d 171c4: 4e ad ldd r20, Y+62 ; 0x3e 171c6: 5f ad ldd r21, Y+63 ; 0x3f 171c8: 6a 97 sbiw r28, 0x1a ; 26 171ca: ca 01 movw r24, r20 171cc: b9 01 movw r22, r18 171ce: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 171d2: 88 23 and r24, r24 171d4: 09 f4 brne .+2 ; 0x171d8 171d6: 91 c1 rjmp .+802 ; 0x174fa 171d8: aa 96 adiw r28, 0x2a ; 42 171da: 2c ad ldd r18, Y+60 ; 0x3c 171dc: 3d ad ldd r19, Y+61 ; 0x3d 171de: 4e ad ldd r20, Y+62 ; 0x3e 171e0: 5f ad ldd r21, Y+63 ; 0x3f 171e2: aa 97 sbiw r28, 0x2a ; 42 171e4: ca 01 movw r24, r20 171e6: b9 01 movw r22, r18 171e8: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 171ec: 88 23 and r24, r24 171ee: 09 f4 brne .+2 ; 0x171f2 171f0: 84 c1 rjmp .+776 ; 0x174fa 171f2: a6 96 adiw r28, 0x26 ; 38 171f4: 2c ad ldd r18, Y+60 ; 0x3c 171f6: 3d ad ldd r19, Y+61 ; 0x3d 171f8: 4e ad ldd r20, Y+62 ; 0x3e 171fa: 5f ad ldd r21, Y+63 ; 0x3f 171fc: a6 97 sbiw r28, 0x26 ; 38 171fe: ca 01 movw r24, r20 17200: b9 01 movw r22, r18 17202: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 17206: 88 23 and r24, r24 17208: 09 f4 brne .+2 ; 0x1720c 1720a: 77 c1 rjmp .+750 ; 0x174fa 1720c: a5 01 movw r20, r10 1720e: 94 01 movw r18, r8 17210: c5 01 movw r24, r10 17212: b4 01 movw r22, r8 17214: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 17218: 88 23 and r24, r24 1721a: 09 f4 brne .+2 ; 0x1721e 1721c: 6e c1 rjmp .+732 ; 0x174fa 1721e: a3 01 movw r20, r6 17220: 92 01 movw r18, r4 17222: c3 01 movw r24, r6 17224: b2 01 movw r22, r4 17226: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 1722a: 88 23 and r24, r24 1722c: 09 f4 brne .+2 ; 0x17230 1722e: 65 c1 rjmp .+714 ; 0x174fa && I < 0 && S < 0 && B < 0 && A < 0 && L < 0) { 17230: ab 96 adiw r28, 0x2b ; 43 17232: 4f ad ldd r20, Y+63 ; 0x3f 17234: ab 97 sbiw r28, 0x2b ; 43 17236: 47 ff sbrs r20, 7 17238: 60 c1 rjmp .+704 ; 0x174fa 1723a: e3 96 adiw r28, 0x33 ; 51 1723c: 5f ad ldd r21, Y+63 ; 0x3f 1723e: e3 97 sbiw r28, 0x33 ; 51 17240: 57 ff sbrs r21, 7 17242: 5b c1 rjmp .+694 ; 0x174fa 17244: e7 96 adiw r28, 0x37 ; 55 17246: 8f ad ldd r24, Y+63 ; 0x3f 17248: e7 97 sbiw r28, 0x37 ; 55 1724a: 87 ff sbrs r24, 7 1724c: 5b c1 rjmp .+694 ; 0x17504 1724e: 37 fe sbrs r3, 7 17250: 9f c1 rjmp .+830 ; 0x17590 17252: 17 fd sbrc r17, 7 17254: 4e c1 rjmp .+668 ; 0x174f2 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; 17256: ce 01 movw r24, r28 17258: 01 96 adiw r24, 0x01 ; 1 1725a: 0f 94 d9 46 call 0x28db2 ; 0x28db2 if(!isnan(P) && P > 0) thermal_model::data.P = P; 1725e: a7 01 movw r20, r14 17260: 96 01 movw r18, r12 17262: c7 01 movw r24, r14 17264: b6 01 movw r22, r12 17266: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 1726a: 88 23 and r24, r24 1726c: 09 f4 brne .+2 ; 0x17270 1726e: 31 c2 rjmp .+1122 ; 0x176d2 if(!isnan(U)) thermal_model::data.U = U; 17270: 6e 96 adiw r28, 0x1e ; 30 17272: 2c ad ldd r18, Y+60 ; 0x3c 17274: 3d ad ldd r19, Y+61 ; 0x3d 17276: 4e ad ldd r20, Y+62 ; 0x3e 17278: 5f ad ldd r21, Y+63 ; 0x3f 1727a: 6e 97 sbiw r28, 0x1e ; 30 1727c: ca 01 movw r24, r20 1727e: b9 01 movw r22, r18 17280: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 17284: 81 11 cpse r24, r1 17286: 0e c0 rjmp .+28 ; 0x172a4 17288: 6e 96 adiw r28, 0x1e ; 30 1728a: 2c ad ldd r18, Y+60 ; 0x3c 1728c: 3d ad ldd r19, Y+61 ; 0x3d 1728e: 4e ad ldd r20, Y+62 ; 0x3e 17290: 5f ad ldd r21, Y+63 ; 0x3f 17292: 6e 97 sbiw r28, 0x1e ; 30 17294: 20 93 bc 12 sts 0x12BC, r18 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.394+0x2e> 17298: 30 93 bd 12 sts 0x12BD, r19 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.394+0x2f> 1729c: 40 93 be 12 sts 0x12BE, r20 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.394+0x30> 172a0: 50 93 bf 12 sts 0x12BF, r21 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.394+0x31> if(!isnan(V)) thermal_model::data.V = V; 172a4: a2 96 adiw r28, 0x22 ; 34 172a6: 2c ad ldd r18, Y+60 ; 0x3c 172a8: 3d ad ldd r19, Y+61 ; 0x3d 172aa: 4e ad ldd r20, Y+62 ; 0x3e 172ac: 5f ad ldd r21, Y+63 ; 0x3f 172ae: a2 97 sbiw r28, 0x22 ; 34 172b0: ca 01 movw r24, r20 172b2: b9 01 movw r22, r18 172b4: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 172b8: 81 11 cpse r24, r1 172ba: 0e c0 rjmp .+28 ; 0x172d8 172bc: a2 96 adiw r28, 0x22 ; 34 172be: 8c ad ldd r24, Y+60 ; 0x3c 172c0: 9d ad ldd r25, Y+61 ; 0x3d 172c2: ae ad ldd r26, Y+62 ; 0x3e 172c4: bf ad ldd r27, Y+63 ; 0x3f 172c6: a2 97 sbiw r28, 0x22 ; 34 172c8: 80 93 c0 12 sts 0x12C0, r24 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x32> 172cc: 90 93 c1 12 sts 0x12C1, r25 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x33> 172d0: a0 93 c2 12 sts 0x12C2, r26 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x34> 172d4: b0 93 c3 12 sts 0x12C3, r27 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x35> if(!isnan(C) && C > 0) thermal_model::data.C = C; 172d8: 6a 96 adiw r28, 0x1a ; 26 172da: 2c ad ldd r18, Y+60 ; 0x3c 172dc: 3d ad ldd r19, Y+61 ; 0x3d 172de: 4e ad ldd r20, Y+62 ; 0x3e 172e0: 5f ad ldd r21, Y+63 ; 0x3f 172e2: 6a 97 sbiw r28, 0x1a ; 26 172e4: ca 01 movw r24, r20 172e6: b9 01 movw r22, r18 172e8: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 172ec: 81 11 cpse r24, r1 172ee: 1b c0 rjmp .+54 ; 0x17326 172f0: 20 e0 ldi r18, 0x00 ; 0 172f2: 30 e0 ldi r19, 0x00 ; 0 172f4: a9 01 movw r20, r18 172f6: 6a 96 adiw r28, 0x1a ; 26 172f8: 6c ad ldd r22, Y+60 ; 0x3c 172fa: 7d ad ldd r23, Y+61 ; 0x3d 172fc: 8e ad ldd r24, Y+62 ; 0x3e 172fe: 9f ad ldd r25, Y+63 ; 0x3f 17300: 6a 97 sbiw r28, 0x1a ; 26 17302: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 17306: 18 16 cp r1, r24 17308: 74 f4 brge .+28 ; 0x17326 1730a: 6a 96 adiw r28, 0x1a ; 26 1730c: 2c ad ldd r18, Y+60 ; 0x3c 1730e: 3d ad ldd r19, Y+61 ; 0x3d 17310: 4e ad ldd r20, Y+62 ; 0x3e 17312: 5f ad ldd r21, Y+63 ; 0x3f 17314: 6a 97 sbiw r28, 0x1a ; 26 17316: 20 93 c4 12 sts 0x12C4, r18 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 1731a: 30 93 c5 12 sts 0x12C5, r19 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 1731e: 40 93 c6 12 sts 0x12C6, r20 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 17322: 50 93 c7 12 sts 0x12C7, r21 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> if(!isnan(D)) thermal_model::data.fS = D; 17326: aa 96 adiw r28, 0x2a ; 42 17328: 2c ad ldd r18, Y+60 ; 0x3c 1732a: 3d ad ldd r19, Y+61 ; 0x3d 1732c: 4e ad ldd r20, Y+62 ; 0x3e 1732e: 5f ad ldd r21, Y+63 ; 0x3f 17330: aa 97 sbiw r28, 0x2a ; 42 17332: ca 01 movw r24, r20 17334: b9 01 movw r22, r18 17336: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 1733a: 81 11 cpse r24, r1 1733c: 0e c0 rjmp .+28 ; 0x1735a 1733e: aa 96 adiw r28, 0x2a ; 42 17340: 8c ad ldd r24, Y+60 ; 0x3c 17342: 9d ad ldd r25, Y+61 ; 0x3d 17344: ae ad ldd r26, Y+62 ; 0x3e 17346: bf ad ldd r27, Y+63 ; 0x3f 17348: aa 97 sbiw r28, 0x2a ; 42 1734a: 80 93 c8 12 sts 0x12C8, r24 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3a> 1734e: 90 93 c9 12 sts 0x12C9, r25 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3b> 17352: a0 93 ca 12 sts 0x12CA, r26 ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.394+0x3c> 17356: b0 93 cb 12 sts 0x12CB, r27 ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.394+0x3d> if(L >= 0) thermal_model_set_lag(L); 1735a: 17 fd sbrc r17, 7 1735c: 03 c0 rjmp .+6 ; 0x17364 1735e: c8 01 movw r24, r16 17360: 0f 94 bc 43 call 0x28778 ; 0x28778 if(!isnan(Ta_corr)) thermal_model::data.Ta_corr = Ta_corr; 17364: a6 96 adiw r28, 0x26 ; 38 17366: 2c ad ldd r18, Y+60 ; 0x3c 17368: 3d ad ldd r19, Y+61 ; 0x3d 1736a: 4e ad ldd r20, Y+62 ; 0x3e 1736c: 5f ad ldd r21, Y+63 ; 0x3f 1736e: a6 97 sbiw r28, 0x26 ; 38 17370: ca 01 movw r24, r20 17372: b9 01 movw r22, r18 17374: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 17378: 81 11 cpse r24, r1 1737a: 0e c0 rjmp .+28 ; 0x17398 1737c: a6 96 adiw r28, 0x26 ; 38 1737e: 2c ad ldd r18, Y+60 ; 0x3c 17380: 3d ad ldd r19, Y+61 ; 0x3d 17382: 4e ad ldd r20, Y+62 ; 0x3e 17384: 5f ad ldd r21, Y+63 ; 0x3f 17386: a6 97 sbiw r28, 0x26 ; 38 17388: 20 93 0e 13 sts 0x130E, r18 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 1738c: 30 93 0f 13 sts 0x130F, r19 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 17390: 40 93 10 13 sts 0x1310, r20 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 17394: 50 93 11 13 sts 0x1311, r21 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> if(!isnan(warn) && warn > 0) thermal_model::data.warn = warn; 17398: a5 01 movw r20, r10 1739a: 94 01 movw r18, r8 1739c: c5 01 movw r24, r10 1739e: b4 01 movw r22, r8 173a0: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 173a4: 81 11 cpse r24, r1 173a6: 11 c0 rjmp .+34 ; 0x173ca 173a8: 20 e0 ldi r18, 0x00 ; 0 173aa: 30 e0 ldi r19, 0x00 ; 0 173ac: a9 01 movw r20, r18 173ae: c5 01 movw r24, r10 173b0: b4 01 movw r22, r8 173b2: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 173b6: 18 16 cp r1, r24 173b8: 44 f4 brge .+16 ; 0x173ca 173ba: 80 92 12 13 sts 0x1312, r8 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 173be: 90 92 13 13 sts 0x1313, r9 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 173c2: a0 92 14 13 sts 0x1314, r10 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 173c6: b0 92 15 13 sts 0x1315, r11 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> if(!isnan(err) && err > 0) thermal_model::data.err = err; 173ca: a3 01 movw r20, r6 173cc: 92 01 movw r18, r4 173ce: c3 01 movw r24, r6 173d0: b2 01 movw r22, r4 173d2: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 173d6: 81 11 cpse r24, r1 173d8: 11 c0 rjmp .+34 ; 0x173fc 173da: 20 e0 ldi r18, 0x00 ; 0 173dc: 30 e0 ldi r19, 0x00 ; 0 173de: a9 01 movw r20, r18 173e0: c3 01 movw r24, r6 173e2: b2 01 movw r22, r4 173e4: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 173e8: 18 16 cp r1, r24 173ea: 44 f4 brge .+16 ; 0x173fc 173ec: 40 92 16 13 sts 0x1316, r4 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 173f0: 50 92 17 13 sts 0x1317, r5 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 173f4: 60 92 18 13 sts 0x1318, r6 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 173f8: 70 92 19 13 sts 0x1319, r7 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> // ensure warn <= err if (thermal_model::data.warn > thermal_model::data.err) 173fc: c0 90 16 13 lds r12, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 17400: d0 90 17 13 lds r13, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 17404: e0 90 18 13 lds r14, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 17408: f0 90 19 13 lds r15, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> 1740c: a7 01 movw r20, r14 1740e: 96 01 movw r18, r12 17410: 60 91 12 13 lds r22, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 17414: 70 91 13 13 lds r23, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 17418: 80 91 14 13 lds r24, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 1741c: 90 91 15 13 lds r25, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> 17420: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 17424: 18 16 cp r1, r24 17426: 44 f4 brge .+16 ; 0x17438 thermal_model::data.warn = thermal_model::data.err; 17428: c0 92 12 13 sts 0x1312, r12 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 1742c: d0 92 13 13 sts 0x1313, r13 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 17430: e0 92 14 13 sts 0x1314, r14 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 17434: f0 92 15 13 sts 0x1315, r15 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> thermal_model::setup(); 17438: 0f 94 43 44 call 0x28886 ; 0x28886 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; 1743c: ce 01 movw r24, r28 1743e: 01 96 adiw r24, 0x01 ; 1 17440: 0f 94 cc 46 call 0x28d98 ; 0x28d98 17444: c8 c0 rjmp .+400 ; 0x175d6 */ 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; 17446: 4f ef ldi r20, 0xFF ; 255 17448: ab 96 adiw r28, 0x2b ; 43 1744a: 4f af std Y+63, r20 ; 0x3f 1744c: ab 97 sbiw r28, 0x2b ; 43 1744e: d0 cd rjmp .-1120 ; 0x16ff0 - `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; 17450: 80 e0 ldi r24, 0x00 ; 0 17452: 90 e0 ldi r25, 0x00 ; 0 17454: a0 ec ldi r26, 0xC0 ; 192 17456: bf e7 ldi r27, 0x7F ; 127 17458: e2 96 adiw r28, 0x32 ; 50 1745a: 8c af std Y+60, r24 ; 0x3c 1745c: 9d af std Y+61, r25 ; 0x3d 1745e: ae af std Y+62, r26 ; 0x3e 17460: bf af std Y+63, r27 ; 0x3f 17462: e2 97 sbiw r28, 0x32 ; 50 17464: d3 cd rjmp .-1114 ; 0x1700c 17466: 20 e0 ldi r18, 0x00 ; 0 17468: 30 e0 ldi r19, 0x00 ; 0 1746a: 40 ec ldi r20, 0xC0 ; 192 1746c: 5f e7 ldi r21, 0x7F ; 127 1746e: 6e 96 adiw r28, 0x1e ; 30 17470: 2c af std Y+60, r18 ; 0x3c 17472: 3d af std Y+61, r19 ; 0x3d 17474: 4e af std Y+62, r20 ; 0x3e 17476: 5f af std Y+63, r21 ; 0x3f 17478: 6e 97 sbiw r28, 0x1e ; 30 1747a: e5 cd rjmp .-1078 ; 0x17046 1747c: 80 e0 ldi r24, 0x00 ; 0 1747e: 90 e0 ldi r25, 0x00 ; 0 17480: a0 ec ldi r26, 0xC0 ; 192 17482: bf e7 ldi r27, 0x7F ; 127 17484: a2 96 adiw r28, 0x22 ; 34 17486: 8c af std Y+60, r24 ; 0x3c 17488: 9d af std Y+61, r25 ; 0x3d 1748a: ae af std Y+62, r26 ; 0x3e 1748c: bf af std Y+63, r27 ; 0x3f 1748e: a2 97 sbiw r28, 0x22 ; 34 17490: e8 cd rjmp .-1072 ; 0x17062 17492: 20 e0 ldi r18, 0x00 ; 0 17494: 30 e0 ldi r19, 0x00 ; 0 17496: 40 ec ldi r20, 0xC0 ; 192 17498: 5f e7 ldi r21, 0x7F ; 127 1749a: 6a 96 adiw r28, 0x1a ; 26 1749c: 2c af std Y+60, r18 ; 0x3c 1749e: 3d af std Y+61, r19 ; 0x3d 174a0: 4e af std Y+62, r20 ; 0x3e 174a2: 5f af std Y+63, r21 ; 0x3f 174a4: 6a 97 sbiw r28, 0x1a ; 26 174a6: eb cd rjmp .-1066 ; 0x1707e 174a8: 80 e0 ldi r24, 0x00 ; 0 174aa: 90 e0 ldi r25, 0x00 ; 0 174ac: a0 ec ldi r26, 0xC0 ; 192 174ae: bf e7 ldi r27, 0x7F ; 127 174b0: aa 96 adiw r28, 0x2a ; 42 174b2: 8c af std Y+60, r24 ; 0x3c 174b4: 9d af std Y+61, r25 ; 0x3d 174b6: ae af std Y+62, r26 ; 0x3e 174b8: bf af std Y+63, r27 ; 0x3f 174ba: aa 97 sbiw r28, 0x2a ; 42 174bc: ee cd rjmp .-1060 ; 0x1709a int8_t I = -1, S = -1, B = -1, F = -1; 174be: 9f ef ldi r25, 0xFF ; 255 174c0: e3 96 adiw r28, 0x33 ; 51 174c2: 9f af std Y+63, r25 ; 0x3f 174c4: e3 97 sbiw r28, 0x33 ; 51 174c6: fe cd rjmp .-1028 ; 0x170c4 174c8: af ef ldi r26, 0xFF ; 255 174ca: e7 96 adiw r28, 0x37 ; 55 174cc: af af std Y+63, r26 ; 0x3f 174ce: e7 97 sbiw r28, 0x37 ; 55 174d0: 04 ce rjmp .-1016 ; 0x170da - `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; 174d2: 20 e0 ldi r18, 0x00 ; 0 174d4: 30 e0 ldi r19, 0x00 ; 0 174d6: 40 ec ldi r20, 0xC0 ; 192 174d8: 5f e7 ldi r21, 0x7F ; 127 174da: a6 96 adiw r28, 0x26 ; 38 174dc: 2c af std Y+60, r18 ; 0x3c 174de: 3d af std Y+61, r19 ; 0x3d 174e0: 4e af std Y+62, r20 ; 0x3e 174e2: 5f af std Y+63, r21 ; 0x3f 174e4: a6 97 sbiw r28, 0x26 ; 38 174e6: 07 ce rjmp .-1010 ; 0x170f6 int8_t I = -1, S = -1, B = -1, F = -1; 174e8: 3f ef ldi r19, 0xFF ; 255 174ea: eb 96 adiw r28, 0x3b ; 59 174ec: 3f af std Y+63, r19 ; 0x3f 174ee: eb 97 sbiw r28, 0x3b ; 59 174f0: 36 ce rjmp .-916 ; 0x1715e 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(); 174f2: 0f 94 fb 42 call 0x285f6 ; 0x285f6 174f6: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e break; } // update all parameters if(B >= 0) 174fa: e7 96 adiw r28, 0x37 ; 55 174fc: 9f ad ldd r25, Y+63 ; 0x3f 174fe: e7 97 sbiw r28, 0x37 ; 55 17500: 97 fd sbrc r25, 7 17502: 09 c0 rjmp .+18 ; 0x17516 thermal_model_set_warn_beep(B); 17504: 81 e0 ldi r24, 0x01 ; 1 17506: e7 96 adiw r28, 0x37 ; 55 17508: af ad ldd r26, Y+63 ; 0x3f 1750a: e7 97 sbiw r28, 0x37 ; 55 1750c: a1 11 cpse r26, r1 1750e: 01 c0 rjmp .+2 ; 0x17512 17510: 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; 17512: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.468> if(!isnan(P) || !isnan(U) || !isnan(V) || !isnan(C) || !isnan(D) || (L >= 0) || !isnan(T) || !isnan(W) || !isnan(E)) 17516: a7 01 movw r20, r14 17518: 96 01 movw r18, r12 1751a: c7 01 movw r24, r14 1751c: b6 01 movw r22, r12 1751e: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 17522: 88 23 and r24, r24 17524: 09 f4 brne .+2 ; 0x17528 17526: 97 ce rjmp .-722 ; 0x17256 17528: 6e 96 adiw r28, 0x1e ; 30 1752a: 2c ad ldd r18, Y+60 ; 0x3c 1752c: 3d ad ldd r19, Y+61 ; 0x3d 1752e: 4e ad ldd r20, Y+62 ; 0x3e 17530: 5f ad ldd r21, Y+63 ; 0x3f 17532: 6e 97 sbiw r28, 0x1e ; 30 17534: ca 01 movw r24, r20 17536: b9 01 movw r22, r18 17538: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 1753c: 88 23 and r24, r24 1753e: 09 f4 brne .+2 ; 0x17542 17540: 8a ce rjmp .-748 ; 0x17256 17542: a2 96 adiw r28, 0x22 ; 34 17544: 2c ad ldd r18, Y+60 ; 0x3c 17546: 3d ad ldd r19, Y+61 ; 0x3d 17548: 4e ad ldd r20, Y+62 ; 0x3e 1754a: 5f ad ldd r21, Y+63 ; 0x3f 1754c: a2 97 sbiw r28, 0x22 ; 34 1754e: ca 01 movw r24, r20 17550: b9 01 movw r22, r18 17552: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 17556: 88 23 and r24, r24 17558: 09 f4 brne .+2 ; 0x1755c 1755a: 7d ce rjmp .-774 ; 0x17256 1755c: 6a 96 adiw r28, 0x1a ; 26 1755e: 2c ad ldd r18, Y+60 ; 0x3c 17560: 3d ad ldd r19, Y+61 ; 0x3d 17562: 4e ad ldd r20, Y+62 ; 0x3e 17564: 5f ad ldd r21, Y+63 ; 0x3f 17566: 6a 97 sbiw r28, 0x1a ; 26 17568: ca 01 movw r24, r20 1756a: b9 01 movw r22, r18 1756c: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 17570: 88 23 and r24, r24 17572: 09 f4 brne .+2 ; 0x17576 17574: 70 ce rjmp .-800 ; 0x17256 17576: aa 96 adiw r28, 0x2a ; 42 17578: 2c ad ldd r18, Y+60 ; 0x3c 1757a: 3d ad ldd r19, Y+61 ; 0x3d 1757c: 4e ad ldd r20, Y+62 ; 0x3e 1757e: 5f ad ldd r21, Y+63 ; 0x3f 17580: aa 97 sbiw r28, 0x2a ; 42 17582: ca 01 movw r24, r20 17584: b9 01 movw r22, r18 17586: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 1758a: 88 23 and r24, r24 1758c: 09 f4 brne .+2 ; 0x17590 1758e: 63 ce rjmp .-826 ; 0x17256 17590: 17 fd sbrc r17, 7 17592: 02 c0 rjmp .+4 ; 0x17598 17594: 0c 94 9c ce jmp 0x19d38 ; 0x19d38 17598: a6 96 adiw r28, 0x26 ; 38 1759a: 2c ad ldd r18, Y+60 ; 0x3c 1759c: 3d ad ldd r19, Y+61 ; 0x3d 1759e: 4e ad ldd r20, Y+62 ; 0x3e 175a0: 5f ad ldd r21, Y+63 ; 0x3f 175a2: a6 97 sbiw r28, 0x26 ; 38 175a4: ca 01 movw r24, r20 175a6: b9 01 movw r22, r18 175a8: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 175ac: 88 23 and r24, r24 175ae: 09 f4 brne .+2 ; 0x175b2 175b0: 52 ce rjmp .-860 ; 0x17256 175b2: a5 01 movw r20, r10 175b4: 94 01 movw r18, r8 175b6: c5 01 movw r24, r10 175b8: b4 01 movw r22, r8 175ba: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 175be: 88 23 and r24, r24 175c0: 09 f4 brne .+2 ; 0x175c4 175c2: 49 ce rjmp .-878 ; 0x17256 175c4: a3 01 movw r20, r6 175c6: 92 01 movw r18, r4 175c8: c3 01 movw r24, r6 175ca: b2 01 movw r22, r4 175cc: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 175d0: 88 23 and r24, r24 175d2: 09 f4 brne .+2 ; 0x175d6 175d4: 40 ce rjmp .-896 ; 0x17256 thermal_model_set_params(P, U, V, C, D, L, T, W, E); if(I >= 0 && !isnan(R)) 175d6: ab 96 adiw r28, 0x2b ; 43 175d8: 3f ad ldd r19, Y+63 ; 0x3f 175da: ab 97 sbiw r28, 0x2b ; 43 175dc: 37 fd sbrc r19, 7 175de: 3b c0 rjmp .+118 ; 0x17656 175e0: e2 96 adiw r28, 0x32 ; 50 175e2: 2c ad ldd r18, Y+60 ; 0x3c 175e4: 3d ad ldd r19, Y+61 ; 0x3d 175e6: 4e ad ldd r20, Y+62 ; 0x3e 175e8: 5f ad ldd r21, Y+63 ; 0x3f 175ea: e2 97 sbiw r28, 0x32 ; 50 175ec: ca 01 movw r24, r20 175ee: b9 01 movw r22, r18 175f0: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 175f4: 81 11 cpse r24, r1 175f6: 2f c0 rjmp .+94 ; 0x17656 thermal_model::setup(); } void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) 175f8: ab 96 adiw r28, 0x2b ; 43 175fa: 4f ad ldd r20, Y+63 ; 0x3f 175fc: ab 97 sbiw r28, 0x2b ; 43 175fe: 40 31 cpi r20, 0x10 ; 16 17600: 54 f5 brge .+84 ; 0x17656 17602: 20 e0 ldi r18, 0x00 ; 0 17604: 30 e0 ldi r19, 0x00 ; 0 17606: a9 01 movw r20, r18 17608: e2 96 adiw r28, 0x32 ; 50 1760a: 6c ad ldd r22, Y+60 ; 0x3c 1760c: 7d ad ldd r23, Y+61 ; 0x3d 1760e: 8e ad ldd r24, Y+62 ; 0x3e 17610: 9f ad ldd r25, Y+63 ; 0x3f 17612: e2 97 sbiw r28, 0x32 ; 50 17614: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 17618: 18 16 cp r1, r24 1761a: ec f4 brge .+58 ; 0x17656 return; TempMgrGuard temp_mgr_guard; 1761c: ce 01 movw r24, r28 1761e: 01 96 adiw r24, 0x01 ; 1 17620: 0f 94 d9 46 call 0x28db2 ; 0x28db2 thermal_model::data.R[index] = R; 17624: ab 96 adiw r28, 0x2b ; 43 17626: 5f ad ldd r21, Y+63 ; 0x3f 17628: ab 97 sbiw r28, 0x2b ; 43 1762a: 84 e0 ldi r24, 0x04 ; 4 1762c: 58 02 muls r21, r24 1762e: f0 01 movw r30, r0 17630: 11 24 eor r1, r1 17632: e2 53 subi r30, 0x32 ; 50 17634: fd 4e sbci r31, 0xED ; 237 17636: e2 96 adiw r28, 0x32 ; 50 17638: 2c ad ldd r18, Y+60 ; 0x3c 1763a: 3d ad ldd r19, Y+61 ; 0x3d 1763c: 4e ad ldd r20, Y+62 ; 0x3e 1763e: 5f ad ldd r21, Y+63 ; 0x3f 17640: e2 97 sbiw r28, 0x32 ; 50 17642: 20 83 st Z, r18 17644: 31 83 std Z+1, r19 ; 0x01 17646: 42 83 std Z+2, r20 ; 0x02 17648: 53 83 std Z+3, r21 ; 0x03 thermal_model::setup(); 1764a: 0f 94 43 44 call 0x28886 ; 0x28886 void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) return; TempMgrGuard temp_mgr_guard; 1764e: ce 01 movw r24, r28 17650: 01 96 adiw r24, 0x01 ; 1 17652: 0f 94 cc 46 call 0x28d98 ; 0x28d98 thermal_model_set_resistance(I, R); // enable the model last, if requested if(S >= 0) thermal_model_set_enabled(S); 17656: e3 96 adiw r28, 0x33 ; 51 17658: 3f ad ldd r19, Y+63 ; 0x3f 1765a: e3 97 sbiw r28, 0x33 ; 51 1765c: 37 fd sbrc r19, 7 1765e: 06 c0 rjmp .+12 ; 0x1766c 17660: 81 e0 ldi r24, 0x01 ; 1 17662: 31 11 cpse r19, r1 17664: 01 c0 rjmp .+2 ; 0x17668 17666: 80 e0 ldi r24, 0x00 ; 0 17668: 0f 94 7c 47 call 0x28ef8 ; 0x28ef8 // run autotune if(A >= 0) thermal_model_autotune(A, F > 0); 1766c: 37 fe sbrs r3, 7 1766e: 02 c0 rjmp .+4 ; 0x17674 17670: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 17674: 11 e0 ldi r17, 0x01 ; 1 17676: eb 96 adiw r28, 0x3b ; 59 17678: 4f ad ldd r20, Y+63 ; 0x3f 1767a: eb 97 sbiw r28, 0x3b ; 59 1767c: 14 16 cp r1, r20 1767e: 0c f0 brlt .+2 ; 0x17682 17680: 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; 17682: 81 e0 ldi r24, 0x01 ; 1 17684: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.555> } //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); 17688: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 1768c: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 17690: 89 1b sub r24, r25 17692: 8f 70 andi r24, 0x0F ; 15 char tm_message[LCD_WIDTH+1]; if(moves_planned() || (lcd_commands_type != LcdCommands::ThermalModel && printer_active())) { 17694: 41 f4 brne .+16 ; 0x176a6 17696: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 1769a: 85 30 cpi r24, 0x05 ; 5 1769c: 69 f1 breq .+90 ; 0x176f8 1769e: 0e 94 16 69 call 0xd22c ; 0xd22c 176a2: 88 23 and r24, r24 176a4: 49 f1 breq .+82 ; 0x176f8 sprintf_P(tm_message, PSTR("TM: Cal. NOT IDLE")); 176a6: 8b ed ldi r24, 0xDB ; 219 176a8: 95 e8 ldi r25, 0x85 ; 133 176aa: 9f 93 push r25 176ac: 8f 93 push r24 176ae: 81 e0 ldi r24, 0x01 ; 1 176b0: 90 e0 ldi r25, 0x00 ; 0 176b2: 8c 0f add r24, r28 176b4: 9d 1f adc r25, r29 176b6: 9f 93 push r25 176b8: 8f 93 push r24 176ba: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 lcd_setstatus_serial(tm_message); 176be: ce 01 movw r24, r28 176c0: 01 96 adiw r24, 0x01 ; 1 176c2: 0f 94 fb 0a call 0x215f6 ; 0x215f6 return; 176c6: 0f 90 pop r0 176c8: 0f 90 pop r0 176ca: 0f 90 pop r0 176cc: 0f 90 pop r0 176ce: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 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; 176d2: 20 e0 ldi r18, 0x00 ; 0 176d4: 30 e0 ldi r19, 0x00 ; 0 176d6: a9 01 movw r20, r18 176d8: c7 01 movw r24, r14 176da: b6 01 movw r22, r12 176dc: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 176e0: 18 16 cp r1, r24 176e2: 0c f0 brlt .+2 ; 0x176e6 176e4: c5 cd rjmp .-1142 ; 0x17270 176e6: c0 92 b8 12 sts 0x12B8, r12 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2a> 176ea: d0 92 b9 12 sts 0x12B9, r13 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2b> 176ee: e0 92 ba 12 sts 0x12BA, r14 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.394+0x2c> 176f2: f0 92 bb 12 sts 0x12BB, r15 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.394+0x2d> 176f6: bc cd rjmp .-1160 ; 0x17270 lcd_setstatus_serial(tm_message); return; } // lockout the printer during calibration KEEPALIVE_STATE(IN_PROCESS); 176f8: 83 e0 ldi r24, 0x03 ; 3 176fa: 80 93 96 02 sts 0x0296, r24 ; 0x800296 menu_set_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 176fe: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 17702: 82 60 ori r24, 0x02 ; 2 17704: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 lcd_return_to_status(); 17708: 0f 94 4e 26 call 0x24c9c ; 0x24c9c // save the original model data and set the model checking state during self-calibration orig_C = thermal_model::data.C; 1770c: 20 91 c4 12 lds r18, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 17710: 30 91 c5 12 lds r19, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 17714: 40 91 c6 12 lds r20, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 17718: 50 91 c7 12 lds r21, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> 1771c: 6e 96 adiw r28, 0x1e ; 30 1771e: 2c af std Y+60, r18 ; 0x3c 17720: 3d af std Y+61, r19 ; 0x3d 17722: 4e af std Y+62, r20 ; 0x3e 17724: 5f af std Y+63, r21 ; 0x3f 17726: 6e 97 sbiw r28, 0x1e ; 30 memcpy(orig_R, thermal_model::data.R, sizeof(thermal_model::data.R)); 17728: 80 e4 ldi r24, 0x40 ; 64 1772a: ee ec ldi r30, 0xCE ; 206 1772c: f2 e1 ldi r31, 0x12 ; 18 1772e: de 01 movw r26, r28 17730: 11 96 adiw r26, 0x01 ; 1 17732: 01 90 ld r0, Z+ 17734: 0d 92 st X+, r0 17736: 8a 95 dec r24 17738: e1 f7 brne .-8 ; 0x17732 orig_enabled = thermal_model::enabled; 1773a: 30 91 20 05 lds r19, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> 1773e: 67 96 adiw r28, 0x17 ; 23 17740: 3f af std Y+63, r19 ; 0x3f 17742: 67 97 sbiw r28, 0x17 ; 23 thermal_model_reset_enabled(selftest); 17744: 81 2f mov r24, r17 17746: 0f 94 9e 47 call 0x28f3c ; 0x28f3c // autotune SERIAL_ECHOLNPGM("TM: calibration start"); 1774a: 85 ec ldi r24, 0xC5 ; 197 1774c: 95 e8 ldi r25, 0x85 ; 133 1774e: 0e 94 86 7b call 0xf70c ; 0xf70c thermal_model_autotune_err = thermal_model_cal::autotune(temp > 0 ? temp : THERMAL_MODEL_CAL_T_high); 17752: 21 14 cp r2, r1 17754: 31 04 cpc r3, r1 17756: 19 f4 brne .+6 ; 0x1775e 17758: 26 ee ldi r18, 0xE6 ; 230 1775a: 22 2e mov r2, r18 1775c: 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); 1775e: 80 e0 ldi r24, 0x00 ; 0 17760: 0f 94 f1 42 call 0x285e2 ; 0x285e2 17764: 82 e0 ldi r24, 0x02 ; 2 17766: 48 2e mov r4, r24 17768: 51 2c mov r5, r1 for(uint8_t i = 0; i != 2; ++i) { const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refine")); 1776a: 99 ea ldi r25, 0xA9 ; 169 1776c: 69 2e mov r6, r25 1776e: 95 e8 ldi r25, 0x85 ; 133 17770: 79 2e mov r7, r25 17772: ae 01 movw r20, r28 17774: 4f 5b subi r20, 0xBF ; 191 17776: 5f 4f sbci r21, 0xFF ; 255 17778: 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); 1777a: 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; 1777c: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 17780: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d if(current_temperature[0] >= THERMAL_MODEL_CAL_T_low) { 17784: 20 e0 ldi r18, 0x00 ; 0 17786: 30 e0 ldi r19, 0x00 ; 0 17788: 48 e4 ldi r20, 0x48 ; 72 1778a: 52 e4 ldi r21, 0x42 ; 66 1778c: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 17790: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 17794: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 17798: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 1779c: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 177a0: 87 fd sbrc r24, 7 177a2: 58 c0 rjmp .+176 ; 0x17854 sprintf_P(tm_message, PSTR("TM: cool down <%dC"), THERMAL_MODEL_CAL_T_low); 177a4: 1f 92 push r1 177a6: 1f 93 push r17 177a8: 8f e8 ldi r24, 0x8F ; 143 177aa: 95 e8 ldi r25, 0x85 ; 133 177ac: 9f 93 push r25 177ae: 8f 93 push r24 177b0: 9f 92 push r9 177b2: 8f 92 push r8 177b4: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 lcd_setstatus_serial(tm_message); 177b8: c4 01 movw r24, r8 177ba: 0f 94 fb 0a call 0x215f6 ; 0x215f6 } } static void cooldown(float temp) { uint8_t old_speed = fanSpeed; 177be: 00 91 e3 03 lds r16, 0x03E3 ; 0x8003e3 set_fan_speed(255); 177c2: 8f ef ldi r24, 0xFF ; 255 177c4: 0f 94 f1 42 call 0x285e2 ; 0x285e2 177c8: 0f 90 pop r0 177ca: 0f 90 pop r0 177cc: 0f 90 pop r0 177ce: 0f 90 pop r0 177d0: 0f 90 pop r0 177d2: 0f 90 pop r0 while(current_temperature[0] >= temp) { 177d4: c0 90 61 0e lds r12, 0x0E61 ; 0x800e61 177d8: d0 90 62 0e lds r13, 0x0E62 ; 0x800e62 177dc: e0 90 63 0e lds r14, 0x0E63 ; 0x800e63 177e0: f0 90 64 0e lds r15, 0x0E64 ; 0x800e64 177e4: 20 e0 ldi r18, 0x00 ; 0 177e6: 30 e0 ldi r19, 0x00 ; 0 177e8: 48 e4 ldi r20, 0x48 ; 72 177ea: 52 e4 ldi r21, 0x42 ; 66 177ec: c7 01 movw r24, r14 177ee: b6 01 movw r22, r12 177f0: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 177f4: 87 fd sbrc r24, 7 177f6: 27 c0 rjmp .+78 ; 0x17846 if(temp_error_state.v) break; 177f8: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 177fc: 81 11 cpse r24, r1 177fe: 23 c0 rjmp .+70 ; 0x17846 float ambient = current_temperature_ambient + thermal_model::data.Ta_corr; 17800: 20 91 53 06 lds r18, 0x0653 ; 0x800653 17804: 30 91 54 06 lds r19, 0x0654 ; 0x800654 17808: 40 91 55 06 lds r20, 0x0655 ; 0x800655 1780c: 50 91 56 06 lds r21, 0x0656 ; 0x800656 17810: 60 91 0e 13 lds r22, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 17814: 70 91 0f 13 lds r23, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 17818: 80 91 10 13 lds r24, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 1781c: 90 91 11 13 lds r25, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> 17820: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> if(current_temperature[0] < (ambient + TEMP_HYSTERESIS)) { 17824: 20 e0 ldi r18, 0x00 ; 0 17826: 30 e0 ldi r19, 0x00 ; 0 17828: 40 ea ldi r20, 0xA0 ; 160 1782a: 50 e4 ldi r21, 0x40 ; 64 1782c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 17830: 9b 01 movw r18, r22 17832: ac 01 movw r20, r24 17834: c7 01 movw r24, r14 17836: b6 01 movw r22, r12 17838: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1783c: 87 fd sbrc r24, 7 1783e: 03 c0 rjmp .+6 ; 0x17846 // do not get stuck waiting very close to ambient temperature break; } waiting_handler(); 17840: 0f 94 c3 4f call 0x29f86 ; 0x29f86 17844: c7 cf rjmp .-114 ; 0x177d4 } set_fan_speed(old_speed); 17846: 80 2f mov r24, r16 17848: 0f 94 f1 42 call 0x285e2 ; 0x285e2 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); 1784c: 80 e1 ldi r24, 0x10 ; 16 1784e: 97 e2 ldi r25, 0x27 ; 39 17850: 0f 94 f0 4f call 0x29fe0 ; 0x29fe0 } sprintf_P(tm_message, PSTR("TM: %S C est."), verb); 17854: 7f 92 push r7 17856: 6f 92 push r6 17858: e1 e8 ldi r30, 0x81 ; 129 1785a: f5 e8 ldi r31, 0x85 ; 133 1785c: ff 93 push r31 1785e: ef 93 push r30 17860: 9f 92 push r9 17862: 8f 92 push r8 17864: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 lcd_setstatus_serial(tm_message); 17868: c4 01 movw r24, r8 1786a: 0f 94 fb 0a call 0x215f6 ; 0x215f6 target_temperature[0] = cal_temp; 1786e: 30 92 6e 0e sts 0x0E6E, r3 ; 0x800e6e 17872: 20 92 6d 0e sts 0x0E6D, r2 ; 0x800e6d samples = record(); 17876: 0f 94 04 1d call 0x23a08 ; 0x23a08 1787a: 5c 01 movw r10, r24 if(temp_error_state.v || !samples) 1787c: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 17880: 0f 90 pop r0 17882: 0f 90 pop r0 17884: 0f 90 pop r0 17886: 0f 90 pop r0 17888: 0f 90 pop r0 1788a: 0f 90 pop r0 1788c: 81 11 cpse r24, r1 1788e: 7a c0 rjmp .+244 ; 0x17984 17890: a1 14 cp r10, r1 17892: b1 04 cpc r11, r1 17894: 09 f4 brne .+2 ; 0x17898 17896: 76 c0 rjmp .+236 ; 0x17984 return true; // we need a high R value for the initial C guess if(isnan(thermal_model::data.R[0])) 17898: 60 91 ce 12 lds r22, 0x12CE ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.394+0x40> 1789c: 70 91 cf 12 lds r23, 0x12CF ; 0x8012cf <_ZN13thermal_modelL4dataE.lto_priv.394+0x41> 178a0: 80 91 d0 12 lds r24, 0x12D0 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x42> 178a4: 90 91 d1 12 lds r25, 0x12D1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x43> 178a8: 9b 01 movw r18, r22 178aa: ac 01 movw r20, r24 178ac: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 178b0: 88 23 and r24, r24 178b2: 61 f0 breq .+24 ; 0x178cc thermal_model::data.R[0] = THERMAL_MODEL_CAL_R_high; 178b4: 80 e0 ldi r24, 0x00 ; 0 178b6: 90 e0 ldi r25, 0x00 ; 0 178b8: a8 e4 ldi r26, 0x48 ; 72 178ba: b2 e4 ldi r27, 0x42 ; 66 178bc: 80 93 ce 12 sts 0x12CE, r24 ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.394+0x40> 178c0: 90 93 cf 12 sts 0x12CF, r25 ; 0x8012cf <_ZN13thermal_modelL4dataE.lto_priv.394+0x41> 178c4: a0 93 d0 12 sts 0x12D0, r26 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x42> 178c8: b0 93 d1 12 sts 0x12D1, r27 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x43> e = estimate(samples, &thermal_model::data.C, 178cc: c0 90 53 06 lds r12, 0x0653 ; 0x800653 178d0: d0 90 54 06 lds r13, 0x0654 ; 0x800654 178d4: e0 90 55 06 lds r14, 0x0655 ; 0x800655 178d8: f0 90 56 06 lds r15, 0x0656 ; 0x800656 178dc: 00 e0 ldi r16, 0x00 ; 0 178de: 20 e0 ldi r18, 0x00 ; 0 178e0: 30 e0 ldi r19, 0x00 ; 0 178e2: 40 ea ldi r20, 0xA0 ; 160 178e4: 51 e4 ldi r21, 0x41 ; 65 178e6: 64 ec ldi r22, 0xC4 ; 196 178e8: 72 e1 ldi r23, 0x12 ; 18 178ea: c5 01 movw r24, r10 178ec: 0e 94 59 dc call 0x1b8b2 ; 0x1b8b2 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)) 178f0: 9b 01 movw r18, r22 178f2: ac 01 movw r20, r24 178f4: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 178f8: 81 11 cpse r24, r1 178fa: 44 c0 rjmp .+136 ; 0x17984 return true; wait_temp(); 178fc: 0f 94 ce 4f call 0x29f9c ; 0x29f9c if(i) break; // we don't need to refine R 17900: 4a 94 dec r4 17902: 45 28 or r4, r5 17904: 09 f4 brne .+2 ; 0x17908 17906: 85 c0 rjmp .+266 ; 0x17a12 wait(30000); // settle PID regulation 17908: 80 e3 ldi r24, 0x30 ; 48 1790a: 95 e7 ldi r25, 0x75 ; 117 1790c: 0f 94 f0 4f call 0x29fe0 ; 0x29fe0 sprintf_P(tm_message, PSTR("TM: %S R %dC"), verb, cal_temp); 17910: 3f 92 push r3 17912: 2f 92 push r2 17914: 7f 92 push r7 17916: 6f 92 push r6 17918: 44 e7 ldi r20, 0x74 ; 116 1791a: 55 e8 ldi r21, 0x85 ; 133 1791c: 5f 93 push r21 1791e: 4f 93 push r20 17920: 9f 92 push r9 17922: 8f 92 push r8 17924: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 lcd_setstatus_serial(tm_message); 17928: c4 01 movw r24, r8 1792a: 0f 94 fb 0a call 0x215f6 ; 0x215f6 samples = record(); 1792e: 0f 94 04 1d call 0x23a08 ; 0x23a08 if(temp_error_state.v || !samples) 17932: 20 91 1e 05 lds r18, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 17936: 0f b6 in r0, 0x3f ; 63 17938: f8 94 cli 1793a: de bf out 0x3e, r29 ; 62 1793c: 0f be out 0x3f, r0 ; 63 1793e: cd bf out 0x3d, r28 ; 61 17940: 21 11 cpse r18, r1 17942: 20 c0 rjmp .+64 ; 0x17984 17944: 00 97 sbiw r24, 0x00 ; 0 17946: f1 f0 breq .+60 ; 0x17984 return true; e = estimate(samples, &thermal_model::data.R[0], 17948: c0 90 53 06 lds r12, 0x0653 ; 0x800653 1794c: d0 90 54 06 lds r13, 0x0654 ; 0x800654 17950: e0 90 55 06 lds r14, 0x0655 ; 0x800655 17954: f0 90 56 06 lds r15, 0x0656 ; 0x800656 17958: 20 e0 ldi r18, 0x00 ; 0 1795a: 30 e0 ldi r19, 0x00 ; 0 1795c: 48 e4 ldi r20, 0x48 ; 72 1795e: 52 e4 ldi r21, 0x42 ; 66 17960: 6e ec ldi r22, 0xCE ; 206 17962: 72 e1 ldi r23, 0x12 ; 18 17964: 0e 94 59 dc call 0x1b8b2 ; 0x1b8b2 // 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")); 17968: b2 ea ldi r27, 0xA2 ; 162 1796a: 6b 2e mov r6, r27 1796c: b5 e8 ldi r27, 0x85 ; 133 1796e: 7b 2e mov r7, r27 17970: 44 24 eor r4, r4 17972: 43 94 inc r4 17974: 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)) 17976: 9b 01 movw r18, r22 17978: ac 01 movw r20, r24 1797a: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 1797e: 88 23 and r24, r24 17980: 09 f4 brne .+2 ; 0x17984 17982: fc ce rjmp .-520 ; 0x1777c 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; 17984: 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); 17986: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.555> // always reset temperature disable_heater(); 1798a: 0f 94 52 44 call 0x288a4 ; 0x288a4 if(thermal_model_autotune_err) { 1798e: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.555> 17992: 88 23 and r24, r24 17994: 09 f4 brne .+2 ; 0x17998 17996: fd c0 rjmp .+506 ; 0x17b92 sprintf_P(tm_message, PSTR("TM: calibr. failed!")); 17998: 81 eb ldi r24, 0xB1 ; 177 1799a: 95 e8 ldi r25, 0x85 ; 133 1799c: 9f 93 push r25 1799e: 8f 93 push r24 179a0: 9f 92 push r9 179a2: 8f 92 push r8 179a4: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 lcd_setstatus_serial(tm_message); 179a8: c4 01 movw r24, r8 179aa: 0f 94 fb 0a call 0x215f6 ; 0x215f6 if(temp_error_state.v) 179ae: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 179b2: 0f 90 pop r0 179b4: 0f 90 pop r0 179b6: 0f 90 pop r0 179b8: 0f 90 pop r0 179ba: 88 23 and r24, r24 179bc: 19 f0 breq .+6 ; 0x179c4 thermal_model_cal::set_fan_speed(255); 179be: 8f ef ldi r24, 0xFF ; 255 179c0: 0f 94 f1 42 call 0x285e2 ; 0x285e2 // show calibrated values before overwriting them thermal_model_report_settings(); 179c4: 0f 94 fb 42 call 0x285f6 ; 0x285f6 // restore original state thermal_model::data.C = orig_C; 179c8: 6e 96 adiw r28, 0x1e ; 30 179ca: 2c ad ldd r18, Y+60 ; 0x3c 179cc: 3d ad ldd r19, Y+61 ; 0x3d 179ce: 4e ad ldd r20, Y+62 ; 0x3e 179d0: 5f ad ldd r21, Y+63 ; 0x3f 179d2: 6e 97 sbiw r28, 0x1e ; 30 179d4: 20 93 c4 12 sts 0x12C4, r18 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 179d8: 30 93 c5 12 sts 0x12C5, r19 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 179dc: 40 93 c6 12 sts 0x12C6, r20 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 179e0: 50 93 c7 12 sts 0x12C7, r21 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> memcpy(thermal_model::data.R, orig_R, sizeof(thermal_model::data.R)); 179e4: 80 e4 ldi r24, 0x40 ; 64 179e6: fe 01 movw r30, r28 179e8: 31 96 adiw r30, 0x01 ; 1 179ea: ae ec ldi r26, 0xCE ; 206 179ec: b2 e1 ldi r27, 0x12 ; 18 179ee: 01 90 ld r0, Z+ 179f0: 0d 92 st X+, r0 179f2: 8a 95 dec r24 179f4: e1 f7 brne .-8 ; 0x179ee thermal_model_set_enabled(orig_enabled); 179f6: 67 96 adiw r28, 0x17 ; 23 179f8: 8f ad ldd r24, Y+63 ; 0x3f 179fa: 67 97 sbiw r28, 0x17 ; 23 179fc: 0f 94 7c 47 call 0x28ef8 ; 0x28ef8 thermal_model_cal::set_fan_speed(0); thermal_model_set_enabled(orig_enabled); thermal_model_report_settings(); } lcd_consume_click(); 17a00: 0e 94 2d 72 call 0xe45a ; 0xe45a menu_unset_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 17a04: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 17a08: 8d 7f andi r24, 0xFD ; 253 17a0a: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 17a0e: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e // 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); 17a12: 8f ef ldi r24, 0xFF ; 255 17a14: 0f 94 f1 42 call 0x285e2 ; 0x285e2 wait(30000); 17a18: 80 e3 ldi r24, 0x30 ; 48 17a1a: 95 e7 ldi r25, 0x75 ; 117 17a1c: 0f 94 f0 4f call 0x29fe0 ; 0x29fe0 17a20: ea e0 ldi r30, 0x0A ; 10 17a22: 6e 2e mov r6, r30 17a24: e3 e1 ldi r30, 0x13 ; 19 17a26: 7e 2e mov r7, r30 17a28: 1f ef ldi r17, 0xFF ; 255 17a2a: ff e0 ldi r31, 0x0F ; 15 17a2c: af 2e mov r10, r31 17a2e: 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; 17a30: 21 2c mov r2, r1 17a32: 31 2c mov r3, r1 17a34: a0 ec ldi r26, 0xC0 ; 192 17a36: 4a 2e mov r4, r26 17a38: af e7 ldi r26, 0x7F ; 127 17a3a: 5a 2e mov r5, r26 17a3c: f3 01 movw r30, r6 17a3e: 20 82 st Z, r2 17a40: 31 82 std Z+1, r3 ; 0x01 17a42: 42 82 std Z+2, r4 ; 0x02 17a44: 53 82 std Z+3, r5 ; 0x03 uint8_t speed = 256 / THERMAL_MODEL_R_SIZE * (i + 1) - 1; set_fan_speed(speed); 17a46: 81 2f mov r24, r17 17a48: 0f 94 f1 42 call 0x285e2 ; 0x285e2 wait(10000); 17a4c: 80 e1 ldi r24, 0x10 ; 16 17a4e: 97 e2 ldi r25, 0x27 ; 39 17a50: 0f 94 f0 4f call 0x29fe0 ; 0x29fe0 sprintf_P(tm_message, PSTR("TM: R[%u] estimate."), (unsigned)i); 17a54: bf 92 push r11 17a56: af 92 push r10 17a58: 20 e6 ldi r18, 0x60 ; 96 17a5a: 35 e8 ldi r19, 0x85 ; 133 17a5c: 3f 93 push r19 17a5e: 2f 93 push r18 17a60: 9f 92 push r9 17a62: 8f 92 push r8 17a64: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 lcd_setstatus_serial(tm_message); 17a68: c4 01 movw r24, r8 17a6a: 0f 94 fb 0a call 0x215f6 ; 0x215f6 samples = record(); 17a6e: 0f 94 04 1d call 0x23a08 ; 0x23a08 if(temp_error_state.v || !samples) 17a72: 20 91 1e 05 lds r18, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 17a76: 0f 90 pop r0 17a78: 0f 90 pop r0 17a7a: 0f 90 pop r0 17a7c: 0f 90 pop r0 17a7e: 0f 90 pop r0 17a80: 0f 90 pop r0 17a82: 21 11 cpse r18, r1 17a84: 7f cf rjmp .-258 ; 0x17984 17a86: 00 97 sbiw r24, 0x00 ; 0 17a88: 09 f4 brne .+2 ; 0x17a8c 17a8a: 7c cf rjmp .-264 ; 0x17984 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], 17a8c: c0 90 53 06 lds r12, 0x0653 ; 0x800653 17a90: d0 90 54 06 lds r13, 0x0654 ; 0x800654 17a94: e0 90 55 06 lds r14, 0x0655 ; 0x800655 17a98: f0 90 56 06 lds r15, 0x0656 ; 0x800656 17a9c: 20 91 ce 12 lds r18, 0x12CE ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.394+0x40> 17aa0: 30 91 cf 12 lds r19, 0x12CF ; 0x8012cf <_ZN13thermal_modelL4dataE.lto_priv.394+0x41> 17aa4: 40 91 d0 12 lds r20, 0x12D0 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x42> 17aa8: 50 91 d1 12 lds r21, 0x12D1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x43> 17aac: 0a 2d mov r16, r10 17aae: b3 01 movw r22, r6 17ab0: 0e 94 59 dc call 0x1b8b2 ; 0x1b8b2 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)) 17ab4: 9b 01 movw r18, r22 17ab6: ac 01 movw r20, r24 17ab8: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 17abc: 81 11 cpse r24, r1 17abe: 62 cf rjmp .-316 ; 0x17984 17ac0: 54 e0 ldi r21, 0x04 ; 4 17ac2: a5 1a sub r10, r21 17ac4: b1 08 sbc r11, r1 17ac6: 80 e1 ldi r24, 0x10 ; 16 17ac8: 68 1a sub r6, r24 17aca: 71 08 sbc r7, r1 17acc: 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) { 17ace: 9f ef ldi r25, 0xFF ; 255 17ad0: a9 16 cp r10, r25 17ad2: b9 06 cpc r11, r25 17ad4: 09 f0 breq .+2 ; 0x17ad8 17ad6: b2 cf rjmp .-156 ; 0x17a3c 17ad8: 66 e0 ldi r22, 0x06 ; 6 17ada: e6 2e mov r14, r22 17adc: 63 e1 ldi r22, 0x13 ; 19 17ade: f6 2e mov r15, r22 17ae0: 0e e0 ldi r16, 0x0E ; 14 17ae2: 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; 17ae4: 7f e0 ldi r23, 0x0F ; 15 17ae6: 37 2e mov r3, r23 for(uint8_t i = THERMAL_MODEL_R_SIZE - 2; i != 0; --i) { if(!((THERMAL_MODEL_R_SIZE - i - 1) % THERMAL_MODEL_CAL_R_STEP)) { 17ae8: 8f e0 ldi r24, 0x0F ; 15 17aea: 90 e0 ldi r25, 0x00 ; 0 17aec: 80 1b sub r24, r16 17aee: 91 0b sbc r25, r17 17af0: 83 70 andi r24, 0x03 ; 3 17af2: 99 27 eor r25, r25 17af4: 89 2b or r24, r25 17af6: 59 f4 brne .+22 ; 0x17b0e next = i; 17af8: 30 2e mov r3, r16 17afa: 01 50 subi r16, 0x01 ; 1 17afc: 11 09 sbc r17, r1 17afe: f4 e0 ldi r31, 0x04 ; 4 17b00: ef 1a sub r14, r31 17b02: 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) { 17b04: 01 15 cp r16, r1 17b06: 11 05 cpc r17, r1 17b08: 79 f7 brne .-34 ; 0x17ae8 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; 17b0a: 80 e0 ldi r24, 0x00 ; 0 17b0c: 3c cf rjmp .-392 ; 0x17986 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; 17b0e: 8c ef ldi r24, 0xFC ; 252 17b10: 83 0d add r24, r3 if(prev < 0) prev = 0; float f = (float)(i - prev) / THERMAL_MODEL_CAL_R_STEP; 17b12: 87 fd sbrc r24, 7 17b14: 80 e0 ldi r24, 0x00 ; 0 17b16: 08 2e mov r0, r24 17b18: 00 0c add r0, r0 17b1a: 99 0b sbc r25, r25 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 17b1c: fc 01 movw r30, r24 17b1e: ee 0f add r30, r30 17b20: ff 1f adc r31, r31 17b22: ee 0f add r30, r30 17b24: ff 1f adc r31, r31 17b26: e2 53 subi r30, 0x32 ; 50 17b28: fd 4e sbci r31, 0xED ; 237 17b2a: 40 80 ld r4, Z 17b2c: 51 80 ldd r5, Z+1 ; 0x01 17b2e: 62 80 ldd r6, Z+2 ; 0x02 17b30: 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; 17b32: b8 01 movw r22, r16 17b34: 68 1b sub r22, r24 17b36: 79 0b sbc r23, r25 17b38: 07 2e mov r0, r23 17b3a: 00 0c add r0, r0 17b3c: 88 0b sbc r24, r24 17b3e: 99 0b sbc r25, r25 17b40: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 17b44: 20 e0 ldi r18, 0x00 ; 0 17b46: 30 e0 ldi r19, 0x00 ; 0 17b48: 40 e8 ldi r20, 0x80 ; 128 17b4a: 5e e3 ldi r21, 0x3E ; 62 17b4c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 17b50: 5b 01 movw r10, r22 17b52: 6c 01 movw r12, r24 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 17b54: a3 2d mov r26, r3 17b56: b4 e0 ldi r27, 0x04 ; 4 17b58: ab 02 muls r26, r27 17b5a: f0 01 movw r30, r0 17b5c: 11 24 eor r1, r1 17b5e: e2 53 subi r30, 0x32 ; 50 17b60: fd 4e sbci r31, 0xED ; 237 17b62: a3 01 movw r20, r6 17b64: 92 01 movw r18, r4 17b66: 60 81 ld r22, Z 17b68: 71 81 ldd r23, Z+1 ; 0x01 17b6a: 82 81 ldd r24, Z+2 ; 0x02 17b6c: 93 81 ldd r25, Z+3 ; 0x03 17b6e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 17b72: 9b 01 movw r18, r22 17b74: ac 01 movw r20, r24 thermal_model::data.R[i] = thermal_model::data.R[prev] + d * f; 17b76: c6 01 movw r24, r12 17b78: b5 01 movw r22, r10 17b7a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 17b7e: a3 01 movw r20, r6 17b80: 92 01 movw r18, r4 17b82: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 17b86: f7 01 movw r30, r14 17b88: 60 83 st Z, r22 17b8a: 71 83 std Z+1, r23 ; 0x01 17b8c: 82 83 std Z+2, r24 ; 0x02 17b8e: 93 83 std Z+3, r25 ; 0x03 17b90: b4 cf rjmp .-152 ; 0x17afa // 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); 17b92: 88 e0 ldi r24, 0x08 ; 8 17b94: 0e 94 88 e6 call 0x1cd10 ; 0x1cd10 lcd_setstatuspgm(MSG_WELCOME); 17b98: 8e e0 ldi r24, 0x0E ; 14 17b9a: 91 e7 ldi r25, 0x71 ; 113 17b9c: 0f 94 0c 0b call 0x21618 ; 0x21618 thermal_model_cal::set_fan_speed(0); 17ba0: 80 e0 ldi r24, 0x00 ; 0 17ba2: 0f 94 f1 42 call 0x285e2 ; 0x285e2 thermal_model_set_enabled(orig_enabled); 17ba6: 67 96 adiw r28, 0x17 ; 23 17ba8: 8f ad ldd r24, Y+63 ; 0x3f 17baa: 67 97 sbiw r28, 0x17 ; 23 17bac: 0f 94 7c 47 call 0x28ef8 ; 0x28ef8 thermal_model_report_settings(); 17bb0: 0f 94 fb 42 call 0x285f6 ; 0x285f6 17bb4: 25 cf rjmp .-438 ; 0x17a00 M400 */ case 400: { st_synchronize(); 17bb6: 0f 94 27 58 call 0x2b04e ; 0x2b04e 17bba: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e */ 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()) 17bbe: 80 91 98 13 lds r24, 0x1398 ; 0x801398 17bc2: 81 30 cpi r24, 0x01 ; 1 17bc4: 11 f0 breq .+4 ; 0x17bca 17bc6: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 17bca: 85 e4 ldi r24, 0x45 ; 69 17bcc: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 17bd0: 81 11 cpse r24, r1 17bd2: 0e 94 8e 5c call 0xb91c ; 0xb91c if(code_seen('F')) filament = code_value_uint8(); 17bd6: 86 e4 ldi r24, 0x46 ; 70 17bd8: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 17bdc: 81 11 cpse r24, r1 17bde: 0e 94 8e 5c call 0xb91c ; 0xb91c MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 17be2: 0f 94 20 88 call 0x31040 ; 0x31040 17be6: 88 23 and r24, r24 17be8: 11 f4 brne .+4 ; 0x17bee 17bea: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 17bee: 60 e0 ldi r22, 0x00 ; 0 17bf0: 80 e0 ldi r24, 0x00 ; 0 17bf2: 0f 94 6c 9f call 0x33ed8 ; 0x33ed8 17bf6: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 17bfa: 80 e0 ldi r24, 0x00 ; 0 17bfc: 0e 94 34 76 call 0xec68 ; 0xec68 17c00: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e M500 */ case 500: { Config_StoreSettings(); 17c04: 0e 94 4f 84 call 0x1089e ; 0x1089e 17c08: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e M501 */ case 501: { Config_RetrieveSettings(); 17c0c: 0e 94 d1 95 call 0x12ba2 ; 0x12ba2 17c10: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e M502 */ case 502: { Config_ResetDefault(); 17c14: 0e 94 37 84 call 0x1086e ; 0x1086e 17c18: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e #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( 17c1c: 80 91 d1 06 lds r24, 0x06D1 ; 0x8006d1 17c20: 8f 93 push r24 17c22: 80 91 d0 06 lds r24, 0x06D0 ; 0x8006d0 17c26: 8f 93 push r24 17c28: 80 91 cf 06 lds r24, 0x06CF ; 0x8006cf 17c2c: 8f 93 push r24 17c2e: 80 91 ce 06 lds r24, 0x06CE ; 0x8006ce 17c32: 8f 93 push r24 17c34: 80 91 cd 06 lds r24, 0x06CD ; 0x8006cd 17c38: 8f 93 push r24 17c3a: 80 91 cc 06 lds r24, 0x06CC ; 0x8006cc 17c3e: 8f 93 push r24 17c40: 80 91 cb 06 lds r24, 0x06CB ; 0x8006cb 17c44: 8f 93 push r24 17c46: 80 91 ca 06 lds r24, 0x06CA ; 0x8006ca 17c4a: 8f 93 push r24 17c4c: 80 91 c9 06 lds r24, 0x06C9 ; 0x8006c9 17c50: 8f 93 push r24 17c52: 80 91 c8 06 lds r24, 0x06C8 ; 0x8006c8 17c56: 8f 93 push r24 17c58: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 17c5c: 8f 93 push r24 17c5e: 80 91 c6 06 lds r24, 0x06C6 ; 0x8006c6 17c62: 8f 93 push r24 17c64: 02 ef ldi r16, 0xF2 ; 242 17c66: 1a ea ldi r17, 0xAA ; 170 17c68: 1f 93 push r17 17c6a: 0f 93 push r16 17c6c: 1f 93 push r17 17c6e: 0f 93 push r16 17c70: 80 91 c5 06 lds r24, 0x06C5 ; 0x8006c5 17c74: 8f 93 push r24 17c76: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 17c7a: 8f 93 push r24 17c7c: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 17c80: 8f 93 push r24 17c82: 80 91 c2 06 lds r24, 0x06C2 ; 0x8006c2 17c86: 8f 93 push r24 17c88: 80 91 c1 06 lds r24, 0x06C1 ; 0x8006c1 17c8c: 8f 93 push r24 17c8e: 80 91 c0 06 lds r24, 0x06C0 ; 0x8006c0 17c92: 8f 93 push r24 17c94: 80 91 bf 06 lds r24, 0x06BF ; 0x8006bf 17c98: 8f 93 push r24 17c9a: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 17c9e: 8f 93 push r24 17ca0: 80 91 bd 06 lds r24, 0x06BD ; 0x8006bd 17ca4: 8f 93 push r24 17ca6: 80 91 bc 06 lds r24, 0x06BC ; 0x8006bc 17caa: 8f 93 push r24 17cac: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 17cb0: 8f 93 push r24 17cb2: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 17cb6: 8f 93 push r24 17cb8: 80 91 b9 06 lds r24, 0x06B9 ; 0x8006b9 17cbc: 8f 93 push r24 17cbe: 80 91 b8 06 lds r24, 0x06B8 ; 0x8006b8 17cc2: 8f 93 push r24 17cc4: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 17cc8: 8f 93 push r24 17cca: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 17cce: 8f 93 push r24 17cd0: 80 91 b5 06 lds r24, 0x06B5 ; 0x8006b5 17cd4: 8f 93 push r24 17cd6: 80 91 b4 06 lds r24, 0x06B4 ; 0x8006b4 17cda: 8f 93 push r24 17cdc: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 17ce0: 8f 93 push r24 17ce2: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 17ce6: 8f 93 push r24 17ce8: 80 91 b1 06 lds r24, 0x06B1 ; 0x8006b1 17cec: 8f 93 push r24 17cee: 80 91 b0 06 lds r24, 0x06B0 ; 0x8006b0 17cf2: 8f 93 push r24 17cf4: 80 91 af 06 lds r24, 0x06AF ; 0x8006af 17cf8: 8f 93 push r24 17cfa: 80 91 ae 06 lds r24, 0x06AE ; 0x8006ae 17cfe: 8f 93 push r24 17d00: 80 91 ad 06 lds r24, 0x06AD ; 0x8006ad 17d04: 8f 93 push r24 17d06: 80 91 ac 06 lds r24, 0x06AC ; 0x8006ac 17d0a: 8f 93 push r24 17d0c: 80 91 ab 06 lds r24, 0x06AB ; 0x8006ab 17d10: 8f 93 push r24 17d12: 80 91 aa 06 lds r24, 0x06AA ; 0x8006aa 17d16: 8f 93 push r24 17d18: 1f 93 push r17 17d1a: 0f 93 push r16 17d1c: 1f 93 push r17 17d1e: 0f 93 push r16 17d20: 80 91 31 07 lds r24, 0x0731 ; 0x800731 17d24: 8f 93 push r24 17d26: 80 91 30 07 lds r24, 0x0730 ; 0x800730 17d2a: 8f 93 push r24 17d2c: 80 91 2f 07 lds r24, 0x072F ; 0x80072f 17d30: 8f 93 push r24 17d32: 80 91 2e 07 lds r24, 0x072E ; 0x80072e 17d36: 8f 93 push r24 17d38: 80 91 a9 06 lds r24, 0x06A9 ; 0x8006a9 17d3c: 8f 93 push r24 17d3e: 80 91 a8 06 lds r24, 0x06A8 ; 0x8006a8 17d42: 8f 93 push r24 17d44: 80 91 a7 06 lds r24, 0x06A7 ; 0x8006a7 17d48: 8f 93 push r24 17d4a: 80 91 a6 06 lds r24, 0x06A6 ; 0x8006a6 17d4e: 8f 93 push r24 17d50: 80 91 a5 06 lds r24, 0x06A5 ; 0x8006a5 17d54: 8f 93 push r24 17d56: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 17d5a: 8f 93 push r24 17d5c: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 17d60: 8f 93 push r24 17d62: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 17d66: 8f 93 push r24 17d68: 1f 93 push r17 17d6a: 0f 93 push r16 17d6c: 1f 93 push r17 17d6e: 0f 93 push r16 17d70: 80 91 29 07 lds r24, 0x0729 ; 0x800729 17d74: 8f 93 push r24 17d76: 80 91 28 07 lds r24, 0x0728 ; 0x800728 17d7a: 8f 93 push r24 17d7c: 80 91 27 07 lds r24, 0x0727 ; 0x800727 17d80: 8f 93 push r24 17d82: 80 91 26 07 lds r24, 0x0726 ; 0x800726 17d86: 8f 93 push r24 17d88: 80 91 25 07 lds r24, 0x0725 ; 0x800725 17d8c: 8f 93 push r24 17d8e: 80 91 24 07 lds r24, 0x0724 ; 0x800724 17d92: 8f 93 push r24 17d94: 80 91 23 07 lds r24, 0x0723 ; 0x800723 17d98: 8f 93 push r24 17d9a: 80 91 22 07 lds r24, 0x0722 ; 0x800722 17d9e: 8f 93 push r24 17da0: 80 91 21 07 lds r24, 0x0721 ; 0x800721 17da4: 8f 93 push r24 17da6: 80 91 20 07 lds r24, 0x0720 ; 0x800720 17daa: 8f 93 push r24 17dac: 80 91 1f 07 lds r24, 0x071F ; 0x80071f 17db0: 8f 93 push r24 17db2: 80 91 1e 07 lds r24, 0x071E ; 0x80071e 17db6: 8f 93 push r24 17db8: 80 91 1d 07 lds r24, 0x071D ; 0x80071d 17dbc: 8f 93 push r24 17dbe: 80 91 1c 07 lds r24, 0x071C ; 0x80071c 17dc2: 8f 93 push r24 17dc4: 80 91 1b 07 lds r24, 0x071B ; 0x80071b 17dc8: 8f 93 push r24 17dca: 80 91 1a 07 lds r24, 0x071A ; 0x80071a 17dce: 8f 93 push r24 17dd0: 1f 93 push r17 17dd2: 0f 93 push r16 17dd4: 1f 93 push r17 17dd6: 0f 93 push r16 17dd8: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 17ddc: 8f 93 push r24 17dde: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 17de2: 8f 93 push r24 17de4: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 17de8: 8f 93 push r24 17dea: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 17dee: 8f 93 push r24 17df0: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 17df4: 8f 93 push r24 17df6: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 17dfa: 8f 93 push r24 17dfc: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 17e00: 8f 93 push r24 17e02: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 17e06: 8f 93 push r24 17e08: 80 91 99 06 lds r24, 0x0699 ; 0x800699 17e0c: 8f 93 push r24 17e0e: 80 91 98 06 lds r24, 0x0698 ; 0x800698 17e12: 8f 93 push r24 17e14: 80 91 97 06 lds r24, 0x0697 ; 0x800697 17e18: 8f 93 push r24 17e1a: 80 91 96 06 lds r24, 0x0696 ; 0x800696 17e1e: 8f 93 push r24 17e20: 80 91 95 06 lds r24, 0x0695 ; 0x800695 17e24: 8f 93 push r24 17e26: 80 91 94 06 lds r24, 0x0694 ; 0x800694 17e2a: 8f 93 push r24 17e2c: 80 91 93 06 lds r24, 0x0693 ; 0x800693 17e30: 8f 93 push r24 17e32: 80 91 92 06 lds r24, 0x0692 ; 0x800692 17e36: 8f 93 push r24 17e38: 1f 93 push r17 17e3a: 0f 93 push r16 17e3c: 1f 93 push r17 17e3e: 0f 93 push r16 17e40: 80 91 19 07 lds r24, 0x0719 ; 0x800719 17e44: 8f 93 push r24 17e46: 80 91 18 07 lds r24, 0x0718 ; 0x800718 17e4a: 8f 93 push r24 17e4c: 80 91 17 07 lds r24, 0x0717 ; 0x800717 17e50: 8f 93 push r24 17e52: 80 91 16 07 lds r24, 0x0716 ; 0x800716 17e56: 8f 93 push r24 17e58: 80 91 15 07 lds r24, 0x0715 ; 0x800715 17e5c: 8f 93 push r24 17e5e: 80 91 14 07 lds r24, 0x0714 ; 0x800714 17e62: 8f 93 push r24 17e64: 80 91 13 07 lds r24, 0x0713 ; 0x800713 17e68: 8f 93 push r24 17e6a: 80 91 12 07 lds r24, 0x0712 ; 0x800712 17e6e: 8f 93 push r24 17e70: 80 91 11 07 lds r24, 0x0711 ; 0x800711 17e74: 8f 93 push r24 17e76: 80 91 10 07 lds r24, 0x0710 ; 0x800710 17e7a: 8f 93 push r24 17e7c: 80 91 0f 07 lds r24, 0x070F ; 0x80070f 17e80: 8f 93 push r24 17e82: 80 91 0e 07 lds r24, 0x070E ; 0x80070e 17e86: 8f 93 push r24 17e88: 80 91 0d 07 lds r24, 0x070D ; 0x80070d 17e8c: 8f 93 push r24 17e8e: 80 91 0c 07 lds r24, 0x070C ; 0x80070c 17e92: 8f 93 push r24 17e94: 80 91 0b 07 lds r24, 0x070B ; 0x80070b 17e98: 8f 93 push r24 17e9a: 80 91 0a 07 lds r24, 0x070A ; 0x80070a 17e9e: 8f 93 push r24 17ea0: 1f 93 push r17 17ea2: 0f 93 push r16 17ea4: 1f 93 push r17 17ea6: 0f 93 push r16 17ea8: 80 91 91 06 lds r24, 0x0691 ; 0x800691 17eac: 8f 93 push r24 17eae: 80 91 90 06 lds r24, 0x0690 ; 0x800690 17eb2: 8f 93 push r24 17eb4: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 17eb8: 8f 93 push r24 17eba: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 17ebe: 8f 93 push r24 17ec0: 80 91 8d 06 lds r24, 0x068D ; 0x80068d 17ec4: 8f 93 push r24 17ec6: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 17eca: 8f 93 push r24 17ecc: 80 91 8b 06 lds r24, 0x068B ; 0x80068b 17ed0: 8f 93 push r24 17ed2: 80 91 8a 06 lds r24, 0x068A ; 0x80068a 17ed6: 8f 93 push r24 17ed8: 80 91 89 06 lds r24, 0x0689 ; 0x800689 17edc: 8f 93 push r24 17ede: 80 91 88 06 lds r24, 0x0688 ; 0x800688 17ee2: 8f 93 push r24 17ee4: 80 91 87 06 lds r24, 0x0687 ; 0x800687 17ee8: 8f 93 push r24 17eea: 80 91 86 06 lds r24, 0x0686 ; 0x800686 17eee: 8f 93 push r24 17ef0: 80 91 85 06 lds r24, 0x0685 ; 0x800685 17ef4: 8f 93 push r24 17ef6: 80 91 84 06 lds r24, 0x0684 ; 0x800684 17efa: 8f 93 push r24 17efc: 80 91 83 06 lds r24, 0x0683 ; 0x800683 17f00: 8f 93 push r24 17f02: 80 91 82 06 lds r24, 0x0682 ; 0x800682 17f06: 8f 93 push r24 17f08: 1f 93 push r17 17f0a: 0f 93 push r16 17f0c: 1f 93 push r17 17f0e: 0f 93 push r16 17f10: 80 91 2d 07 lds r24, 0x072D ; 0x80072d 17f14: 1f 92 push r1 17f16: 8f 93 push r24 17f18: 80 91 2c 07 lds r24, 0x072C ; 0x80072c 17f1c: 1f 92 push r1 17f1e: 8f 93 push r24 17f20: 80 91 2b 07 lds r24, 0x072B ; 0x80072b 17f24: 1f 92 push r1 17f26: 8f 93 push r24 17f28: 80 91 2a 07 lds r24, 0x072A ; 0x80072a 17f2c: 1f 92 push r1 17f2e: 8f 93 push r24 17f30: 1f 93 push r17 17f32: 0f 93 push r16 17f34: 1f 93 push r17 17f36: 0f 93 push r16 17f38: 80 91 81 06 lds r24, 0x0681 ; 0x800681 17f3c: 8f 93 push r24 17f3e: 80 91 80 06 lds r24, 0x0680 ; 0x800680 17f42: 8f 93 push r24 17f44: 80 91 7f 06 lds r24, 0x067F ; 0x80067f 17f48: 8f 93 push r24 17f4a: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 17f4e: 8f 93 push r24 17f50: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 17f54: 8f 93 push r24 17f56: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 17f5a: 8f 93 push r24 17f5c: 80 91 7b 06 lds r24, 0x067B ; 0x80067b 17f60: 8f 93 push r24 17f62: 80 91 7a 06 lds r24, 0x067A ; 0x80067a 17f66: 8f 93 push r24 17f68: 80 91 79 06 lds r24, 0x0679 ; 0x800679 17f6c: 8f 93 push r24 17f6e: 80 91 78 06 lds r24, 0x0678 ; 0x800678 17f72: 8f 93 push r24 17f74: 80 91 77 06 lds r24, 0x0677 ; 0x800677 17f78: 8f 93 push r24 17f7a: 80 91 76 06 lds r24, 0x0676 ; 0x800676 17f7e: 8f 93 push r24 17f80: 80 91 75 06 lds r24, 0x0675 ; 0x800675 17f84: 8f 93 push r24 17f86: 80 91 74 06 lds r24, 0x0674 ; 0x800674 17f8a: 8f 93 push r24 17f8c: 80 91 73 06 lds r24, 0x0673 ; 0x800673 17f90: 8f 93 push r24 17f92: 80 91 72 06 lds r24, 0x0672 ; 0x800672 17f96: 8f 93 push r24 17f98: 1f 93 push r17 17f9a: 0f 93 push r16 17f9c: 1f 93 push r17 17f9e: 0f 93 push r16 17fa0: 88 e8 ldi r24, 0x88 ; 136 17fa2: 92 e8 ldi r25, 0x82 ; 130 17fa4: 9f 93 push r25 17fa6: 8f 93 push r24 17fa8: 0f 94 1d dc call 0x3b83a ; 0x3b83a 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"), 17fac: 0f b6 in r0, 0x3f ; 63 17fae: f8 94 cli 17fb0: de bf out 0x3e, r29 ; 62 17fb2: 0f be out 0x3f, r0 ; 63 17fb4: 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; 17fb6: 2c ea ldi r18, 0xAC ; 172 17fb8: 35 ec ldi r19, 0xC5 ; 197 17fba: 47 e2 ldi r20, 0x27 ; 39 17fbc: 5e e3 ldi r21, 0x3E ; 62 17fbe: 60 91 de 06 lds r22, 0x06DE ; 0x8006de 17fc2: 70 91 df 06 lds r23, 0x06DF ; 0x8006df 17fc6: 80 91 e0 06 lds r24, 0x06E0 ; 0x8006e0 17fca: 90 91 e1 06 lds r25, 0x06E1 ; 0x8006e1 17fce: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 17fd2: 9f 93 push r25 17fd4: 8f 93 push r24 17fd6: 7f 93 push r23 17fd8: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 17fda: 2c ea ldi r18, 0xAC ; 172 17fdc: 35 ec ldi r19, 0xC5 ; 197 17fde: 47 e2 ldi r20, 0x27 ; 39 17fe0: 5e e3 ldi r21, 0x3E ; 62 17fe2: 60 91 da 06 lds r22, 0x06DA ; 0x8006da 17fe6: 70 91 db 06 lds r23, 0x06DB ; 0x8006db 17fea: 80 91 dc 06 lds r24, 0x06DC ; 0x8006dc 17fee: 90 91 dd 06 lds r25, 0x06DD ; 0x8006dd 17ff2: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 17ff6: 9f 93 push r25 17ff8: 8f 93 push r24 17ffa: 7f 93 push r23 17ffc: 6f 93 push r22 17ffe: 80 91 d9 06 lds r24, 0x06D9 ; 0x8006d9 18002: 8f 93 push r24 18004: 80 91 d8 06 lds r24, 0x06D8 ; 0x8006d8 18008: 8f 93 push r24 1800a: 80 91 d7 06 lds r24, 0x06D7 ; 0x8006d7 1800e: 8f 93 push r24 18010: 80 91 d6 06 lds r24, 0x06D6 ; 0x8006d6 18014: 8f 93 push r24 18016: 1f 93 push r17 18018: 0f 93 push r16 1801a: 1f 93 push r17 1801c: 0f 93 push r16 1801e: 8b e5 ldi r24, 0x5B ; 91 18020: 92 e8 ldi r25, 0x82 ; 130 18022: 9f 93 push r25 18024: 8f 93 push r24 18026: 0f 94 1d dc call 0x3b83a ; 0x3b83a #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 1802a: 2c ea ldi r18, 0xAC ; 172 1802c: 35 ec ldi r19, 0xC5 ; 197 1802e: 47 e2 ldi r20, 0x27 ; 39 18030: 5e e3 ldi r21, 0x3E ; 62 18032: 60 91 ea 06 lds r22, 0x06EA ; 0x8006ea 18036: 70 91 eb 06 lds r23, 0x06EB ; 0x8006eb 1803a: 80 91 ec 06 lds r24, 0x06EC ; 0x8006ec 1803e: 90 91 ed 06 lds r25, 0x06ED ; 0x8006ed 18042: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__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"), 18046: 9f 93 push r25 18048: 8f 93 push r24 1804a: 7f 93 push r23 1804c: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 1804e: 2c ea ldi r18, 0xAC ; 172 18050: 35 ec ldi r19, 0xC5 ; 197 18052: 47 e2 ldi r20, 0x27 ; 39 18054: 5e e3 ldi r21, 0x3E ; 62 18056: 60 91 e6 06 lds r22, 0x06E6 ; 0x8006e6 1805a: 70 91 e7 06 lds r23, 0x06E7 ; 0x8006e7 1805e: 80 91 e8 06 lds r24, 0x06E8 ; 0x8006e8 18062: 90 91 e9 06 lds r25, 0x06E9 ; 0x8006e9 18066: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1806a: 9f 93 push r25 1806c: 8f 93 push r24 1806e: 7f 93 push r23 18070: 6f 93 push r22 18072: 80 91 e5 06 lds r24, 0x06E5 ; 0x8006e5 18076: 8f 93 push r24 18078: 80 91 e4 06 lds r24, 0x06E4 ; 0x8006e4 1807c: 8f 93 push r24 1807e: 80 91 e3 06 lds r24, 0x06E3 ; 0x8006e3 18082: 8f 93 push r24 18084: 80 91 e2 06 lds r24, 0x06E2 ; 0x8006e2 18088: 8f 93 push r24 1808a: 1f 93 push r17 1808c: 0f 93 push r16 1808e: 1f 93 push r17 18090: 0f 93 push r16 18092: 86 e2 ldi r24, 0x26 ; 38 18094: 92 e8 ldi r25, 0x82 ; 130 18096: 9f 93 push r25 18098: 8f 93 push r24 1809a: 0f 94 1d dc call 0x3b83a ; 0x3b83a echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 1809e: 0f b6 in r0, 0x3f ; 63 180a0: f8 94 cli 180a2: de bf out 0x3e, r29 ; 62 180a4: 0f be out 0x3f, r0 ; 63 180a6: cd bf out 0x3d, r28 ; 61 180a8: 80 91 f0 06 lds r24, 0x06F0 ; 0x8006f0 180ac: 1f 92 push r1 180ae: 8f 93 push r24 180b0: 1f 93 push r17 180b2: 0f 93 push r16 180b4: 1f 93 push r17 180b6: 0f 93 push r16 180b8: 20 e0 ldi r18, 0x00 ; 0 180ba: 30 e0 ldi r19, 0x00 ; 0 180bc: 40 e7 ldi r20, 0x70 ; 112 180be: 52 e4 ldi r21, 0x42 ; 66 180c0: 60 91 01 07 lds r22, 0x0701 ; 0x800701 180c4: 70 91 02 07 lds r23, 0x0702 ; 0x800702 180c8: 80 91 03 07 lds r24, 0x0703 ; 0x800703 180cc: 90 91 04 07 lds r25, 0x0704 ; 0x800704 180d0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 180d4: 9f 93 push r25 180d6: 8f 93 push r24 180d8: 7f 93 push r23 180da: 6f 93 push r22 180dc: 80 91 00 07 lds r24, 0x0700 ; 0x800700 180e0: 8f 93 push r24 180e2: 80 91 ff 06 lds r24, 0x06FF ; 0x8006ff 180e6: 8f 93 push r24 180e8: 80 91 fe 06 lds r24, 0x06FE ; 0x8006fe 180ec: 8f 93 push r24 180ee: 80 91 fd 06 lds r24, 0x06FD ; 0x8006fd 180f2: 8f 93 push r24 180f4: 1f 93 push r17 180f6: 0f 93 push r16 180f8: 1f 93 push r17 180fa: 0f 93 push r16 180fc: 80 91 fc 06 lds r24, 0x06FC ; 0x8006fc 18100: 8f 93 push r24 18102: 80 91 fb 06 lds r24, 0x06FB ; 0x8006fb 18106: 8f 93 push r24 18108: 80 91 fa 06 lds r24, 0x06FA ; 0x8006fa 1810c: 8f 93 push r24 1810e: 80 91 f9 06 lds r24, 0x06F9 ; 0x8006f9 18112: 8f 93 push r24 18114: 20 e0 ldi r18, 0x00 ; 0 18116: 30 e0 ldi r19, 0x00 ; 0 18118: 40 e7 ldi r20, 0x70 ; 112 1811a: 52 e4 ldi r21, 0x42 ; 66 1811c: 60 91 f5 06 lds r22, 0x06F5 ; 0x8006f5 18120: 70 91 f6 06 lds r23, 0x06F6 ; 0x8006f6 18124: 80 91 f7 06 lds r24, 0x06F7 ; 0x8006f7 18128: 90 91 f8 06 lds r25, 0x06F8 ; 0x8006f8 1812c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 18130: 9f 93 push r25 18132: 8f 93 push r24 18134: 7f 93 push r23 18136: 6f 93 push r22 18138: 80 91 f4 06 lds r24, 0x06F4 ; 0x8006f4 1813c: 8f 93 push r24 1813e: 80 91 f3 06 lds r24, 0x06F3 ; 0x8006f3 18142: 8f 93 push r24 18144: 80 91 f2 06 lds r24, 0x06F2 ; 0x8006f2 18148: 8f 93 push r24 1814a: 80 91 f1 06 lds r24, 0x06F1 ; 0x8006f1 1814e: 8f 93 push r24 18150: 1f 93 push r17 18152: 0f 93 push r16 18154: 1f 93 push r17 18156: 0f 93 push r16 18158: 85 e2 ldi r24, 0x25 ; 37 1815a: 91 e8 ldi r25, 0x81 ; 129 1815c: 9f 93 push r25 1815e: 8f 93 push r24 18160: 0f 94 1d dc call 0x3b83a ; 0x3b83a ); #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) { 18164: 0f b6 in r0, 0x3f ; 63 18166: f8 94 cli 18168: de bf out 0x3e, r29 ; 62 1816a: 0f be out 0x3f, r0 ; 63 1816c: cd bf out 0x3d, r28 ; 61 1816e: 80 91 05 07 lds r24, 0x0705 ; 0x800705 18172: 88 23 and r24, r24 18174: 09 f4 brne .+2 ; 0x18178 18176: 58 c0 rjmp .+176 ; 0x18228 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 18178: 80 91 09 07 lds r24, 0x0709 ; 0x800709 1817c: 8f 93 push r24 1817e: 80 91 08 07 lds r24, 0x0708 ; 0x800708 18182: 8f 93 push r24 18184: 80 91 07 07 lds r24, 0x0707 ; 0x800707 18188: 8f 93 push r24 1818a: 80 91 06 07 lds r24, 0x0706 ; 0x800706 1818e: 8f 93 push r24 18190: 1f 93 push r17 18192: 0f 93 push r16 18194: 1f 93 push r17 18196: 0f 93 push r16 18198: 8f ef ldi r24, 0xFF ; 255 1819a: 90 e8 ldi r25, 0x80 ; 128 1819c: 9f 93 push r25 1819e: 8f 93 push r24 181a0: 0f 94 1d dc call 0x3b83a ; 0x3b83a 181a4: 0f b6 in r0, 0x3f ; 63 181a6: f8 94 cli 181a8: de bf out 0x3e, r29 ; 62 181aa: 0f be out 0x3f, r0 ; 63 181ac: 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( 181ae: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 181b2: 8f 93 push r24 181b4: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 181b8: 8f 93 push r24 181ba: 80 91 3c 07 lds r24, 0x073C ; 0x80073c 181be: 8f 93 push r24 181c0: 80 91 3b 07 lds r24, 0x073B ; 0x80073b 181c4: 8f 93 push r24 181c6: 80 91 3a 07 lds r24, 0x073A ; 0x80073a 181ca: 1f 92 push r1 181cc: 8f 93 push r24 181ce: 80 91 39 07 lds r24, 0x0739 ; 0x800739 181d2: 8f 93 push r24 181d4: 80 91 38 07 lds r24, 0x0738 ; 0x800738 181d8: 8f 93 push r24 181da: 80 91 37 07 lds r24, 0x0737 ; 0x800737 181de: 8f 93 push r24 181e0: 80 91 36 07 lds r24, 0x0736 ; 0x800736 181e4: 8f 93 push r24 181e6: 80 91 35 07 lds r24, 0x0735 ; 0x800735 181ea: 8f 93 push r24 181ec: 80 91 34 07 lds r24, 0x0734 ; 0x800734 181f0: 8f 93 push r24 181f2: 80 91 33 07 lds r24, 0x0733 ; 0x800733 181f6: 8f 93 push r24 181f8: 80 91 32 07 lds r24, 0x0732 ; 0x800732 181fc: 8f 93 push r24 181fe: 82 ef ldi r24, 0xF2 ; 242 18200: 9a ea ldi r25, 0xAA ; 170 18202: 9f 93 push r25 18204: 8f 93 push r24 18206: 9f 93 push r25 18208: 8f 93 push r24 1820a: 8e e5 ldi r24, 0x5E ; 94 1820c: 90 e8 ldi r25, 0x80 ; 128 1820e: 9f 93 push r25 18210: 8f 93 push r24 18212: 0f 94 1d dc call 0x3b83a ; 0x3b83a "%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(); 18216: 0f 94 fb 42 call 0x285f6 ; 0x285f6 1821a: 0f b6 in r0, 0x3f ; 63 1821c: f8 94 cli 1821e: de bf out 0x3e, r29 ; 62 18220: 0f be out 0x3f, r0 ; 63 18222: cd bf out 0x3d, r28 ; 61 18224: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 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); 18228: 1f 93 push r17 1822a: 0f 93 push r16 1822c: 80 ee ldi r24, 0xE0 ; 224 1822e: 90 e8 ldi r25, 0x80 ; 128 18230: 9f 93 push r25 18232: 8f 93 push r24 18234: 0f 94 1d dc call 0x3b83a ; 0x3b83a 18238: 0f 90 pop r0 1823a: 0f 90 pop r0 1823c: 0f 90 pop r0 1823e: 0f 90 pop r0 18240: b6 cf rjmp .-148 ; 0x181ae #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 18242: 80 e5 ldi r24, 0x50 ; 80 18244: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18248: 88 23 and r24, r24 1824a: 11 f4 brne .+4 ; 0x18250 1824c: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e { uint8_t valCnt = 0; IP_address = 0; 18250: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 18254: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c 18258: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 1825c: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e 18260: 0b e5 ldi r16, 0x5B ; 91 18262: 16 e0 ldi r17, 0x06 ; 6 18264: 3f e5 ldi r19, 0x5F ; 95 18266: e3 2e mov r14, r19 18268: 36 e0 ldi r19, 0x06 ; 6 1826a: f3 2e mov r15, r19 do { *strchr_pointer = '*'; 1826c: 4a e2 ldi r20, 0x2A ; 42 1826e: d4 2e mov r13, r20 18270: e0 91 97 03 lds r30, 0x0397 ; 0x800397 18274: f0 91 98 03 lds r31, 0x0398 ; 0x800398 18278: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 1827a: 0e 94 9b 5c call 0xb936 ; 0xb936 1827e: d8 01 movw r26, r16 18280: 8d 93 st X+, r24 18282: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 18284: ea 16 cp r14, r26 18286: fb 06 cpc r15, r27 18288: 11 f4 brne .+4 ; 0x1828e 1828a: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 1828e: 8e e2 ldi r24, 0x2E ; 46 18290: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18294: 81 11 cpse r24, r1 18296: ec cf rjmp .-40 ; 0x18270 if (valCnt != 4) IP_address = 0; 18298: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 1829c: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c 182a0: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 182a4: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e 182a8: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e - `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(); 182ac: 0f 94 27 58 call 0x2b04e ; 0x2b04e /// 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; 182b0: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 182b4: 81 11 cpse r24, r1 182b6: 02 c0 rjmp .+4 ; 0x182bc 182b8: 0e 94 7e 65 call 0xcafc ; 0xcafc 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(); 182bc: 85 e4 ldi r24, 0x45 ; 69 182be: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 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; 182c2: 81 2c mov r8, r1 182c4: 91 2c mov r9, r1 182c6: a1 2c mov r10, r1 182c8: 20 ec ldi r18, 0xC0 ; 192 182ca: b2 2e mov r11, r18 float e_shift_late = FILAMENTCHANGE_FINALRETRACT; bool automatic = false; //Retract extruder if (code_seen('E')) e_shift_init = code_value(); 182cc: 88 23 and r24, r24 182ce: 21 f0 breq .+8 ; 0x182d8 182d0: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 182d4: 4b 01 movw r8, r22 182d6: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 182d8: 8c e4 ldi r24, 0x4C ; 76 182da: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 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; 182de: c1 2c mov r12, r1 182e0: d1 2c mov r13, r1 182e2: 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(); 182e4: 88 23 and r24, r24 182e6: 21 f0 breq .+8 ; 0x182f0 182e8: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 182ec: 6b 01 movw r12, r22 182ee: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 182f0: 8a e5 ldi r24, 0x5A ; 90 182f2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 // 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; 182f6: 41 2c mov r4, r1 182f8: 51 2c mov r5, r1 182fa: 98 ed ldi r25, 0xD8 ; 216 182fc: 69 2e mov r6, r25 182fe: 91 e4 ldi r25, 0x41 ; 65 18300: 79 2e mov r7, r25 //Retract extruder if (code_seen('E')) e_shift_init = code_value(); if (code_seen('L')) e_shift_late = code_value(); // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 18302: 88 23 and r24, r24 18304: 31 f0 breq .+12 ; 0x18312 18306: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 1830a: 2b 01 movw r4, r22 1830c: 3c 01 movw r6, r24 1830e: e8 94 clt 18310: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 18312: 88 e5 ldi r24, 0x58 ; 88 18314: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18318: 88 23 and r24, r24 1831a: 09 f4 brne .+2 ; 0x1831e 1831c: ba c1 rjmp .+884 ; 0x18692 1831e: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 18322: 6a 96 adiw r28, 0x1a ; 26 18324: 6c af std Y+60, r22 ; 0x3c 18326: 7d af std Y+61, r23 ; 0x3d 18328: 8e af std Y+62, r24 ; 0x3e 1832a: 9f af std Y+63, r25 ; 0x3f 1832c: 6a 97 sbiw r28, 0x1a ; 26 if (code_seen('Y')) y_position = code_value(); 1832e: 89 e5 ldi r24, 0x59 ; 89 18330: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18334: 88 23 and r24, r24 18336: 09 f4 brne .+2 ; 0x1833a 18338: b7 c1 rjmp .+878 ; 0x186a8 1833a: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 1833e: 6e 96 adiw r28, 0x1e ; 30 18340: 6c af std Y+60, r22 ; 0x3c 18342: 7d af std Y+61, r23 ; 0x3d 18344: 8e af std Y+62, r24 ; 0x3e 18346: 9f af std Y+63, r25 ; 0x3f 18348: 6e 97 sbiw r28, 0x1e ; 30 // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 1834a: 1a 82 std Y+2, r1 ; 0x02 1834c: 19 82 std Y+1, r1 ; 0x01 1834e: fe 01 movw r30, r28 18350: 33 96 adiw r30, 0x03 ; 3 18352: 83 e1 ldi r24, 0x13 ; 19 18354: df 01 movw r26, r30 18356: 1d 92 st X+, r1 18358: 8a 95 dec r24 1835a: e9 f7 brne .-6 ; 0x18356 if (code_seen('C')) { 1835c: 83 e4 ldi r24, 0x43 ; 67 1835e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18362: 88 23 and r24, r24 18364: f9 f0 breq .+62 ; 0x183a4 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 18366: 62 e2 ldi r22, 0x22 ; 34 18368: 70 e0 ldi r23, 0x00 ; 0 1836a: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1836e: 90 91 98 03 lds r25, 0x0398 ; 0x800398 18372: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 18376: 8c 01 movw r16, r24 if (!this->ptr) { 18378: 89 2b or r24, r25 1837a: a1 f0 breq .+40 ; 0x183a4 // First quote not found return; } // Skip the leading quote this->ptr++; 1837c: 0f 5f subi r16, 0xFF ; 255 1837e: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 18380: 62 e2 ldi r22, 0x22 ; 34 18382: 70 e0 ldi r23, 0x00 ; 0 18384: c8 01 movw r24, r16 18386: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 if(!pStrEnd) { 1838a: 00 97 sbiw r24, 0x00 ; 0 1838c: 59 f0 breq .+22 ; 0x183a4 // Second quote not found return; } this->len = pStrEnd - this->ptr; 1838e: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 18390: 84 31 cpi r24, 0x14 ; 20 18392: 08 f0 brcs .+2 ; 0x18396 18394: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 18396: 48 2f mov r20, r24 18398: 50 e0 ldi r21, 0x00 ; 0 1839a: b8 01 movw r22, r16 1839c: ce 01 movw r24, r28 1839e: 01 96 adiw r24, 0x01 ; 1 183a0: 0f 94 84 e3 call 0x3c708 ; 0x3c708 } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 183a4: 80 91 98 13 lds r24, 0x1398 ; 0x801398 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; 183a8: 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"))) 183aa: 81 30 cpi r24, 0x01 ; 1 183ac: 29 f4 brne .+10 ; 0x183b8 183ae: 8a ed ldi r24, 0xDA ; 218 183b0: 97 e8 ldi r25, 0x87 ; 135 183b2: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 183b6: 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(); 183b8: 0f 94 27 58 call 0x2b04e ; 0x2b04e uint8_t eject_slot = 0; prusa_statistics(22); // Turn off the fan fanSpeed = 0; 183bc: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 // Retract E if (!printingIsPaused()) 183c0: 0e 94 ba 68 call 0xd174 ; 0xd174 183c4: 81 11 cpse r24, r1 183c6: 77 c1 rjmp .+750 ; 0x186b6 { current_position[E_AXIS] += e_shift; 183c8: a5 01 movw r20, r10 183ca: 94 01 movw r18, r8 183cc: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 183d0: 70 91 50 07 lds r23, 0x0750 ; 0x800750 183d4: 80 91 51 07 lds r24, 0x0751 ; 0x800751 183d8: 90 91 52 07 lds r25, 0x0752 ; 0x800752 183dc: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 183e0: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 183e4: 70 93 50 07 sts 0x0750, r23 ; 0x800750 183e8: 80 93 51 07 sts 0x0751, r24 ; 0x800751 183ec: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 183f0: 60 e0 ldi r22, 0x00 ; 0 183f2: 70 e0 ldi r23, 0x00 ; 0 183f4: 88 ee ldi r24, 0xE8 ; 232 183f6: 92 e4 ldi r25, 0x42 ; 66 183f8: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 183fc: 0f 94 27 58 call 0x2b04e ; 0x2b04e SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 18400: 8a ec ldi r24, 0xCA ; 202 18402: 9f e6 ldi r25, 0x6F ; 111 18404: 0e 94 86 7b call 0xf70c ; 0xf70c // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 18408: c3 01 movw r24, r6 1840a: b2 01 movw r22, r4 1840c: 0e 94 16 6f call 0xde2c ; 0xde2c // Move XY to side current_position[X_AXIS] = x_position; 18410: 6a 96 adiw r28, 0x1a ; 26 18412: 2c ad ldd r18, Y+60 ; 0x3c 18414: 3d ad ldd r19, Y+61 ; 0x3d 18416: 4e ad ldd r20, Y+62 ; 0x3e 18418: 5f ad ldd r21, Y+63 ; 0x3f 1841a: 6a 97 sbiw r28, 0x1a ; 26 1841c: 20 93 43 07 sts 0x0743, r18 ; 0x800743 18420: 30 93 44 07 sts 0x0744, r19 ; 0x800744 18424: 40 93 45 07 sts 0x0745, r20 ; 0x800745 18428: 50 93 46 07 sts 0x0746, r21 ; 0x800746 current_position[Y_AXIS] = y_position; 1842c: 6e 96 adiw r28, 0x1e ; 30 1842e: 8c ad ldd r24, Y+60 ; 0x3c 18430: 9d ad ldd r25, Y+61 ; 0x3d 18432: ae ad ldd r26, Y+62 ; 0x3e 18434: bf ad ldd r27, Y+63 ; 0x3f 18436: 6e 97 sbiw r28, 0x1e ; 30 18438: 80 93 47 07 sts 0x0747, r24 ; 0x800747 1843c: 90 93 48 07 sts 0x0748, r25 ; 0x800748 18440: a0 93 49 07 sts 0x0749, r26 ; 0x800749 18444: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 18448: 60 e0 ldi r22, 0x00 ; 0 1844a: 70 e0 ldi r23, 0x00 ; 0 1844c: 88 e4 ldi r24, 0x48 ; 72 1844e: 92 e4 ldi r25, 0x42 ; 66 18450: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 18454: 0f 94 27 58 call 0x2b04e ; 0x2b04e bool repeat = false; 18458: b1 2c mov r11, r1 st_synchronize(); // When using an MMU, save the currently use slot number // so the firmware can know which slot to eject after the filament // is unloaded. uint8_t eject_slot = 0; 1845a: a1 2c mov r10, r1 #endif //PINDA_THERMISTOR void lcd_wait_for_heater() { lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 1845c: 0a e4 ldi r16, 0x4A ; 74 1845e: 20 2e mov r2, r16 18460: 00 e8 ldi r16, 0x80 ; 128 18462: 30 2e mov r3, r16 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); waiting_start_time = _millis(); wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 18464: 82 e5 ldi r24, 0x52 ; 82 18466: 88 2e mov r8, r24 18468: 80 e8 ldi r24, 0x80 ; 128 1846a: 98 2e mov r9, r24 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 1846c: 80 91 98 13 lds r24, 0x1398 ; 0x801398 18470: 81 30 cpi r24, 0x01 ; 1 18472: 09 f0 breq .+2 ; 0x18476 18474: 23 c1 rjmp .+582 ; 0x186bc eject_slot = MMU2::mmu2.get_current_tool(); 18476: 0f 94 a4 75 call 0x2eb48 ; 0x2eb48 1847a: a8 2e mov r10, r24 mmu_M600_unload_filament(); 1847c: 0e 94 4c 74 call 0xe898 ; 0xe898 } 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 18480: 0f 94 27 58 call 0x2b04e ; 0x2b04e eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 18484: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 18488: 10 92 89 17 sts 0x1789, r1 ; 0x801789 FSensorBlockRunout fsBlockRunout; if (!MMU2::mmu2.Enabled()) 1848c: 80 91 98 13 lds r24, 0x1398 ; 0x801398 18490: 81 30 cpi r24, 0x01 ; 1 18492: 09 f4 brne .+2 ; 0x18496 18494: e1 c1 rjmp .+962 ; 0x18858 { KEEPALIVE_STATE(PAUSED_FOR_USER); 18496: 84 e0 ldi r24, 0x04 ; 4 18498: 80 93 96 02 sts 0x0296, r24 ; 0x800296 uint8_t choice = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_UNLOAD_SUCCESSFUL), false, LCD_LEFT_BUTTON_CHOICE); 1849c: 82 e7 ldi r24, 0x72 ; 114 1849e: 99 e3 ldi r25, 0x39 ; 57 184a0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 184a4: 40 e0 ldi r20, 0x00 ; 0 184a6: 60 e0 ldi r22, 0x00 ; 0 184a8: 0f 94 b3 64 call 0x2c966 ; 0x2c966 184ac: 08 2f mov r16, r24 lcd_update_enable(false); 184ae: 80 e0 ldi r24, 0x00 ; 0 184b0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 184b4: 01 30 cpi r16, 0x01 ; 1 184b6: 29 f5 brne .+74 ; 0x18502 lcd_clear(); 184b8: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 184bc: 8a ee ldi r24, 0xEA ; 234 184be: 99 e3 ldi r25, 0x39 ; 57 184c0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 184c4: ac 01 movw r20, r24 184c6: 62 e0 ldi r22, 0x02 ; 2 184c8: 80 e0 ldi r24, 0x00 ; 0 184ca: 0e 94 29 70 call 0xe052 ; 0xe052 current_position[X_AXIS] = 100; 184ce: 80 e0 ldi r24, 0x00 ; 0 184d0: 90 e0 ldi r25, 0x00 ; 0 184d2: a8 ec ldi r26, 0xC8 ; 200 184d4: b2 e4 ldi r27, 0x42 ; 66 184d6: 80 93 43 07 sts 0x0743, r24 ; 0x800743 184da: 90 93 44 07 sts 0x0744, r25 ; 0x800744 184de: a0 93 45 07 sts 0x0745, r26 ; 0x800745 184e2: b0 93 46 07 sts 0x0746, r27 ; 0x800746 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 184e6: 60 e0 ldi r22, 0x00 ; 0 184e8: 70 e0 ldi r23, 0x00 ; 0 184ea: 88 e4 ldi r24, 0x48 ; 72 184ec: 92 e4 ldi r25, 0x42 ; 66 184ee: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 184f2: 0f 94 27 58 call 0x2b04e ; 0x2b04e lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 184f6: 80 e4 ldi r24, 0x40 ; 64 184f8: 99 e3 ldi r25, 0x39 ; 57 184fa: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 184fe: 0f 94 07 35 call 0x26a0e ; 0x26a0e preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 18502: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 18506: 8e ec ldi r24, 0xCE ; 206 18508: 98 e3 ldi r25, 0x38 ; 56 1850a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1850e: ac 01 movw r20, r24 18510: 60 e0 ldi r22, 0x00 ; 0 18512: 80 e0 ldi r24, 0x00 ; 0 18514: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(0, 1); 18518: 61 e0 ldi r22, 0x01 ; 1 1851a: 80 e0 ldi r24, 0x00 ; 0 1851c: 0e 94 15 70 call 0xe02a ; 0xe02a if (filament_name[0]) { 18520: 89 81 ldd r24, Y+1 ; 0x01 18522: 88 23 and r24, r24 18524: 41 f0 breq .+16 ; 0x18536 lcd_print(filament_name); 18526: ce 01 movw r24, r28 18528: 01 96 adiw r24, 0x01 ; 1 1852a: 0e 94 1c 72 call 0xe438 ; 0xe438 lcd_set_cursor(0, 2); 1852e: 62 e0 ldi r22, 0x02 ; 2 18530: 80 e0 ldi r24, 0x00 ; 0 18532: 0e 94 15 70 call 0xe02a ; 0xe02a } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 18536: 80 91 89 17 lds r24, 0x1789 ; 0x801789 1853a: 81 11 cpse r24, r1 1853c: 06 c0 rjmp .+12 ; 0x1854a #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 1853e: 89 eb ldi r24, 0xB9 ; 185 18540: 98 e3 ldi r25, 0x38 ; 56 18542: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 18546: 0e 94 00 70 call 0xe000 ; 0xe000 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); 1854a: 84 e0 ldi r24, 0x04 ; 4 1854c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 while(!lcd_clicked()) 18550: 0e 94 32 72 call 0xe464 ; 0xe464 18554: 81 11 cpse r24, r1 18556: 10 c0 rjmp .+32 ; 0x18578 { manage_heater(); 18558: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(true); 1855c: 81 e0 ldi r24, 0x01 ; 1 1855e: 0e 94 5a 8c call 0x118b4 ; 0x118b4 #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 18562: 80 91 8c 17 lds r24, 0x178C ; 0x80178c 18566: 88 23 and r24, r24 18568: 99 f3 breq .-26 ; 0x18550 Sound_MakeCustom(50,1000,false); 1856a: 40 e0 ldi r20, 0x00 ; 0 1856c: 68 ee ldi r22, 0xE8 ; 232 1856e: 73 e0 ldi r23, 0x03 ; 3 18570: 82 e3 ldi r24, 0x32 ; 50 18572: 90 e0 ldi r25, 0x00 ; 0 18574: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 18578: 32 e0 ldi r19, 0x02 ; 2 1857a: 30 93 96 02 sts 0x0296, r19 ; 0x800296 M600_load_filament_movements(filament_name); 1857e: ce 01 movw r24, r28 18580: 01 96 adiw r24, 0x01 ; 1 18582: 0e 94 05 74 call 0xe80a ; 0xe80a Sound_MakeCustom(50,1000,false); 18586: 40 e0 ldi r20, 0x00 ; 0 18588: 68 ee ldi r22, 0xE8 ; 232 1858a: 73 e0 ldi r23, 0x03 ; 3 1858c: 82 e3 ldi r24, 0x32 ; 50 1858e: 90 e0 ldi r25, 0x00 ; 0 18590: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); mmu_M600_load_filament(automatic); } if (!automatic) 18594: 11 11 cpse r17, r1 18596: a6 c1 rjmp .+844 ; 0x188e4 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); 18598: b4 e0 ldi r27, 0x04 ; 4 1859a: bb 2e mov r11, r27 1859c: b0 92 96 02 sts 0x0296, r11 ; 0x800296 uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 185a0: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 185a4: 8a e0 ldi r24, 0x0A ; 10 185a6: 99 e3 ldi r25, 0x39 ; 57 185a8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 185ac: ac 01 movw r20, r24 185ae: 60 e0 ldi r22, 0x00 ; 0 185b0: 81 e0 ldi r24, 0x01 ; 1 185b2: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 185b6: 84 ef ldi r24, 0xF4 ; 244 185b8: 98 e3 ldi r25, 0x38 ; 56 185ba: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 185be: ac 01 movw r20, r24 185c0: 61 e0 ldi r22, 0x01 ; 1 185c2: 81 e0 ldi r24, 0x01 ; 1 185c4: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 185c8: 80 ee ldi r24, 0xE0 ; 224 185ca: 98 e3 ldi r25, 0x38 ; 56 185cc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 185d0: ac 01 movw r20, r24 185d2: 62 e0 ldi r22, 0x02 ; 2 185d4: 81 e0 ldi r24, 0x01 ; 1 185d6: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 185da: 84 e0 ldi r24, 0x04 ; 4 185dc: 9c e3 ldi r25, 0x3C ; 60 185de: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 185e2: ac 01 movw r20, r24 185e4: 63 e0 ldi r22, 0x03 ; 3 185e6: 81 e0 ldi r24, 0x01 ; 1 185e8: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_putc_at(0, cursor_pos, '>'); 185ec: 4e e3 ldi r20, 0x3E ; 62 185ee: 60 e0 ldi r22, 0x00 ; 0 185f0: 80 e0 ldi r24, 0x00 ; 0 185f2: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_consume_click(); 185f6: 0e 94 2d 72 call 0xe45a ; 0xe45a uint8_t lcd_alright() { uint8_t cursor_pos = 0; 185fa: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 185fc: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(true); 18600: 81 e0 ldi r24, 0x01 ; 1 18602: 0e 94 5a 8c call 0x118b4 ; 0x118b4 if (lcd_encoder) 18606: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1860a: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1860e: 00 97 sbiw r24, 0x00 ; 0 18610: d9 f0 breq .+54 ; 0x18648 { if (lcd_encoder < 0 ) { 18612: 97 ff sbrs r25, 7 18614: 2a c1 rjmp .+596 ; 0x1886a // Rotating knob counter clockwise if (cursor_pos > 0) 18616: 00 23 and r16, r16 18618: 09 f4 brne .+2 ; 0x1861c 1861a: 2b c1 rjmp .+598 ; 0x18872 cursor_pos--; 1861c: 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 ")); 1861e: 46 e5 ldi r20, 0x56 ; 86 18620: 50 e8 ldi r21, 0x80 ; 128 18622: 60 e0 ldi r22, 0x00 ; 0 18624: 80 e0 ldi r24, 0x00 ; 0 18626: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_putc_at(0, cursor_pos, '>'); 1862a: 4e e3 ldi r20, 0x3E ; 62 1862c: 60 2f mov r22, r16 1862e: 80 e0 ldi r24, 0x00 ; 0 18630: 0e 94 35 70 call 0xe06a ; 0xe06a // Consume rotation event and make feedback sound lcd_encoder = 0; 18634: 10 92 38 05 sts 0x0538, r1 ; 0x800538 18638: 10 92 37 05 sts 0x0537, r1 ; 0x800537 _delay(100); 1863c: 64 e6 ldi r22, 0x64 ; 100 1863e: 70 e0 ldi r23, 0x00 ; 0 18640: 80 e0 ldi r24, 0x00 ; 0 18642: 90 e0 ldi r25, 0x00 ; 0 18644: 0f 94 8d 3c call 0x2791a ; 0x2791a } if (lcd_clicked()) 18648: 0e 94 32 72 call 0xe464 ; 0xe464 1864c: 88 23 and r24, r24 1864e: b1 f2 breq .-84 ; 0x185fc { lcd_clear(); 18650: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_return_to_status(); 18654: 0f 94 4e 26 call 0x24c9c ; 0x24c9c lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 18658: 42 e0 ldi r20, 0x02 ; 2 1865a: 40 93 96 02 sts 0x0296, r20 ; 0x800296 switch(lcd_change_filament_state) 1865e: 02 30 cpi r16, 0x02 ; 2 18660: 09 f4 brne .+2 ; 0x18664 18662: 10 c1 rjmp .+544 ; 0x18884 18664: 03 30 cpi r16, 0x03 ; 3 18666: 09 f4 brne .+2 ; 0x1866a 18668: f7 c1 rjmp .+1006 ; 0x18a58 1866a: 01 30 cpi r16, 0x01 ; 1 1866c: 09 f0 breq .+2 ; 0x18670 1866e: 29 c1 rjmp .+594 ; 0x188c2 { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 18670: 80 91 98 13 lds r24, 0x1398 ; 0x801398 18674: 81 30 cpi r24, 0x01 ; 1 18676: 09 f0 breq .+2 ; 0x1867a 18678: 00 c1 rjmp .+512 ; 0x1887a uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 1867a: 0f 94 a4 75 call 0x2eb48 ; 0x2eb48 1867e: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 18680: 0e 94 4c 74 call 0xe898 ; 0xe898 // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 18684: 80 2f mov r24, r16 18686: 0e 94 22 8f call 0x11e44 ; 0x11e44 // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 1868a: 80 e0 ldi r24, 0x00 ; 0 1868c: 0e 94 19 7a call 0xf432 ; 0xf432 18690: 85 cf rjmp .-246 ; 0x1859c // 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; 18692: 20 e0 ldi r18, 0x00 ; 0 18694: 30 e0 ldi r19, 0x00 ; 0 18696: 43 e5 ldi r20, 0x53 ; 83 18698: 53 e4 ldi r21, 0x43 ; 67 1869a: 6a 96 adiw r28, 0x1a ; 26 1869c: 2c af std Y+60, r18 ; 0x3c 1869e: 3d af std Y+61, r19 ; 0x3d 186a0: 4e af std Y+62, r20 ; 0x3e 186a2: 5f af std Y+63, r21 ; 0x3f 186a4: 6a 97 sbiw r28, 0x1a ; 26 186a6: 43 ce rjmp .-890 ; 0x1832e float y_position = FILAMENTCHANGE_YPOS; 186a8: 6e 96 adiw r28, 0x1e ; 30 186aa: 1c ae std Y+60, r1 ; 0x3c 186ac: 1d ae std Y+61, r1 ; 0x3d 186ae: 1e ae std Y+62, r1 ; 0x3e 186b0: 1f ae std Y+63, r1 ; 0x3f 186b2: 6e 97 sbiw r28, 0x1e ; 30 186b4: 4a ce rjmp .-876 ; 0x1834a 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(); 186b6: 0e 94 fe 65 call 0xcbfc ; 0xcbfc 186ba: a6 ce rjmp .-692 ; 0x18408 //! //! 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); 186bc: 84 e0 ldi r24, 0x04 ; 4 186be: 80 93 96 02 sts 0x0296, r24 ; 0x800296 unsigned long waiting_start_time = _millis(); 186c2: 0f 94 86 3e call 0x27d0c ; 0x27d0c 186c6: 2b 01 movw r4, r22 186c8: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 186ca: 8e e8 ldi r24, 0x8E ; 142 186cc: 98 e3 ldi r25, 0x38 ; 56 186ce: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 186d2: 0f 94 80 34 call 0x26900 ; 0x26900 while (!(wait_for_user_state == 0 && lcd_clicked())){ 186d6: 0e 94 32 72 call 0xe464 ; 0xe464 186da: 08 2f mov r16, r24 186dc: 81 11 cpse r24, r1 186de: 38 c0 rjmp .+112 ; 0x18750 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) { 186e0: a3 01 movw r20, r6 186e2: 92 01 movw r18, r4 186e4: 20 54 subi r18, 0x40 ; 64 186e6: 38 4d sbci r19, 0xD8 ; 216 186e8: 46 4f sbci r20, 0xF6 ; 246 186ea: 5f 4f sbci r21, 0xFF ; 255 186ec: 6a 96 adiw r28, 0x1a ; 26 186ee: 2c af std Y+60, r18 ; 0x3c 186f0: 3d af std Y+61, r19 ; 0x3d 186f2: 4e af std Y+62, r20 ; 0x3e 186f4: 5f af std Y+63, r21 ; 0x3f 186f6: 6a 97 sbiw r28, 0x1a ; 26 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(); 186f8: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(true); 186fc: 81 e0 ldi r24, 0x01 ; 1 186fe: 0e 94 5a 8c call 0x118b4 ; 0x118b4 if (wait_for_user_state != 2) sound_wait_for_user(); 18702: 02 30 cpi r16, 0x02 ; 2 18704: 09 f4 brne .+2 ; 0x18708 18706: 67 c0 rjmp .+206 ; 0x187d6 18708: 0f 94 0a 6a call 0x2d414 ; 0x2d414 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); 1870c: 84 e0 ldi r24, 0x04 ; 4 1870e: 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) { 18710: 01 30 cpi r16, 0x01 ; 1 18712: 39 f1 breq .+78 ; 0x18762 case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 18714: 0e 94 ff 8e call 0x11dfe ; 0x11dfe if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 18718: 0f 94 86 3e call 0x27d0c ; 0x27d0c 1871c: 6a 96 adiw r28, 0x1a ; 26 1871e: 2c ad ldd r18, Y+60 ; 0x3c 18720: 3d ad ldd r19, Y+61 ; 0x3d 18722: 4e ad ldd r20, Y+62 ; 0x3e 18724: 5f ad ldd r21, Y+63 ; 0x3f 18726: 6a 97 sbiw r28, 0x1a ; 26 18728: 26 17 cp r18, r22 1872a: 37 07 cpc r19, r23 1872c: 48 07 cpc r20, r24 1872e: 59 07 cpc r21, r25 18730: 90 f6 brcc .-92 ; 0x186d6 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 18732: 8d e5 ldi r24, 0x5D ; 93 18734: 98 e3 ldi r25, 0x38 ; 56 18736: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1873a: 0f 94 80 34 call 0x26900 ; 0x26900 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1873e: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 18742: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 18746: 0f 94 27 58 call 0x2b04e ; 0x2b04e disable_e0(); 1874a: 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; 1874c: 01 e0 ldi r16, 0x01 ; 1 1874e: d4 cf rjmp .-88 ; 0x186f8 18750: 10 92 6c 05 sts 0x056C, r1 ; 0x80056c <_ZL10beep_timer.lto_priv.511> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 18754: 10 92 6f 05 sts 0x056F, r1 ; 0x80056f <_ZL6bFirst.lto_priv.512> 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); 18758: c7 01 movw r24, r14 1875a: b6 01 movw r22, r12 1875c: 0f 94 d2 15 call 0x22ba4 ; 0x22ba4 18760: 8f ce rjmp .-738 ; 0x18480 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); 18762: 0e 94 ff 8e call 0x11dfe ; 0x11dfe if (lcd_clicked()) { 18766: 0e 94 32 72 call 0xe464 ; 0xe464 1876a: 88 23 and r24, r24 1876c: 29 f2 breq .-118 ; 0x186f8 1876e: 80 91 ad 05 lds r24, 0x05AD ; 0x8005ad 18772: 90 91 ae 05 lds r25, 0x05AE ; 0x8005ae 18776: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e 1877a: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d return target_temp_reached; } #endif //PINDA_THERMISTOR void lcd_wait_for_heater() { lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1877e: 8e e2 ldi r24, 0x2E ; 46 18780: 90 e5 ldi r25, 0x50 ; 80 18782: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 18786: 0f 94 80 34 call 0x26900 ; 0x26900 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1878a: 42 e8 ldi r20, 0x82 ; 130 1878c: 64 e0 ldi r22, 0x04 ; 4 1878e: 80 e0 ldi r24, 0x00 ; 0 18790: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 18794: 80 91 6e 0e lds r24, 0x0E6E ; 0x800e6e 18798: 8f 93 push r24 1879a: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 1879e: 8f 93 push r24 187a0: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 187a4: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 187a8: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 187ac: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 187b0: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 187b4: 7f 93 push r23 187b6: 6f 93 push r22 187b8: 3f 92 push r3 187ba: 2f 92 push r2 187bc: 0e 94 ee 6f call 0xdfdc ; 0xdfdc lcd_putc(LCD_STR_DEGREE[0]); 187c0: 81 e8 ldi r24, 0x81 ; 129 187c2: 0e 94 04 70 call 0xe008 ; 0xe008 187c6: 0f 90 pop r0 187c8: 0f 90 pop r0 187ca: 0f 90 pop r0 187cc: 0f 90 pop r0 187ce: 0f 90 pop r0 187d0: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 187d2: 02 e0 ldi r16, 0x02 ; 2 187d4: 91 cf rjmp .-222 ; 0x186f8 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 187d6: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 187da: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 187de: 07 2e mov r0, r23 187e0: 00 0c add r0, r0 187e2: 88 0b sbc r24, r24 187e4: 99 0b sbc r25, r25 187e6: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 187ea: 20 91 61 0e lds r18, 0x0E61 ; 0x800e61 187ee: 30 91 62 0e lds r19, 0x0E62 ; 0x800e62 187f2: 40 91 63 0e lds r20, 0x0E63 ; 0x800e63 187f6: 50 91 64 0e lds r21, 0x0E64 ; 0x800e64 187fa: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 187fe: 9f 77 andi r25, 0x7F ; 127 18800: 20 e0 ldi r18, 0x00 ; 0 18802: 30 e0 ldi r19, 0x00 ; 0 18804: 40 ea ldi r20, 0xA0 ; 160 18806: 50 e4 ldi r21, 0x40 ; 64 18808: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1880c: 87 ff sbrs r24, 7 1880e: 0b c0 rjmp .+22 ; 0x18826 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 18810: 8e e8 ldi r24, 0x8E ; 142 18812: 98 e3 ldi r25, 0x38 ; 56 18814: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 18818: 0f 94 80 34 call 0x26900 ; 0x26900 waiting_start_time = _millis(); 1881c: 0f 94 86 3e call 0x27d0c ; 0x27d0c 18820: 2b 01 movw r4, r22 18822: 3c 01 movw r6, r24 18824: 58 cf rjmp .-336 ; 0x186d6 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 18826: 64 e0 ldi r22, 0x04 ; 4 18828: 81 e0 ldi r24, 0x01 ; 1 1882a: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 1882e: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 18832: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 18836: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 1883a: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 1883e: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 18842: 7f 93 push r23 18844: 6f 93 push r22 18846: 9f 92 push r9 18848: 8f 92 push r8 1884a: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 1884e: 0f 90 pop r0 18850: 0f 90 pop r0 18852: 0f 90 pop r0 18854: 0f 90 pop r0 18856: 50 cf rjmp .-352 ; 0x186f8 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 18858: 11 11 cpse r17, r1 1885a: 03 c0 rjmp .+6 ; 0x18862 1885c: 8a 2d mov r24, r10 1885e: 0e 94 22 8f call 0x11e44 ; 0x11e44 mmu_M600_load_filament(automatic); 18862: 81 2f mov r24, r17 18864: 0e 94 19 7a call 0xf432 ; 0xf432 18868: 95 ce rjmp .-726 ; 0x18594 cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 1886a: 03 30 cpi r16, 0x03 ; 3 1886c: 10 f4 brcc .+4 ; 0x18872 cursor_pos++; 1886e: 0f 5f subi r16, 0xFF ; 255 18870: d6 ce rjmp .-596 ; 0x1861e else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 18872: 87 e0 ldi r24, 0x07 ; 7 18874: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 18878: d2 ce rjmp .-604 ; 0x1861e 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); 1887a: ce 01 movw r24, r28 1887c: 01 96 adiw r24, 0x01 ; 1 1887e: 0e 94 05 74 call 0xe80a ; 0xe80a 18882: 8c ce rjmp .-744 ; 0x1859c } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 18884: 0f 94 27 58 call 0x2b04e ; 0x2b04e load_filament_final_feed(); 18888: 0e 94 c8 65 call 0xcb90 ; 0xcb90 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(); 1888c: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 18890: 8e e1 ldi r24, 0x1E ; 30 18892: 99 e3 ldi r25, 0x39 ; 57 18894: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 18898: ac 01 movw r20, r24 1889a: 60 e0 ldi r22, 0x00 ; 0 1889c: 80 e0 ldi r24, 0x00 ; 0 1889e: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 188a2: 8a ee ldi r24, 0xEA ; 234 188a4: 99 e3 ldi r25, 0x39 ; 57 188a6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 188aa: ac 01 movw r20, r24 188ac: 62 e0 ldi r22, 0x02 ; 2 188ae: 80 e0 ldi r24, 0x00 ; 0 188b0: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 188b4: 87 e9 ldi r24, 0x97 ; 151 188b6: 9d e1 ldi r25, 0x1D ; 29 188b8: 0f 94 cb 35 call 0x26b96 ; 0x26b96 lcd_loading_color(); st_synchronize(); 188bc: 0f 94 27 58 call 0x2b04e ; 0x2b04e 188c0: 6d ce rjmp .-806 ; 0x1859c } void lcd_change_success() { lcd_clear(); 188c2: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 188c6: 8e e2 ldi r24, 0x2E ; 46 188c8: 99 e3 ldi r25, 0x39 ; 57 188ca: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 188ce: ac 01 movw r20, r24 188d0: 62 e0 ldi r22, 0x02 ; 2 188d2: 80 e0 ldi r24, 0x00 ; 0 188d4: 0e 94 29 70 call 0xe052 ; 0xe052 //! @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) 188d8: 00 23 and r16, r16 188da: 19 f0 breq .+6 ; 0x188e2 188dc: 03 30 cpi r16, 0x03 ; 3 188de: 09 f0 breq .+2 ; 0x188e2 188e0: 5d ce rjmp .-838 ; 0x1859c default: lcd_change_success(); break; } } return false; 188e2: b1 2c mov r11, r1 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 188e4: 88 e8 ldi r24, 0x88 ; 136 188e6: 97 e1 ldi r25, 0x17 ; 23 188e8: 0e 94 04 76 call 0xec08 ; 0xec08 current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 188ec: b1 10 cpse r11, r1 188ee: be cd rjmp .-1156 ; 0x1846c if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 188f0: 81 e0 ldi r24, 0x01 ; 1 188f2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 // Not let's go back to print fanSpeed = saved_fan_speed; 188f6: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 188fa: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 // Feed a little of filament to stabilize pressure if (!automatic) { 188fe: 11 11 cpse r17, r1 18900: 27 c0 rjmp .+78 ; 0x18950 if (printingIsPaused()) 18902: 0e 94 ba 68 call 0xd174 ; 0xd174 18906: c0 90 4f 07 lds r12, 0x074F ; 0x80074f 1890a: d0 90 50 07 lds r13, 0x0750 ; 0x800750 1890e: e0 90 51 07 lds r14, 0x0751 ; 0x800751 18912: f0 90 52 07 lds r15, 0x0752 ; 0x800752 18916: 88 23 and r24, r24 18918: 09 f4 brne .+2 ; 0x1891c 1891a: a1 c0 rjmp .+322 ; 0x18a5e { // 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; 1891c: 20 e0 ldi r18, 0x00 ; 0 1891e: 30 e0 ldi r19, 0x00 ; 0 18920: 40 e8 ldi r20, 0x80 ; 128 18922: 5f e3 ldi r21, 0x3F ; 63 18924: c7 01 movw r24, r14 18926: b6 01 movw r22, r12 18928: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1892c: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 18930: 70 93 50 07 sts 0x0750, r23 ; 0x800750 18934: 80 93 51 07 sts 0x0751, r24 ; 0x800751 18938: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 1893c: 60 e0 ldi r22, 0x00 ; 0 1893e: 70 e0 ldi r23, 0x00 ; 0 18940: 88 ee ldi r24, 0xE8 ; 232 18942: 92 e4 ldi r25, 0x42 ; 66 18944: 0f 94 5d ba call 0x374ba ; 0x374ba return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 18948: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 1894c: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d 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); 18950: e0 90 4b 07 lds r14, 0x074B ; 0x80074b 18954: f0 90 4c 07 lds r15, 0x074C ; 0x80074c 18958: 00 91 4d 07 lds r16, 0x074D ; 0x80074d 1895c: 10 91 4e 07 lds r17, 0x074E ; 0x80074e 18960: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 18964: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 18968: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 1896c: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 18970: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 18974: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 18978: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 1897c: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 18980: 1f 92 push r1 18982: 1f 92 push r1 18984: 1f 92 push r1 18986: 1f 92 push r1 18988: 81 2c mov r8, r1 1898a: 91 2c mov r9, r1 1898c: e8 e4 ldi r30, 0x48 ; 72 1898e: ae 2e mov r10, r30 18990: e2 e4 ldi r30, 0x42 ; 66 18992: be 2e mov r11, r30 18994: ff e4 ldi r31, 0x4F ; 79 18996: cf 2e mov r12, r31 18998: f7 e0 ldi r31, 0x07 ; 7 1899a: df 2e mov r13, r31 1899c: 0f 94 08 ab call 0x35610 ; 0x35610 st_synchronize(); 189a0: 0f 94 27 58 call 0x2b04e ; 0x2b04e // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 189a4: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 189a8: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 189ac: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 189b0: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 189b4: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 189b8: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 189bc: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 189c0: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 189c4: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 189c8: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 189cc: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 189d0: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 189d4: 1f 92 push r1 189d6: 1f 92 push r1 189d8: 1f 92 push r1 189da: 1f 92 push r1 189dc: 81 2c mov r8, r1 189de: 91 2c mov r9, r1 189e0: a0 e7 ldi r26, 0x70 ; 112 189e2: aa 2e mov r10, r26 189e4: a1 e4 ldi r26, 0x41 ; 65 189e6: ba 2e mov r11, r26 189e8: 0f 94 08 ab call 0x35610 ; 0x35610 st_synchronize(); 189ec: 0f 94 27 58 call 0x2b04e ; 0x2b04e // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 189f0: 87 ea ldi r24, 0xA7 ; 167 189f2: 92 e0 ldi r25, 0x02 ; 2 189f4: 0f 94 ae aa call 0x3555c ; 0x3555c memcpy(current_position, saved_pos, sizeof(saved_pos)); 189f8: 80 e1 ldi r24, 0x10 ; 16 189fa: eb e9 ldi r30, 0x9B ; 155 189fc: f2 e0 ldi r31, 0x02 ; 2 189fe: a3 e4 ldi r26, 0x43 ; 67 18a00: b7 e0 ldi r27, 0x07 ; 7 18a02: 01 90 ld r0, Z+ 18a04: 0d 92 st X+, r0 18a06: 8a 95 dec r24 18a08: e1 f7 brne .-8 ; 0x18a02 set_destination_to_current(); 18a0a: 0e 94 6f 69 call 0xd2de ; 0xd2de // Recover feed rate feedmultiply = saved_feedmultiply2; 18a0e: 80 91 73 03 lds r24, 0x0373 ; 0x800373 18a12: 90 91 74 03 lds r25, 0x0374 ; 0x800374 18a16: 80 93 39 02 sts 0x0239, r24 ; 0x800239 18a1a: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a enquecommandf_P(MSG_M220, saved_feedmultiply2); 18a1e: 9f 93 push r25 18a20: 8f 93 push r24 18a22: 82 e4 ldi r24, 0x42 ; 66 18a24: 92 e7 ldi r25, 0x72 ; 114 18a26: 9f 93 push r25 18a28: 8f 93 push r24 18a2a: 0e 94 61 8a call 0x114c2 ; 0x114c2 if (printingIsPaused()) { 18a2e: 0e 94 ba 68 call 0xd174 ; 0xd174 18a32: 0f b6 in r0, 0x3f ; 63 18a34: f8 94 cli 18a36: de bf out 0x3e, r29 ; 62 18a38: 0f be out 0x3f, r0 ; 63 18a3a: cd bf out 0x3d, r28 ; 61 18a3c: 88 23 and r24, r24 18a3e: 31 f1 breq .+76 ; 0x18a8c lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 18a40: 8e ee ldi r24, 0xEE ; 238 18a42: 90 e4 ldi r25, 0x40 ; 64 18a44: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 18a48: 0f 94 0c 0b call 0x21618 ; 0x21618 } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 18a4c: 10 92 75 07 sts 0x0775, r1 ; 0x800775 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 18a50: 10 92 53 07 sts 0x0753, r1 ; 0x800753 18a54: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e st_synchronize(); break; // Unload filament case 3: return true; 18a58: bb 24 eor r11, r11 18a5a: b3 94 inc r11 18a5c: 43 cf rjmp .-378 ; 0x188e4 setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 18a5e: 20 e0 ldi r18, 0x00 ; 0 18a60: 30 e0 ldi r19, 0x00 ; 0 18a62: 40 ea ldi r20, 0xA0 ; 160 18a64: 50 e4 ldi r21, 0x40 ; 64 18a66: c7 01 movw r24, r14 18a68: b6 01 movw r22, r12 18a6a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 18a6e: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 18a72: 70 93 50 07 sts 0x0750, r23 ; 0x800750 18a76: 80 93 51 07 sts 0x0751, r24 ; 0x800751 18a7a: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 18a7e: 60 e0 ldi r22, 0x00 ; 0 18a80: 70 e0 ldi r23, 0x00 ; 0 18a82: 80 e0 ldi r24, 0x00 ; 0 18a84: 90 e4 ldi r25, 0x40 ; 64 18a86: 0f 94 5d ba call 0x374ba ; 0x374ba 18a8a: 62 cf rjmp .-316 ; 0x18950 if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 18a8c: 8e e0 ldi r24, 0x0E ; 14 18a8e: 91 e7 ldi r25, 0x71 ; 113 18a90: 0f 94 0c 0b call 0x21618 ; 0x21618 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 18a94: 8c ec ldi r24, 0xCC ; 204 18a96: 9b e6 ldi r25, 0x6B ; 107 18a98: 0e 94 86 7b call 0xf70c ; 0xf70c 18a9c: d7 cf rjmp .-82 ; 0x18a4c SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 18a9e: 0e 94 ba 68 call 0xd174 ; 0xd174 18aa2: 81 11 cpse r24, r1 18aa4: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e st_synchronize(); 18aa8: 0f 94 27 58 call 0x2b04e ; 0x2b04e ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 18aac: 0e 94 35 81 call 0x1026a ; 0x1026a cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 18ab0: 0e 94 c7 78 call 0xf18e ; 0xf18e lcd_pause_print(); 18ab4: 0f 94 92 3e call 0x27d24 ; 0x27d24 18ab8: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 18abc: 0e 94 ba 68 call 0xd174 ; 0xd174 18ac0: 88 23 and r24, r24 18ac2: 11 f4 brne .+4 ; 0x18ac8 18ac4: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 18ac8: 0c 94 de ad jmp 0x15bbc ; 0x15bbc /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 18acc: 60 e0 ldi r22, 0x00 ; 0 18ace: 80 e0 ldi r24, 0x00 ; 0 18ad0: 0f 94 12 15 call 0x22a24 ; 0x22a24 18ad4: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 18ad8: 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')) { 18ada: 83 e5 ldi r24, 0x53 ; 83 18adc: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18ae0: 88 23 and r24, r24 18ae2: b1 f0 breq .+44 ; 0x18b10 iSel = code_value_uint8(); 18ae4: 0e 94 8e 5c call 0xb91c ; 0xb91c 18ae8: 18 2f mov r17, r24 if (iSel>=max_sheets) 18aea: 88 30 cpi r24, 0x08 ; 8 18aec: b0 f0 brcs .+44 ; 0x18b1a { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 18aee: 8b eb ldi r24, 0xBB ; 187 18af0: 97 e8 ldi r25, 0x87 ; 135 18af2: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 18af6: 4a e0 ldi r20, 0x0A ; 10 18af8: 67 e0 ldi r22, 0x07 ; 7 18afa: 70 e0 ldi r23, 0x00 ; 0 18afc: 80 e0 ldi r24, 0x00 ; 0 18afe: 90 e0 ldi r25, 0x00 ; 0 18b00: 0f 94 4a d2 call 0x3a494 ; 0x3a494 SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 18b04: 84 ef ldi r24, 0xF4 ; 244 18b06: 92 e0 ldi r25, 0x02 ; 2 18b08: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 18b0c: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 18b10: 81 ea ldi r24, 0xA1 ; 161 18b12: 9d e0 ldi r25, 0x0D ; 13 18b14: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 18b18: 18 2f mov r17, r24 } if (code_seen('Z')){ 18b1a: 8a e5 ldi r24, 0x5A ; 90 18b1c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18b20: 88 23 and r24, r24 18b22: 09 f4 brne .+2 ; 0x18b26 18b24: d7 c0 rjmp .+430 ; 0x18cd4 z_val = code_value(); 18b26: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 18b2a: 2b 01 movw r4, r22 18b2c: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 18b2e: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 18b32: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 18b36: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 18b3a: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 18b3e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 18b42: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 18b46: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 18b48: 9b 01 movw r18, r22 18b4a: 21 56 subi r18, 0x61 ; 97 18b4c: 30 4f sbci r19, 0xF0 ; 240 18b4e: 20 3a cpi r18, 0xA0 ; 160 18b50: 3f 40 sbci r19, 0x0F ; 15 18b52: 30 f0 brcs .+12 ; 0x18b60 { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 18b54: 85 ea ldi r24, 0xA5 ; 165 18b56: 97 e8 ldi r25, 0x87 ; 135 18b58: 0e 94 86 7b call 0xf70c ; 0xf70c 18b5c: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 18b60: 5b e0 ldi r21, 0x0B ; 11 18b62: 15 9f mul r17, r21 18b64: 90 01 movw r18, r0 18b66: 11 24 eor r1, r1 18b68: c9 01 movw r24, r18 18b6a: 80 5b subi r24, 0xB0 ; 176 18b6c: 92 4f sbci r25, 0xF2 ; 242 18b6e: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a { 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')) 18b72: 8c e4 ldi r24, 0x4C ; 76 18b74: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18b78: bb e0 ldi r27, 0x0B ; 11 18b7a: 1b 9f mul r17, r27 18b7c: 70 01 movw r14, r0 18b7e: 11 24 eor r1, r1 18b80: 57 01 movw r10, r14 18b82: e7 eb ldi r30, 0xB7 ; 183 18b84: ae 1a sub r10, r30 18b86: e2 ef ldi r30, 0xF2 ; 242 18b88: be 0a sbc r11, r30 18b8a: 88 23 and r24, r24 18b8c: 09 f4 brne .+2 ; 0x18b90 18b8e: be c0 rjmp .+380 ; 0x18d0c { char *src = strchr_pointer + 1; 18b90: e0 91 97 03 lds r30, 0x0397 ; 0x800397 18b94: f0 91 98 03 lds r31, 0x0398 ; 0x800398 18b98: 31 96 adiw r30, 0x01 ; 1 18b9a: bf 01 movw r22, r30 while (*src == ' ') ++src; 18b9c: 81 91 ld r24, Z+ 18b9e: 80 32 cpi r24, 0x20 ; 32 18ba0: e1 f3 breq .-8 ; 0x18b9a if (*src != '\0') 18ba2: 88 23 and r24, r24 18ba4: 31 f0 breq .+12 ; 0x18bb2 { strncpy(strLabel,src,7); 18ba6: 47 e0 ldi r20, 0x07 ; 7 18ba8: 50 e0 ldi r21, 0x00 ; 0 18baa: ce 01 movw r24, r28 18bac: 01 96 adiw r24, 0x01 ; 1 18bae: 0f 94 db e3 call 0x3c7b6 ; 0x3c7b6 #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); 18bb2: 47 e0 ldi r20, 0x07 ; 7 18bb4: 50 e0 ldi r21, 0x00 ; 0 18bb6: b5 01 movw r22, r10 18bb8: ce 01 movw r24, r28 18bba: 01 96 adiw r24, 0x01 ; 1 18bbc: 0f 94 6f dd call 0x3bade ; 0x3bade else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 18bc0: 82 e4 ldi r24, 0x42 ; 66 18bc2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18bc6: 57 01 movw r10, r14 18bc8: fe ea ldi r31, 0xAE ; 174 18bca: af 1a sub r10, r31 18bcc: f2 ef ldi r31, 0xF2 ; 242 18bce: bf 0a sbc r11, r31 18bd0: 88 23 and r24, r24 18bd2: 09 f4 brne .+2 ; 0x18bd6 18bd4: a3 c0 rjmp .+326 ; 0x18d1c { iBedC = code_value_uint8(); 18bd6: 0e 94 8e 5c call 0xb91c ; 0xb91c 18bda: 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); 18bdc: 68 2f mov r22, r24 18bde: c5 01 movw r24, r10 18be0: 0f 94 7f dd call 0x3bafe ; 0x3bafe else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 18be4: 80 e5 ldi r24, 0x50 ; 80 18be6: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18bea: 2d ea ldi r18, 0xAD ; 173 18bec: e2 1a sub r14, r18 18bee: 22 ef ldi r18, 0xF2 ; 242 18bf0: f2 0a sbc r15, r18 18bf2: 88 23 and r24, r24 18bf4: 09 f4 brne .+2 ; 0x18bf8 18bf6: 97 c0 rjmp .+302 ; 0x18d26 { iPindaC = code_value_uint8(); 18bf8: 0e 94 8e 5c call 0xb91c ; 0xb91c 18bfc: b8 2e mov r11, r24 18bfe: 68 2f mov r22, r24 18c00: c7 01 movw r24, r14 18c02: 0f 94 7f dd call 0x3bafe ; 0x3bafe else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 18c06: 81 e4 ldi r24, 0x41 ; 65 18c08: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18c0c: 88 23 and r24, r24 18c0e: 09 f4 brne .+2 ; 0x18c12 18c10: 8f c0 rjmp .+286 ; 0x18d30 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18c12: 0e 94 8e 5c call 0xb91c ; 0xb91c 18c16: 81 11 cpse r24, r1 18c18: 06 c0 rjmp .+12 ; 0x18c26 18c1a: 81 ea ldi r24, 0xA1 ; 161 18c1c: 9d e0 ldi r25, 0x0D ; 13 18c1e: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 18c22: 18 13 cpse r17, r24 18c24: 8d c0 rjmp .+282 ; 0x18d40 if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 18c26: 81 2f mov r24, r17 18c28: 0e 94 4c 78 call 0xf098 ; 0xf098 18c2c: 08 2f mov r16, r24 18c2e: 88 23 and r24, r24 18c30: 29 f0 breq .+10 ; 0x18c3c 18c32: 61 2f mov r22, r17 18c34: 81 ea ldi r24, 0xA1 ; 161 18c36: 9d e0 ldi r25, 0x0D ; 13 18c38: 0f 94 7f dd call 0x3bafe ; 0x3bafe else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 18c3c: 8e e9 ldi r24, 0x9E ; 158 18c3e: 97 e8 ldi r25, 0x87 ; 135 18c40: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18c44: 61 2f mov r22, r17 18c46: 70 e0 ldi r23, 0x00 ; 0 18c48: 90 e0 ldi r25, 0x00 ; 0 18c4a: 80 e0 ldi r24, 0x00 ; 0 18c4c: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 18c50: 81 2f mov r24, r17 18c52: 0e 94 4c 78 call 0xf098 ; 0xf098 18c56: 81 11 cpse r24, r1 18c58: 04 c0 rjmp .+8 ; 0x18c62 SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 18c5a: 8d e8 ldi r24, 0x8D ; 141 18c5c: 97 e8 ldi r25, 0x87 ; 135 18c5e: 0e 94 86 7b call 0xf70c ; 0xf70c SERIAL_PROTOCOLPGM(" Z"); 18c62: 8a e8 ldi r24, 0x8A ; 138 18c64: 97 e8 ldi r25, 0x87 ; 135 18c66: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18c6a: 44 e0 ldi r20, 0x04 ; 4 18c6c: c3 01 movw r24, r6 18c6e: b2 01 movw r22, r4 18c70: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 18c74: 87 e8 ldi r24, 0x87 ; 135 18c76: 97 e8 ldi r25, 0x87 ; 135 18c78: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18c7c: b6 01 movw r22, r12 18c7e: dd 0c add r13, r13 18c80: 88 0b sbc r24, r24 18c82: 99 0b sbc r25, r25 18c84: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 18c88: 84 e8 ldi r24, 0x84 ; 132 18c8a: 97 e8 ldi r25, 0x87 ; 135 18c8c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 18c90: ce 01 movw r24, r28 18c92: 01 96 adiw r24, 0x01 ; 1 18c94: 0e 94 bf 89 call 0x1137e ; 0x1137e SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 18c98: 81 e8 ldi r24, 0x81 ; 129 18c9a: 97 e8 ldi r25, 0x87 ; 135 18c9c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 18ca0: 69 2d mov r22, r9 18ca2: 70 e0 ldi r23, 0x00 ; 0 18ca4: 90 e0 ldi r25, 0x00 ; 0 18ca6: 80 e0 ldi r24, 0x00 ; 0 18ca8: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 18cac: 8e e7 ldi r24, 0x7E ; 126 18cae: 97 e8 ldi r25, 0x87 ; 135 18cb0: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 18cb4: 6b 2d mov r22, r11 18cb6: 70 e0 ldi r23, 0x00 ; 0 18cb8: 90 e0 ldi r25, 0x00 ; 0 18cba: 80 e0 ldi r24, 0x00 ; 0 18cbc: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 18cc0: 8b e7 ldi r24, 0x7B ; 123 18cc2: 97 e8 ldi r25, 0x87 ; 135 18cc4: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOLLN((int)bIsActive); 18cc8: 80 2f mov r24, r16 18cca: 90 e0 ldi r25, 0x00 ; 0 18ccc: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 18cd0: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e } 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))); 18cd4: ab e0 ldi r26, 0x0B ; 11 18cd6: 1a 9f mul r17, r26 18cd8: c0 01 movw r24, r0 18cda: 11 24 eor r1, r1 18cdc: 80 5b subi r24, 0xB0 ; 176 18cde: 92 4f sbci r25, 0xF2 ; 242 18ce0: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 18ce4: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 18ce6: bc 01 movw r22, r24 18ce8: 99 0f add r25, r25 18cea: 88 0b sbc r24, r24 18cec: 99 0b sbc r25, r25 18cee: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 18cf2: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 18cf6: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 18cfa: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 18cfe: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 18d02: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 18d06: 2b 01 movw r4, r22 18d08: 3c 01 movw r6, r24 18d0a: 33 cf rjmp .-410 ; 0x18b72 } 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)); 18d0c: 47 e0 ldi r20, 0x07 ; 7 18d0e: 50 e0 ldi r21, 0x00 ; 0 18d10: b5 01 movw r22, r10 18d12: ce 01 movw r24, r28 18d14: 01 96 adiw r24, 0x01 ; 1 18d16: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 18d1a: 52 cf rjmp .-348 ; 0x18bc0 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); 18d1c: c5 01 movw r24, r10 18d1e: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 18d22: 98 2e mov r9, r24 18d24: 5f cf rjmp .-322 ; 0x18be4 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); 18d26: c7 01 movw r24, r14 18d28: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 18d2c: b8 2e mov r11, r24 18d2e: 6b cf rjmp .-298 ; 0x18c06 bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18d30: 81 ea ldi r24, 0xA1 ; 161 18d32: 9d e0 ldi r25, 0x0D ; 13 18d34: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 18d38: 01 e0 ldi r16, 0x01 ; 1 18d3a: 18 17 cp r17, r24 18d3c: 09 f4 brne .+2 ; 0x18d40 18d3e: 7e cf rjmp .-260 ; 0x18c3c { 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; 18d40: 00 e0 ldi r16, 0x00 ; 0 18d42: 7c cf rjmp .-264 ; 0x18c3c 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)) ) { 18d44: c3 01 movw r24, r6 18d46: b2 01 movw r22, r4 18d48: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 18d4c: 20 91 99 03 lds r18, 0x0399 ; 0x800399 18d50: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 18d54: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 18d58: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 18d5c: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 18d60: 87 fd sbrc r24, 7 18d62: 02 c0 rjmp .+4 ; 0x18d68 18d64: 0c 94 01 ad jmp 0x15a02 ; 0x15a02 if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 18d68: 0f 94 86 3e call 0x27d0c ; 0x27d0c 18d6c: 68 19 sub r22, r8 18d6e: 79 09 sbc r23, r9 18d70: 8a 09 sbc r24, r10 18d72: 9b 09 sbc r25, r11 18d74: 69 3e cpi r22, 0xE9 ; 233 18d76: 73 40 sbci r23, 0x03 ; 3 18d78: 81 05 cpc r24, r1 18d7a: 91 05 cpc r25, r1 18d7c: c8 f0 brcs .+50 ; 0x18db0 { SERIAL_PROTOCOLPGM("P:"); 18d7e: 85 e5 ldi r24, 0x55 ; 85 18d80: 97 e8 ldi r25, 0x87 ; 135 18d82: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18d86: 60 91 99 03 lds r22, 0x0399 ; 0x800399 18d8a: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 18d8e: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 18d92: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 18d96: 41 e0 ldi r20, 0x01 ; 1 18d98: 0f 94 e7 d5 call 0x3abce ; 0x3abce } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 18d9c: 8f e2 ldi r24, 0x2F ; 47 18d9e: 0e 94 42 79 call 0xf284 ; 0xf284 SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 18da2: c8 01 movw r24, r16 18da4: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 codenum = _millis(); 18da8: 0f 94 86 3e call 0x27d0c ; 0x27d0c 18dac: 4b 01 movw r8, r22 18dae: 5c 01 movw r10, r24 } manage_heater(); 18db0: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(); 18db4: 80 e0 ldi r24, 0x00 ; 0 18db6: 0e 94 5a 8c call 0x118b4 ; 0x118b4 lcd_update(0); 18dba: 80 e0 ldi r24, 0x00 ; 0 18dbc: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 18dc0: 0c 94 e8 ac jmp 0x159d0 ; 0x159d0 - `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 18dc4: 8f e3 ldi r24, 0x3F ; 63 18dc6: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18dca: 88 23 and r24, r24 18dcc: c9 f0 breq .+50 ; 0x18e00 SERIAL_PROTOCOLPGM("PINDA cal status: "); 18dce: 82 e4 ldi r24, 0x42 ; 66 18dd0: 97 e8 ldi r25, 0x87 ; 135 18dd2: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 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); } 18dd6: 86 ea ldi r24, 0xA6 ; 166 18dd8: 9f e0 ldi r25, 0x0F ; 15 18dda: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 18dde: 21 e0 ldi r18, 0x01 ; 1 18de0: 30 e0 ldi r19, 0x00 ; 0 18de2: 81 11 cpse r24, r1 18de4: 02 c0 rjmp .+4 ; 0x18dea 18de6: 30 e0 ldi r19, 0x00 ; 0 18de8: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 18dea: c9 01 movw r24, r18 18dec: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 SERIAL_PROTOCOLLNRPGM(_header); 18df0: 8b e2 ldi r24, 0x2B ; 43 18df2: 97 e8 ldi r25, 0x87 ; 135 18df4: 0e 94 86 7b call 0xf70c ; 0xf70c gcode_M861_print_pinda_cal_eeprom(); 18df8: 0e 94 93 79 call 0xf326 ; 0xf326 18dfc: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e } else if (code_seen('!')) { // ! - Set factory default values 18e00: 81 e2 ldi r24, 0x21 ; 33 18e02: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18e06: 88 23 and r24, r24 18e08: 49 f1 breq .+82 ; 0x18e5c 18e0a: 61 e0 ldi r22, 0x01 ; 1 18e0c: 86 ea ldi r24, 0xA6 ; 166 18e0e: 9f e0 ldi r25, 0x0F ; 15 18e10: 0f 94 7f dd call 0x3bafe ; 0x3bafe if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 18e14: 68 e0 ldi r22, 0x08 ; 8 18e16: 70 e0 ldi r23, 0x00 ; 0 18e18: 80 eb ldi r24, 0xB0 ; 176 18e1a: 9f e0 ldi r25, 0x0F ; 15 18e1c: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 18e20: 68 e1 ldi r22, 0x18 ; 24 18e22: 70 e0 ldi r23, 0x00 ; 0 18e24: 82 eb ldi r24, 0xB2 ; 178 18e26: 9f e0 ldi r25, 0x0F ; 15 18e28: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 18e2c: 60 e3 ldi r22, 0x30 ; 48 18e2e: 70 e0 ldi r23, 0x00 ; 0 18e30: 84 eb ldi r24, 0xB4 ; 180 18e32: 9f e0 ldi r25, 0x0F ; 15 18e34: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 18e38: 60 e5 ldi r22, 0x50 ; 80 18e3a: 70 e0 ldi r23, 0x00 ; 0 18e3c: 86 eb ldi r24, 0xB6 ; 182 18e3e: 9f e0 ldi r25, 0x0F ; 15 18e40: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 18e44: 68 e7 ldi r22, 0x78 ; 120 18e46: 70 e0 ldi r23, 0x00 ; 0 18e48: 88 eb ldi r24, 0xB8 ; 184 18e4a: 9f e0 ldi r25, 0x0F ; 15 18e4c: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 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"); 18e50: 8a e1 ldi r24, 0x1A ; 26 18e52: 97 e8 ldi r25, 0x87 ; 135 18e54: 0e 94 86 7b call 0xf70c ; 0xf70c 18e58: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 18e5c: 8a e5 ldi r24, 0x5A ; 90 18e5e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18e62: 88 23 and r24, r24 18e64: c1 f0 breq .+48 ; 0x18e96 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 18e66: 61 e0 ldi r22, 0x01 ; 1 18e68: 86 ea ldi r24, 0xA6 ; 166 18e6a: 9f e0 ldi r25, 0x0F ; 15 18e6c: 0f 94 7f dd call 0x3bafe ; 0x3bafe 18e70: 00 eb ldi r16, 0xB0 ; 176 18e72: 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); 18e74: 70 e0 ldi r23, 0x00 ; 0 18e76: 60 e0 ldi r22, 0x00 ; 0 18e78: c8 01 movw r24, r16 18e7a: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 18e7e: 0e 5f subi r16, 0xFE ; 254 18e80: 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++) { 18e82: 0a 3b cpi r16, 0xBA ; 186 18e84: 4f e0 ldi r20, 0x0F ; 15 18e86: 14 07 cpc r17, r20 18e88: a9 f7 brne .-22 ; 0x18e74 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 18e8a: 80 e1 ldi r24, 0x10 ; 16 18e8c: 97 e8 ldi r25, 0x87 ; 135 18e8e: 0e 94 86 7b call 0xf70c ; 0xf70c 18e92: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 18e96: 83 e5 ldi r24, 0x53 ; 83 18e98: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18e9c: 88 23 and r24, r24 18e9e: 21 f1 breq .+72 ; 0x18ee8 int16_t usteps = code_value_short(); 18ea0: 0e 94 9b 5c call 0xb936 ; 0xb936 18ea4: 8c 01 movw r16, r24 if (code_seen('I')) { 18ea6: 89 e4 ldi r24, 0x49 ; 73 18ea8: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18eac: 88 23 and r24, r24 18eae: 11 f4 brne .+4 ; 0x18eb4 18eb0: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e uint8_t index = code_value_uint8(); 18eb4: 0e 94 8e 5c call 0xb91c ; 0xb91c if (index < 5) { 18eb8: 85 30 cpi r24, 0x05 ; 5 18eba: 10 f0 brcs .+4 ; 0x18ec0 18ebc: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 18ec0: 90 e0 ldi r25, 0x00 ; 0 18ec2: 88 52 subi r24, 0x28 ; 40 18ec4: 98 4f sbci r25, 0xF8 ; 248 18ec6: b8 01 movw r22, r16 18ec8: 88 0f add r24, r24 18eca: 99 1f adc r25, r25 18ecc: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a SERIAL_PROTOCOLLNRPGM(MSG_OK); 18ed0: 8e ea ldi r24, 0xAE ; 174 18ed2: 9e e6 ldi r25, 0x6E ; 110 18ed4: 0e 94 86 7b call 0xf70c ; 0xf70c SERIAL_PROTOCOLLNRPGM(_header); 18ed8: 8b e2 ldi r24, 0x2B ; 43 18eda: 97 e8 ldi r25, 0x87 ; 135 18edc: 0e 94 86 7b call 0xf70c ; 0xf70c gcode_M861_print_pinda_cal_eeprom(); 18ee0: 0e 94 93 79 call 0xf326 ; 0xf326 18ee4: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 18ee8: 8f ef ldi r24, 0xFF ; 255 18eea: 96 e8 ldi r25, 0x86 ; 134 18eec: 0e 94 86 7b call 0xf70c ; 0xf70c 18ef0: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e */ 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); 18ef4: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 18ef8: 20 e0 ldi r18, 0x00 ; 0 18efa: 30 e0 ldi r19, 0x00 ; 0 18efc: 40 e2 ldi r20, 0x20 ; 32 18efe: 51 e4 ldi r21, 0x41 ; 65 18f00: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 18f04: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 18f08: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 18f0a: 63 30 cpi r22, 0x03 ; 3 18f0c: 09 f4 brne .+2 ; 0x18f10 18f0e: a2 c0 rjmp .+324 ; 0x19054 18f10: 98 f5 brcc .+102 ; 0x18f78 18f12: 61 30 cpi r22, 0x01 ; 1 18f14: 09 f4 brne .+2 ; 0x18f18 18f16: 59 c0 rjmp .+178 ; 0x18fca 18f18: 62 30 cpi r22, 0x02 ; 2 18f1a: 11 f0 breq .+4 ; 0x18f20 18f1c: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 18f20: 80 91 98 13 lds r24, 0x1398 ; 0x801398 return pgm_read_word(&_nPrinterMmuType); 18f24: e6 e4 ldi r30, 0x46 ; 70 18f26: f0 e8 ldi r31, 0x80 ; 128 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 18f28: 81 30 cpi r24, 0x01 ; 1 18f2a: 11 f0 breq .+4 ; 0x18f30 return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 18f2c: e8 e4 ldi r30, 0x48 ; 72 18f2e: f0 e8 ldi r31, 0x80 ; 128 18f30: 05 91 lpm r16, Z+ 18f32: 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')) 18f34: 80 e5 ldi r24, 0x50 ; 80 18f36: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18f3a: 88 23 and r24, r24 18f3c: 09 f4 brne .+2 ; 0x18f40 18f3e: 79 c0 rjmp .+242 ; 0x19032 { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 18f40: 0e 94 a8 5c call 0xb950 ; 0xb950 menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 18f44: f0 90 ed 04 lds r15, 0x04ED ; 0x8004ed 18f48: ff 20 and r15, r15 18f4a: 11 f4 brne .+4 ; 0x18f50 18f4c: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e return; if (nPrinterModel == actualPrinterModel) 18f50: 60 17 cp r22, r16 18f52: 71 07 cpc r23, r17 18f54: 11 f4 brne .+4 ; 0x18f5a 18f56: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 18f5a: 8d ef ldi r24, 0xFD ; 253 18f5c: 97 e3 ldi r25, 0x37 ; 55 18f5e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 18f62: 8c 01 movw r16, r24 18f64: 85 ec ldi r24, 0xC5 ; 197 18f66: 97 e3 ldi r25, 0x37 ; 55 18f68: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 18f6c: 4f 2d mov r20, r15 18f6e: b8 01 movw r22, r16 18f70: 0f 94 69 15 call 0x22ad2 ; 0x22ad2 18f74: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 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) 18f78: 64 30 cpi r22, 0x04 ; 4 18f7a: 09 f4 brne .+2 ; 0x18f7e 18f7c: be c0 rjmp .+380 ; 0x190fa 18f7e: 65 30 cpi r22, 0x05 ; 5 18f80: 11 f0 breq .+4 ; 0x18f86 18f82: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 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')) 18f86: 80 e5 ldi r24, 0x50 ; 80 18f88: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18f8c: 88 23 and r24, r24 18f8e: 09 f4 brne .+2 ; 0x18f92 18f90: 3a c1 rjmp .+628 ; 0x19206 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 18f92: 0e 94 a8 5c call 0xb950 ; 0xb950 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 18f96: 10 91 eb 04 lds r17, 0x04EB ; 0x8004eb 18f9a: 11 23 and r17, r17 18f9c: 11 f4 brne .+4 ; 0x18fa2 18f9e: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 18fa2: 62 30 cpi r22, 0x02 ; 2 18fa4: 71 05 cpc r23, r1 18fa6: 10 f4 brcc .+4 ; 0x18fac 18fa8: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 18fac: 89 ee ldi r24, 0xE9 ; 233 18fae: 96 e3 ldi r25, 0x36 ; 54 18fb0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 18fb4: 7c 01 movw r14, r24 18fb6: 88 eb ldi r24, 0xB8 ; 184 18fb8: 96 e3 ldi r25, 0x36 ; 54 18fba: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 18fbe: 41 2f mov r20, r17 18fc0: b7 01 movw r22, r14 18fc2: 0f 94 69 15 call 0x22ad2 ; 0x22ad2 18fc6: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 18fca: 80 e5 ldi r24, 0x50 ; 80 18fcc: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 18fd0: 88 23 and r24, r24 18fd2: a9 f0 breq .+42 ; 0x18ffe { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 18fd4: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 18fd8: 20 e0 ldi r18, 0x00 ; 0 18fda: 30 e0 ldi r19, 0x00 ; 0 18fdc: 4a e7 ldi r20, 0x7A ; 122 18fde: 54 e4 ldi r21, 0x44 ; 68 18fe0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 18fe4: 20 e0 ldi r18, 0x00 ; 0 18fe6: 30 e0 ldi r19, 0x00 ; 0 18fe8: 40 e0 ldi r20, 0x00 ; 0 18fea: 5f e3 ldi r21, 0x3F ; 63 18fec: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 18ff0: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> nozzle_diameter_check(nDiameter); 18ff4: cb 01 movw r24, r22 18ff6: 0f 94 a8 15 call 0x22b50 ; 0x22b50 18ffa: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e } else if(code_seen('Q')) 18ffe: 81 e5 ldi r24, 0x51 ; 81 19000: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 19004: 88 23 and r24, r24 19006: 11 f4 brne .+4 ; 0x1900c 19008: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 1900c: 85 ea ldi r24, 0xA5 ; 165 1900e: 9d e0 ldi r25, 0x0D ; 13 19010: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 19014: bc 01 movw r22, r24 19016: 90 e0 ldi r25, 0x00 ; 0 19018: 80 e0 ldi r24, 0x00 ; 0 1901a: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 1901e: 20 e0 ldi r18, 0x00 ; 0 19020: 30 e0 ldi r19, 0x00 ; 0 19022: 4a e7 ldi r20, 0x7A ; 122 19024: 54 e4 ldi r21, 0x44 ; 68 19026: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1902a: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e 1902e: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 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')) 19032: 81 e5 ldi r24, 0x51 ; 81 19034: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 19038: 88 23 and r24, r24 1903a: 11 f4 brne .+4 ; 0x19040 1903c: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 19040: b8 01 movw r22, r16 19042: 90 e0 ldi r25, 0x00 ; 0 19044: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 19046: 4a e0 ldi r20, 0x0A ; 10 19048: 0f 94 4a d2 call 0x3a494 ; 0x3a494 } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 1904c: 0f 94 5d d6 call 0x3acba ; 0x3acba 19050: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 19054: 80 91 98 13 lds r24, 0x1398 ; 0x801398 return _sPrinterMmuName; 19058: 6d e3 ldi r22, 0x3D ; 61 1905a: e6 2e mov r14, r22 1905c: 60 e8 ldi r22, 0x80 ; 128 1905e: f6 2e mov r15, r22 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 19060: 81 30 cpi r24, 0x01 ; 1 19062: 21 f0 breq .+8 ; 0x1906c return _sPrinterMmuName; } else { return _sPrinterName; 19064: 58 e3 ldi r21, 0x38 ; 56 19066: e5 2e mov r14, r21 19068: 50 e8 ldi r21, 0x80 ; 128 1906a: f5 2e mov r15, r21 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 1906c: 80 e5 ldi r24, 0x50 ; 80 1906e: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 19072: 88 23 and r24, r24 19074: b1 f1 breq .+108 ; 0x190e2 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 19076: 62 e2 ldi r22, 0x22 ; 34 19078: 70 e0 ldi r23, 0x00 ; 0 1907a: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1907e: 90 91 98 03 lds r25, 0x0398 ; 0x800398 19082: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 19086: 8c 01 movw r16, r24 if (!this->ptr) { 19088: 89 2b or r24, r25 1908a: d1 f0 breq .+52 ; 0x190c0 // First quote not found return; } // Skip the leading quote this->ptr++; 1908c: 0f 5f subi r16, 0xFF ; 255 1908e: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 19090: 62 e2 ldi r22, 0x22 ; 34 19092: 70 e0 ldi r23, 0x00 ; 0 19094: c8 01 movw r24, r16 19096: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 if(!pStrEnd) { 1909a: 00 97 sbiw r24, 0x00 ; 0 1909c: 89 f0 breq .+34 ; 0x190c0 // Second quote not found return; } this->len = pStrEnd - this->ptr; 1909e: d8 2e mov r13, r24 190a0: d0 1a sub r13, r16 190a2: c7 01 movw r24, r14 190a4: 0f 94 19 db call 0x3b632 ; 0x3b632 <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 190a8: d8 12 cpse r13, r24 190aa: 0a c0 rjmp .+20 ; 0x190c0 if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 190ac: ac 01 movw r20, r24 190ae: 55 27 eor r21, r21 190b0: b7 01 movw r22, r14 190b2: c8 01 movw r24, r16 190b4: 0f 94 3a db call 0x3b674 ; 0x3b674 190b8: 89 2b or r24, r25 190ba: 11 f4 brne .+4 ; 0x190c0 190bc: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e } } render_M862_warnings( 190c0: f0 90 ed 04 lds r15, 0x04ED ; 0x8004ed 190c4: 8d ef ldi r24, 0xFD ; 253 190c6: 97 e3 ldi r25, 0x37 ; 55 190c8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 190cc: 8c 01 movw r16, r24 190ce: 85 ec ldi r24, 0xC5 ; 197 190d0: 97 e3 ldi r25, 0x37 ; 55 190d2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 190d6: 4f 2d mov r20, r15 190d8: b8 01 movw r22, r16 190da: 0f 94 69 15 call 0x22ad2 ; 0x22ad2 190de: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 190e2: 81 e5 ldi r24, 0x51 ; 81 190e4: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 190e8: 88 23 and r24, r24 190ea: 11 f4 brne .+4 ; 0x190f0 190ec: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e SERIAL_PROTOCOLLNRPGM(type); 190f0: c7 01 movw r24, r14 190f2: 0e 94 86 7b call 0xf70c ; 0xf70c 190f6: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 190fa: 80 e5 ldi r24, 0x50 ; 80 190fc: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 19100: 88 23 and r24, r24 19102: 09 f4 brne .+2 ; 0x19106 19104: 77 c0 rjmp .+238 ; 0x191f4 fw_version_check(++strchr_pointer); 19106: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1910a: 90 91 98 03 lds r25, 0x0398 ; 0x800398 1910e: 01 96 adiw r24, 0x01 ; 1 19110: 90 93 98 03 sts 0x0398, r25 ; 0x800398 19114: 80 93 97 03 sts 0x0397, r24 ; 0x800397 return ((uint8_t)ClCompareValue::_Less); return ((uint8_t)ClCompareValue::_Equal); } void fw_version_check(const char *pVersion) { if (oCheckVersion == ClCheckMode::_None) 19118: 20 91 ec 04 lds r18, 0x04EC ; 0x8004ec 1911c: 22 23 and r18, r18 1911e: 11 f4 brne .+4 ; 0x19124 19120: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 19124: be 01 movw r22, r28 19126: 6f 5f subi r22, 0xFF ; 255 19128: 7f 4f sbci r23, 0xFF ; 255 1912a: 0e 94 7a f8 call 0x1f0f4 ; 0x1f0f4 nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 1912e: 8a e0 ldi r24, 0x0A ; 10 19130: 90 e0 ldi r25, 0x00 ; 0 19132: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 19136: 29 81 ldd r18, Y+1 ; 0x01 19138: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 1913a: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 1913c: 82 17 cp r24, r18 1913e: 93 07 cpc r25, r19 19140: 28 f0 brcs .+10 ; 0x1914c return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 19142: 11 e0 ldi r17, 0x01 ; 1 19144: 28 17 cp r18, r24 19146: 39 07 cpc r19, r25 19148: 08 f4 brcc .+2 ; 0x1914c 1914a: 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; 1914c: 12 95 swap r17 1914e: 11 0f add r17, r17 19150: 11 0f add r17, r17 19152: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 19154: 8c e0 ldi r24, 0x0C ; 12 19156: 90 e0 ldi r25, 0x00 ; 0 19158: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 1915c: ac 01 movw r20, r24 1915e: 2b 81 ldd r18, Y+3 ; 0x03 19160: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 19162: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 19164: 42 17 cp r20, r18 19166: 53 07 cpc r21, r19 19168: 28 f0 brcs .+10 ; 0x19174 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 1916a: 81 e0 ldi r24, 0x01 ; 1 1916c: 24 17 cp r18, r20 1916e: 35 07 cpc r19, r21 19170: 08 f4 brcc .+2 ; 0x19174 19172: 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; 19174: 50 e1 ldi r21, 0x10 ; 16 19176: 85 9f mul r24, r21 19178: c0 01 movw r24, r0 1917a: 11 24 eor r1, r1 1917c: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 1917e: 8e e0 ldi r24, 0x0E ; 14 19180: 90 e0 ldi r25, 0x00 ; 0 19182: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 19186: ac 01 movw r20, r24 19188: 2d 81 ldd r18, Y+5 ; 0x05 1918a: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 1918c: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 1918e: 42 17 cp r20, r18 19190: 53 07 cpc r21, r19 19192: 28 f0 brcs .+10 ; 0x1919e return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 19194: 81 e0 ldi r24, 0x01 ; 1 19196: 24 17 cp r18, r20 19198: 35 07 cpc r19, r21 1919a: 08 f4 brcc .+2 ; 0x1919e 1919c: 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; 1919e: a4 e0 ldi r26, 0x04 ; 4 191a0: 8a 9f mul r24, r26 191a2: c0 01 movw r24, r0 191a4: 11 24 eor r1, r1 191a6: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 191a8: 80 e1 ldi r24, 0x10 ; 16 191aa: 90 e0 ldi r25, 0x00 ; 0 191ac: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 191b0: ac 01 movw r20, r24 191b2: 2f 81 ldd r18, Y+7 ; 0x07 191b4: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 191b6: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 191b8: 42 17 cp r20, r18 191ba: 53 07 cpc r21, r19 191bc: 28 f0 brcs .+10 ; 0x191c8 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 191be: 91 e0 ldi r25, 0x01 ; 1 191c0: 24 17 cp r18, r20 191c2: 35 07 cpc r19, r21 191c4: 08 f4 brcc .+2 ; 0x191c8 191c6: 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)); 191c8: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 191ca: 16 35 cpi r17, 0x56 ; 86 191cc: 10 f4 brcc .+4 ; 0x191d2 191ce: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 191d2: f0 90 ec 04 lds r15, 0x04EC ; 0x8004ec 191d6: 82 e7 ldi r24, 0x72 ; 114 191d8: 97 e3 ldi r25, 0x37 ; 55 191da: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 191de: 8c 01 movw r16, r24 191e0: 82 e4 ldi r24, 0x42 ; 66 191e2: 97 e3 ldi r25, 0x37 ; 55 191e4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 191e8: 4f 2d mov r20, r15 191ea: b8 01 movw r22, r16 191ec: 0f 94 69 15 call 0x22ad2 ; 0x22ad2 191f0: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e else if(code_seen('Q')) 191f4: 81 e5 ldi r24, 0x51 ; 81 191f6: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 191fa: 88 23 and r24, r24 191fc: 11 f4 brne .+4 ; 0x19202 191fe: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 19202: 0c 94 8f a9 jmp 0x1531e ; 0x1531e { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 19206: 81 e5 ldi r24, 0x51 ; 81 19208: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1920c: 88 23 and r24, r24 1920e: 11 f4 brne .+4 ; 0x19214 19210: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e SERIAL_PROTOCOLLN(GCODE_LEVEL); 19214: 81 e0 ldi r24, 0x01 ; 1 19216: 90 e0 ldi r25, 0x00 ; 0 19218: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 1921c: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e * 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; 19220: 8b e4 ldi r24, 0x4B ; 75 19222: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 19226: c1 2c mov r12, r1 19228: d1 2c mov r13, r1 1922a: e1 2c mov r14, r1 1922c: 40 ec ldi r20, 0xC0 ; 192 1922e: f4 2e mov r15, r20 19230: 88 23 and r24, r24 19232: 49 f1 breq .+82 ; 0x19286 19234: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 19238: 6b 01 movw r12, r22 1923a: 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) 1923c: 20 e0 ldi r18, 0x00 ; 0 1923e: 30 e0 ldi r19, 0x00 ; 0 19240: a9 01 movw r20, r18 19242: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 19246: 81 11 cpse r24, r1 19248: 1e c0 rjmp .+60 ; 0x19286 { extruder_advance_K = 0; 1924a: 10 92 07 18 sts 0x1807, r1 ; 0x801807 1924e: 10 92 08 18 sts 0x1808, r1 ; 0x801808 19252: 10 92 09 18 sts 0x1809, r1 ; 0x801809 19256: 10 92 0a 18 sts 0x180A, r1 ; 0x80180a 1925a: 0e 94 c2 83 call 0x10784 ; 0x10784 else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 1925e: 82 ef ldi r24, 0xF2 ; 242 19260: 9a ea ldi r25, 0xAA ; 170 19262: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOPGM("Advance K="); 19266: 85 e1 ldi r24, 0x15 ; 21 19268: 90 e8 ldi r25, 0x80 ; 128 1926a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN(extruder_advance_K); 1926e: 60 91 07 18 lds r22, 0x1807 ; 0x801807 19272: 70 91 08 18 lds r23, 0x1808 ; 0x801808 19276: 80 91 09 18 lds r24, 0x1809 ; 0x801809 1927a: 90 91 0a 18 lds r25, 0x180A ; 0x80180a 1927e: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e 19282: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 19286: 80 91 72 03 lds r24, 0x0372 ; 0x800372 1928a: 81 11 cpse r24, r1 1928c: 1b c0 rjmp .+54 ; 0x192c4 { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 1928e: 20 e0 ldi r18, 0x00 ; 0 19290: 30 e0 ldi r19, 0x00 ; 0 19292: a9 01 movw r20, r18 19294: c7 01 movw r24, r14 19296: b6 01 movw r22, r12 19298: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1929c: 87 ff sbrs r24, 7 1929e: 05 c0 rjmp .+10 ; 0x192aa } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 192a0: 80 e2 ldi r24, 0x20 ; 32 192a2: 90 e8 ldi r25, 0x80 ; 128 192a4: 0e 94 86 7b call 0xf70c ; 0xf70c 192a8: da cf rjmp .-76 ; 0x1925e return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 192aa: 20 e0 ldi r18, 0x00 ; 0 192ac: 30 e0 ldi r19, 0x00 ; 0 192ae: 40 e2 ldi r20, 0x20 ; 32 192b0: 51 e4 ldi r21, 0x41 ; 65 192b2: c7 01 movw r24, r14 192b4: b6 01 movw r22, r12 192b6: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 192ba: 87 ff sbrs r24, 7 192bc: 2c c0 rjmp .+88 ; 0x19316 192be: 81 e0 ldi r24, 0x01 ; 1 192c0: 0e 94 c2 83 call 0x10784 ; 0x10784 } if(la10c_mode == LA10C_LA15) 192c4: 80 91 72 03 lds r24, 0x0372 ; 0x800372 return (k >= 0 && k < LA_K_MAX? k: -1); 192c8: 20 e0 ldi r18, 0x00 ; 0 192ca: 30 e0 ldi r19, 0x00 ; 0 192cc: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 192ce: 81 30 cpi r24, 0x01 ; 1 192d0: 21 f5 brne .+72 ; 0x1931a return (k >= 0 && k < LA_K_MAX? k: -1); 192d2: c7 01 movw r24, r14 192d4: b6 01 movw r22, r12 192d6: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 192da: 87 fd sbrc r24, 7 192dc: e1 cf rjmp .-62 ; 0x192a0 192de: 20 e0 ldi r18, 0x00 ; 0 192e0: 30 e0 ldi r19, 0x00 ; 0 192e2: 40 e2 ldi r20, 0x20 ; 32 192e4: 51 e4 ldi r21, 0x41 ; 65 192e6: c7 01 movw r24, r14 192e8: b6 01 movw r22, r12 192ea: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 192ee: 87 ff sbrs r24, 7 192f0: d7 cf rjmp .-82 ; 0x192a0 la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 192f2: 20 e0 ldi r18, 0x00 ; 0 192f4: 30 e0 ldi r19, 0x00 ; 0 192f6: a9 01 movw r20, r18 192f8: c7 01 movw r24, r14 192fa: b6 01 movw r22, r12 192fc: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 19300: 87 fd sbrc r24, 7 19302: ce cf rjmp .-100 ; 0x192a0 SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 19304: c0 92 07 18 sts 0x1807, r12 ; 0x801807 19308: d0 92 08 18 sts 0x1808, r13 ; 0x801808 1930c: e0 92 09 18 sts 0x1809, r14 ; 0x801809 19310: f0 92 0a 18 sts 0x180A, r15 ; 0x80180a 19314: a4 cf rjmp .-184 ; 0x1925e if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 19316: 82 e0 ldi r24, 0x02 ; 2 19318: d3 cf rjmp .-90 ; 0x192c0 } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 1931a: c7 01 movw r24, r14 1931c: b6 01 movw r22, r12 1931e: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 19322: 87 fd sbrc r24, 7 19324: bd cf rjmp .-134 ; 0x192a0 // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 19326: 2f e6 ldi r18, 0x6F ; 111 19328: 32 e1 ldi r19, 0x12 ; 18 1932a: 43 e0 ldi r20, 0x03 ; 3 1932c: 5b e3 ldi r21, 0x3B ; 59 1932e: c7 01 movw r24, r14 19330: b6 01 movw r22, r12 19332: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 19336: 2a e0 ldi r18, 0x0A ; 10 19338: 37 ed ldi r19, 0xD7 ; 215 1933a: 43 e2 ldi r20, 0x23 ; 35 1933c: 5c e3 ldi r21, 0x3C ; 60 1933e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 19342: 6b 01 movw r12, r22 19344: 7c 01 movw r14, r24 return new_K < 0? 0: 19346: 20 e0 ldi r18, 0x00 ; 0 19348: 30 e0 ldi r19, 0x00 ; 0 1934a: a9 01 movw r20, r18 1934c: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 19350: 87 fd sbrc r24, 7 19352: 11 c0 rjmp .+34 ; 0x19376 new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 19354: 20 e0 ldi r18, 0x00 ; 0 19356: 30 e0 ldi r19, 0x00 ; 0 19358: 40 e2 ldi r20, 0x20 ; 32 1935a: 51 e4 ldi r21, 0x41 ; 65 1935c: c7 01 movw r24, r14 1935e: b6 01 movw r22, r12 19360: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 19364: 18 16 cp r1, r24 19366: 2c f6 brge .-118 ; 0x192f2 19368: c1 2c mov r12, r1 1936a: d1 2c mov r13, r1 1936c: 30 e2 ldi r19, 0x20 ; 32 1936e: e3 2e mov r14, r19 19370: 31 e4 ldi r19, 0x41 ; 65 19372: f3 2e mov r15, r19 19374: c7 cf rjmp .-114 ; 0x19304 // 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: 19376: c1 2c mov r12, r1 19378: d1 2c mov r13, r1 1937a: 76 01 movw r14, r12 1937c: c3 cf rjmp .-122 ; 0x19304 1937e: 9d ed ldi r25, 0xDD ; 221 19380: 89 2e mov r8, r25 19382: 92 e0 ldi r25, 0x02 ; 2 19384: 99 2e mov r9, r25 19386: 0d e5 ldi r16, 0x5D ; 93 19388: 12 e0 ldi r17, 0x02 ; 2 1938a: 28 ef ldi r18, 0xF8 ; 248 1938c: a2 2e mov r10, r18 1938e: 24 e0 ldi r18, 0x04 ; 4 19390: 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++){ 19392: 71 2c mov r7, r1 if(code_seen(axis_codes[i])){ 19394: f4 01 movw r30, r8 19396: 81 91 ld r24, Z+ 19398: 4f 01 movw r8, r30 1939a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1939e: 88 23 and r24, r24 193a0: 09 f4 brne .+2 ; 0x193a4 193a2: 45 c0 rjmp .+138 ; 0x1942e if( i == E_AXIS && FarmOrUserECool() ){ 193a4: f3 e0 ldi r31, 0x03 ; 3 193a6: 7f 12 cpse r7, r31 193a8: 04 c0 rjmp .+8 ; 0x193b2 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(); 193aa: 0e 94 f8 f8 call 0x1f1f0 ; 0x1f1f0 193ae: 81 11 cpse r24, r1 193b0: 61 c0 rjmp .+194 ; 0x19474 SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); SERIAL_ECHOLNPGM(", M907 E ignored"); continue; } float cur_mA = code_value(); 193b2: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 193b6: 6b 01 movw r12, r22 193b8: 7c 01 movw r14, r24 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 193ba: 20 e0 ldi r18, 0x00 ; 0 193bc: 30 e0 ldi r19, 0x00 ; 0 193be: a9 01 movw r20, r18 193c0: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 193c4: 87 fd sbrc r24, 7 193c6: 46 c0 rjmp .+140 ; 0x19454 if (cur > 1029) cur = 1029; //limit max 193c8: 20 e0 ldi r18, 0x00 ; 0 193ca: 30 ea ldi r19, 0xA0 ; 160 193cc: 40 e8 ldi r20, 0x80 ; 128 193ce: 54 e4 ldi r21, 0x44 ; 68 193d0: c7 01 movw r24, r14 193d2: b6 01 movw r22, r12 193d4: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 193d8: 18 16 cp r1, r24 193da: a4 f1 brlt .+104 ; 0x19444 //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; 193dc: 20 e0 ldi r18, 0x00 ; 0 193de: 30 e0 ldi r19, 0x00 ; 0 193e0: 47 e0 ldi r20, 0x07 ; 7 193e2: 54 e4 ldi r21, 0x44 ; 68 193e4: c7 01 movw r24, r14 193e6: b6 01 movw r22, r12 193e8: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 193ec: 87 fd sbrc r24, 7 193ee: 35 c0 rjmp .+106 ; 0x1945a 193f0: 20 e0 ldi r18, 0x00 ; 0 193f2: 30 e0 ldi r19, 0x00 ; 0 193f4: 4c e7 ldi r20, 0x7C ; 124 193f6: 52 e4 ldi r21, 0x42 ; 66 193f8: c7 01 movw r24, r14 193fa: b6 01 movw r22, r12 193fc: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 19400: 20 e0 ldi r18, 0x00 ; 0 19402: 30 ea ldi r19, 0xA0 ; 160 19404: 40 e8 ldi r20, 0x80 ; 128 19406: 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); 19408: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1940c: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 19410: f6 2e mov r15, r22 uint8_t val = tmc2130_cur2val(cur_mA); currents[i].setiHold(val); 19412: c8 01 movw r24, r16 19414: 0e 94 33 69 call 0xd266 ; 0xd266 currents[i].setiRun(val); 19418: 6f 2d mov r22, r15 1941a: c8 01 movw r24, r16 1941c: 0e 94 3b 69 call 0xd276 ; 0xd276 tmc2130_setup_chopper(i, tmc2130_mres[i]); 19420: 50 e0 ldi r21, 0x00 ; 0 19422: 40 e0 ldi r20, 0x00 ; 0 19424: d5 01 movw r26, r10 19426: 6c 91 ld r22, X 19428: 87 2d mov r24, r7 1942a: 0f 94 45 39 call 0x2728a ; 0x2728a */ case 907: { #ifdef TMC2130 // See tmc2130_cur2val() for translation to 0 .. 63 range for (uint_least8_t i = 0; i < NUM_AXIS; i++){ 1942e: 73 94 inc r7 19430: 0d 5f subi r16, 0xFD ; 253 19432: 1f 4f sbci r17, 0xFF ; 255 19434: bf ef ldi r27, 0xFF ; 255 19436: ab 1a sub r10, r27 19438: bb 0a sbc r11, r27 1943a: e4 e0 ldi r30, 0x04 ; 4 1943c: 7e 12 cpse r7, r30 1943e: aa cf rjmp .-172 ; 0x19394 19440: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min if (cur > 1029) cur = 1029; //limit max 19444: c1 2c mov r12, r1 19446: 80 ea ldi r24, 0xA0 ; 160 19448: d8 2e mov r13, r24 1944a: 80 e8 ldi r24, 0x80 ; 128 1944c: e8 2e mov r14, r24 1944e: 84 e4 ldi r24, 0x44 ; 68 19450: f8 2e mov r15, r24 19452: ce cf rjmp .-100 ; 0x193f0 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 19454: c1 2c mov r12, r1 19456: d1 2c mov r13, r1 19458: 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); 1945a: 20 e0 ldi r18, 0x00 ; 0 1945c: 30 e0 ldi r19, 0x00 ; 0 1945e: 4c e7 ldi r20, 0x7C ; 124 19460: 52 e4 ldi r21, 0x42 ; 66 19462: c7 01 movw r24, r14 19464: b6 01 movw r22, r12 19466: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1946a: 20 e0 ldi r18, 0x00 ; 0 1946c: 34 eb ldi r19, 0xB4 ; 180 1946e: 40 e9 ldi r20, 0x90 ; 144 19470: 54 e4 ldi r21, 0x44 ; 68 19472: ca cf rjmp .-108 ; 0x19408 if(code_seen(axis_codes[i])){ if( i == E_AXIS && FarmOrUserECool() ){ SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); 19474: 80 eb ldi r24, 0xB0 ; 176 19476: 90 ea ldi r25, 0xA0 ; 160 19478: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNPGM(", M907 E ignored"); 1947c: 8e ee ldi r24, 0xEE ; 238 1947e: 96 e8 ldi r25, 0x86 ; 134 19480: 0e 94 86 7b call 0xf70c ; 0xf70c 19484: d4 cf rjmp .-88 ; 0x1942e 19486: 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; } 1948a: 80 91 66 02 lds r24, 0x0266 ; 0x800266 1948e: 81 11 cpse r24, r1 19490: 01 c0 rjmp .+2 ; 0x19494 19492: 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"), 19494: 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() 19496: 86 e6 ldi r24, 0x66 ; 102 19498: 92 e0 ldi r25, 0x02 ; 2 1949a: 0f 94 50 3c call 0x278a0 ; 0x278a0 1949e: 88 2e mov r8, r24 194a0: c0 90 64 02 lds r12, 0x0264 ; 0x800264 194a4: 80 91 63 02 lds r24, 0x0263 ; 0x800263 194a8: 81 11 cpse r24, r1 194aa: 01 c0 rjmp .+2 ; 0x194ae 194ac: 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"), 194ae: d1 2c mov r13, r1 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), currents[2].getOriginaliHold(), currents[2].getOriginaliRun(), 194b0: 83 e6 ldi r24, 0x63 ; 99 194b2: 92 e0 ldi r25, 0x02 ; 2 194b4: 0f 94 50 3c call 0x278a0 ; 0x278a0 194b8: 98 2e mov r9, r24 194ba: 00 91 61 02 lds r16, 0x0261 ; 0x800261 194be: 80 91 60 02 lds r24, 0x0260 ; 0x800260 194c2: 81 11 cpse r24, r1 194c4: 01 c0 rjmp .+2 ; 0x194c8 194c6: 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"), 194c8: 10 e0 ldi r17, 0x00 ; 0 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), 194ca: 80 e6 ldi r24, 0x60 ; 96 194cc: 92 e0 ldi r25, 0x02 ; 2 194ce: 0f 94 50 3c call 0x278a0 ; 0x278a0 194d2: e8 2e mov r14, r24 194d4: f0 90 5e 02 lds r15, 0x025E ; 0x80025e 194d8: 80 91 5d 02 lds r24, 0x025D ; 0x80025d 194dc: 81 11 cpse r24, r1 194de: 01 c0 rjmp .+2 ; 0x194e2 194e0: 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(), 194e2: 8d e5 ldi r24, 0x5D ; 93 194e4: 92 e0 ldi r25, 0x02 ; 2 194e6: 0f 94 50 3c call 0x278a0 ; 0x278a0 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"), 194ea: bf 92 push r11 194ec: af 92 push r10 194ee: 1f 92 push r1 194f0: 8f 92 push r8 194f2: df 92 push r13 194f4: cf 92 push r12 194f6: 1f 92 push r1 194f8: 9f 92 push r9 194fa: 1f 93 push r17 194fc: 0f 93 push r16 194fe: 1f 92 push r1 19500: ef 92 push r14 19502: 1f 92 push r1 19504: ff 92 push r15 19506: 1f 92 push r1 19508: 8f 93 push r24 1950a: 86 ed ldi r24, 0xD6 ; 214 1950c: 98 e6 ldi r25, 0x68 ; 104 1950e: 9f 93 push r25 19510: 8f 93 push r24 19512: 0f 94 1d dc call 0x3b83a ; 0x3b83a 19516: 0f b6 in r0, 0x3f ; 63 19518: f8 94 cli 1951a: de bf out 0x3e, r29 ; 62 1951c: 0f be out 0x3f, r0 ; 63 1951e: cd bf out 0x3d, r28 ; 61 19520: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e - `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; 19524: 11 e0 ldi r17, 0x01 ; 1 19526: 82 39 cpi r24, 0x92 ; 146 19528: 93 40 sbci r25, 0x03 ; 3 1952a: 09 f4 brne .+2 ; 0x1952e 1952c: 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')) 1952e: 82 e5 ldi r24, 0x52 ; 82 19530: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 19534: 88 23 and r24, r24 19536: 81 f0 breq .+32 ; 0x19558 { newMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 19538: 8f ef ldi r24, 0xFF ; 255 1953a: 9f e0 ldi r25, 0x0F ; 15 1953c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 19540: 18 2f mov r17, r24 tmc2130_mode == TMC2130_MODE_NORMAL ? _O(MSG_NORMAL) : _O(MSG_SILENT) ); } if (tmc2130_mode != newMode 19542: 80 91 6c 06 lds r24, 0x066C ; 0x80066c 19546: 81 17 cp r24, r17 19548: 11 f4 brne .+4 ; 0x1954e 1954a: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e ) { #ifdef PSU_Delta enable_force_z(); #endif change_power_mode_live(newMode); 1954e: 81 2f mov r24, r17 19550: 0e 94 be 61 call 0xc37c ; 0xc37c 19554: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e //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')) 19558: 80 e5 ldi r24, 0x50 ; 80 1955a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1955e: 88 23 and r24, r24 19560: 89 f0 breq .+34 ; 0x19584 { uint8_t newMenuMode = (mcode_in_progress==914) ? SILENT_MODE_NORMAL : SILENT_MODE_STEALTH; 19562: 01 e0 ldi r16, 0x01 ; 1 19564: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b <_ZL17mcode_in_progress.lto_priv.549> 19568: 90 91 5c 0e lds r25, 0x0E5C ; 0x800e5c <_ZL17mcode_in_progress.lto_priv.549+0x1> 1956c: 82 39 cpi r24, 0x92 ; 146 1956e: 93 40 sbci r25, 0x03 ; 3 19570: 09 f4 brne .+2 ; 0x19574 19572: 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); 19574: 60 2f mov r22, r16 19576: 8f ef ldi r24, 0xFF ; 255 19578: 9f e0 ldi r25, 0x0F ; 15 1957a: 0f 94 7f dd call 0x3bafe ; 0x3bafe eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, newMenuMode); SilentModeMenu = newMenuMode; 1957e: 00 93 a4 03 sts 0x03A4, r16 ; 0x8003a4 19582: df cf rjmp .-66 ; 0x19542 //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')) 19584: 81 e5 ldi r24, 0x51 ; 81 19586: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1958a: 88 23 and r24, r24 1958c: d1 f2 breq .-76 ; 0x19542 { printf_P(PSTR("%S: %S\n"), _O(MSG_MODE), 1958e: 80 91 6c 06 lds r24, 0x066C ; 0x80066c 19592: 81 11 cpse r24, r1 19594: 15 c0 rjmp .+42 ; 0x195c0 19596: 80 e4 ldi r24, 0x40 ; 64 19598: 98 e5 ldi r25, 0x58 ; 88 1959a: 9f 93 push r25 1959c: 8f 93 push r24 1959e: 8f e7 ldi r24, 0x7F ; 127 195a0: 9d e3 ldi r25, 0x3D ; 61 195a2: 9f 93 push r25 195a4: 8f 93 push r24 195a6: 86 ee ldi r24, 0xE6 ; 230 195a8: 96 e8 ldi r25, 0x86 ; 134 195aa: 9f 93 push r25 195ac: 8f 93 push r24 195ae: 0f 94 1d dc call 0x3b83a ; 0x3b83a 195b2: 0f 90 pop r0 195b4: 0f 90 pop r0 195b6: 0f 90 pop r0 195b8: 0f 90 pop r0 195ba: 0f 90 pop r0 195bc: 0f 90 pop r0 195be: c1 cf rjmp .-126 ; 0x19542 195c0: 8c ef ldi r24, 0xFC ; 252 195c2: 9c e3 ldi r25, 0x3C ; 60 195c4: ea cf rjmp .-44 ; 0x1959a 195c6: 8d ed ldi r24, 0xDD ; 221 195c8: 92 e0 ldi r25, 0x02 ; 2 195ca: 6c 96 adiw r28, 0x1c ; 28 195cc: 9f af std Y+63, r25 ; 0x3f 195ce: 8e af std Y+62, r24 ; 0x3e 195d0: 6c 97 sbiw r28, 0x1c ; 28 195d2: ee e6 ldi r30, 0x6E ; 110 195d4: ee 2e mov r14, r30 195d6: e6 e0 ldi r30, 0x06 ; 6 195d8: fe 2e mov r15, r30 195da: f4 e5 ldi r31, 0x54 ; 84 195dc: cf 2e mov r12, r31 195de: f7 e0 ldi r31, 0x07 ; 7 195e0: df 2e mov r13, r31 195e2: a8 ef ldi r26, 0xF8 ; 248 195e4: 2a 2e mov r2, r26 195e6: a4 e0 ldi r26, 0x04 ; 4 195e8: 3a 2e mov r3, r26 195ea: ba e2 ldi r27, 0x2A ; 42 195ec: 8b 2e mov r8, r27 195ee: b7 e0 ldi r27, 0x07 ; 7 195f0: 9b 2e mov r9, r27 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 1960e: b8 2e mov r11, r24 19610: 88 23 and r24, r24 19612: 09 f4 brne .+2 ; 0x19616 19614: 75 c0 rjmp .+234 ; 0x19700 { uint16_t res_new = code_value(); 19616: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 1961a: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 1961e: 2b 01 movw r4, r22 19620: 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 19622: 68 30 cpi r22, 0x08 ; 8 19624: 71 05 cpc r23, r1 19626: 09 f4 brne .+2 ; 0x1962a 19628: 59 c3 rjmp .+1714 ; 0x19cdc 1962a: 60 31 cpi r22, 0x10 ; 16 1962c: 71 05 cpc r23, r1 1962e: 09 f4 brne .+2 ; 0x19632 19630: 55 c3 rjmp .+1706 ; 0x19cdc 19632: 81 e0 ldi r24, 0x01 ; 1 19634: 00 32 cpi r16, 0x20 ; 32 19636: 11 05 cpc r17, r1 19638: 09 f0 breq .+2 ; 0x1963c 1963a: 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 1963c: 67 96 adiw r28, 0x17 ; 23 1963e: bf ad ldd r27, Y+63 ; 0x3f 19640: 67 97 sbiw r28, 0x17 ; 23 19642: b3 30 cpi r27, 0x03 ; 3 19644: 09 f4 brne .+2 ; 0x19648 19646: 55 c3 rjmp .+1706 ; 0x19cf2 19648: 92 01 movw r18, r4 1964a: 21 50 subi r18, 0x01 ; 1 1964c: 31 09 sbc r19, r1 1964e: 22 30 cpi r18, 0x02 ; 2 19650: 31 05 cpc r19, r1 19652: 08 f0 brcs .+2 ; 0x19656 19654: 49 c3 rjmp .+1682 ; 0x19ce8 19656: 9b 2d mov r25, r11 19658: 89 2b or r24, r25 res_valid |= (i == E_AXIS) && ((res_new == 64) || (res_new == 128)); // resolutions valid for E only 1965a: 67 96 adiw r28, 0x17 ; 23 1965c: ef ad ldd r30, Y+63 ; 0x3f 1965e: 67 97 sbiw r28, 0x17 ; 23 19660: e3 30 cpi r30, 0x03 ; 3 19662: 41 f4 brne .+16 ; 0x19674 19664: 00 34 cpi r16, 0x40 ; 64 19666: 11 05 cpc r17, r1 19668: 31 f0 breq .+12 ; 0x19676 1966a: bb 24 eor r11, r11 1966c: b3 94 inc r11 1966e: 00 38 cpi r16, 0x80 ; 128 19670: 11 05 cpc r17, r1 19672: 09 f0 breq .+2 ; 0x19676 19674: b1 2c mov r11, r1 #endif if (res_valid) 19676: 81 11 cpse r24, r1 19678: 03 c0 rjmp .+6 ; 0x19680 1967a: bb 20 and r11, r11 1967c: 09 f4 brne .+2 ; 0x19680 1967e: 40 c0 rjmp .+128 ; 0x19700 { st_synchronize(); 19680: 0f 94 27 58 call 0x2b04e ; 0x2b04e return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 19684: d1 01 movw r26, r2 19686: 8c 91 ld r24, X 19688: a1 2c mov r10, r1 1968a: bb 24 eor r11, r11 1968c: b3 94 inc r11 1968e: 02 c0 rjmp .+4 ; 0x19694 19690: b6 94 lsr r11 19692: a7 94 ror r10 19694: 8a 95 dec r24 19696: e2 f7 brpl .-8 ; 0x19690 uint16_t res = tmc2130_get_res(i); tmc2130_set_res(i, res_new); 19698: b2 01 movw r22, r4 1969a: 67 96 adiw r28, 0x17 ; 23 1969c: 8f ad ldd r24, Y+63 ; 0x3f 1969e: 67 97 sbiw r28, 0x17 ; 23 196a0: 0f 94 b0 39 call 0x27360 ; 0x27360 cs.axis_ustep_resolution[i] = res_new; 196a4: f4 01 movw r30, r8 196a6: 40 82 st Z, r4 if (res_new > res) 196a8: a0 16 cp r10, r16 196aa: b1 06 cpc r11, r17 196ac: 08 f0 brcs .+2 ; 0x196b0 196ae: 40 c0 rjmp .+128 ; 0x19730 { uint16_t fac = (res_new / res); 196b0: c8 01 movw r24, r16 196b2: b5 01 movw r22, r10 196b4: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> cs.axis_steps_per_mm[i] *= fac; 196b8: 2b 01 movw r4, r22 196ba: 71 2c mov r7, r1 196bc: 61 2c mov r6, r1 196be: c3 01 movw r24, r6 196c0: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 196c4: 9b 01 movw r18, r22 196c6: ac 01 movw r20, r24 196c8: d7 01 movw r26, r14 196ca: 14 96 adiw r26, 0x04 ; 4 196cc: 6d 91 ld r22, X+ 196ce: 7d 91 ld r23, X+ 196d0: 8d 91 ld r24, X+ 196d2: 9c 91 ld r25, X 196d4: 17 97 sbiw r26, 0x07 ; 7 196d6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 196da: f7 01 movw r30, r14 196dc: 64 83 std Z+4, r22 ; 0x04 196de: 75 83 std Z+5, r23 ; 0x05 196e0: 86 83 std Z+6, r24 ; 0x06 196e2: 97 83 std Z+7, r25 ; 0x07 position[i] *= fac; 196e4: d6 01 movw r26, r12 196e6: 2d 91 ld r18, X+ 196e8: 3d 91 ld r19, X+ 196ea: 4d 91 ld r20, X+ 196ec: 5c 91 ld r21, X 196ee: c3 01 movw r24, r6 196f0: b2 01 movw r22, r4 196f2: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__mulsi3> 196f6: f6 01 movw r30, r12 196f8: 60 83 st Z, r22 196fa: 71 83 std Z+1, r23 ; 0x01 196fc: 82 83 std Z+2, r24 ; 0x02 196fe: 93 83 std Z+3, r25 ; 0x03 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 1972a: 66 cf rjmp .-308 ; 0x195f8 1972c: 0c 94 9b b2 jmp 0x16536 ; 0x16536 cs.axis_steps_per_mm[i] *= fac; position[i] *= fac; } else { uint16_t fac = (res / res_new); 19730: c5 01 movw r24, r10 19732: b8 01 movw r22, r16 19734: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> cs.axis_steps_per_mm[i] /= fac; 19738: 2b 01 movw r4, r22 1973a: 71 2c mov r7, r1 1973c: 61 2c mov r6, r1 1973e: c3 01 movw r24, r6 19740: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 19744: 9b 01 movw r18, r22 19746: ac 01 movw r20, r24 19748: d7 01 movw r26, r14 1974a: 14 96 adiw r26, 0x04 ; 4 1974c: 6d 91 ld r22, X+ 1974e: 7d 91 ld r23, X+ 19750: 8d 91 ld r24, X+ 19752: 9c 91 ld r25, X 19754: 17 97 sbiw r26, 0x07 ; 7 19756: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1975a: f7 01 movw r30, r14 1975c: 64 83 std Z+4, r22 ; 0x04 1975e: 75 83 std Z+5, r23 ; 0x05 19760: 86 83 std Z+6, r24 ; 0x06 19762: 97 83 std Z+7, r25 ; 0x07 position[i] /= fac; 19764: d6 01 movw r26, r12 19766: 6d 91 ld r22, X+ 19768: 7d 91 ld r23, X+ 1976a: 8d 91 ld r24, X+ 1976c: 9c 91 ld r25, X 1976e: a3 01 movw r20, r6 19770: 92 01 movw r18, r4 19772: 0f 94 4c de call 0x3bc98 ; 0x3bc98 <__divmodsi4> 19776: f6 01 movw r30, r12 19778: 20 83 st Z, r18 1977a: 31 83 std Z+1, r19 ; 0x01 1977c: 42 83 std Z+2, r20 ; 0x02 1977e: 53 83 std Z+3, r21 ; 0x03 19780: bf cf rjmp .-130 ; 0x19700 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') ) { 19782: 80 e5 ldi r24, 0x50 ; 80 19784: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 19788: 88 23 and r24, r24 1978a: 29 f0 breq .+10 ; 0x19796 mmuSlotIndex = code_value_uint8(); 1978c: 0e 94 8e 5c call 0xb91c ; 0xb91c 19790: 18 2f mov r17, r24 19792: 0c 94 19 ac jmp 0x15832 ; 0x15832 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') ) { 19796: 84 e5 ldi r24, 0x54 ; 84 19798: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1979c: 81 11 cpse r24, r1 1979e: f6 cf rjmp .-20 ; 0x1978c 197a0: 0c 94 18 ac jmp 0x15830 ; 0x15830 */ case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; 197a4: 60 e0 ldi r22, 0x00 ; 0 197a6: 70 e0 ldi r23, 0x00 ; 0 197a8: cb 01 movw r24, r22 197aa: 0c 94 32 ac jmp 0x15864 ; 0x15864 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; 197ae: 82 e0 ldi r24, 0x02 ; 2 197b0: 80 93 75 07 sts 0x0775, r24 ; 0x800775 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 197b4: 88 e3 ldi r24, 0x38 ; 56 197b6: 9d e5 ldi r25, 0x5D ; 93 197b8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 197bc: 0f 94 0c 0b call 0x21618 ; 0x21618 current_position[E_AXIS] += fastLoadLength; 197c0: a7 01 movw r20, r14 197c2: 96 01 movw r18, r12 197c4: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 197c8: 70 91 50 07 lds r23, 0x0750 ; 0x800750 197cc: 80 91 51 07 lds r24, 0x0751 ; 0x800751 197d0: 90 91 52 07 lds r25, 0x0752 ; 0x800752 197d4: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 197d8: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 197dc: 70 93 50 07 sts 0x0750, r23 ; 0x800750 197e0: 80 93 51 07 sts 0x0751, r24 ; 0x800751 197e4: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 197e8: 60 e0 ldi r22, 0x00 ; 0 197ea: 70 e0 ldi r23, 0x00 ; 0 197ec: 80 ea ldi r24, 0xA0 ; 160 197ee: 91 e4 ldi r25, 0x41 ; 65 197f0: 0f 94 5d ba call 0x374ba ; 0x374ba if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 197f4: 01 11 cpse r16, r1 197f6: 06 c0 rjmp .+12 ; 0x19804 raise_z_above(MIN_Z_FOR_LOAD); 197f8: 60 e0 ldi r22, 0x00 ; 0 197fa: 70 e0 ldi r23, 0x00 ; 0 197fc: 88 e4 ldi r24, 0x48 ; 72 197fe: 92 e4 ldi r25, 0x42 ; 66 19800: 0e 94 95 6f call 0xdf2a ; 0xdf2a } load_filament_final_feed(); // slow sequence 19804: 0e 94 c8 65 call 0xcb90 ; 0xcb90 st_synchronize(); 19808: 0f 94 27 58 call 0x2b04e ; 0x2b04e Sound_MakeCustom(50, 500, false); 1980c: 40 e0 ldi r20, 0x00 ; 0 1980e: 64 ef ldi r22, 0xF4 ; 244 19810: 71 e0 ldi r23, 0x01 ; 1 19812: 82 e3 ldi r24, 0x32 ; 50 19814: 90 e0 ldi r25, 0x00 ; 0 19816: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 1981a: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1981e: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 19820: 0f 94 89 67 call 0x2cf12 ; 0x2cf12 #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 19824: 81 e0 ldi r24, 0x01 ; 1 19826: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_update(2); 1982a: 82 e0 ldi r24, 0x02 ; 2 1982c: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 lcd_setstatuspgm(MSG_WELCOME); 19830: 8e e0 ldi r24, 0x0E ; 14 19832: 91 e7 ldi r25, 0x71 ; 113 19834: 0f 94 0c 0b call 0x21618 ; 0x21618 custom_message_type = CustomMsg::Status; 19838: 10 92 75 07 sts 0x0775, r1 ; 0x800775 1983c: 0c 94 49 ac jmp 0x15892 ; 0x15892 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 19840: 85 e5 ldi r24, 0x55 ; 85 19842: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 - `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; 19846: c1 2c mov r12, r1 19848: d1 2c mov r13, r1 1984a: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 1984c: 88 23 and r24, r24 1984e: 21 f0 breq .+8 ; 0x19858 19850: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 19854: 6b 01 movw r12, r22 19856: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 19858: 8a e5 ldi r24, 0x5A ; 90 1985a: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 1985e: 88 23 and r24, r24 19860: a1 f0 breq .+40 ; 0x1988a 19862: 0e 94 d2 61 call 0xc3a4 ; 0xc3a4 19866: 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); 19868: 0e 94 16 6f call 0xde2c ; 0xde2c 1986c: 4b 01 movw r8, r22 1986e: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 19870: 80 91 98 13 lds r24, 0x1398 ; 0x801398 19874: 81 30 cpi r24, 0x01 ; 1 19876: 99 f4 brne .+38 ; 0x1989e 19878: 0f 94 37 a0 call 0x3406e ; 0x3406e else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 1987c: c5 01 movw r24, r10 1987e: b4 01 movw r22, r8 19880: 90 58 subi r25, 0x80 ; 128 19882: 0e 94 16 6f call 0xde2c ; 0xde2c 19886: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 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 1988a: 60 e0 ldi r22, 0x00 ; 0 1988c: 70 e0 ldi r23, 0x00 ; 0 1988e: 80 ea ldi r24, 0xA0 ; 160 19890: 91 e4 ldi r25, 0x41 ; 65 19892: 0e 94 95 6f call 0xdf2a ; 0xdf2a - `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; 19896: 60 e0 ldi r22, 0x00 ; 0 19898: 70 e0 ldi r23, 0x00 ; 0 1989a: cb 01 movw r24, r22 1989c: e5 cf rjmp .-54 ; 0x19868 // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 1989e: c7 01 movw r24, r14 198a0: b6 01 movw r22, r12 198a2: 0f 94 d2 15 call 0x22ba4 ; 0x22ba4 198a6: ea cf rjmp .-44 ; 0x1987c #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 198a8: 81 ec ldi r24, 0xC1 ; 193 198aa: 92 e0 ldi r25, 0x02 ; 2 198ac: 0e 94 84 61 call 0xc308 ; 0xc308 198b0: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 198b4: 82 ec ldi r24, 0xC2 ; 194 198b6: 92 e0 ldi r25, 0x02 ; 2 198b8: 0e 94 84 61 call 0xc308 ; 0xc308 198bc: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 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() ) { 198c0: 80 91 98 13 lds r24, 0x1398 ; 0x801398 198c4: 81 30 cpi r24, 0x01 ; 1 198c6: 11 f0 breq .+4 ; 0x198cc 198c8: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e if( code_seen('A') ) { 198cc: 81 e4 ldi r24, 0x41 ; 65 198ce: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 198d2: 88 23 and r24, r24 198d4: 11 f4 brne .+4 ; 0x198da 198d6: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 198da: 80 91 97 03 lds r24, 0x0397 ; 0x800397 198de: 90 91 98 03 lds r25, 0x0398 ; 0x800398 198e2: 40 e1 ldi r20, 0x10 ; 16 198e4: 50 e0 ldi r21, 0x00 ; 0 198e6: 70 e0 ldi r23, 0x00 ; 0 198e8: 60 e0 ldi r22, 0x00 ; 0 198ea: 01 96 adiw r24, 0x01 ; 1 198ec: 0f 94 e6 d8 call 0x3b1cc ; 0x3b1cc 198f0: 86 2f mov r24, r22 198f2: 0f 94 d3 1c call 0x239a6 ; 0x239a6 198f6: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 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() ){ 198fa: 80 91 98 13 lds r24, 0x1398 ; 0x801398 198fe: 81 30 cpi r24, 0x01 ; 1 19900: 11 f0 breq .+4 ; 0x19906 19902: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e uint8_t addr = 0; if( code_seen('A') ) { 19906: 81 e4 ldi r24, 0x41 ; 65 19908: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 1990c: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 1990e: 88 23 and r24, r24 19910: 61 f0 breq .+24 ; 0x1992a addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 19912: 80 91 97 03 lds r24, 0x0397 ; 0x800397 19916: 90 91 98 03 lds r25, 0x0398 ; 0x800398 1991a: 40 e1 ldi r20, 0x10 ; 16 1991c: 50 e0 ldi r21, 0x00 ; 0 1991e: 70 e0 ldi r23, 0x00 ; 0 19920: 60 e0 ldi r22, 0x00 ; 0 19922: 01 96 adiw r24, 0x01 ; 1 19924: 0f 94 e6 d8 call 0x3b1cc ; 0x3b1cc 19928: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 1992a: 88 e5 ldi r24, 0x58 ; 88 1992c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 19930: 88 23 and r24, r24 19932: 61 f0 breq .+24 ; 0x1994c data = code_value_short(); 19934: 0e 94 9b 5c call 0xb936 ; 0xb936 } if(addr){ 19938: 11 23 and r17, r17 1993a: 11 f4 brne .+4 ; 0x19940 1993c: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e MMU2::mmu2.WriteRegister(addr, data); 19940: bc 01 movw r22, r24 19942: 81 2f mov r24, r17 19944: 0e 94 e6 dd call 0x1bbcc ; 0x1bbcc 19948: 0c 94 17 ad jmp 0x15a2e ; 0x15a2e 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; 1994c: 90 e0 ldi r25, 0x00 ; 0 1994e: 80 e0 ldi r24, 0x00 ; 0 19950: f3 cf rjmp .-26 ; 0x19938 19952: 60 e0 ldi r22, 0x00 ; 0 19954: 8c ea ldi r24, 0xAC ; 172 19956: 9c e0 ldi r25, 0x0C ; 12 19958: 0f 94 7f dd call 0x3bafe ; 0x3bafe StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 1995c: 10 92 98 13 sts 0x1398, r1 ; 0x801398 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 19960: 10 92 46 13 sts 0x1346, r1 ; 0x801346 currentScope = Scope::Stopped; 19964: 10 92 2b 13 sts 0x132B, r1 ; 0x80132b 19968: 0c 94 8f ac jmp 0x1591e ; 0x1591e 1996c: 61 e0 ldi r22, 0x01 ; 1 1996e: 8c ea ldi r24, 0xAC ; 172 19970: 9c e0 ldi r25, 0x0C ; 12 19972: 0f 94 7f dd call 0x3bafe ; 0x3bafe 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(); 19976: 0e 94 46 da call 0x1b48c ; 0x1b48c 1997a: 0c 94 8f ac jmp 0x1591e ; 0x1591e break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 1997e: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 19980: 0f 94 b7 1c call 0x2396e ; 0x2396e 19984: 0c 94 a5 ac jmp 0x1594a ; 0x1594a } void MMU2::TriggerResetPin() { reset(); 19988: 0f 94 e3 c2 call 0x385c6 ; 0x385c6 1998c: 0c 94 a5 ac jmp 0x1594a ; 0x1594a void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset } void MMU2::ResetX42() { logic.ResetMMU(42); 19990: 8a e2 ldi r24, 0x2A ; 42 19992: f6 cf rjmp .-20 ; 0x19980 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') { 19994: 84 35 cpi r24, 0x54 ; 84 19996: 09 f0 breq .+2 ; 0x1999a 19998: 79 c0 rjmp .+242 ; 0x19a8c strchr_pointer = CMDBUFFER_CURRENT_STRING; 1999a: 10 93 98 03 sts 0x0398, r17 ; 0x800398 1999e: 00 93 97 03 sts 0x0397, r16 ; 0x800397 processing_tcode = true; 199a2: 81 e0 ldi r24, 0x01 ; 1 199a4: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 TCodes(strchr_pointer, code_value_uint8()); 199a8: 0e 94 8e 5c call 0xb91c ; 0xb91c 199ac: 18 2f mov r17, r24 199ae: 20 91 97 03 lds r18, 0x0397 ; 0x800397 199b2: 30 91 98 03 lds r19, 0x0398 ; 0x800398 inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); } void TCodes(char *const strchr_pointer, const uint8_t codeValue) { uint8_t index = 1; 199b6: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 199b8: 79 01 movw r14, r18 199ba: e9 0e add r14, r25 199bc: f1 1c adc r15, r1 199be: d7 01 movw r26, r14 199c0: 8c 91 ld r24, X 199c2: 80 32 cpi r24, 0x20 ; 32 199c4: 11 f0 breq .+4 ; 0x199ca 199c6: 89 30 cpi r24, 0x09 ; 9 199c8: 11 f4 brne .+4 ; 0x199ce 199ca: 9f 5f subi r25, 0xFF ; 255 199cc: f5 cf rjmp .-22 ; 0x199b8 ; strchr_pointer[index] = tolower(strchr_pointer[index]); 199ce: 08 2e mov r0, r24 199d0: 00 0c add r0, r0 199d2: 99 0b sbc r25, r25 199d4: 0f 94 6f e3 call 0x3c6de ; 0x3c6de 199d8: f7 01 movw r30, r14 199da: 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'); 199dc: 90 ed ldi r25, 0xD0 ; 208 199de: 98 0f add r25, r24 199e0: 95 30 cpi r25, 0x05 ; 5 199e2: 58 f0 brcs .+22 ; 0x199fa 199e4: 8f 33 cpi r24, 0x3F ; 63 199e6: 59 f0 breq .+22 ; 0x199fe 199e8: 88 37 cpi r24, 0x78 ; 120 199ea: 49 f0 breq .+18 ; 0x199fe 199ec: 83 36 cpi r24, 0x63 ; 99 199ee: f1 f0 breq .+60 ; 0x19a2c } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 199f0: 8b ee ldi r24, 0xEB ; 235 199f2: 9f e7 ldi r25, 0x7F ; 127 } else { SERIAL_ECHO_START; if (codeValue >= EXTRUDERS) { SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 199f4: 0e 94 86 7b call 0xf70c ; 0xf70c 199f8: 13 c0 rjmp .+38 ; 0x19a20 strchr_pointer[index] = tolower(strchr_pointer[index]); if (IsInvalidTCode(strchr_pointer, index)){ TCodeInvalid(); } else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){ 199fa: 8f 33 cpi r24, 0x3F ; 63 199fc: a9 f4 brne .+42 ; 0x19a28 // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 199fe: 80 91 98 13 lds r24, 0x1398 ; 0x801398 19a02: 81 30 cpi r24, 0x01 ; 1 19a04: 69 f4 brne .+26 ; 0x19a20 MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 19a06: 80 e8 ldi r24, 0x80 ; 128 19a08: 9f e3 ldi r25, 0x3F ; 63 19a0a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 19a0e: 70 e0 ldi r23, 0x00 ; 0 19a10: 60 e0 ldi r22, 0x00 ; 0 19a12: 0e 94 dd d8 call 0x1b1ba ; 0x1b1ba 19a16: 68 2f mov r22, r24 19a18: d7 01 movw r26, r14 19a1a: 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()); 19a1c: 0f 94 6c 1c call 0x238d8 ; 0x238d8 processing_tcode = false; 19a20: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 19a24: 0c 94 5e 98 jmp 0x130bc ; 0x130bc } 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'){ 19a28: 83 36 cpi r24, 0x63 ; 99 19a2a: 49 f4 brne .+18 ; 0x19a3e // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 19a2c: 80 91 98 13 lds r24, 0x1398 ; 0x801398 19a30: 81 30 cpi r24, 0x01 ; 1 19a32: b1 f7 brne .-20 ; 0x19a20 MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 19a34: 0f 94 a4 75 call 0x2eb48 ; 0x2eb48 19a38: 68 2f mov r22, r24 19a3a: 83 e6 ldi r24, 0x63 ; 99 19a3c: ef cf rjmp .-34 ; 0x19a1c } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 19a3e: 80 91 98 13 lds r24, 0x1398 ; 0x801398 19a42: 81 30 cpi r24, 0x01 ; 1 19a44: 69 f4 brne .+26 ; 0x19a60 if (codeValue == MMU2::mmu2.get_current_tool()){ 19a46: 0f 94 a4 75 call 0x2eb48 ; 0x2eb48 19a4a: 18 13 cpse r17, r24 19a4c: 05 c0 rjmp .+10 ; 0x19a58 // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 19a4e: 8b ef ldi r24, 0xFB ; 251 19a50: 9f e7 ldi r25, 0x7F ; 127 19a52: 0f 94 44 dc call 0x3b888 ; 0x3b888 19a56: e4 cf rjmp .-56 ; 0x19a20 #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); 19a58: 81 2f mov r24, r17 19a5a: 0f 94 50 19 call 0x232a0 ; 0x232a0 19a5e: e0 cf rjmp .-64 ; 0x19a20 } } else { SERIAL_ECHO_START; 19a60: 82 ef ldi r24, 0xF2 ; 242 19a62: 9a ea ldi r25, 0xAA ; 170 19a64: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if (codeValue >= EXTRUDERS) { 19a68: 11 23 and r17, r17 19a6a: 59 f0 breq .+22 ; 0x19a82 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 19a6c: 84 e5 ldi r24, 0x54 ; 84 19a6e: 0e 94 42 79 call 0xf284 ; 0xf284 SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 19a72: 81 2f mov r24, r17 19a74: 90 e0 ldi r25, 0x00 ; 0 19a76: c0 96 adiw r24, 0x30 ; 48 19a78: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 19a7c: 85 ec ldi r24, 0xC5 ; 197 19a7e: 98 e6 ldi r25, 0x68 ; 104 19a80: b9 cf rjmp .-142 ; 0x199f4 // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 19a82: 82 eb ldi r24, 0xB2 ; 178 19a84: 98 e6 ldi r25, 0x68 ; 104 19a86: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 19a8a: ca cf rjmp .-108 ; 0x19a20 /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 19a8c: 84 34 cpi r24, 0x44 ; 68 19a8e: 09 f0 breq .+2 ; 0x19a92 19a90: ee c0 rjmp .+476 ; 0x19c6e { strchr_pointer = CMDBUFFER_CURRENT_STRING; 19a92: 10 93 98 03 sts 0x0398, r17 ; 0x800398 19a96: 00 93 97 03 sts 0x0397, r16 ; 0x800397 switch(code_value_short()) 19a9a: 0e 94 9b 5c call 0xb936 ; 0xb936 19a9e: 86 30 cpi r24, 0x06 ; 6 19aa0: 91 05 cpc r25, r1 19aa2: 09 f4 brne .+2 ; 0x19aa6 19aa4: 79 c0 rjmp .+242 ; 0x19b98 19aa6: 9c f4 brge .+38 ; 0x19ace 19aa8: 82 30 cpi r24, 0x02 ; 2 19aaa: 91 05 cpc r25, r1 19aac: 09 f4 brne .+2 ; 0x19ab0 19aae: 52 c0 rjmp .+164 ; 0x19b54 19ab0: 83 30 cpi r24, 0x03 ; 3 19ab2: 91 05 cpc r25, r1 19ab4: 09 f4 brne .+2 ; 0x19ab8 19ab6: 61 c0 rjmp .+194 ; 0x19b7a 19ab8: 01 96 adiw r24, 0x01 ; 1 19aba: 89 f4 brne .+34 ; 0x19ade * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 19abc: 8e e9 ldi r24, 0x9E ; 158 19abe: 98 e6 ldi r25, 0x68 ; 104 19ac0: 9f 93 push r25 19ac2: 8f 93 push r24 19ac4: 0f 94 1d dc call 0x3b83a ; 0x3b83a 19ac8: 0f 90 pop r0 19aca: 0f 90 pop r0 19acc: ff cf rjmp .-2 ; 0x19acc 19ace: 85 31 cpi r24, 0x15 ; 21 19ad0: 91 05 cpc r25, r1 19ad2: 09 f4 brne .+2 ; 0x19ad6 19ad4: 8d c0 rjmp .+282 ; 0x19bf0 19ad6: 94 f4 brge .+36 ; 0x19afc 19ad8: 44 97 sbiw r24, 0x14 ; 20 19ada: 09 f4 brne .+2 ; 0x19ade 19adc: 69 c0 rjmp .+210 ; 0x19bb0 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 19ade: 80 91 70 12 lds r24, 0x1270 ; 0x801270 19ae2: 90 91 71 12 lds r25, 0x1271 ; 0x801271 19ae6: 8a 57 subi r24, 0x7A ; 122 19ae8: 9f 4e sbci r25, 0xEF ; 239 19aea: 9f 93 push r25 19aec: 8f 93 push r24 19aee: 1f 92 push r1 19af0: 84 e4 ldi r24, 0x44 ; 68 19af2: 8f 93 push r24 19af4: 86 e9 ldi r24, 0x96 ; 150 19af6: 9a e6 ldi r25, 0x6A ; 106 19af8: 0c 94 f9 99 jmp 0x133f2 ; 0x133f2 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 19afc: 86 31 cpi r24, 0x16 ; 22 19afe: 91 05 cpc r25, r1 19b00: 09 f4 brne .+2 ; 0x19b04 19b02: 9b c0 rjmp .+310 ; 0x19c3a 19b04: 86 34 cpi r24, 0x46 ; 70 19b06: 91 05 cpc r25, r1 19b08: 51 f7 brne .-44 ; 0x19ade #### Parameters - `S` - Enable 0-1 (default 0) */ case 70: { if(code_seen('S')) 19b0a: 83 e5 ldi r24, 0x53 ; 83 19b0c: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 19b10: 88 23 and r24, r24 19b12: 11 f4 brne .+4 ; 0x19b18 19b14: 0c 94 5e 98 jmp 0x130bc ; 0x130bc thermal_model_log_enable(code_value_short()); 19b18: 0e 94 9b 5c call 0xb936 ; 0xb936 19b1c: 11 e0 ldi r17, 0x01 ; 1 19b1e: 00 97 sbiw r24, 0x00 ; 0 19b20: 09 f4 brne .+2 ; 0x19b24 19b22: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { 19b24: 89 2b or r24, r25 19b26: 91 f0 breq .+36 ; 0x19b4c TempMgrGuard temp_mgr_guard; 19b28: ce 01 movw r24, r28 19b2a: 01 96 adiw r24, 0x01 ; 1 19b2c: 0f 94 d9 46 call 0x28db2 ; 0x28db2 thermal_model::log_buf.entry.stamp = _millis(); 19b30: 0f 94 86 3e call 0x27d0c ; 0x27d0c 19b34: 60 93 21 06 sts 0x0621, r22 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.556> 19b38: 70 93 22 06 sts 0x0622, r23 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x1> 19b3c: 80 93 23 06 sts 0x0623, r24 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x2> 19b40: 90 93 24 06 sts 0x0624, r25 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x3> #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { TempMgrGuard temp_mgr_guard; 19b44: ce 01 movw r24, r28 19b46: 01 96 adiw r24, 0x01 ; 1 19b48: 0f 94 cc 46 call 0x28d98 ; 0x28d98 thermal_model::log_buf.entry.stamp = _millis(); } thermal_model::log_buf.enabled = enable; 19b4c: 10 93 31 06 sts 0x0631, r17 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x10> 19b50: 0c 94 5e 98 jmp 0x130bc ; 0x130bc - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 19b54: 49 e9 ldi r20, 0x99 ; 153 19b56: c4 2e mov r12, r20 19b58: 48 e6 ldi r20, 0x68 ; 104 19b5a: d4 2e mov r13, r20 19b5c: 52 e0 ldi r21, 0x02 ; 2 19b5e: e5 2e mov r14, r21 19b60: 00 e0 ldi r16, 0x00 ; 0 19b62: 20 e0 ldi r18, 0x00 ; 0 19b64: 32 e2 ldi r19, 0x22 ; 34 19b66: 40 e0 ldi r20, 0x00 ; 0 19b68: 50 e0 ldi r21, 0x00 ; 0 19b6a: 60 e0 ldi r22, 0x00 ; 0 19b6c: 72 e0 ldi r23, 0x02 ; 2 19b6e: 80 e0 ldi r24, 0x00 ; 0 19b70: 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")); 19b72: 0e 94 d8 63 call 0xc7b0 ; 0xc7b0 19b76: 0c 94 5e 98 jmp 0x130bc ; 0x130bc - The hex data needs to be lowercase */ void dcode_3() { dcode_core(0, EEPROM_SIZE, dcode_mem_t::eeprom, 3, _N("EEPROM")); 19b7a: 22 e9 ldi r18, 0x92 ; 146 19b7c: c2 2e mov r12, r18 19b7e: 28 e6 ldi r18, 0x68 ; 104 19b80: d2 2e mov r13, r18 19b82: 33 e0 ldi r19, 0x03 ; 3 19b84: e3 2e mov r14, r19 19b86: 01 e0 ldi r16, 0x01 ; 1 19b88: 20 e0 ldi r18, 0x00 ; 0 19b8a: 30 e1 ldi r19, 0x10 ; 16 19b8c: 40 e0 ldi r20, 0x00 ; 0 19b8e: 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")); 19b90: 60 e0 ldi r22, 0x00 ; 0 19b92: 70 e0 ldi r23, 0x00 ; 0 19b94: cb 01 movw r24, r22 19b96: ed cf rjmp .-38 ; 0x19b72 19b98: 8b e8 ldi r24, 0x8B ; 139 19b9a: c8 2e mov r12, r24 19b9c: 88 e6 ldi r24, 0x68 ; 104 19b9e: d8 2e mov r13, r24 19ba0: 96 e0 ldi r25, 0x06 ; 6 19ba2: e9 2e mov r14, r25 19ba4: 03 e0 ldi r16, 0x03 ; 3 19ba6: 20 e0 ldi r18, 0x00 ; 0 19ba8: 30 e0 ldi r19, 0x00 ; 0 19baa: 44 e0 ldi r20, 0x04 ; 4 19bac: 50 e0 ldi r21, 0x00 ; 0 19bae: f0 cf rjmp .-32 ; 0x19b90 #ifdef XFLASH_DUMP #include "xflash_dump.h" void dcode_20() { if(code_seen('E')) 19bb0: 85 e4 ldi r24, 0x45 ; 69 19bb2: 0e 94 fc 5c call 0xb9f8 ; 0xb9f8 19bb6: 88 23 and r24, r24 19bb8: 29 f0 breq .+10 ; 0x19bc4 xfdump_full_dump_and_reset(); 19bba: 80 e0 ldi r24, 0x00 ; 0 19bbc: 0e 94 5e e3 call 0x1c6bc ; 0x1c6bc 19bc0: 0c 94 5e 98 jmp 0x130bc ; 0x130bc else { unsigned long ts = _millis(); 19bc4: 0f 94 86 3e call 0x27d0c ; 0x27d0c 19bc8: 6b 01 movw r12, r22 19bca: 7c 01 movw r14, r24 xfdump_dump(); 19bcc: 0e 94 8c e3 call 0x1c718 ; 0x1c718 ts = _millis() - ts; 19bd0: 0f 94 86 3e call 0x27d0c ; 0x27d0c 19bd4: dc 01 movw r26, r24 19bd6: cb 01 movw r24, r22 19bd8: 8c 19 sub r24, r12 19bda: 9d 09 sbc r25, r13 19bdc: ae 09 sbc r26, r14 19bde: bf 09 sbc r27, r15 DBG(_N("dump completed in %lums\n"), ts); 19be0: bf 93 push r27 19be2: af 93 push r26 19be4: 9f 93 push r25 19be6: 8f 93 push r24 19be8: 82 e7 ldi r24, 0x72 ; 114 19bea: 98 e6 ldi r25, 0x68 ; 104 19bec: 0c 94 f9 99 jmp 0x133f2 ; 0x133f2 } } void dcode_21() { if(!xfdump_check_state()) 19bf0: 90 e0 ldi r25, 0x00 ; 0 19bf2: 80 e0 ldi r24, 0x00 ; 0 19bf4: 0e 94 aa e2 call 0x1c554 ; 0x1c554 19bf8: 81 11 cpse r24, r1 19bfa: 07 c0 rjmp .+14 ; 0x19c0a DBG(_N("no dump available\n")); 19bfc: 8f e5 ldi r24, 0x5F ; 95 19bfe: 98 e6 ldi r25, 0x68 ; 104 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19c00: 9f 93 push r25 19c02: 8f 93 push r24 19c04: 0f 94 1d dc call 0x3b83a ; 0x3b83a 19c08: 14 c0 rjmp .+40 ; 0x19c32 { if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { KEEPALIVE_STATE(NOT_BUSY); 19c0a: 81 e0 ldi r24, 0x01 ; 1 19c0c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 DBG(_N("D21 - read crash dump\n")); 19c10: 88 e4 ldi r24, 0x48 ; 72 19c12: 98 e6 ldi r25, 0x68 ; 104 19c14: 9f 93 push r25 19c16: 8f 93 push r24 19c18: 0f 94 1d dc call 0x3b83a ; 0x3b83a print_mem(DUMP_OFFSET, sizeof(dump_t), dcode_mem_t::xflash); 19c1c: 03 e0 ldi r16, 0x03 ; 3 19c1e: 20 e0 ldi r18, 0x00 ; 0 19c20: 33 e2 ldi r19, 0x23 ; 35 19c22: 40 e0 ldi r20, 0x00 ; 0 19c24: 50 e0 ldi r21, 0x00 ; 0 19c26: 60 e0 ldi r22, 0x00 ; 0 19c28: 70 ed ldi r23, 0xD0 ; 208 19c2a: 83 e0 ldi r24, 0x03 ; 3 19c2c: 90 e0 ldi r25, 0x00 ; 0 19c2e: 0f 94 a6 85 call 0x30b4c ; 0x30b4c if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19c32: 0f 90 pop r0 19c34: 0f 90 pop r0 19c36: 0c 94 5e 98 jmp 0x130bc ; 0x130bc } } void dcode_22() { if(!xfdump_check_state()) 19c3a: 90 e0 ldi r25, 0x00 ; 0 19c3c: 80 e0 ldi r24, 0x00 ; 0 19c3e: 0e 94 aa e2 call 0x1c554 ; 0x1c554 19c42: 81 11 cpse r24, r1 19c44: 03 c0 rjmp .+6 ; 0x19c4c DBG(_N("no dump available\n")); 19c46: 85 e3 ldi r24, 0x35 ; 53 19c48: 98 e6 ldi r25, 0x68 ; 104 19c4a: da cf rjmp .-76 ; 0x19c00 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 19c4c: 8c e5 ldi r24, 0x5C ; 92 19c4e: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 19c50: 1d bc out 0x2d, r1 ; 45 void xfdump_reset() { XFLASH_SPI_ENTER(); xflash_enable_wr(); 19c52: 0e 94 e2 e2 call 0x1c5c4 ; 0x1c5c4 _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 19c56: 40 e0 ldi r20, 0x00 ; 0 19c58: 50 ed ldi r21, 0xD0 ; 208 19c5a: 63 e0 ldi r22, 0x03 ; 3 19c5c: 70 e0 ldi r23, 0x00 ; 0 19c5e: 80 e2 ldi r24, 0x20 ; 32 19c60: 0e 94 64 e2 call 0x1c4c8 ; 0x1c4c8 xflash_sector_erase(DUMP_OFFSET + offsetof(dump_t, header.magic)); xflash_wait_busy(); 19c64: 0e 94 46 e2 call 0x1c48c ; 0x1c48c else { xfdump_reset(); DBG(_N("dump cleared\n")); 19c68: 87 e2 ldi r24, 0x27 ; 39 19c6a: 98 e6 ldi r25, 0x68 ; 104 19c6c: c9 cf rjmp .-110 ; 0x19c00 } } else { SERIAL_ECHO_START; 19c6e: 82 ef ldi r24, 0xF2 ; 242 19c70: 9a ea ldi r25, 0xAA ; 170 19c72: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 19c76: 87 e2 ldi r24, 0x27 ; 39 19c78: 99 e6 ldi r25, 0x69 ; 105 19c7a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 19c7e: 80 91 70 12 lds r24, 0x1270 ; 0x801270 19c82: 90 91 71 12 lds r25, 0x1271 ; 0x801271 19c86: 8a 57 subi r24, 0x7A ; 122 19c88: 9f 4e sbci r25, 0xEF ; 239 19c8a: 0e 94 bf 89 call 0x1137e ; 0x1137e SERIAL_ECHOLNPGM("\"(2)"); 19c8e: 81 ee ldi r24, 0xE1 ; 225 19c90: 96 e8 ldi r25, 0x86 ; 134 19c92: 0c 94 69 9a jmp 0x134d2 ; 0x134d2 #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 19c96: 2d ec ldi r18, 0xCD ; 205 19c98: 3c ec ldi r19, 0xCC ; 204 19c9a: 4c ec ldi r20, 0xCC ; 204 19c9c: 5d e3 ldi r21, 0x3D ; 61 19c9e: c7 01 movw r24, r14 19ca0: b6 01 movw r22, r12 19ca2: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 19ca6: 18 16 cp r1, r24 19ca8: 14 f4 brge .+4 ; 0x19cae 19caa: 0c 94 a6 9b jmp 0x1374c ; 0x1374c 19cae: 0c 94 14 9d jmp 0x13a28 ; 0x13a28 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; 19cb2: a3 01 movw r20, r6 19cb4: 92 01 movw r18, r4 19cb6: 62 2d mov r22, r2 19cb8: 73 2d mov r23, r3 19cba: 8e 2d mov r24, r14 19cbc: 9f 2d mov r25, r15 19cbe: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 19cc2: 18 16 cp r1, r24 19cc4: 14 f0 brlt .+4 ; 0x19cca 19cc6: 0c 94 f5 a4 jmp 0x149ea ; 0x149ea 19cca: e5 e0 ldi r30, 0x05 ; 5 19ccc: ce 0e add r12, r30 19cce: d1 1c adc r13, r1 19cd0: f2 e0 ldi r31, 0x02 ; 2 19cd2: 8f 0e add r8, r31 19cd4: 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; 19cd6: 85 01 movw r16, r10 19cd8: 0c 94 bc a4 jmp 0x14978 ; 0x14978 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 19cdc: 67 96 adiw r28, 0x17 ; 23 19cde: 2f ad ldd r18, Y+63 ; 0x3f 19ce0: 67 97 sbiw r28, 0x17 ; 23 19ce2: 8b 2d mov r24, r11 19ce4: 23 30 cpi r18, 0x03 ; 3 19ce6: 29 f0 breq .+10 ; 0x19cf2 19ce8: 91 e0 ldi r25, 0x01 ; 1 19cea: 04 30 cpi r16, 0x04 ; 4 19cec: 11 05 cpc r17, r1 19cee: 09 f4 brne .+2 ; 0x19cf2 19cf0: b3 cc rjmp .-1690 ; 0x19658 19cf2: 90 e0 ldi r25, 0x00 ; 0 19cf4: b1 cc rjmp .-1694 ; 0x19658 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)); 19cf6: 86 ea ldi r24, 0xA6 ; 166 19cf8: 99 e3 ldi r25, 0x39 ; 57 19cfa: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 19cfe: 0f 94 80 34 call 0x26900 ; 0x26900 lcd_puts_at_P(0, 2, PSTR("")); 19d02: 44 e4 ldi r20, 0x44 ; 68 19d04: 56 e8 ldi r21, 0x86 ; 134 19d06: 62 e0 ldi r22, 0x02 ; 2 19d08: 80 e0 ldi r24, 0x00 ; 0 19d0a: 0e 94 29 70 call 0xe052 ; 0xe052 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 19d0e: f8 01 movw r30, r16 19d10: 81 91 ld r24, Z+ 19d12: 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'; 19d14: 98 2f mov r25, r24 19d16: 9f 7d andi r25, 0xDF ; 223 19d18: 11 f4 brne .+4 ; 0x19d1e 19d1a: 0c 94 04 b3 jmp 0x16608 ; 0x16608 19d1e: 97 ef ldi r25, 0xF7 ; 247 19d20: 98 0f add r25, r24 19d22: 92 30 cpi r25, 0x02 ; 2 19d24: 10 f4 brcc .+4 ; 0x19d2a 19d26: 0c 94 04 b3 jmp 0x16608 ; 0x16608 19d2a: 8d 30 cpi r24, 0x0D ; 13 19d2c: 11 f4 brne .+4 ; 0x19d32 19d2e: 0c 94 04 b3 jmp 0x16608 ; 0x16608 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); 19d32: 0e 94 04 70 call 0xe008 ; 0xe008 19d36: eb cf rjmp .-42 ; 0x19d0e 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; 19d38: ce 01 movw r24, r28 19d3a: 01 96 adiw r24, 0x01 ; 1 19d3c: 0f 94 d9 46 call 0x28db2 ; 0x28db2 19d40: 0c 94 38 b9 jmp 0x17270 ; 0x17270 00019d44 : uint8_t check_pinda_0() { return _PINDA?0:1; } 19d44: 80 91 f9 03 lds r24, 0x03F9 ; 0x8003f9 19d48: 90 91 fa 03 lds r25, 0x03FA ; 0x8003fa 19d4c: 08 95 ret 00019d4e : 19d4e: 81 50 subi r24, 0x01 ; 1 19d50: 82 31 cpi r24, 0x12 ; 18 19d52: 08 f0 brcs .+2 ; 0x19d56 19d54: 5a c0 rjmp .+180 ; 0x19e0a 19d56: e8 2f mov r30, r24 19d58: f0 e0 ldi r31, 0x00 ; 0 19d5a: 88 27 eor r24, r24 19d5c: ed 54 subi r30, 0x4D ; 77 19d5e: f1 43 sbci r31, 0x31 ; 49 19d60: 8f 4f sbci r24, 0xFF ; 255 19d62: 0d 94 6b de jmp 0x3bcd6 ; 0x3bcd6 <__tablejump2__> 19d66: d3 ce rjmp .-602 ; 0x19b0e 19d68: d7 ce rjmp .-594 ; 0x19b18 19d6a: c5 ce rjmp .-630 ; 0x19af6 19d6c: cb ce rjmp .-618 ; 0x19b04 19d6e: cf ce rjmp .-610 ; 0x19b0e 19d70: 05 cf rjmp .-502 ; 0x19b7c 19d72: da ce rjmp .-588 ; 0x19b28 19d74: e0 ce rjmp .-576 ; 0x19b36 19d76: e4 ce rjmp .-568 ; 0x19b40 19d78: ea ce rjmp .-556 ; 0x19b4e 19d7a: ee ce rjmp .-548 ; 0x19b58 19d7c: f2 ce rjmp .-540 ; 0x19b62 19d7e: f8 ce rjmp .-528 ; 0x19b70 19d80: fc ce rjmp .-520 ; 0x19b7a 19d82: 05 cf rjmp .-502 ; 0x19b8e 19d84: 00 cf rjmp .-512 ; 0x19b86 19d86: 06 cf rjmp .-500 ; 0x19b94 19d88: 0a cf rjmp .-492 ; 0x19b9e 19d8a: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19d8e: 8f 77 andi r24, 0x7F ; 127 19d90: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19d94: 08 95 ret 19d96: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19d9a: 8f 7d andi r24, 0xDF ; 223 19d9c: f9 cf rjmp .-14 ; 0x19d90 19d9e: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19da2: 87 7f andi r24, 0xF7 ; 247 19da4: f5 cf rjmp .-22 ; 0x19d90 19da6: 84 b5 in r24, 0x24 ; 36 19da8: 8f 77 andi r24, 0x7F ; 127 19daa: 84 bd out 0x24, r24 ; 36 19dac: 08 95 ret 19dae: 84 b5 in r24, 0x24 ; 36 19db0: 8f 7d andi r24, 0xDF ; 223 19db2: fb cf rjmp .-10 ; 0x19daa 19db4: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19db8: 8f 77 andi r24, 0x7F ; 127 19dba: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19dbe: 08 95 ret 19dc0: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19dc4: 8f 7d andi r24, 0xDF ; 223 19dc6: f9 cf rjmp .-14 ; 0x19dba 19dc8: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19dcc: 8f 77 andi r24, 0x7F ; 127 19dce: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19dd2: 08 95 ret 19dd4: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19dd8: 8f 7d andi r24, 0xDF ; 223 19dda: f9 cf rjmp .-14 ; 0x19dce 19ddc: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19de0: 87 7f andi r24, 0xF7 ; 247 19de2: f5 cf rjmp .-22 ; 0x19dce 19de4: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19de8: 8f 77 andi r24, 0x7F ; 127 19dea: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19dee: 08 95 ret 19df0: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19df4: 8f 7d andi r24, 0xDF ; 223 19df6: f9 cf rjmp .-14 ; 0x19dea 19df8: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19dfc: 87 7f andi r24, 0xF7 ; 247 19dfe: f5 cf rjmp .-22 ; 0x19dea 19e00: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19e04: 8f 77 andi r24, 0x7F ; 127 19e06: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19e0a: 08 95 ret 19e0c: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19e10: 8f 7d andi r24, 0xDF ; 223 19e12: f9 cf rjmp .-14 ; 0x19e06 19e14: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19e18: 87 7f andi r24, 0xF7 ; 247 19e1a: f5 cf rjmp .-22 ; 0x19e06 00019e1c : 19e1c: 83 b1 in r24, 0x03 ; 3 19e1e: 82 95 swap r24 19e20: 81 70 andi r24, 0x01 ; 1 19e22: 08 95 ret 00019e24 : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 19e24: cf 92 push r12 19e26: df 92 push r13 19e28: ef 92 push r14 19e2a: 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; 19e2c: 20 91 fb 03 lds r18, 0x03FB ; 0x8003fb 19e30: b0 e0 ldi r27, 0x00 ; 0 19e32: a0 e0 ldi r26, 0x00 ; 0 19e34: c0 90 64 07 lds r12, 0x0764 ; 0x800764 19e38: d0 90 65 07 lds r13, 0x0765 ; 0x800765 19e3c: e0 90 66 07 lds r14, 0x0766 ; 0x800766 19e40: f0 90 67 07 lds r15, 0x0767 ; 0x800767 19e44: 20 ff sbrs r18, 0 19e46: 42 c0 rjmp .+132 ; 0x19ecc 19e48: c8 1a sub r12, r24 19e4a: d9 0a sbc r13, r25 19e4c: ea 0a sbc r14, r26 19e4e: fb 0a sbc r15, r27 19e50: c0 92 64 07 sts 0x0764, r12 ; 0x800764 19e54: d0 92 65 07 sts 0x0765, r13 ; 0x800765 19e58: e0 92 66 07 sts 0x0766, r14 ; 0x800766 19e5c: f0 92 67 07 sts 0x0767, r15 ; 0x800767 19e60: cb 01 movw r24, r22 19e62: b0 e0 ldi r27, 0x00 ; 0 19e64: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 19e66: c0 90 68 07 lds r12, 0x0768 ; 0x800768 19e6a: d0 90 69 07 lds r13, 0x0769 ; 0x800769 19e6e: e0 90 6a 07 lds r14, 0x076A ; 0x80076a 19e72: f0 90 6b 07 lds r15, 0x076B ; 0x80076b 19e76: 21 ff sbrs r18, 1 19e78: 36 c0 rjmp .+108 ; 0x19ee6 19e7a: c8 1a sub r12, r24 19e7c: d9 0a sbc r13, r25 19e7e: ea 0a sbc r14, r26 19e80: fb 0a sbc r15, r27 19e82: c0 92 68 07 sts 0x0768, r12 ; 0x800768 19e86: d0 92 69 07 sts 0x0769, r13 ; 0x800769 19e8a: e0 92 6a 07 sts 0x076A, r14 ; 0x80076a 19e8e: f0 92 6b 07 sts 0x076B, r15 ; 0x80076b 19e92: 70 e0 ldi r23, 0x00 ; 0 19e94: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 19e96: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 19e9a: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 19e9e: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 19ea2: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 19ea6: 22 ff sbrs r18, 2 19ea8: 2b c0 rjmp .+86 ; 0x19f00 19eaa: 84 1b sub r24, r20 19eac: 95 0b sbc r25, r21 19eae: a6 0b sbc r26, r22 19eb0: b7 0b sbc r27, r23 19eb2: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 19eb6: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 19eba: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 19ebe: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f // DBG(_n(" after xyzcal_update_pos x=%ld y=%ld z=%ld\n"), count_position[0], count_position[1], count_position[2]); } 19ec2: ff 90 pop r15 19ec4: ef 90 pop r14 19ec6: df 90 pop r13 19ec8: cf 90 pop r12 19eca: 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; 19ecc: 8c 0d add r24, r12 19ece: 9d 1d adc r25, r13 19ed0: ae 1d adc r26, r14 19ed2: bf 1d adc r27, r15 19ed4: 80 93 64 07 sts 0x0764, r24 ; 0x800764 19ed8: 90 93 65 07 sts 0x0765, r25 ; 0x800765 19edc: a0 93 66 07 sts 0x0766, r26 ; 0x800766 19ee0: b0 93 67 07 sts 0x0767, r27 ; 0x800767 19ee4: bd cf rjmp .-134 ; 0x19e60 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 19ee6: 8c 0d add r24, r12 19ee8: 9d 1d adc r25, r13 19eea: ae 1d adc r26, r14 19eec: bf 1d adc r27, r15 19eee: 80 93 68 07 sts 0x0768, r24 ; 0x800768 19ef2: 90 93 69 07 sts 0x0769, r25 ; 0x800769 19ef6: a0 93 6a 07 sts 0x076A, r26 ; 0x80076a 19efa: b0 93 6b 07 sts 0x076B, r27 ; 0x80076b 19efe: c9 cf rjmp .-110 ; 0x19e92 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 19f00: 84 0f add r24, r20 19f02: 95 1f adc r25, r21 19f04: a6 1f adc r26, r22 19f06: b7 1f adc r27, r23 19f08: d4 cf rjmp .-88 ; 0x19eb2 00019f0a : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 19f0a: fb 01 movw r30, r22 *v = 0; 19f0c: 11 82 std Z+1, r1 ; 0x01 19f0e: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 19f10: 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'; 19f12: dc 01 movw r26, r24 19f14: 2c 91 ld r18, X 19f16: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 19f18: 2a 30 cpi r18, 0x0A ; 10 19f1a: a0 f4 brcc .+40 ; 0x19f44 *v *= 10; 19f1c: 40 81 ld r20, Z 19f1e: 51 81 ldd r21, Z+1 ; 0x01 19f20: 64 9f mul r22, r20 19f22: 90 01 movw r18, r0 19f24: 65 9f mul r22, r21 19f26: 30 0d add r19, r0 19f28: 11 24 eor r1, r1 19f2a: 31 83 std Z+1, r19 ; 0x01 19f2c: 20 83 st Z, r18 *v += *str - '0'; 19f2e: 4d 91 ld r20, X+ 19f30: cd 01 movw r24, r26 19f32: 20 53 subi r18, 0x30 ; 48 19f34: 31 09 sbc r19, r1 19f36: 24 0f add r18, r20 19f38: 31 1d adc r19, r1 19f3a: 47 fd sbrc r20, 7 19f3c: 3a 95 dec r19 19f3e: 31 83 std Z+1, r19 ; 0x01 19f40: 20 83 st Z, r18 19f42: e7 cf rjmp .-50 ; 0x19f12 ++str; } return str; } 19f44: 08 95 ret 00019f46 : } #ifdef THERMAL_MODEL void lcd_thermal_model_cal() { lcd_commands_type = LcdCommands::ThermalModel; 19f46: 85 e0 ldi r24, 0x05 ; 5 19f48: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 lcd_return_to_status(); 19f4c: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 00019f50 : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 19f50: 89 ea ldi r24, 0xA9 ; 169 19f52: 9c e6 ldi r25, 0x6C ; 108 19f54: 0e 94 86 7b call 0xf70c ; 0xf70c lcd_return_to_status(); 19f58: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 00019f5c : //! 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) { 19f5c: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 <_ZL13printer_state.lto_priv.395> 19f60: 81 30 cpi r24, 0x01 ; 1 19f62: 21 f4 brne .+8 ; 0x19f6c SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 19f64: 8c ef ldi r24, 0xFC ; 252 19f66: 9b e6 ldi r25, 0x6B ; 107 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 19f68: 0c 94 86 7b jmp 0xf70c ; 0xf70c 19f6c: 8d ee ldi r24, 0xED ; 237 19f6e: 9b e6 ldi r25, 0x6B ; 107 19f70: fb cf rjmp .-10 ; 0x19f68 00019f72 : } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 19f72: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 19f76: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 #endif manage_heater(); 19f7a: 0d 94 9b 4d jmp 0x29b36 ; 0x29b36 00019f7e : 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, 19f7e: 1f 93 push r17 19f80: cf 93 push r28 19f82: df 93 push r29 19f84: c8 2f mov r28, r24 19f86: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 19f88: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 19f8c: 84 e7 ldi r24, 0x74 ; 116 19f8e: 94 e4 ldi r25, 0x44 ; 68 19f90: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 19f94: ac 01 movw r20, r24 19f96: 60 e0 ldi r22, 0x00 ; 0 19f98: 80 e0 ldi r24, 0x00 ; 0 19f9a: 0e 94 29 70 call 0xe052 ; 0xe052 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)); 19f9e: 8a e0 ldi r24, 0x0A ; 10 19fa0: 95 e4 ldi r25, 0x45 ; 69 19fa2: c1 11 cpse r28, r1 19fa4: 02 c0 rjmp .+4 ; 0x19faa 19fa6: 8d e1 ldi r24, 0x1D ; 29 19fa8: 95 e4 ldi r25, 0x45 ; 69 19faa: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 19fae: ac 01 movw r20, r24 19fb0: 61 e0 ldi r22, 0x01 ; 1 19fb2: 80 e0 ldi r24, 0x00 ; 0 19fb4: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_selftest_setfan(255); 19fb8: 8f ef ldi r24, 0xFF ; 255 19fba: 0e 94 b9 cf call 0x19f72 ; 0x19f72 break; } _delay(500); 19fbe: 64 ef ldi r22, 0xF4 ; 244 19fc0: 71 e0 ldi r23, 0x01 ; 1 19fc2: 80 e0 ldi r24, 0x00 ; 0 19fc4: 90 e0 ldi r25, 0x00 ; 0 19fc6: 0f 94 8d 3c call 0x2791a ; 0x2791a lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 19fca: 89 e6 ldi r24, 0x69 ; 105 19fcc: 94 e4 ldi r25, 0x44 ; 68 19fce: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 19fd2: ac 01 movw r20, r24 19fd4: 62 e0 ldi r22, 0x02 ; 2 19fd6: 81 e0 ldi r24, 0x01 ; 1 19fd8: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_putc_at(0, 3, '>'); 19fdc: 4e e3 ldi r20, 0x3E ; 62 19fde: 63 e0 ldi r22, 0x03 ; 3 19fe0: 80 e0 ldi r24, 0x00 ; 0 19fe2: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 19fe6: 8a e5 ldi r24, 0x5A ; 90 19fe8: 94 e4 ldi r25, 0x44 ; 68 19fea: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 19fee: 0e 94 00 70 call 0xe000 ; 0xe000 lcd_encoder = _default; 19ff2: 6d 2f mov r22, r29 19ff4: 70 e0 ldi r23, 0x00 ; 0 19ff6: 70 93 38 05 sts 0x0538, r23 ; 0x800538 19ffa: 60 93 37 05 sts 0x0537, r22 ; 0x800537 KEEPALIVE_STATE(PAUSED_FOR_USER); 19ffe: 84 e0 ldi r24, 0x04 ; 4 1a000: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_consume_click(); 1a004: 0e 94 2d 72 call 0xe45a ; 0xe45a 1a008: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 1a00a: 11 e0 ldi r17, 0x01 ; 1 1a00c: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 1a00e: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1a012: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1a016: 00 97 sbiw r24, 0x00 ; 0 1a018: 19 f1 breq .+70 ; 0x1a060 if (lcd_encoder < 0) { 1a01a: 97 ff sbrs r25, 7 1a01c: 0b c0 rjmp .+22 ; 0x1a034 _result = !check_opposite; 1a01e: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 1a020: 4e e3 ldi r20, 0x3E ; 62 1a022: 62 e0 ldi r22, 0x02 ; 2 1a024: 80 e0 ldi r24, 0x00 ; 0 1a026: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_putc_at(0, 3, ' '); 1a02a: 40 e2 ldi r20, 0x20 ; 32 1a02c: 63 e0 ldi r22, 0x03 ; 3 1a02e: 80 e0 ldi r24, 0x00 ; 0 1a030: 0e 94 35 70 call 0xe06a ; 0xe06a } if (lcd_encoder > 0) { 1a034: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1a038: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1a03c: 18 16 cp r1, r24 1a03e: 19 06 cpc r1, r25 1a040: 5c f4 brge .+22 ; 0x1a058 _result = check_opposite; lcd_putc_at(0, 2, ' '); 1a042: 40 e2 ldi r20, 0x20 ; 32 1a044: 62 e0 ldi r22, 0x02 ; 2 1a046: 80 e0 ldi r24, 0x00 ; 0 1a048: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_putc_at(0, 3, '>'); 1a04c: 4e e3 ldi r20, 0x3E ; 62 1a04e: 63 e0 ldi r22, 0x03 ; 3 1a050: 80 e0 ldi r24, 0x00 ; 0 1a052: 0e 94 35 70 call 0xe06a ; 0xe06a 1a056: dc 2f mov r29, r28 } lcd_encoder = 0; 1a058: 10 92 38 05 sts 0x0538, r1 ; 0x800538 1a05c: 10 92 37 05 sts 0x0537, r1 ; 0x800537 } manage_heater(); 1a060: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(true); 1a064: 81 e0 ldi r24, 0x01 ; 1 1a066: 0e 94 5a 8c call 0x118b4 ; 0x118b4 _delay(100); 1a06a: 64 e6 ldi r22, 0x64 ; 100 1a06c: 70 e0 ldi r23, 0x00 ; 0 1a06e: 80 e0 ldi r24, 0x00 ; 0 1a070: 90 e0 ldi r25, 0x00 ; 0 1a072: 0f 94 8d 3c call 0x2791a ; 0x2791a } while (!lcd_clicked()); 1a076: 0e 94 32 72 call 0xe464 ; 0xe464 1a07a: 88 23 and r24, r24 1a07c: 41 f2 breq .-112 ; 0x1a00e KEEPALIVE_STATE(IN_HANDLER); 1a07e: 82 e0 ldi r24, 0x02 ; 2 1a080: 80 93 96 02 sts 0x0296, r24 ; 0x800296 setExtruderAutoFanState(0); // Turn off hotend fan 1a084: 80 e0 ldi r24, 0x00 ; 0 1a086: 0e 94 51 77 call 0xeea2 ; 0xeea2 lcd_selftest_setfan(0); // Turn off print fan 1a08a: 80 e0 ldi r24, 0x00 ; 0 1a08c: 0e 94 b9 cf call 0x19f72 ; 0x19f72 return _result; } 1a090: 8d 2f mov r24, r29 1a092: df 91 pop r29 1a094: cf 91 pop r28 1a096: 1f 91 pop r17 1a098: 08 95 ret 0001a09a : #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) { 1a09a: cf 93 push r28 1a09c: df 93 push r29 1a09e: c8 2f mov r28, r24 1a0a0: d6 2f mov r29, r22 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { 1a0a2: c1 50 subi r28, 0x01 ; 1 1a0a4: 98 f0 brcs .+38 ; 0x1a0cc for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 1a0a6: 4d e2 ldi r20, 0x2D ; 45 1a0a8: 6d 2f mov r22, r29 1a0aa: 82 e1 ldi r24, 0x12 ; 18 1a0ac: 0e 94 35 70 call 0xe06a ; 0xe06a delay_keep_alive(1000 / sizeof(symbols)); 1a0b0: 84 ef ldi r24, 0xF4 ; 244 1a0b2: 91 e0 ldi r25, 0x01 ; 1 1a0b4: 0e 94 ff 8e call 0x11dfe ; 0x11dfe // 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]); 1a0b8: 4c e7 ldi r20, 0x7C ; 124 1a0ba: 6d 2f mov r22, r29 1a0bc: 82 e1 ldi r24, 0x12 ; 18 1a0be: 0e 94 35 70 call 0xe06a ; 0xe06a delay_keep_alive(1000 / sizeof(symbols)); 1a0c2: 84 ef ldi r24, 0xF4 ; 244 1a0c4: 91 e0 ldi r25, 0x01 ; 1 1a0c6: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 1a0ca: eb cf rjmp .-42 ; 0x1a0a2 } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 1a0cc: 0f 94 86 3e call 0x27d0c ; 0x27d0c 1a0d0: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c 1a0d4: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d 1a0d8: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e 1a0dc: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f #endif fan_measuring = true; 1a0e0: 81 e0 ldi r24, 0x01 ; 1 1a0e2: 80 93 36 05 sts 0x0536, r24 ; 0x800536 while(fan_measuring) { 1a0e6: 80 91 36 05 lds r24, 0x0536 ; 0x800536 1a0ea: 88 23 and r24, r24 1a0ec: 29 f0 breq .+10 ; 0x1a0f8 delay_keep_alive(100); 1a0ee: 84 e6 ldi r24, 0x64 ; 100 1a0f0: 90 e0 ldi r25, 0x00 ; 0 1a0f2: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 1a0f6: f7 cf rjmp .-18 ; 0x1a0e6 } gcode_M123(); } 1a0f8: df 91 pop r29 1a0fa: cf 91 pop r28 fan_measuring = true; while(fan_measuring) { delay_keep_alive(100); } gcode_M123(); 1a0fc: 0c 94 b9 67 jmp 0xcf72 ; 0xcf72 0001a100 : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 1a100: cf 93 push r28 1a102: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1a104: 0f 94 27 58 call 0x2b04e ; 0x2b04e float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 1a108: c3 e4 ldi r28, 0x43 ; 67 1a10a: d7 e0 ldi r29, 0x07 ; 7 planner_synchronize(); // Compensate for configurable Extra Loading Distance planner_set_current_position_E(planner_get_current_position_E() - (logic.ExtraLoadDistance() - MMU2_FILAMENT_SENSOR_POSITION)); 1a10c: 60 91 75 13 lds r22, 0x1375 ; 0x801375 1a110: 70 e0 ldi r23, 0x00 ; 0 1a112: 90 e0 ldi r25, 0x00 ; 0 1a114: 80 e0 ldi r24, 0x00 ; 0 1a116: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1a11a: 9b 01 movw r18, r22 1a11c: ac 01 movw r20, r24 1a11e: 6c 85 ldd r22, Y+12 ; 0x0c 1a120: 7d 85 ldd r23, Y+13 ; 0x0d 1a122: 8e 85 ldd r24, Y+14 ; 0x0e 1a124: 9f 85 ldd r25, Y+15 ; 0x0f 1a126: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1a12a: 6c 87 std Y+12, r22 ; 0x0c 1a12c: 7d 87 std Y+13, r23 ; 0x0d 1a12e: 8e 87 std Y+14, r24 ; 0x0e 1a130: 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])); 1a132: 62 e0 ldi r22, 0x02 ; 2 1a134: 84 e6 ldi r24, 0x64 ; 100 1a136: 91 e9 ldi r25, 0x91 ; 145 } 1a138: df 91 pop r29 1a13a: 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])); 1a13c: 0d 94 f7 87 jmp 0x30fee ; 0x30fee 0001a140 : 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) { 1a140: 0f 93 push r16 1a142: 1f 93 push r17 1a144: cf 93 push r28 1a146: df 93 push r29 1a148: 98 2f mov r25, r24 1a14a: 86 2f mov r24, r22 1a14c: 14 2f mov r17, r20 1a14e: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 1a150: 69 2f mov r22, r25 1a152: 0e 94 15 70 call 0xe02a ; 0xe02a switch (_state) 1a156: 11 30 cpi r17, 0x01 ; 1 1a158: 21 f0 breq .+8 ; 0x1a162 1a15a: 12 30 cpi r17, 0x02 ; 2 1a15c: 79 f0 breq .+30 ; 0x1a17c lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a15e: ce 01 movw r24, r28 1a160: 15 c0 rjmp .+42 ; 0x1a18c { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 1a162: ce 01 movw r24, r28 1a164: 0e 94 00 70 call 0xe000 ; 0xe000 lcd_putc(':'); 1a168: 8a e3 ldi r24, 0x3A ; 58 1a16a: 0e 94 04 70 call 0xe008 ; 0xe008 lcd_putc(_indicator); 1a16e: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 1a170: df 91 pop r29 1a172: cf 91 pop r28 1a174: 1f 91 pop r17 1a176: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 1a178: 0c 94 04 70 jmp 0xe008 ; 0xe008 break; case 2: lcd_puts_P(_name_PROGMEM); 1a17c: ce 01 movw r24, r28 1a17e: 0e 94 00 70 call 0xe000 ; 0xe000 lcd_putc(':'); 1a182: 8a e3 ldi r24, 0x3A ; 58 1a184: 0e 94 04 70 call 0xe008 ; 0xe008 lcd_puts_P(MSG_OK_CAPS); 1a188: 87 e5 ldi r24, 0x57 ; 87 1a18a: 9c e6 ldi r25, 0x6C ; 108 break; default: lcd_puts_P(_name_PROGMEM); } } 1a18c: df 91 pop r29 1a18e: cf 91 pop r28 1a190: 1f 91 pop r17 1a192: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a194: 0c 94 00 70 jmp 0xe000 ; 0xe000 0001a198 : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 1a198: df 92 push r13 1a19a: ef 92 push r14 1a19c: ff 92 push r15 1a19e: 0f 93 push r16 1a1a0: 1f 93 push r17 1a1a2: cf 93 push r28 1a1a4: df 93 push r29 1a1a6: cd b7 in r28, 0x3d ; 61 1a1a8: de b7 in r29, 0x3e ; 62 1a1aa: 63 97 sbiw r28, 0x13 ; 19 1a1ac: 0f b6 in r0, 0x3f ; 63 1a1ae: f8 94 cli 1a1b0: de bf out 0x3e, r29 ; 62 1a1b2: 0f be out 0x3f, r0 ; 63 1a1b4: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 1a1b6: 30 91 18 05 lds r19, 0x0518 ; 0x800518 1a1ba: 20 91 17 05 lds r18, 0x0517 ; 0x800517 1a1be: 32 13 cpse r19, r18 1a1c0: 73 c0 rjmp .+230 ; 0x1a2a8 1a1c2: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 1a1c4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1a1c8: 88 23 and r24, r24 1a1ca: 09 f4 brne .+2 ; 0x1a1ce 1a1cc: 45 c0 rjmp .+138 ; 0x1a258 //! //! @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)); 1a1ce: 82 e5 ldi r24, 0x52 ; 82 1a1d0: 94 e4 ldi r25, 0x44 ; 68 1a1d2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a1d6: 9f 93 push r25 1a1d8: 8f 93 push r24 1a1da: 83 e2 ldi r24, 0x23 ; 35 1a1dc: 91 e9 ldi r25, 0x91 ; 145 1a1de: 9f 93 push r25 1a1e0: 8f 93 push r24 1a1e2: 8e 01 movw r16, r28 1a1e4: 0f 5f subi r16, 0xFF ; 255 1a1e6: 1f 4f sbci r17, 0xFF ; 255 1a1e8: 1f 93 push r17 1a1ea: 0f 93 push r16 1a1ec: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 1a1f0: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 1a1f2: 47 e0 ldi r20, 0x07 ; 7 1a1f4: 50 e0 ldi r21, 0x00 ; 0 1a1f6: b7 01 movw r22, r14 1a1f8: 80 0f add r24, r16 1a1fa: 91 2f mov r25, r17 1a1fc: 91 1d adc r25, r1 1a1fe: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 1a202: 0f 90 pop r0 1a204: 0f 90 pop r0 1a206: 0f 90 pop r0 1a208: 0f 90 pop r0 1a20a: 0f 90 pop r0 1a20c: 0f 90 pop r0 1a20e: 20 e0 ldi r18, 0x00 ; 0 1a210: 82 2f mov r24, r18 1a212: 8d 0d add r24, r13 1a214: 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) 1a216: 27 30 cpi r18, 0x07 ; 7 1a218: 39 f0 breq .+14 ; 0x1a228 1a21a: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 1a21c: f8 01 movw r30, r16 1a21e: e8 0f add r30, r24 1a220: f9 1f adc r31, r25 1a222: 30 81 ld r19, Z 1a224: 31 11 cpse r19, r1 1a226: f4 cf rjmp .-24 ; 0x1a210 } buffer.c[index] = ']'; 1a228: f8 01 movw r30, r16 1a22a: e8 0f add r30, r24 1a22c: f9 1f adc r31, r25 1a22e: 2d e5 ldi r18, 0x5D ; 93 1a230: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 1a232: 8c 0f add r24, r28 1a234: 9d 1f adc r25, r29 1a236: fc 01 movw r30, r24 1a238: 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()); 1a23a: 0f 94 9c cd call 0x39b38 ; 0x39b38 1a23e: 48 2f mov r20, r24 1a240: 60 91 15 05 lds r22, 0x0515 ; 0x800515 1a244: 80 e0 ldi r24, 0x00 ; 0 1a246: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_print_pad(buffer.c, LCD_WIDTH - 2); 1a24a: 62 e1 ldi r22, 0x12 ; 18 1a24c: c8 01 movw r24, r16 1a24e: 0e 94 04 72 call 0xe408 ; 0xe408 lcd_putc(type_char); 1a252: 80 e2 ldi r24, 0x20 ; 32 1a254: 0e 94 04 70 call 0xe008 ; 0xe008 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)) 1a258: 80 91 16 05 lds r24, 0x0516 ; 0x800516 1a25c: 88 23 and r24, r24 1a25e: 21 f1 breq .+72 ; 0x1a2a8 1a260: 20 91 18 05 lds r18, 0x0518 ; 0x800518 1a264: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1a268: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1a26c: 28 17 cp r18, r24 1a26e: 19 06 cpc r1, r25 1a270: d9 f4 brne .+54 ; 0x1a2a8 { lcd_update_enabled = 0; 1a272: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 1a276: 8e e6 ldi r24, 0x6E ; 110 1a278: 98 e7 ldi r25, 0x78 ; 120 1a27a: 89 2b or r24, r25 1a27c: 11 f0 breq .+4 ; 0x1a282 1a27e: 0e 94 6e 78 call 0xf0dc ; 0xf0dc lcd_update_enabled = 1; 1a282: 81 e0 ldi r24, 0x01 ; 1 1a284: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); 1a288: 0f 94 c0 cd call 0x39b80 ; 0x39b80 return; } } menu_item++; } 1a28c: 63 96 adiw r28, 0x13 ; 19 1a28e: 0f b6 in r0, 0x3f ; 63 1a290: f8 94 cli 1a292: de bf out 0x3e, r29 ; 62 1a294: 0f be out 0x3f, r0 ; 63 1a296: cd bf out 0x3d, r28 ; 61 1a298: df 91 pop r29 1a29a: cf 91 pop r28 1a29c: 1f 91 pop r17 1a29e: 0f 91 pop r16 1a2a0: ff 90 pop r15 1a2a2: ef 90 pop r14 1a2a4: df 90 pop r13 1a2a6: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 1a2a8: 80 91 18 05 lds r24, 0x0518 ; 0x800518 1a2ac: 8f 5f subi r24, 0xFF ; 255 1a2ae: 80 93 18 05 sts 0x0518, r24 ; 0x800518 1a2b2: ec cf rjmp .-40 ; 0x1a28c 0001a2b4 : bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 1a2b4: cf 92 push r12 1a2b6: df 92 push r13 1a2b8: ef 92 push r14 1a2ba: ff 92 push r15 1a2bc: 0f 93 push r16 1a2be: 1f 93 push r17 1a2c0: cf 93 push r28 1a2c2: df 93 push r29 1a2c4: 6c 01 movw r12, r24 1a2c6: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 1a2c8: c4 2f mov r28, r20 1a2ca: d0 e0 ldi r29, 0x00 ; 0 1a2cc: ae 01 movw r20, r28 1a2ce: 0f 94 3a db call 0x3b674 ; 0x3b674 1a2d2: 89 2b or r24, r25 1a2d4: b9 f4 brne .+46 ; 0x1a304 Number(str + tagSize, v); 1a2d6: b8 01 movw r22, r16 1a2d8: c6 01 movw r24, r12 1a2da: 8c 0f add r24, r28 1a2dc: 9d 1f adc r25, r29 1a2de: 0e 94 85 cf call 0x19f0a ; 0x19f0a *v |= tagMask; 1a2e2: f8 01 movw r30, r16 1a2e4: 20 81 ld r18, Z 1a2e6: 31 81 ldd r19, Z+1 ; 0x01 1a2e8: 2e 29 or r18, r14 1a2ea: 3f 29 or r19, r15 1a2ec: 31 83 std Z+1, r19 ; 0x01 1a2ee: 20 83 st Z, r18 return true; 1a2f0: 81 e0 ldi r24, 0x01 ; 1 } return false; } 1a2f2: df 91 pop r29 1a2f4: cf 91 pop r28 1a2f6: 1f 91 pop r17 1a2f8: 0f 91 pop r16 1a2fa: ff 90 pop r15 1a2fc: ef 90 pop r14 1a2fe: df 90 pop r13 1a300: cf 90 pop r12 1a302: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 1a304: 80 e0 ldi r24, 0x00 ; 0 1a306: f5 cf rjmp .-22 ; 0x1a2f2 0001a308 : } #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); 1a308: 87 ea ldi r24, 0xA7 ; 167 1a30a: 9c e0 ldi r25, 0x0C ; 12 1a30c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 if (value > 1) value = 1; 1a310: 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) 1a312: 82 30 cpi r24, 0x02 ; 2 1a314: 08 f4 brcc .+2 ; 0x1a318 1a316: 68 27 eor r22, r24 1a318: 87 ea ldi r24, 0xA7 ; 167 1a31a: 9c e0 ldi r25, 0x0C ; 12 1a31c: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0001a320 : bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); } #ifdef PRUSA_SN_SUPPORT void WorkaroundPrusaSN() { 1a320: cf 93 push r28 1a322: df 93 push r29 1a324: c5 e1 ldi r28, 0x15 ; 21 1a326: 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++)); 1a328: fe 01 movw r30, r28 1a32a: e7 51 subi r30, 0x17 ; 23 1a32c: f0 48 sbci r31, 0x80 ; 128 1a32e: 64 91 lpm r22, Z 1a330: ce 01 movw r24, r28 1a332: 0f 94 7f dd call 0x3bafe ; 0x3bafe 1a336: 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++) { 1a338: c9 32 cpi r28, 0x29 ; 41 1a33a: 8d e0 ldi r24, 0x0D ; 13 1a33c: d8 07 cpc r29, r24 1a33e: a1 f7 brne .-24 ; 0x1a328 eeprom_update_byte_notify((uint8_t*)EEPROM_PRUSA_SN + i, pgm_read_byte(SN++)); } } 1a340: df 91 pop r29 1a342: cf 91 pop r28 1a344: 08 95 ret 0001a346 : 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); 1a346: 8a ea ldi r24, 0xAA ; 170 1a348: 9d e0 ldi r25, 0x0D ; 13 1a34a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 1a34e: 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) { 1a350: 83 30 cpi r24, 0x03 ; 3 1a352: 21 f0 breq .+8 ; 0x1a35c case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 1a354: 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) { 1a356: 85 30 cpi r24, 0x05 ; 5 1a358: 09 f0 breq .+2 ; 0x1a35c case 1: mbl_z_probe_nr = 3; break; 1a35a: 63 e0 ldi r22, 0x03 ; 3 1a35c: 8a ea ldi r24, 0xAA ; 170 1a35e: 9d e0 ldi r25, 0x0D ; 13 1a360: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0001a364 : 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); 1a364: 8b ea ldi r24, 0xAB ; 171 1a366: 9d e0 ldi r25, 0x0D ; 13 1a368: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 1a36c: 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; 1a36e: 83 30 cpi r24, 0x03 ; 3 1a370: 09 f4 brne .+2 ; 0x1a374 1a372: 67 e0 ldi r22, 0x07 ; 7 1a374: 8b ea ldi r24, 0xAB ; 171 1a376: 9d e0 ldi r25, 0x0D ; 13 1a378: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0001a37c : #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); 1a37c: 8c ea ldi r24, 0xAC ; 172 1a37e: 9d e0 ldi r25, 0x0D ; 13 1a380: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 magnet_elimination = !magnet_elimination; 1a384: 61 e0 ldi r22, 0x01 ; 1 1a386: 81 11 cpse r24, r1 1a388: 60 e0 ldi r22, 0x00 ; 0 1a38a: 8c ea ldi r24, 0xAC ; 172 1a38c: 9d e0 ldi r25, 0x0D ; 13 1a38e: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0001a392 : 1a392: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 1a396: 81 ea ldi r24, 0xA1 ; 161 1a398: 9d e0 ldi r25, 0x0D ; 13 1a39a: 0f 94 7f dd call 0x3bafe ; 0x3bafe //! @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(); 1a39e: 0d 94 84 29 jmp 0x25308 ; 0x25308 0001a3a2 : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 1a3a2: 0f 93 push r16 1a3a4: 1f 93 push r17 1a3a6: cf 93 push r28 1a3a8: df 93 push r29 1a3aa: 00 d0 rcall .+0 ; 0x1a3ac 1a3ac: 00 d0 rcall .+0 ; 0x1a3ae 1a3ae: 1f 92 push r1 1a3b0: 1f 92 push r1 1a3b2: cd b7 in r28, 0x3d ; 61 1a3b4: de b7 in r29, 0x3e ; 62 1a3b6: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 1a3b8: 8a e0 ldi r24, 0x0A ; 10 1a3ba: 90 e0 ldi r25, 0x00 ; 0 1a3bc: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 1a3c0: 9a 83 std Y+2, r25 ; 0x02 1a3c2: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 1a3c4: 8c e0 ldi r24, 0x0C ; 12 1a3c6: 90 e0 ldi r25, 0x00 ; 0 1a3c8: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 1a3cc: 9c 83 std Y+4, r25 ; 0x04 1a3ce: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 1a3d0: 8e e0 ldi r24, 0x0E ; 14 1a3d2: 90 e0 ldi r25, 0x00 ; 0 1a3d4: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 1a3d8: 9e 83 std Y+6, r25 ; 0x06 1a3da: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 1a3dc: 80 e1 ldi r24, 0x10 ; 16 1a3de: 90 e0 ldi r25, 0x00 ; 0 1a3e0: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 1a3e4: 98 87 std Y+8, r25 ; 0x08 1a3e6: 8f 83 std Y+7, r24 ; 0x07 1a3e8: c8 01 movw r24, r16 1a3ea: de 01 movw r26, r28 1a3ec: 11 96 adiw r26, 0x01 ; 1 1a3ee: be 01 movw r22, r28 1a3f0: 67 5f subi r22, 0xF7 ; 247 1a3f2: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 1a3f4: fc 01 movw r30, r24 1a3f6: 25 91 lpm r18, Z+ 1a3f8: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 1a3fa: 4d 91 ld r20, X+ 1a3fc: 5d 91 ld r21, X+ 1a3fe: 42 17 cp r20, r18 1a400: 53 07 cpc r21, r19 1a402: 48 f0 brcs .+18 ; 0x1a416 return true; else if (v < ver_eeprom[i]) 1a404: 24 17 cp r18, r20 1a406: 35 07 cpc r19, r21 1a408: 20 f0 brcs .+8 ; 0x1a412 1a40a: 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) { 1a40c: a6 17 cp r26, r22 1a40e: b7 07 cpc r27, r23 1a410: 89 f7 brne .-30 ; 0x1a3f4 return true; else if (v < ver_eeprom[i]) break; } return false; 1a412: 80 e0 ldi r24, 0x00 ; 0 1a414: 01 c0 rjmp .+2 ; 0x1a418 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; 1a416: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 1a418: 28 96 adiw r28, 0x08 ; 8 1a41a: 0f b6 in r0, 0x3f ; 63 1a41c: f8 94 cli 1a41e: de bf out 0x3e, r29 ; 62 1a420: 0f be out 0x3f, r0 ; 63 1a422: cd bf out 0x3d, r28 ; 61 1a424: df 91 pop r29 1a426: cf 91 pop r28 1a428: 1f 91 pop r17 1a42a: 0f 91 pop r16 1a42c: 08 95 ret 0001a42e : value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { restore_file_from_sd(); 1a42e: 0e 94 86 8a call 0x1150c ; 0x1150c // M24: Start/resume SD print enquecommand_P(MSG_M24); 1a432: 61 e0 ldi r22, 0x01 ; 1 1a434: 8d e8 ldi r24, 0x8D ; 141 1a436: 91 e7 ldi r25, 0x71 ; 113 1a438: 0e 94 cb 89 call 0x11396 ; 0x11396 lcd_return_to_status(); 1a43c: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 0001a440 : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 1a440: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 1a442: 8e ec ldi r24, 0xCE ; 206 1a444: 9d e3 ldi r25, 0x3D ; 61 1a446: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a44a: ac 01 movw r20, r24 1a44c: 60 e0 ldi r22, 0x00 ; 0 1a44e: 80 e0 ldi r24, 0x00 ; 0 1a450: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_putc_at(0, 1, '\n'); 1a454: 4a e0 ldi r20, 0x0A ; 10 1a456: 61 e0 ldi r22, 0x01 ; 1 1a458: 80 e0 ldi r24, 0x00 ; 0 1a45a: 0e 94 35 70 call 0xe06a ; 0xe06a MENU_BEGIN(); 1a45e: 0f 94 da ce call 0x39db4 ; 0x39db4 1a462: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a466: 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(); 1a468: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a46c: 84 30 cpi r24, 0x04 ; 4 1a46e: 18 f5 brcc .+70 ; 0x1a4b6 1a470: 10 92 18 05 sts 0x0518, r1 ; 0x800518 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a474: 81 11 cpse r24, r1 1a476: 02 c0 rjmp .+4 ; 0x1a47c 1a478: c0 93 15 05 sts 0x0515, r28 ; 0x800515 // Show No options first, the default selection MENU_ITEM_FUNCTION_P(_T(MSG_NO), lcd_return_to_status); 1a47c: 89 ec ldi r24, 0xC9 ; 201 1a47e: 9d e3 ldi r25, 0x3D ; 61 1a480: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a484: 64 ea ldi r22, 0xA4 ; 164 1a486: 7a e3 ldi r23, 0x3A ; 58 1a488: 0f 94 57 ce call 0x39cae ; 0x39cae MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 1a48c: 83 ec ldi r24, 0xC3 ; 195 1a48e: 9d e3 ldi r25, 0x3D ; 61 1a490: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a494: 6a e3 ldi r22, 0x3A ; 58 1a496: 7b e3 ldi r23, 0x3B ; 59 1a498: 0f 94 57 ce call 0x39cae ; 0x39cae MENU_END(); 1a49c: 0f 94 ae ce call 0x39d5c ; 0x39d5c { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1a4a0: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a4a4: 8f 5f subi r24, 0xFF ; 255 1a4a6: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a4aa: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1a4ae: 8f 5f subi r24, 0xFF ; 255 1a4b0: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1a4b4: d9 cf rjmp .-78 ; 0x1a468 // 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(); } 1a4b6: cf 91 pop r28 1a4b8: 08 95 ret 0001a4ba : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 1a4ba: cf 93 push r28 1a4bc: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 1a4be: 88 ed ldi r24, 0xD8 ; 216 1a4c0: 93 e0 ldi r25, 0x03 ; 3 1a4c2: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 1a4c6: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 1a4ca: 81 11 cpse r24, r1 1a4cc: 18 c0 rjmp .+48 ; 0x1a4fe 1a4ce: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 1a4d2: 81 11 cpse r24, r1 1a4d4: 14 c0 rjmp .+40 ; 0x1a4fe 1a4d6: c0 91 69 0e lds r28, 0x0E69 ; 0x800e69 1a4da: d0 91 6a 0e lds r29, 0x0E6A ; 0x800e6a 1a4de: 8a e3 ldi r24, 0x3A ; 58 1a4e0: c8 3a cpi r28, 0xA8 ; 168 1a4e2: d8 07 cpc r29, r24 1a4e4: 61 f0 breq .+24 ; 0x1a4fe 1a4e6: 89 e3 ldi r24, 0x39 ; 57 1a4e8: c0 3e cpi r28, 0xE0 ; 224 1a4ea: d8 07 cpc r29, r24 1a4ec: 41 f0 breq .+16 ; 0x1a4fe 1a4ee: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 1a4f2: 81 11 cpse r24, r1 1a4f4: 04 c0 rjmp .+8 ; 0x1a4fe 1a4f6: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a4fa: 88 23 and r24, r24 1a4fc: 31 f0 breq .+12 ; 0x1a50a { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 1a4fe: 82 e0 ldi r24, 0x02 ; 2 1a500: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a504: df 91 pop r29 1a506: cf 91 pop r28 1a508: 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) 1a50a: 89 e3 ldi r24, 0x39 ; 57 1a50c: c4 3f cpi r28, 0xF4 ; 244 1a50e: d8 07 cpc r29, r24 1a510: 49 f4 brne .+18 ; 0x1a524 { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 1a512: 82 e0 ldi r24, 0x02 ; 2 1a514: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d eeprom_toggle((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY); 1a518: 8a e2 ldi r24, 0x2A ; 42 1a51a: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a51c: df 91 pop r29 1a51e: 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); 1a520: 0c 94 3f 78 jmp 0xf07e ; 0xf07e 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); 1a524: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 1a528: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 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 1a52c: 98 13 cpse r25, r24 1a52e: 04 c0 rjmp .+8 ; 0x1a538 1a530: 0e 94 c5 68 call 0xd18a ; 0xd18a 1a534: 88 23 and r24, r24 1a536: 61 f0 breq .+24 ; 0x1a550 if ( babystep_allowed_strict() 1a538: 0e 94 00 69 call 0xd200 ; 0xd200 && (menu_menu == lcd_status_screen // and in listed menus... 1a53c: 81 11 cpse r24, r1 1a53e: 10 c0 rjmp .+32 ; 0x1a560 Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 1a540: 82 e0 ldi r24, 0x02 ; 2 1a542: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1a546: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a548: df 91 pop r29 1a54a: cf 91 pop r28 1a54c: 0d 94 7a 63 jmp 0x2c6f4 ; 0x2c6f4 menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 1a550: 8a e3 ldi r24, 0x3A ; 58 1a552: c4 36 cpi r28, 0x64 ; 100 1a554: d8 07 cpc r29, r24 1a556: e1 f4 brne .+56 ; 0x1a590 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a558: 60 e0 ldi r22, 0x00 ; 0 1a55a: 80 ee ldi r24, 0xE0 ; 224 1a55c: 99 e3 ldi r25, 0x39 ; 57 1a55e: 14 c0 rjmp .+40 ; 0x1a588 // 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... 1a560: 8a e3 ldi r24, 0x3A ; 58 1a562: c4 36 cpi r28, 0x64 ; 100 1a564: d8 07 cpc r29, r24 1a566: 59 f0 breq .+22 ; 0x1a57e || menu_menu == lcd_main_menu 1a568: 83 ee ldi r24, 0xE3 ; 227 1a56a: c4 3e cpi r28, 0xE4 ; 228 1a56c: d8 07 cpc r29, r24 1a56e: 39 f0 breq .+14 ; 0x1a57e || menu_menu == lcd_tune_menu 1a570: 84 ed ldi r24, 0xD4 ; 212 1a572: ce 30 cpi r28, 0x0E ; 14 1a574: d8 07 cpc r29, r24 1a576: 19 f0 breq .+6 ; 0x1a57e || menu_menu == lcd_support_menu 1a578: cc 5f subi r28, 0xFC ; 252 1a57a: da 43 sbci r29, 0x3A ; 58 1a57c: 09 f7 brne .-62 ; 0x1a540 ) ){ lcd_clear(); 1a57e: 0e 94 48 70 call 0xe090 ; 0xe090 menu_submenu(lcd_babystep_z); 1a582: 60 e0 ldi r22, 0x00 ; 0 1a584: 88 ea ldi r24, 0xA8 ; 168 1a586: 9a e3 ldi r25, 0x3A ; 58 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a588: df 91 pop r29 1a58a: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a58c: 0d 94 47 d0 jmp 0x3a08e ; 0x3a08e } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 1a590: 83 ee ldi r24, 0xE3 ; 227 1a592: c4 3e cpi r28, 0xE4 ; 228 1a594: d8 07 cpc r29, r24 1a596: 01 f3 breq .-64 ; 0x1a558 || menu_menu == lcd_preheat_menu 1a598: 89 e3 ldi r24, 0x39 ; 57 1a59a: cc 3d cpi r28, 0xDC ; 220 1a59c: d8 07 cpc r29, r24 1a59e: e1 f2 breq .-72 ; 0x1a558 || menu_menu == lcd_sdcard_menu 1a5a0: 89 e3 ldi r24, 0x39 ; 57 1a5a2: ce 3d cpi r28, 0xDE ; 222 1a5a4: d8 07 cpc r29, r24 1a5a6: c1 f2 breq .-80 ; 0x1a558 || menu_menu == lcd_settings_menu 1a5a8: 8b e3 ldi r24, 0x3B ; 59 1a5aa: ce 35 cpi r28, 0x5E ; 94 1a5ac: d8 07 cpc r29, r24 1a5ae: a1 f2 breq .-88 ; 0x1a558 || menu_menu == lcd_control_temperature_menu 1a5b0: 83 ed ldi r24, 0xD3 ; 211 1a5b2: ce 3e cpi r28, 0xEE ; 238 1a5b4: d8 07 cpc r29, r24 1a5b6: 81 f2 breq .-96 ; 0x1a558 #if (LANG_MODE != 0) || menu_menu == lcd_language 1a5b8: 8a e3 ldi r24, 0x3A ; 58 1a5ba: c4 38 cpi r28, 0x84 ; 132 1a5bc: d8 07 cpc r29, r24 1a5be: 61 f2 breq .-104 ; 0x1a558 #endif || menu_menu == lcd_support_menu 1a5c0: cc 5f subi r28, 0xFC ; 252 1a5c2: da 43 sbci r29, 0x3A ; 58 1a5c4: 09 f0 breq .+2 ; 0x1a5c8 1a5c6: bc cf rjmp .-136 ; 0x1a540 1a5c8: c7 cf rjmp .-114 ; 0x1a558 0001a5ca : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a5ca: 0f 94 da ce call 0x39db4 ; 0x39db4 1a5ce: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1a5d2: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a5d6: 84 30 cpi r24, 0x04 ; 4 1a5d8: 08 f0 brcs .+2 ; 0x1a5dc 1a5da: 3f c0 rjmp .+126 ; 0x1a65a 1a5dc: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 1a5e0: 8e e8 ldi r24, 0x8E ; 142 1a5e2: 9b e3 ldi r25, 0x3B ; 59 1a5e4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a5e8: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a if(eeprom_is_sheet_initialized(selected_sheet)){ 1a5ec: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 1a5f0: 0e 94 4c 78 call 0xf098 ; 0xf098 1a5f4: 88 23 and r24, r24 1a5f6: 41 f0 breq .+16 ; 0x1a608 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 1a5f8: 85 e8 ldi r24, 0x85 ; 133 1a5fa: 9b e3 ldi r25, 0x3B ; 59 1a5fc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a600: 6e e1 ldi r22, 0x1E ; 30 1a602: 78 ed ldi r23, 0xD8 ; 216 1a604: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } if (lcd_commands_type == LcdCommands::Idle) 1a608: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 1a60c: 81 11 cpse r24, r1 1a60e: 08 c0 rjmp .+16 ; 0x1a620 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 1a610: 82 e7 ldi r24, 0x72 ; 114 1a612: 9b e3 ldi r25, 0x3B ; 59 1a614: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a618: 69 ec ldi r22, 0xC9 ; 201 1a61a: 71 ed ldi r23, 0xD1 ; 209 1a61c: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 1a620: 89 e6 ldi r24, 0x69 ; 105 1a622: 9b e3 ldi r25, 0x3B ; 59 1a624: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a628: 61 ee ldi r22, 0xE1 ; 225 1a62a: 75 ed ldi r23, 0xD5 ; 213 1a62c: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 1a630: 81 e6 ldi r24, 0x61 ; 97 1a632: 9b e3 ldi r25, 0x3B ; 59 1a634: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a638: 61 e4 ldi r22, 0x41 ; 65 1a63a: 76 ee ldi r23, 0xE6 ; 230 1a63c: 0f 94 57 ce call 0x39cae ; 0x39cae MENU_END(); 1a640: 0f 94 ae ce call 0x39d5c ; 0x39d5c lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a644: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a648: 8f 5f subi r24, 0xFF ; 255 1a64a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a64e: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1a652: 8f 5f subi r24, 0xFF ; 255 1a654: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1a658: bc cf rjmp .-136 ; 0x1a5d2 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 1a65a: 08 95 ret 0001a65c () [clone .lto_priv.452]>: } template static void select_sheet_menu() { selected_sheet = number; 1a65c: 87 e0 ldi r24, 0x07 ; 7 1a65e: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a662: 0c 94 e5 d2 jmp 0x1a5ca ; 0x1a5ca 0001a666 () [clone .lto_priv.451]>: } template static void select_sheet_menu() { selected_sheet = number; 1a666: 86 e0 ldi r24, 0x06 ; 6 1a668: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a66c: 0c 94 e5 d2 jmp 0x1a5ca ; 0x1a5ca 0001a670 () [clone .lto_priv.450]>: } template static void select_sheet_menu() { selected_sheet = number; 1a670: 85 e0 ldi r24, 0x05 ; 5 1a672: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a676: 0c 94 e5 d2 jmp 0x1a5ca ; 0x1a5ca 0001a67a () [clone .lto_priv.449]>: } template static void select_sheet_menu() { selected_sheet = number; 1a67a: 84 e0 ldi r24, 0x04 ; 4 1a67c: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a680: 0c 94 e5 d2 jmp 0x1a5ca ; 0x1a5ca 0001a684 () [clone .lto_priv.448]>: } template static void select_sheet_menu() { selected_sheet = number; 1a684: 83 e0 ldi r24, 0x03 ; 3 1a686: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a68a: 0c 94 e5 d2 jmp 0x1a5ca ; 0x1a5ca 0001a68e () [clone .lto_priv.447]>: } template static void select_sheet_menu() { selected_sheet = number; 1a68e: 82 e0 ldi r24, 0x02 ; 2 1a690: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a694: 0c 94 e5 d2 jmp 0x1a5ca ; 0x1a5ca 0001a698 () [clone .lto_priv.446]>: } template static void select_sheet_menu() { selected_sheet = number; 1a698: 81 e0 ldi r24, 0x01 ; 1 1a69a: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a69e: 0c 94 e5 d2 jmp 0x1a5ca ; 0x1a5ca 0001a6a2 () [clone .lto_priv.445]>: } template static void select_sheet_menu() { selected_sheet = number; 1a6a2: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de lcd_sheet_menu(); 1a6a6: 0c 94 e5 d2 jmp 0x1a5ca ; 0x1a5ca 0001a6aa : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1a6aa: 0f 94 da ce call 0x39db4 ; 0x39db4 1a6ae: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1a6b2: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a6b6: 84 30 cpi r24, 0x04 ; 4 1a6b8: 08 f0 brcs .+2 ; 0x1a6bc 1a6ba: 8f c0 rjmp .+286 ; 0x1a7da 1a6bc: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1a6c0: 8a e1 ldi r24, 0x1A ; 26 1a6c2: 9e e3 ldi r25, 0x3E ; 62 1a6c4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a6c8: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 1a6cc: 83 e1 ldi r24, 0x13 ; 19 1a6ce: 9b e3 ldi r25, 0x3B ; 59 1a6d0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a6d4: 6c ee ldi r22, 0xEC ; 236 1a6d6: 7a e3 ldi r23, 0x3A ; 58 1a6d8: 0f 94 57 ce call 0x39cae ; 0x39cae if (lcd_commands_type == LcdCommands::Idle) 1a6dc: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 1a6e0: 81 11 cpse r24, r1 1a6e2: 08 c0 rjmp .+16 ; 0x1a6f4 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1a6e4: 82 e7 ldi r24, 0x72 ; 114 1a6e6: 9b e3 ldi r25, 0x3B ; 59 1a6e8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a6ec: 62 ed ldi r22, 0xD2 ; 210 1a6ee: 7a e3 ldi r23, 0x3A ; 58 1a6f0: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 1a6f4: 8a e0 ldi r24, 0x0A ; 10 1a6f6: 9a e4 ldi r25, 0x4A ; 74 1a6f8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a6fc: 65 ec ldi r22, 0xC5 ; 197 1a6fe: 7c e6 ldi r23, 0x6C ; 108 1a700: 0f 94 d0 cd call 0x39ba0 ; 0x39ba0 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); 1a704: 87 e0 ldi r24, 0x07 ; 7 1a706: 9b e3 ldi r25, 0x3B ; 59 1a708: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a70c: 62 ec ldi r22, 0xC2 ; 194 1a70e: 79 e3 ldi r23, 0x39 ; 57 1a710: 0f 94 57 ce call 0x39cae ; 0x39cae #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 1a714: 8c ef ldi r24, 0xFC ; 252 1a716: 9a e3 ldi r25, 0x3A ; 58 1a718: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a71c: 60 e8 ldi r22, 0x80 ; 128 1a71e: 7b e3 ldi r23, 0x3B ; 59 1a720: 0f 94 57 ce call 0x39cae ; 0x39cae // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 1a724: 8c ee ldi r24, 0xEC ; 236 1a726: 9a e3 ldi r25, 0x3A ; 58 1a728: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a72c: 60 ec ldi r22, 0xC0 ; 192 1a72e: 79 e3 ldi r23, 0x39 ; 57 1a730: 0f 94 57 ce call 0x39cae ; 0x39cae // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 1a734: 8e ed ldi r24, 0xDE ; 222 1a736: 9a e3 ldi r25, 0x3A ; 58 1a738: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a73c: 68 e0 ldi r22, 0x08 ; 8 1a73e: 7b e3 ldi r23, 0x3B ; 59 1a740: 0f 94 57 ce call 0x39cae ; 0x39cae MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 1a744: 8a ec ldi r24, 0xCA ; 202 1a746: 9a e3 ldi r25, 0x3A ; 58 1a748: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a74c: 68 e3 ldi r22, 0x38 ; 56 1a74e: 7a e3 ldi r23, 0x3A ; 58 1a750: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 1a754: 86 eb ldi r24, 0xB6 ; 182 1a756: 9a e3 ldi r25, 0x3A ; 58 1a758: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a75c: 66 ea ldi r22, 0xA6 ; 166 1a75e: 7a e3 ldi r23, 0x3A ; 58 1a760: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 1a764: 84 ea ldi r24, 0xA4 ; 164 1a766: 9a e3 ldi r25, 0x3A ; 58 1a768: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a76c: 6c e5 ldi r22, 0x5C ; 92 1a76e: 7b e3 ldi r23, 0x3B ; 59 1a770: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #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")); 1a774: 80 e9 ldi r24, 0x90 ; 144 1a776: 9a e3 ldi r25, 0x3A ; 58 1a778: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a77c: 6e ee ldi r22, 0xEE ; 238 1a77e: 7b e8 ldi r23, 0x8B ; 139 1a780: 0f 94 d0 cd call 0x39ba0 ; 0x39ba0 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1a784: 20 e0 ldi r18, 0x00 ; 0 1a786: 30 e0 ldi r19, 0x00 ; 0 1a788: 40 e2 ldi r20, 0x20 ; 32 1a78a: 51 e4 ldi r21, 0x41 ; 65 1a78c: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1a790: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 1a794: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1a798: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1a79c: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1a7a0: 87 fd sbrc r24, 7 1a7a2: 08 c0 rjmp .+16 ; 0x1a7b4 MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 1a7a4: 83 e8 ldi r24, 0x83 ; 131 1a7a6: 9a e3 ldi r25, 0x3A ; 58 1a7a8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a7ac: 68 e4 ldi r22, 0x48 ; 72 1a7ae: 7a e3 ldi r23, 0x3A ; 58 1a7b0: 0f 94 57 ce call 0x39cae ; 0x39cae #endif #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); 1a7b4: 63 ea ldi r22, 0xA3 ; 163 1a7b6: 7f ec ldi r23, 0xCF ; 207 1a7b8: 80 e9 ldi r24, 0x90 ; 144 1a7ba: 9b e6 ldi r25, 0x6B ; 107 1a7bc: 0f 94 57 ce call 0x39cae ; 0x39cae #endif //THERMAL_MODEL MENU_END(); 1a7c0: 0f 94 ae ce call 0x39d5c ; 0x39d5c } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1a7c4: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a7c8: 8f 5f subi r24, 0xFF ; 255 1a7ca: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a7ce: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1a7d2: 8f 5f subi r24, 0xFF ; 255 1a7d4: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1a7d8: 6c cf rjmp .-296 ; 0x1a6b2 #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 1a7da: 08 95 ret 0001a7dc : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1a7dc: 0f 94 da ce call 0x39db4 ; 0x39db4 1a7e0: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1a7e4: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a7e8: 84 30 cpi r24, 0x04 ; 4 1a7ea: b8 f4 brcc .+46 ; 0x1a81a 1a7ec: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1a7f0: 88 eb ldi r24, 0xB8 ; 184 1a7f2: 9d e3 ldi r25, 0x3D ; 61 1a7f4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a7f8: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a menuitems_temperature_common(); 1a7fc: 0f 94 d6 31 call 0x263ac ; 0x263ac MENU_END(); 1a800: 0f 94 ae ce call 0x39d5c ; 0x39d5c } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1a804: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a808: 8f 5f subi r24, 0xFF ; 255 1a80a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a80e: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1a812: 8f 5f subi r24, 0xFF ; 255 1a814: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1a818: e5 cf rjmp .-54 ; 0x1a7e4 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 1a81a: 08 95 ret 0001a81c : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 1a81c: ef 92 push r14 1a81e: ff 92 push r15 1a820: 0f 93 push r16 1a822: 1f 93 push r17 1a824: cf 93 push r28 1a826: df 93 push r29 1a828: 80 91 94 02 lds r24, 0x0294 ; 0x800294 1a82c: 90 91 95 02 lds r25, 0x0295 ; 0x800295 //! 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) 1a830: 20 91 b6 03 lds r18, 0x03B6 ; 0x8003b6 1a834: 21 11 cpse r18, r1 1a836: 97 c0 rjmp .+302 ; 0x1a966 { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 1a838: 21 e0 ldi r18, 0x01 ; 1 1a83a: 20 93 b6 03 sts 0x03B6, r18 ; 0x8003b6 _md->extrudemultiply = extrudemultiply; 1a83e: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 1a842: 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); 1a846: 8f ef ldi r24, 0xFF ; 255 1a848: 9f e0 ldi r25, 0x0F ; 15 1a84a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1a84e: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 MENU_BEGIN(); 1a852: 0f 94 da ce call 0x39db4 ; 0x39db4 1a856: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1a85a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a85e: 84 30 cpi r24, 0x04 ; 4 1a860: 08 f0 brcs .+2 ; 0x1a864 1a862: 99 c0 rjmp .+306 ; 0x1a996 1a864: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 1a868: 0f 94 5a cd call 0x39ab4 ; 0x39ab4 1a86c: 81 11 cpse r24, r1 1a86e: 0e 94 18 66 call 0xcc30 ; 0xcc30 refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1a872: 8a e1 ldi r24, 0x1A ; 26 1a874: 9e e3 ldi r25, 0x3E ; 62 1a876: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a87a: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 1a87e: 80 e4 ldi r24, 0x40 ; 64 1a880: 9d e3 ldi r25, 0x3D ; 61 1a882: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a886: f1 2c mov r15, r1 1a888: e1 2c mov r14, r1 1a88a: 07 ee ldi r16, 0xE7 ; 231 1a88c: 13 e0 ldi r17, 0x03 ; 3 1a88e: 2a e0 ldi r18, 0x0A ; 10 1a890: 30 e0 ldi r19, 0x00 ; 0 1a892: 40 e1 ldi r20, 0x10 ; 16 1a894: 69 e3 ldi r22, 0x39 ; 57 1a896: 72 e0 ldi r23, 0x02 ; 2 1a898: 0f 94 2a cf call 0x39e54 ; 0x39e54 menuitems_temperature_common(); 1a89c: 0f 94 d6 31 call 0x263ac ; 0x263ac MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 1a8a0: 89 e3 ldi r24, 0x39 ; 57 1a8a2: 9d e3 ldi r25, 0x3D ; 61 1a8a4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a8a8: 2a e0 ldi r18, 0x0A ; 10 1a8aa: 30 e0 ldi r19, 0x00 ; 0 1a8ac: 40 e1 ldi r20, 0x10 ; 16 1a8ae: 64 e9 ldi r22, 0x94 ; 148 1a8b0: 72 e0 ldi r23, 0x02 ; 2 1a8b2: 0f 94 2a cf call 0x39e54 ; 0x39e54 #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); 1a8b6: 87 e2 ldi r24, 0x27 ; 39 1a8b8: 9d e3 ldi r25, 0x3D ; 61 1a8ba: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a8be: 60 e5 ldi r22, 0x50 ; 80 1a8c0: 7b e3 ldi r23, 0x3B ; 59 1a8c2: 0f 94 57 ce call 0x39cae ; 0x39cae #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 1a8c6: 0e 94 ba 68 call 0xd174 ; 0xd174 1a8ca: 88 23 and r24, r24 1a8cc: 41 f0 breq .+16 ; 0x1a8de MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 1a8ce: 8a e0 ldi r24, 0x0A ; 10 1a8d0: 9a e4 ldi r25, 0x4A ; 74 1a8d2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a8d6: 66 e0 ldi r22, 0x06 ; 6 1a8d8: 7c e8 ldi r23, 0x8C ; 140 1a8da: 0f 94 d0 cd call 0x39ba0 ; 0x39ba0 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1a8de: 89 e1 ldi r24, 0x19 ; 25 1a8e0: 9d e3 ldi r25, 0x3D ; 61 1a8e2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a8e6: 66 eb ldi r22, 0xB6 ; 182 1a8e8: 79 e3 ldi r23, 0x39 ; 57 1a8ea: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 1a8ee: 80 91 98 13 lds r24, 0x1398 ; 0x801398 1a8f2: 81 30 cpi r24, 0x01 ; 1 1a8f4: 11 f4 brne .+4 ; 0x1a8fa { menuitems_MMU_settings_common(); 1a8f6: 0f 94 73 32 call 0x264e6 ; 0x264e6 } SETTINGS_FANS_CHECK(); 1a8fa: 0f 94 bc 31 call 0x26378 ; 0x26378 SETTINGS_SILENT_MODE(); 1a8fe: 0f 94 0f 32 call 0x2641e ; 0x2641e SETTINGS_SOUND; 1a902: 80 91 e1 04 lds r24, 0x04E1 ; 0x8004e1 1a906: 82 30 cpi r24, 0x02 ; 2 1a908: 09 f4 brne .+2 ; 0x1a90c 1a90a: 3f c0 rjmp .+126 ; 0x1a98a 1a90c: 83 30 cpi r24, 0x03 ; 3 1a90e: 09 f4 brne .+2 ; 0x1a912 1a910: 3f c0 rjmp .+126 ; 0x1a990 1a912: 81 30 cpi r24, 0x01 ; 1 1a914: b9 f1 breq .+110 ; 0x1a984 1a916: 82 e1 ldi r24, 0x12 ; 18 1a918: 9d e3 ldi r25, 0x3D ; 61 1a91a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a91e: ec 01 movw r28, r24 1a920: 8a e0 ldi r24, 0x0A ; 10 1a922: 9d e3 ldi r25, 0x3D ; 61 1a924: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a928: 22 e0 ldi r18, 0x02 ; 2 1a92a: 48 eb ldi r20, 0xB8 ; 184 1a92c: 5b e3 ldi r21, 0x3B ; 59 1a92e: be 01 movw r22, r28 1a930: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 #ifdef LCD_BL_PIN if (backlightSupport) 1a934: 80 91 fe 03 lds r24, 0x03FE ; 0x8003fe 1a938: 88 23 and r24, r24 1a93a: 41 f0 breq .+16 ; 0x1a94c { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1a93c: 84 ee ldi r24, 0xE4 ; 228 1a93e: 9c e3 ldi r25, 0x3C ; 60 1a940: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a944: 6e eb ldi r22, 0xBE ; 190 1a946: 76 ed ldi r23, 0xD6 ; 214 1a948: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } #endif //LCD_BL_PIN MENU_END(); 1a94c: 0f 94 ae ce call 0x39d5c ; 0x39d5c calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1a950: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a954: 8f 5f subi r24, 0xFF ; 255 1a956: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a95a: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1a95e: 8f 5f subi r24, 0xFF ; 255 1a960: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1a964: 7a cf rjmp .-268 ; 0x1a85a { // 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) 1a966: 20 91 b7 03 lds r18, 0x03B7 ; 0x8003b7 1a96a: 30 91 b8 03 lds r19, 0x03B8 ; 0x8003b8 1a96e: 28 17 cp r18, r24 1a970: 39 07 cpc r19, r25 1a972: 09 f4 brne .+2 ; 0x1a976 1a974: 68 cf rjmp .-304 ; 0x1a846 { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 1a976: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 1a97a: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 calculate_extruder_multipliers(); 1a97e: 0e 94 ee 66 call 0xcddc ; 0xcddc 1a982: 61 cf rjmp .-318 ; 0x1a846 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 1a984: 83 e0 ldi r24, 0x03 ; 3 1a986: 9d e3 ldi r25, 0x3D ; 61 1a988: c8 cf rjmp .-112 ; 0x1a91a 1a98a: 8a ef ldi r24, 0xFA ; 250 1a98c: 9c e3 ldi r25, 0x3C ; 60 1a98e: c5 cf rjmp .-118 ; 0x1a91a 1a990: 81 ef ldi r24, 0xF1 ; 241 1a992: 9c e3 ldi r25, 0x3C ; 60 1a994: c2 cf rjmp .-124 ; 0x1a91a { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 1a996: df 91 pop r29 1a998: cf 91 pop r28 1a99a: 1f 91 pop r17 1a99c: 0f 91 pop r16 1a99e: ff 90 pop r15 1a9a0: ef 90 pop r14 1a9a2: 08 95 ret 0001a9a4 : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 1a9a4: bf 92 push r11 1a9a6: cf 92 push r12 1a9a8: df 92 push r13 1a9aa: ef 92 push r14 1a9ac: ff 92 push r15 1a9ae: 0f 93 push r16 1a9b0: 1f 93 push r17 1a9b2: cf 93 push r28 1a9b4: df 93 push r29 1a9b6: c8 2f mov r28, r24 1a9b8: f6 2e mov r15, r22 1a9ba: e4 2e mov r14, r20 1a9bc: b2 2e mov r11, r18 1a9be: 68 01 movw r12, r16 lcd_update_enable(false); 1a9c0: 80 e0 ldi r24, 0x00 ; 0 1a9c2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 1a9c6: dc e7 ldi r29, 0x7C ; 124 1a9c8: fe 14 cp r15, r14 1a9ca: 08 f0 brcs .+2 ; 0x1a9ce 1a9cc: dd e2 ldi r29, 0x2D ; 45 if (_clear) 1a9ce: bb 20 and r11, r11 1a9d0: 09 f1 breq .+66 ; 0x1aa14 lcd_clear(); 1a9d2: 0e 94 48 70 call 0xe090 ; 0xe090 else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1a9d6: c1 11 cpse r28, r1 1a9d8: 20 c0 rjmp .+64 ; 0x1aa1a if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1a9da: 84 e7 ldi r24, 0x74 ; 116 1a9dc: 94 e4 ldi r25, 0x44 ; 68 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 1a9de: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a9e2: 0e 94 00 70 call 0xe000 ; 0xe000 if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1a9e6: 88 ef ldi r24, 0xF8 ; 248 1a9e8: 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 1a9ea: 82 30 cpi r24, 0x02 ; 2 1a9ec: 78 f5 brcc .+94 ; 0x1aa4c || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1a9ee: 81 e0 ldi r24, 0x01 ; 1 1a9f0: 90 e4 ldi r25, 0x40 ; 64 1a9f2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1a9f6: 0e 94 00 70 call 0xe000 ; 0xe000 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)); 1a9fa: 80 ee ldi r24, 0xE0 ; 224 1a9fc: 9f e3 ldi r25, 0x3F ; 63 1a9fe: cc 30 cpi r28, 0x0C ; 12 1aa00: 49 f1 breq .+82 ; 0x1aa54 if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 1aa02: 8f e7 ldi r24, 0x7F ; 127 1aa04: 94 e4 ldi r25, 0x44 ; 68 1aa06: cd 30 cpi r28, 0x0D ; 13 1aa08: 29 f1 breq .+74 ; 0x1aa54 if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 1aa0a: ce 30 cpi r28, 0x0E ; 14 1aa0c: 39 f5 brne .+78 ; 0x1aa5c 1aa0e: 8d ec ldi r24, 0xCD ; 205 1aa10: 9f e3 ldi r25, 0x3F ; 63 1aa12: 20 c0 rjmp .+64 ; 0x1aa54 lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 1aa14: 0e 94 41 70 call 0xe082 ; 0xe082 1aa18: de cf rjmp .-68 ; 0x1a9d6 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1aa1a: c1 30 cpi r28, 0x01 ; 1 1aa1c: f1 f2 breq .-68 ; 0x1a9da if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1aa1e: c2 30 cpi r28, 0x02 ; 2 1aa20: e1 f2 breq .-72 ; 0x1a9da if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 1aa22: 88 e5 ldi r24, 0x58 ; 88 1aa24: 90 e4 ldi r25, 0x40 ; 64 1aa26: c3 30 cpi r28, 0x03 ; 3 1aa28: d1 f2 breq .-76 ; 0x1a9de if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 1aa2a: 86 e4 ldi r24, 0x46 ; 70 1aa2c: 90 e4 ldi r25, 0x40 ; 64 1aa2e: c4 30 cpi r28, 0x04 ; 4 1aa30: b1 f2 breq .-84 ; 0x1a9de if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 1aa32: 84 e3 ldi r24, 0x34 ; 52 1aa34: 90 e4 ldi r25, 0x40 ; 64 1aa36: c5 30 cpi r28, 0x05 ; 5 1aa38: 91 f2 breq .-92 ; 0x1a9de if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 1aa3a: 82 e2 ldi r24, 0x22 ; 34 1aa3c: 90 e4 ldi r25, 0x40 ; 64 1aa3e: c6 30 cpi r28, 0x06 ; 6 1aa40: 71 f2 breq .-100 ; 0x1a9de if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 1aa42: c7 30 cpi r28, 0x07 ; 7 1aa44: 81 f6 brne .-96 ; 0x1a9e6 1aa46: 83 e1 ldi r24, 0x13 ; 19 1aa48: 90 e4 ldi r25, 0x40 ; 64 1aa4a: c9 cf rjmp .-110 ; 0x1a9de 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)); 1aa4c: ca 30 cpi r28, 0x0A ; 10 1aa4e: 99 f5 brne .+102 ; 0x1aab6 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1aa50: 8e ee ldi r24, 0xEE ; 238 1aa52: 9f e3 ldi r25, 0x3F ; 63 if (screen == TestScreen::AllCorrect) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ALLCORRECT)); if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 1aa54: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1aa58: 0e 94 00 70 call 0xe000 ; 0xe000 lcd_puts_at_P(0, 1, STR_SEPARATOR); 1aa5c: 49 ee ldi r20, 0xE9 ; 233 1aa5e: 5c e8 ldi r21, 0x8C ; 140 1aa60: 61 e0 ldi r22, 0x01 ; 1 1aa62: 80 e0 ldi r24, 0x00 ; 0 1aa64: 0e 94 29 70 call 0xe052 ; 0xe052 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 1aa68: c3 30 cpi r28, 0x03 ; 3 1aa6a: 70 f5 brcc .+92 ; 0x1aac8 { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 1aa6c: 8f eb ldi r24, 0xBF ; 191 1aa6e: 9f e3 ldi r25, 0x3F ; 63 1aa70: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1aa74: ac 01 movw r20, r24 1aa76: 62 e0 ldi r22, 0x02 ; 2 1aa78: 80 e0 ldi r24, 0x00 ; 0 1aa7a: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(18, 2); 1aa7e: 62 e0 ldi r22, 0x02 ; 2 1aa80: 82 e1 ldi r24, 0x12 ; 18 1aa82: 0e 94 15 70 call 0xe02a ; 0xe02a (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1aa86: c1 11 cpse r28, r1 1aa88: 1a c0 rjmp .+52 ; 0x1aabe 1aa8a: 8d 2f mov r24, r29 1aa8c: 0e 94 04 70 call 0xe008 ; 0xe008 lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 1aa90: 82 eb ldi r24, 0xB2 ; 178 1aa92: 9f e3 ldi r25, 0x3F ; 63 1aa94: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1aa98: ac 01 movw r20, r24 1aa9a: 63 e0 ldi r22, 0x03 ; 3 1aa9c: 80 e0 ldi r24, 0x00 ; 0 1aa9e: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(18, 3); 1aaa2: 63 e0 ldi r22, 0x03 ; 3 1aaa4: 82 e1 ldi r24, 0x12 ; 18 1aaa6: 0e 94 15 70 call 0xe02a ; 0xe02a (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1aaaa: c2 30 cpi r28, 0x02 ; 2 1aaac: 19 f1 breq .+70 ; 0x1aaf4 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); 1aaae: 8d 2f mov r24, r29 1aab0: 0e 94 04 70 call 0xe008 ; 0xe008 1aab4: 23 c0 rjmp .+70 ; 0x1aafc 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)); 1aab6: cb 30 cpi r28, 0x0B ; 11 1aab8: 09 f0 breq .+2 ; 0x1aabc 1aaba: 9f cf rjmp .-194 ; 0x1a9fa 1aabc: c9 cf rjmp .-110 ; 0x1aa50 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); 1aabe: 87 e5 ldi r24, 0x57 ; 87 1aac0: 9c e6 ldi r25, 0x6C ; 108 1aac2: 0e 94 00 70 call 0xe000 ; 0xe000 1aac6: e4 cf rjmp .-56 ; 0x1aa90 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) 1aac8: 86 ef ldi r24, 0xF6 ; 246 1aaca: 8c 0f add r24, r28 1aacc: 82 30 cpi r24, 0x02 ; 2 1aace: 80 f5 brcc .+96 ; 0x1ab30 { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1aad0: 88 eb ldi r24, 0xB8 ; 184 1aad2: 94 e4 ldi r25, 0x44 ; 68 1aad4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1aad8: ac 01 movw r20, r24 1aada: 62 e0 ldi r22, 0x02 ; 2 1aadc: 80 e0 ldi r24, 0x00 ; 0 1aade: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_putc(':'); 1aae2: 8a e3 ldi r24, 0x3A ; 58 1aae4: 0e 94 04 70 call 0xe008 ; 0xe008 lcd_set_cursor(18, 2); 1aae8: 62 e0 ldi r22, 0x02 ; 2 1aaea: 82 e1 ldi r24, 0x12 ; 18 1aaec: 0e 94 15 70 call 0xe02a ; 0xe02a (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1aaf0: ca 30 cpi r28, 0x0A ; 10 1aaf2: e9 f2 breq .-70 ; 0x1aaae 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); 1aaf4: 87 e5 ldi r24, 0x57 ; 87 1aaf6: 9c e6 ldi r25, 0x6C ; 108 1aaf8: 0e 94 00 70 call 0xe000 ; 0xe000 _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); 1aafc: c1 14 cp r12, r1 1aafe: d1 04 cpc r13, r1 1ab00: 19 f0 breq .+6 ; 0x1ab08 1ab02: c6 01 movw r24, r12 1ab04: 0e 94 ff 8e call 0x11dfe ; 0x11dfe _progress++; 1ab08: 81 e0 ldi r24, 0x01 ; 1 1ab0a: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 1ab0c: 4e 2d mov r20, r14 1ab0e: 50 e0 ldi r21, 0x00 ; 0 1ab10: 44 0f add r20, r20 1ab12: 55 1f adc r21, r21 1ab14: 84 17 cp r24, r20 1ab16: 15 06 cpc r1, r21 1ab18: 0c f0 brlt .+2 ; 0x1ab1c 1ab1a: 80 e0 ldi r24, 0x00 ; 0 } 1ab1c: df 91 pop r29 1ab1e: cf 91 pop r28 1ab20: 1f 91 pop r17 1ab22: 0f 91 pop r16 1ab24: ff 90 pop r15 1ab26: ef 90 pop r14 1ab28: df 90 pop r13 1ab2a: cf 90 pop r12 1ab2c: bf 90 pop r11 1ab2e: 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) 1ab30: ca 30 cpi r28, 0x0A ; 10 1ab32: 20 f7 brcc .-56 ; 0x1aafc { //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); 1ab34: 41 e0 ldi r20, 0x01 ; 1 1ab36: c4 30 cpi r28, 0x04 ; 4 1ab38: 21 f0 breq .+8 ; 0x1ab42 1ab3a: 42 e0 ldi r20, 0x02 ; 2 1ab3c: c3 30 cpi r28, 0x03 ; 3 1ab3e: 09 f4 brne .+2 ; 0x1ab42 1ab40: 40 e0 ldi r20, 0x00 ; 0 1ab42: 0d 2f mov r16, r29 1ab44: 27 ee ldi r18, 0xE7 ; 231 1ab46: 3c e8 ldi r19, 0x8C ; 140 1ab48: 62 e0 ldi r22, 0x02 ; 2 1ab4a: 82 e0 ldi r24, 0x02 ; 2 1ab4c: 0e 94 a0 d0 call 0x1a140 ; 0x1a140 _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 1ab50: 41 e0 ldi r20, 0x01 ; 1 1ab52: c5 30 cpi r28, 0x05 ; 5 1ab54: 21 f0 breq .+8 ; 0x1ab5e 1ab56: 42 e0 ldi r20, 0x02 ; 2 1ab58: c5 30 cpi r28, 0x05 ; 5 1ab5a: 08 f4 brcc .+2 ; 0x1ab5e 1ab5c: 40 e0 ldi r20, 0x00 ; 0 1ab5e: 0d 2f mov r16, r29 1ab60: 25 ee ldi r18, 0xE5 ; 229 1ab62: 3c e8 ldi r19, 0x8C ; 140 1ab64: 68 e0 ldi r22, 0x08 ; 8 1ab66: 82 e0 ldi r24, 0x02 ; 2 1ab68: 0e 94 a0 d0 call 0x1a140 ; 0x1a140 _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 1ab6c: 41 e0 ldi r20, 0x01 ; 1 1ab6e: c6 30 cpi r28, 0x06 ; 6 1ab70: 21 f0 breq .+8 ; 0x1ab7a 1ab72: 42 e0 ldi r20, 0x02 ; 2 1ab74: c6 30 cpi r28, 0x06 ; 6 1ab76: 08 f4 brcc .+2 ; 0x1ab7a 1ab78: 40 e0 ldi r20, 0x00 ; 0 1ab7a: 0d 2f mov r16, r29 1ab7c: 23 ee ldi r18, 0xE3 ; 227 1ab7e: 3c e8 ldi r19, 0x8C ; 140 1ab80: 6e e0 ldi r22, 0x0E ; 14 1ab82: 82 e0 ldi r24, 0x02 ; 2 1ab84: 0e 94 a0 d0 call 0x1a140 ; 0x1a140 _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 1ab88: 41 e0 ldi r20, 0x01 ; 1 1ab8a: c7 30 cpi r28, 0x07 ; 7 1ab8c: 21 f0 breq .+8 ; 0x1ab96 1ab8e: 42 e0 ldi r20, 0x02 ; 2 1ab90: c7 30 cpi r28, 0x07 ; 7 1ab92: 08 f4 brcc .+2 ; 0x1ab96 1ab94: 40 e0 ldi r20, 0x00 ; 0 1ab96: 0d 2f mov r16, r29 1ab98: 2f ed ldi r18, 0xDF ; 223 1ab9a: 3c e8 ldi r19, 0x8C ; 140 1ab9c: 60 e0 ldi r22, 0x00 ; 0 1ab9e: 83 e0 ldi r24, 0x03 ; 3 1aba0: 0e 94 a0 d0 call 0x1a140 ; 0x1a140 _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 1aba4: 41 e0 ldi r20, 0x01 ; 1 1aba6: c8 30 cpi r28, 0x08 ; 8 1aba8: 21 f0 breq .+8 ; 0x1abb2 1abaa: 42 e0 ldi r20, 0x02 ; 2 1abac: c8 30 cpi r28, 0x08 ; 8 1abae: 08 f4 brcc .+2 ; 0x1abb2 1abb0: 40 e0 ldi r20, 0x00 ; 0 1abb2: 0d 2f mov r16, r29 1abb4: 28 ed ldi r18, 0xD8 ; 216 1abb6: 3c e8 ldi r19, 0x8C ; 140 1abb8: 69 e0 ldi r22, 0x09 ; 9 1abba: 83 e0 ldi r24, 0x03 ; 3 1abbc: 0e 94 a0 d0 call 0x1a140 ; 0x1a140 1abc0: 9d cf rjmp .-198 ; 0x1aafc 0001abc2 : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 1abc2: cf 93 push r28 1abc4: 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) 1abc6: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1abca: 81 11 cpse r24, r1 1abcc: 18 c0 rjmp .+48 ; 0x1abfe { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 1abce: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 1abd2: 8b e0 ldi r24, 0x0B ; 11 1abd4: 68 9f mul r22, r24 1abd6: b0 01 movw r22, r0 1abd8: 11 24 eor r1, r1 1abda: 67 5b subi r22, 0xB7 ; 183 1abdc: 72 4f sbci r23, 0xF2 ; 242 1abde: 47 e0 ldi r20, 0x07 ; 7 1abe0: 50 e0 ldi r21, 0x00 ; 0 1abe2: 8b ea ldi r24, 0xAB ; 171 1abe4: 93 e0 ldi r25, 0x03 ; 3 1abe6: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 lcd_encoder = menuData->name[0]; 1abea: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 1abee: 90 e0 ldi r25, 0x00 ; 0 1abf0: 90 93 38 05 sts 0x0538, r25 ; 0x800538 1abf4: 80 93 37 05 sts 0x0537, r24 ; 0x800537 menuData->initialized = true; 1abf8: 81 e0 ldi r24, 0x01 ; 1 1abfa: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 1abfe: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1ac02: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1ac06: 80 97 sbiw r24, 0x20 ; 32 1ac08: 34 f4 brge .+12 ; 0x1ac16 1ac0a: 80 e2 ldi r24, 0x20 ; 32 1ac0c: 90 e0 ldi r25, 0x00 ; 0 1ac0e: 90 93 38 05 sts 0x0538, r25 ; 0x800538 1ac12: 80 93 37 05 sts 0x0537, r24 ; 0x800537 if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 1ac16: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1ac1a: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1ac1e: 8f 3f cpi r24, 0xFF ; 255 1ac20: 91 05 cpc r25, r1 1ac22: 39 f0 breq .+14 ; 0x1ac32 1ac24: 34 f0 brlt .+12 ; 0x1ac32 1ac26: 8f ef ldi r24, 0xFF ; 255 1ac28: 90 e0 ldi r25, 0x00 ; 0 1ac2a: 90 93 38 05 sts 0x0538, r25 ; 0x800538 1ac2e: 80 93 37 05 sts 0x0537, r24 ; 0x800537 menuData->name[menuData->selected] = lcd_encoder; 1ac32: e0 91 aa 03 lds r30, 0x03AA ; 0x8003aa 1ac36: f0 e0 ldi r31, 0x00 ; 0 1ac38: e7 55 subi r30, 0x57 ; 87 1ac3a: fc 4f sbci r31, 0xFC ; 252 1ac3c: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1ac40: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 1ac42: 0e 94 41 70 call 0xe082 ; 0xe082 1ac46: cb ea ldi r28, 0xAB ; 171 1ac48: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 1ac4a: 89 91 ld r24, Y+ 1ac4c: 0e 94 04 70 call 0xe008 ; 0xe008 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) 1ac50: 83 e0 ldi r24, 0x03 ; 3 1ac52: c2 3b cpi r28, 0xB2 ; 178 1ac54: d8 07 cpc r29, r24 1ac56: c9 f7 brne .-14 ; 0x1ac4a { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 1ac58: 4e e5 ldi r20, 0x5E ; 94 1ac5a: 61 e0 ldi r22, 0x01 ; 1 1ac5c: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1ac60: 0e 94 35 70 call 0xe06a ; 0xe06a if (menuData->selected > 0) 1ac64: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1ac68: 88 23 and r24, r24 1ac6a: 29 f0 breq .+10 ; 0x1ac76 { lcd_putc_at(menuData->selected-1, 1, ' '); 1ac6c: 40 e2 ldi r20, 0x20 ; 32 1ac6e: 61 e0 ldi r22, 0x01 ; 1 1ac70: 81 50 subi r24, 0x01 ; 1 1ac72: 0e 94 35 70 call 0xe06a ; 0xe06a } if (lcd_clicked()) 1ac76: 0e 94 32 72 call 0xe464 ; 0xe464 1ac7a: 88 23 and r24, r24 1ac7c: 99 f0 breq .+38 ; 0x1aca4 { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 1ac7e: e0 91 aa 03 lds r30, 0x03AA ; 0x8003aa 1ac82: 8e 2f mov r24, r30 1ac84: 90 e0 ldi r25, 0x00 ; 0 1ac86: 01 96 adiw r24, 0x01 ; 1 1ac88: 07 97 sbiw r24, 0x07 ; 7 1ac8a: 78 f4 brcc .+30 ; 0x1acaa { lcd_encoder = menuData->name[++(menuData->selected)]; 1ac8c: ef 5f subi r30, 0xFF ; 255 1ac8e: e0 93 aa 03 sts 0x03AA, r30 ; 0x8003aa 1ac92: f0 e0 ldi r31, 0x00 ; 0 1ac94: e7 55 subi r30, 0x57 ; 87 1ac96: fc 4f sbci r31, 0xFC ; 252 1ac98: 82 81 ldd r24, Z+2 ; 0x02 1ac9a: 90 e0 ldi r25, 0x00 ; 0 1ac9c: 90 93 38 05 sts 0x0538, r25 ; 0x800538 1aca0: 80 93 37 05 sts 0x0537, r24 ; 0x800537 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1aca4: df 91 pop r29 1aca6: cf 91 pop r28 1aca8: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 1acaa: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 1acae: 8b e0 ldi r24, 0x0B ; 11 1acb0: 68 9f mul r22, r24 1acb2: b0 01 movw r22, r0 1acb4: 11 24 eor r1, r1 1acb6: 67 5b subi r22, 0xB7 ; 183 1acb8: 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); 1acba: 47 e0 ldi r20, 0x07 ; 7 1acbc: 50 e0 ldi r21, 0x00 ; 0 1acbe: 8b ea ldi r24, 0xAB ; 171 1acc0: 93 e0 ldi r25, 0x03 ; 3 1acc2: 0f 94 6f dd call 0x3bade ; 0x3bade EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1acc6: df 91 pop r29 1acc8: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 1acca: 0d 94 a2 d1 jmp 0x3a344 ; 0x3a344 0001acce : return(_result); } #ifdef TMC2130 static void reset_crash_det(uint8_t axis) { 1acce: cf 93 push r28 1acd0: df 93 push r29 current_position[axis] += 10; 1acd2: 94 e0 ldi r25, 0x04 ; 4 1acd4: 89 9f mul r24, r25 1acd6: e0 01 movw r28, r0 1acd8: 11 24 eor r1, r1 1acda: cd 5b subi r28, 0xBD ; 189 1acdc: d8 4f sbci r29, 0xF8 ; 248 1acde: 20 e0 ldi r18, 0x00 ; 0 1ace0: 30 e0 ldi r19, 0x00 ; 0 1ace2: 40 e2 ldi r20, 0x20 ; 32 1ace4: 51 e4 ldi r21, 0x41 ; 65 1ace6: 68 81 ld r22, Y 1ace8: 79 81 ldd r23, Y+1 ; 0x01 1acea: 8a 81 ldd r24, Y+2 ; 0x02 1acec: 9b 81 ldd r25, Y+3 ; 0x03 1acee: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1acf2: 68 83 st Y, r22 1acf4: 79 83 std Y+1, r23 ; 0x01 1acf6: 8a 83 std Y+2, r24 ; 0x02 1acf8: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1acfa: 60 e0 ldi r22, 0x00 ; 0 1acfc: 70 e0 ldi r23, 0x00 ; 0 1acfe: 84 e3 ldi r24, 0x34 ; 52 1ad00: 92 e4 ldi r25, 0x42 ; 66 1ad02: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 1ad06: 0f 94 27 58 call 0x2b04e ; 0x2b04e crashdet_use_eeprom_setting(); } 1ad0a: df 91 pop r29 1ad0c: 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(); 1ad0e: 0d 94 0b 3b jmp 0x27616 ; 0x27616 0001ad12 : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 1ad12: 0f 94 0f 7c call 0x2f81e ; 0x2f81e #endif menu_top = 0; 1ad16: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_encoder = 0; 1ad1a: 10 92 38 05 sts 0x0538, r1 ; 0x800538 1ad1e: 10 92 37 05 sts 0x0537, r1 ; 0x800537 menu_data_reset(); //Forces reloading of cached variables. 1ad22: 0d 94 fc ce jmp 0x39df8 ; 0x39df8 0001ad26 : } } void CardReader::updir() { if(workDirDepth > 0) 1ad26: 80 91 0e 16 lds r24, 0x160E ; 0x80160e 1ad2a: 88 23 and r24, r24 1ad2c: f9 f0 breq .+62 ; 0x1ad6c { --workDirDepth; 1ad2e: 81 50 subi r24, 0x01 ; 1 1ad30: 80 93 0e 16 sts 0x160E, r24 ; 0x80160e workDir = workDirParents[0]; 1ad34: 93 e2 ldi r25, 0x23 ; 35 1ad36: ec e3 ldi r30, 0x3C ; 60 1ad38: f5 e1 ldi r31, 0x15 ; 21 1ad3a: a9 e1 ldi r26, 0x19 ; 25 1ad3c: b5 e1 ldi r27, 0x15 ; 21 1ad3e: 01 90 ld r0, Z+ 1ad40: 0d 92 st X+, r0 1ad42: 9a 95 dec r25 1ad44: e1 f7 brne .-8 ; 0x1ad3e 1ad46: 2c e3 ldi r18, 0x3C ; 60 1ad48: 35 e1 ldi r19, 0x15 ; 21 for (uint8_t d = 0; d < workDirDepth; d++) 1ad4a: 90 e0 ldi r25, 0x00 ; 0 1ad4c: 98 17 cp r25, r24 1ad4e: 60 f4 brcc .+24 ; 0x1ad68 { workDirParents[d] = workDirParents[d+1]; 1ad50: 43 e2 ldi r20, 0x23 ; 35 1ad52: f9 01 movw r30, r18 1ad54: b3 96 adiw r30, 0x23 ; 35 1ad56: d9 01 movw r26, r18 1ad58: 01 90 ld r0, Z+ 1ad5a: 0d 92 st X+, r0 1ad5c: 4a 95 dec r20 1ad5e: e1 f7 brne .-8 ; 0x1ad58 { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 1ad60: 9f 5f subi r25, 0xFF ; 255 1ad62: 2d 5d subi r18, 0xDD ; 221 1ad64: 3f 4f sbci r19, 0xFF ; 255 1ad66: f2 cf rjmp .-28 ; 0x1ad4c { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 1ad68: 0f 94 0f 7c call 0x2f81e ; 0x2f81e } static void lcd_sd_updir() { card.updir(); menu_top = 0; 1ad6c: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_encoder = 0; 1ad70: 10 92 38 05 sts 0x0538, r1 ; 0x800538 1ad74: 10 92 37 05 sts 0x0537, r1 ; 0x800537 menu_data_reset(); //Forces reloading of cached variables. 1ad78: 0d 94 fc ce jmp 0x39df8 ; 0x39df8 0001ad7c : } backlight_save(); } static void lcd_backlight_menu() { 1ad7c: ef 92 push r14 1ad7e: ff 92 push r15 1ad80: 0f 93 push r16 1ad82: 1f 93 push r17 1ad84: cf 93 push r28 1ad86: df 93 push r29 MENU_BEGIN(); 1ad88: 0f 94 da ce call 0x39db4 ; 0x39db4 1ad8c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1ad90: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1ad94: 84 30 cpi r24, 0x04 ; 4 1ad96: 08 f0 brcs .+2 ; 0x1ad9a 1ad98: 63 c0 rjmp .+198 ; 0x1ae60 1ad9a: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 1ad9e: 0f 94 5a cd call 0x39ab4 ; 0x39ab4 1ada2: 81 11 cpse r24, r1 1ada4: 0e 94 da 8b call 0x117b4 ; 0x117b4 backlight_save(); ); MENU_ITEM_BACK_P(_T(MSG_BACK)); 1ada8: 8b e7 ldi r24, 0x7B ; 123 1adaa: 90 e4 ldi r25, 0x40 ; 64 1adac: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1adb0: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_EDIT_int3_P(_T(MSG_BL_HIGH), &backlightLevel_HIGH, backlightLevel_LOW, 255); 1adb4: c0 91 fc 03 lds r28, 0x03FC ; 0x8003fc 1adb8: d0 e0 ldi r29, 0x00 ; 0 1adba: 89 ea ldi r24, 0xA9 ; 169 1adbc: 9d e3 ldi r25, 0x3D ; 61 1adbe: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1adc2: f1 2c mov r15, r1 1adc4: e1 2c mov r14, r1 1adc6: 0f ef ldi r16, 0xFF ; 255 1adc8: 10 e0 ldi r17, 0x00 ; 0 1adca: 9e 01 movw r18, r28 1adcc: 48 e0 ldi r20, 0x08 ; 8 1adce: 6d ef ldi r22, 0xFD ; 253 1add0: 73 e0 ldi r23, 0x03 ; 3 1add2: 0f 94 2a cf call 0x39e54 ; 0x39e54 MENU_ITEM_EDIT_int3_P(_T(MSG_BL_LOW), &backlightLevel_LOW, 0, backlightLevel_HIGH); 1add6: 00 91 fd 03 lds r16, 0x03FD ; 0x8003fd 1adda: 10 e0 ldi r17, 0x00 ; 0 1addc: 8a e9 ldi r24, 0x9A ; 154 1adde: 9d e3 ldi r25, 0x3D ; 61 1ade0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1ade4: 30 e0 ldi r19, 0x00 ; 0 1ade6: 20 e0 ldi r18, 0x00 ; 0 1ade8: 48 e0 ldi r20, 0x08 ; 8 1adea: 6c ef ldi r22, 0xFC ; 252 1adec: 73 e0 ldi r23, 0x03 ; 3 1adee: 0f 94 2a cf call 0x39e54 ; 0x39e54 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); 1adf2: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1adf6: 81 30 cpi r24, 0x01 ; 1 1adf8: 59 f5 brne .+86 ; 0x1ae50 1adfa: 81 e9 ldi r24, 0x91 ; 145 1adfc: 9d e3 ldi r25, 0x3D ; 61 1adfe: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1ae02: ec 01 movw r28, r24 1ae04: 8d e7 ldi r24, 0x7D ; 125 1ae06: 9d e3 ldi r25, 0x3D ; 61 1ae08: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1ae0c: 22 e0 ldi r18, 0x02 ; 2 1ae0e: 47 e3 ldi r20, 0x37 ; 55 1ae10: 57 ed ldi r21, 0xD7 ; 215 1ae12: be 01 movw r22, r28 1ae14: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, 1, 999); 1ae18: 83 e7 ldi r24, 0x73 ; 115 1ae1a: 9d e3 ldi r25, 0x3D ; 61 1ae1c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1ae20: f1 2c mov r15, r1 1ae22: e1 2c mov r14, r1 1ae24: 07 ee ldi r16, 0xE7 ; 231 1ae26: 13 e0 ldi r17, 0x03 ; 3 1ae28: 21 e0 ldi r18, 0x01 ; 1 1ae2a: 30 e0 ldi r19, 0x00 ; 0 1ae2c: 40 e1 ldi r20, 0x10 ; 16 1ae2e: 6d e4 ldi r22, 0x4D ; 77 1ae30: 72 e0 ldi r23, 0x02 ; 2 1ae32: 0f 94 2a cf call 0x39e54 ; 0x39e54 MENU_END(); 1ae36: 0f 94 ae ce call 0x39d5c ; 0x39d5c backlight_save(); } static void lcd_backlight_menu() { MENU_BEGIN(); 1ae3a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1ae3e: 8f 5f subi r24, 0xFF ; 255 1ae40: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1ae44: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1ae48: 8f 5f subi r24, 0xFF ; 255 1ae4a: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1ae4e: a0 cf rjmp .-192 ; 0x1ad90 ); 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); 1ae50: 81 11 cpse r24, r1 1ae52: 03 c0 rjmp .+6 ; 0x1ae5a 1ae54: 8b e8 ldi r24, 0x8B ; 139 1ae56: 9d e3 ldi r25, 0x3D ; 61 1ae58: d2 cf rjmp .-92 ; 0x1adfe 1ae5a: 84 e8 ldi r24, 0x84 ; 132 1ae5c: 9d e3 ldi r25, 0x3D ; 61 1ae5e: cf cf rjmp .-98 ; 0x1adfe MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, 1, 999); MENU_END(); } 1ae60: df 91 pop r29 1ae62: cf 91 pop r28 1ae64: 1f 91 pop r17 1ae66: 0f 91 pop r16 1ae68: ff 90 pop r15 1ae6a: ef 90 pop r14 1ae6c: 08 95 ret 0001ae6e : } #ifdef LCD_BL_PIN static void backlight_mode_toggle() { switch (backlightMode) 1ae6e: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1ae72: 88 23 and r24, r24 1ae74: 31 f0 breq .+12 ; 0x1ae82 1ae76: 81 30 cpi r24, 0x01 ; 1 1ae78: 41 f4 brne .+16 ; 0x1ae8a { case BACKLIGHT_MODE_BRIGHT: backlightMode = BACKLIGHT_MODE_DIM; break; 1ae7a: 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(); 1ae7e: 0c 94 da 8b jmp 0x117b4 ; 0x117b4 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; 1ae82: 82 e0 ldi r24, 0x02 ; 2 case BACKLIGHT_MODE_AUTO: backlightMode = BACKLIGHT_MODE_BRIGHT; break; 1ae84: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f 1ae88: fa cf rjmp .-12 ; 0x1ae7e 1ae8a: 81 e0 ldi r24, 0x01 ; 1 1ae8c: fb cf rjmp .-10 ; 0x1ae84 0001ae8e : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 1ae8e: bf 92 push r11 1ae90: cf 92 push r12 1ae92: df 92 push r13 1ae94: ef 92 push r14 1ae96: ff 92 push r15 1ae98: 0f 93 push r16 1ae9a: 1f 93 push r17 1ae9c: cf 93 push r28 1ae9e: df 93 push r29 1aea0: 00 d0 rcall .+0 ; 0x1aea2 1aea2: 1f 92 push r1 1aea4: cd b7 in r28, 0x3d ; 61 1aea6: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 1aea8: 8c ea ldi r24, 0xAC ; 172 1aeaa: 9d e0 ldi r25, 0x0D ; 13 1aeac: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1aeb0: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 1aeb2: 8b ea ldi r24, 0xAB ; 171 1aeb4: 9d e0 ldi r25, 0x0D ; 13 1aeb6: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1aeba: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 1aebc: 8a ea ldi r24, 0xAA ; 170 1aebe: 9d e0 ldi r25, 0x0D ; 13 1aec0: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1aec4: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 1aec6: 0f 94 da ce call 0x39db4 ; 0x39db4 1aeca: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (points_nr == 7) { lcd_z_calibration_prompt(true); } ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); sToggle[0] = points_nr + '0'; 1aece: 80 e3 ldi r24, 0x30 ; 48 1aed0: d8 2e mov r13, r24 1aed2: df 0c add r13, r15 sToggle[1] = 'x'; 1aed4: 98 e7 ldi r25, 0x78 ; 120 1aed6: 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'; 1aed8: 20 e3 ldi r18, 0x30 ; 48 1aeda: e2 2e mov r14, r18 1aedc: 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(); 1aede: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1aee2: 84 30 cpi r24, 0x04 ; 4 1aee4: 08 f0 brcs .+2 ; 0x1aee8 1aee6: 56 c0 rjmp .+172 ; 0x1af94 1aee8: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 1aeec: 0f 94 5a cd call 0x39ab4 ; 0x39ab4 1aef0: 88 23 and r24, r24 1aef2: 31 f0 breq .+12 ; 0x1af00 1aef4: 87 e0 ldi r24, 0x07 ; 7 1aef6: f8 12 cpse r15, r24 1aef8: 03 c0 rjmp .+6 ; 0x1af00 1aefa: 81 e0 ldi r24, 0x01 ; 1 1aefc: 0f 94 8e 66 call 0x2cd1c ; 0x2cd1c // 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)); 1af00: 88 eb ldi r24, 0xB8 ; 184 1af02: 9d e3 ldi r25, 0x3D ; 61 1af04: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1af08: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a sToggle[0] = points_nr + '0'; 1af0c: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 1af0e: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 1af10: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 1af12: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 1af14: 8c e6 ldi r24, 0x6C ; 108 1af16: 9d e3 ldi r25, 0x3D ; 61 1af18: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1af1c: 20 e0 ldi r18, 0x00 ; 0 1af1e: 42 eb ldi r20, 0xB2 ; 178 1af20: 51 ed ldi r21, 0xD1 ; 209 1af22: be 01 movw r22, r28 1af24: 6f 5f subi r22, 0xFF ; 255 1af26: 7f 4f sbci r23, 0xFF ; 255 1af28: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 sToggle[0] = mbl_z_probe_nr + '0'; 1af2c: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 1af2e: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 1af30: 8e e5 ldi r24, 0x5E ; 94 1af32: 9d e3 ldi r25, 0x3D ; 61 1af34: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1af38: 20 e0 ldi r18, 0x00 ; 0 1af3a: 43 ea ldi r20, 0xA3 ; 163 1af3c: 51 ed ldi r21, 0xD1 ; 209 1af3e: be 01 movw r22, r28 1af40: 6f 5f subi r22, 0xFF ; 255 1af42: 7f 4f sbci r23, 0xFF ; 255 1af44: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 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); 1af48: 87 e0 ldi r24, 0x07 ; 7 1af4a: f8 12 cpse r15, r24 1af4c: 20 c0 rjmp .+64 ; 0x1af8e 1af4e: 8a e0 ldi r24, 0x0A ; 10 1af50: 9e e5 ldi r25, 0x5E ; 94 1af52: c1 10 cpse r12, r1 1af54: 02 c0 rjmp .+4 ; 0x1af5a 1af56: 84 e0 ldi r24, 0x04 ; 4 1af58: 9e e5 ldi r25, 0x5E ; 94 1af5a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1af5e: 8c 01 movw r16, r24 1af60: 88 e4 ldi r24, 0x48 ; 72 1af62: 9d e3 ldi r25, 0x3D ; 61 1af64: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1af68: 22 e0 ldi r18, 0x02 ; 2 1af6a: 4e eb ldi r20, 0xBE ; 190 1af6c: 51 ed ldi r21, 0xD1 ; 209 1af6e: b8 01 movw r22, r16 1af70: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 MENU_END(); 1af74: 0f 94 ae ce call 0x39d5c ; 0x39d5c 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(); 1af78: 90 91 15 05 lds r25, 0x0515 ; 0x800515 1af7c: 9f 5f subi r25, 0xFF ; 255 1af7e: 90 93 15 05 sts 0x0515, r25 ; 0x800515 1af82: 90 91 17 05 lds r25, 0x0517 ; 0x800517 1af86: 9f 5f subi r25, 0xFF ; 255 1af88: 90 93 17 05 sts 0x0517, r25 ; 0x800517 1af8c: a8 cf rjmp .-176 ; 0x1aede 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); 1af8e: 88 e5 ldi r24, 0x58 ; 88 1af90: 9d e3 ldi r25, 0x3D ; 61 1af92: e3 cf rjmp .-58 ; 0x1af5a MENU_END(); } 1af94: 0f 90 pop r0 1af96: 0f 90 pop r0 1af98: 0f 90 pop r0 1af9a: 0f 90 pop r0 1af9c: df 91 pop r29 1af9e: cf 91 pop r28 1afa0: 1f 91 pop r17 1afa2: 0f 91 pop r16 1afa4: ff 90 pop r15 1afa6: ef 90 pop r14 1afa8: df 90 pop r13 1afaa: cf 90 pop r12 1afac: bf 90 pop r11 1afae: 08 95 ret 0001afb0 : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 1afb0: cf 93 push r28 MENU_BEGIN(); 1afb2: 0f 94 da ce call 0x39db4 ; 0x39db4 1afb6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1afba: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1afbe: 84 30 cpi r24, 0x04 ; 4 1afc0: 60 f5 brcc .+88 ; 0x1b01a 1afc2: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1afc6: 8a e1 ldi r24, 0x1A ; 26 1afc8: 9e e3 ldi r25, 0x3E ; 62 1afca: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1afce: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 1afd2: 8f e2 ldi r24, 0x2F ; 47 1afd4: 9b e3 ldi r25, 0x3B ; 59 1afd6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1afda: 6c ec ldi r22, 0xCC ; 204 1afdc: 78 ed ldi r23, 0xD8 ; 216 1afde: 0f 94 57 ce call 0x39cae ; 0x39cae for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1afe2: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 1afe4: 84 ef ldi r24, 0xF4 ; 244 1afe6: 9b e3 ldi r25, 0x3B ; 59 1afe8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1afec: 61 e3 ldi r22, 0x31 ; 49 1afee: 6c 0f add r22, r28 1aff0: 2c 2f mov r18, r28 1aff2: 4b ed ldi r20, 0xDB ; 219 1aff4: 58 ed ldi r21, 0xD8 ; 216 1aff6: 0f 94 00 ce call 0x39c00 ; 0x39c00 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++) 1affa: cf 5f subi r28, 0xFF ; 255 1affc: c5 30 cpi r28, 0x05 ; 5 1affe: 91 f7 brne .-28 ; 0x1afe4 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 1b000: 0f 94 ae ce call 0x39d5c ; 0x39d5c static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 1b004: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b008: 8f 5f subi r24, 0xFF ; 255 1b00a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1b00e: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1b012: 8f 5f subi r24, 0xFF ; 255 1b014: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1b018: d0 cf rjmp .-96 ; 0x1afba 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(); } 1b01a: cf 91 pop r28 1b01c: 08 95 ret 0001b01e : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 1b01e: 84 e0 ldi r24, 0x04 ; 4 1b020: 0d 94 db 68 jmp 0x2d1b6 ; 0x2d1b6 0001b024 : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 1b024: 85 e0 ldi r24, 0x05 ; 5 1b026: 0d 94 db 68 jmp 0x2d1b6 ; 0x2d1b6 0001b02a : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 1b02a: 86 e0 ldi r24, 0x06 ; 6 1b02c: 0d 94 db 68 jmp 0x2d1b6 ; 0x2d1b6 0001b030 : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 1b030: 87 e0 ldi r24, 0x07 ; 7 1b032: 0d 94 db 68 jmp 0x2d1b6 ; 0x2d1b6 0001b036 : 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); 1b036: 88 e0 ldi r24, 0x08 ; 8 1b038: 0d 94 db 68 jmp 0x2d1b6 ; 0x2d1b6 0001b03c : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1b03c: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 1b040: 81 ea ldi r24, 0xA1 ; 161 1b042: 9d e0 ldi r25, 0x0D ; 13 1b044: 0f 94 7f dd call 0x3bafe ; 0x3bafe } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 1b048: 83 e0 ldi r24, 0x03 ; 3 1b04a: 0d 94 86 d1 jmp 0x3a30c ; 0x3a30c 0001b04e : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 1b04e: cf 93 push r28 MENU_BEGIN(); 1b050: 0f 94 da ce call 0x39db4 ; 0x39db4 1b054: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1b058: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b05c: 84 30 cpi r24, 0x04 ; 4 1b05e: 88 f5 brcc .+98 ; 0x1b0c2 1b060: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 1b064: 0f 94 5a cd call 0x39ab4 ; 0x39ab4 1b068: 81 11 cpse r24, r1 1b06a: 0f 94 ef 35 call 0x26bde ; 0x26bde clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b06e: 8a e1 ldi r24, 0x1A ; 26 1b070: 9e e3 ldi r25, 0x3E ; 62 1b072: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1b076: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 1b07a: 8f e2 ldi r24, 0x2F ; 47 1b07c: 9b e3 ldi r25, 0x3B ; 59 1b07e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1b082: 6a ea ldi r22, 0xAA ; 170 1b084: 7b e3 ldi r23, 0x3B ; 59 1b086: 0f 94 57 ce call 0x39cae ; 0x39cae for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b08a: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 1b08c: 84 ef ldi r24, 0xF4 ; 244 1b08e: 9b e3 ldi r25, 0x3B ; 59 1b090: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1b094: 61 e3 ldi r22, 0x31 ; 49 1b096: 6c 0f add r22, r28 1b098: 2c 2f mov r18, r28 1b09a: 40 e1 ldi r20, 0x10 ; 16 1b09c: 5a e3 ldi r21, 0x3A ; 58 1b09e: 0f 94 00 ce call 0x39c00 ; 0x39c00 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++) 1b0a2: cf 5f subi r28, 0xFF ; 255 1b0a4: c5 30 cpi r28, 0x05 ; 5 1b0a6: 91 f7 brne .-28 ; 0x1b08c MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 1b0a8: 0f 94 ae ce call 0x39d5c ; 0x39d5c // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 1b0ac: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b0b0: 8f 5f subi r24, 0xFF ; 255 1b0b2: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1b0b6: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1b0ba: 8f 5f subi r24, 0xFF ; 255 1b0bc: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1b0c0: cb cf rjmp .-106 ; 0x1b058 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(); } 1b0c2: cf 91 pop r28 1b0c4: 08 95 ret 0001b0c6 : } // 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)) { 1b0c6: ef 92 push r14 1b0c8: ff 92 push r15 1b0ca: 0f 93 push r16 1b0cc: 1f 93 push r17 1b0ce: cf 93 push r28 1b0d0: 8c 01 movw r16, r24 1b0d2: 7b 01 movw r14, r22 MENU_BEGIN(); 1b0d4: 0f 94 da ce call 0x39db4 ; 0x39db4 1b0d8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1b0dc: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b0e0: 84 30 cpi r24, 0x04 ; 4 1b0e2: 28 f5 brcc .+74 ; 0x1b12e 1b0e4: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 1b0e8: 0f 94 5a cd call 0x39ab4 ; 0x39ab4 1b0ec: 81 11 cpse r24, r1 1b0ee: 0f 94 ef 35 call 0x26bde ; 0x26bde clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b0f2: 8a e1 ldi r24, 0x1A ; 26 1b0f4: 9e e3 ldi r25, 0x3E ; 62 1b0f6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1b0fa: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b0fe: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 1b100: 61 e3 ldi r22, 0x31 ; 49 1b102: 6c 0f add r22, r28 1b104: 2c 2f mov r18, r28 1b106: a7 01 movw r20, r14 1b108: c8 01 movw r24, r16 1b10a: 0f 94 00 ce call 0x39c00 ; 0x39c00 MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b10e: cf 5f subi r28, 0xFF ; 255 1b110: c5 30 cpi r28, 0x05 ; 5 1b112: b1 f7 brne .-20 ; 0x1b100 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 1b114: 0f 94 ae ce call 0x39d5c ; 0x39d5c // 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(); 1b118: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b11c: 8f 5f subi r24, 0xFF ; 255 1b11e: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1b122: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1b126: 8f 5f subi r24, 0xFF ; 255 1b128: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1b12c: d7 cf rjmp .-82 ; 0x1b0dc ); 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(); } 1b12e: cf 91 pop r28 1b130: 1f 91 pop r17 1b132: 0f 91 pop r16 1b134: ff 90 pop r15 1b136: ef 90 pop r14 1b138: 08 95 ret 0001b13a : 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); 1b13a: 88 e1 ldi r24, 0x18 ; 24 1b13c: 9d e5 ldi r25, 0x5D ; 93 1b13e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1b142: 65 eb ldi r22, 0xB5 ; 181 1b144: 78 ed ldi r23, 0xD8 ; 216 1b146: 0c 94 63 d8 jmp 0x1b0c6 ; 0x1b0c6 0001b14a : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 1b14a: 87 e2 ldi r24, 0x27 ; 39 1b14c: 9d e5 ldi r25, 0x5D ; 93 1b14e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1b152: 61 ec ldi r22, 0xC1 ; 193 1b154: 78 ed ldi r23, 0xD8 ; 216 1b156: 0c 94 63 d8 jmp 0x1b0c6 ; 0x1b0c6 0001b15a : 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); 1b15a: 84 ef ldi r24, 0xF4 ; 244 1b15c: 9b e3 ldi r25, 0x3B ; 59 1b15e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1b162: 6a e8 ldi r22, 0x8A ; 138 1b164: 7b e3 ldi r23, 0x3B ; 59 1b166: 0c 94 63 d8 jmp 0x1b0c6 ; 0x1b0c6 0001b16a : 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){ 1b16a: cf 93 push r28 1b16c: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 1b16e: 0f 94 20 88 call 0x31040 ; 0x31040 1b172: 88 23 and r24, r24 1b174: 21 f0 breq .+8 ; 0x1b17e 1b176: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 1b178: cf 91 pop r28 1b17a: 0d 94 0f a1 jmp 0x3421e ; 0x3421e 1b17e: cf 91 pop r28 1b180: 08 95 ret 0001b182 : 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) { 1b182: cf 93 push r28 1b184: c8 2f mov r28, r24 menu_back(); 1b186: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 MMU2::mmu2.eject_filament(filament, true); 1b18a: 61 e0 ldi r22, 0x01 ; 1 1b18c: 8c 2f mov r24, r28 1b18e: 0f 94 92 a0 call 0x34124 ; 0x34124 // Clear the filament action clearFilamentAction(); } 1b192: 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(); 1b194: 0d 94 ef 35 jmp 0x26bde ; 0x26bde 0001b198 : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.load_filament(i); 1b198: 80 e0 ldi r24, 0x00 ; 0 1b19a: 0f 94 4f a0 call 0x3409e ; 0x3409e 1b19e: 81 e0 ldi r24, 0x01 ; 1 1b1a0: 0f 94 4f a0 call 0x3409e ; 0x3409e 1b1a4: 82 e0 ldi r24, 0x02 ; 2 1b1a6: 0f 94 4f a0 call 0x3409e ; 0x3409e 1b1aa: 83 e0 ldi r24, 0x03 ; 3 1b1ac: 0f 94 4f a0 call 0x3409e ; 0x3409e 1b1b0: 84 e0 ldi r24, 0x04 ; 4 1b1b2: 0d 94 4f a0 jmp 0x3409e ; 0x3409e 0001b1b6 : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 1b1b6: 0d 94 4f a0 jmp 0x3409e ; 0x3409e 0001b1ba : //! //! @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) 1b1ba: 4f 92 push r4 1b1bc: 5f 92 push r5 1b1be: 6f 92 push r6 1b1c0: 7f 92 push r7 1b1c2: 8f 92 push r8 1b1c4: 9f 92 push r9 1b1c6: af 92 push r10 1b1c8: bf 92 push r11 1b1ca: cf 92 push r12 1b1cc: df 92 push r13 1b1ce: ef 92 push r14 1b1d0: ff 92 push r15 1b1d2: 0f 93 push r16 1b1d4: 1f 93 push r17 1b1d6: cf 93 push r28 1b1d8: df 93 push r29 1b1da: 6c 01 movw r12, r24 1b1dc: 7b 01 movw r14, r22 1b1de: 80 91 98 13 lds r24, 0x1398 ; 0x801398 { //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); 1b1e2: 67 2b or r22, r23 1b1e4: 29 f0 breq .+10 ; 0x1b1f0 1b1e6: 06 e0 ldi r16, 0x06 ; 6 1b1e8: 81 30 cpi r24, 0x01 ; 1 1b1ea: 29 f0 breq .+10 ; 0x1b1f6 1b1ec: 05 e0 ldi r16, 0x05 ; 5 1b1ee: 03 c0 rjmp .+6 ; 0x1b1f6 1b1f0: 04 e0 ldi r16, 0x04 ; 4 1b1f2: 81 30 cpi r24, 0x01 ; 1 1b1f4: d9 f3 breq .-10 ; 0x1b1ec const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 1b1f6: 0e 94 48 70 call 0xe090 ; 0xe090 KEEPALIVE_STATE(PAUSED_FOR_USER); 1b1fa: 84 e0 ldi r24, 0x04 ; 4 1b1fc: 80 93 96 02 sts 0x0296, r24 ; 0x800296 { //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; 1b200: 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; 1b202: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 1b204: 03 50 subi r16, 0x03 ; 3 1b206: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 1b208: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(true); 1b20c: 81 e0 ldi r24, 0x01 ; 1 1b20e: 0e 94 5a 8c call 0x118b4 ; 0x118b4 if (lcd_encoder) 1b212: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1b216: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1b21a: 00 97 sbiw r24, 0x00 ; 0 1b21c: 09 f4 brne .+2 ; 0x1b220 1b21e: 9d c0 rjmp .+314 ; 0x1b35a { if (lcd_encoder < 0) 1b220: 97 ff sbrs r25, 7 1b222: 88 c0 rjmp .+272 ; 0x1b334 { cursor_pos--; 1b224: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 1b226: 10 92 38 05 sts 0x0538, r1 ; 0x800538 1b22a: 10 92 37 05 sts 0x0537, r1 ; 0x800537 } if (cursor_pos > 3) 1b22e: c4 30 cpi r28, 0x04 ; 4 1b230: 0c f4 brge .+2 ; 0x1b234 1b232: 86 c0 rjmp .+268 ; 0x1b340 { cursor_pos = 3; if (first < items_no - 3) 1b234: 88 2d mov r24, r8 1b236: 08 2c mov r0, r8 1b238: 00 0c add r0, r0 1b23a: 99 0b sbc r25, r25 1b23c: 80 17 cp r24, r16 1b23e: 91 07 cpc r25, r17 1b240: 0c f0 brlt .+2 ; 0x1b244 1b242: 7a c0 rjmp .+244 ; 0x1b338 { first++; 1b244: 83 94 inc r8 lcd_clear(); 1b246: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 1b24a: 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); 1b24c: c1 14 cp r12, r1 1b24e: d1 04 cpc r13, r1 1b250: 29 f0 breq .+10 ; 0x1b25c 1b252: a6 01 movw r20, r12 1b254: 60 e0 ldi r22, 0x00 ; 0 1b256: 80 e0 ldi r24, 0x00 ; 0 1b258: 0e 94 29 70 call 0xe052 ; 0xe052 const bool last_visible = (first == items_no - 3); 1b25c: a8 2c mov r10, r8 1b25e: 08 2c mov r0, r8 1b260: 00 0c add r0, r0 1b262: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 1b264: e1 14 cp r14, r1 1b266: f1 04 cpc r15, r1 1b268: 29 f0 breq .+10 ; 0x1b274 1b26a: 82 e0 ldi r24, 0x02 ; 2 1b26c: 98 2e mov r9, r24 1b26e: a0 16 cp r10, r16 1b270: b1 06 cpc r11, r17 1b272: 11 f0 breq .+4 ; 0x1b278 1b274: 93 e0 ldi r25, 0x03 ; 3 1b276: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 1b278: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 1b27a: df 5f subi r29, 0xFF ; 255 1b27c: 41 eb ldi r20, 0xB1 ; 177 1b27e: 5e e6 ldi r21, 0x6E ; 110 1b280: 6d 2f mov r22, r29 1b282: 81 e0 ldi r24, 0x01 ; 1 1b284: 0e 94 29 70 call 0xe052 ; 0xe052 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++) 1b288: 9d 12 cpse r9, r29 1b28a: f7 cf rjmp .-18 ; 0x1b27a 1b28c: 48 2c mov r4, r8 1b28e: 08 2c mov r0, r8 1b290: 00 0c add r0, r0 1b292: 55 08 sbc r5, r5 1b294: 66 08 sbc r6, r6 1b296: 77 08 sbc r7, r7 1b298: 8f ef ldi r24, 0xFF ; 255 1b29a: 48 1a sub r4, r24 1b29c: 58 0a sbc r5, r24 1b29e: 68 0a sbc r6, r24 1b2a0: 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++) 1b2a2: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 1b2a4: 93 94 inc r9 1b2a6: 69 2d mov r22, r9 1b2a8: 8a e0 ldi r24, 0x0A ; 10 1b2aa: 0e 94 15 70 call 0xe02a ; 0xe02a 1b2ae: c3 01 movw r24, r6 1b2b0: b2 01 movw r22, r4 1b2b2: 0e 94 ce 71 call 0xe39c ; 0xe39c 1b2b6: 8f ef ldi r24, 0xFF ; 255 1b2b8: 48 1a sub r4, r24 1b2ba: 58 0a sbc r5, r24 1b2bc: 68 0a sbc r6, r24 1b2be: 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++) 1b2c0: d9 11 cpse r29, r9 1b2c2: f0 cf rjmp .-32 ; 0x1b2a4 { 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); 1b2c4: e1 14 cp r14, r1 1b2c6: f1 04 cpc r15, r1 1b2c8: 41 f0 breq .+16 ; 0x1b2da 1b2ca: a0 16 cp r10, r16 1b2cc: b1 06 cpc r11, r17 1b2ce: 29 f4 brne .+10 ; 0x1b2da 1b2d0: a7 01 movw r20, r14 1b2d2: 63 e0 ldi r22, 0x03 ; 3 1b2d4: 81 e0 ldi r24, 0x01 ; 1 1b2d6: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 1b2da: 44 e7 ldi r20, 0x74 ; 116 1b2dc: 51 e9 ldi r21, 0x91 ; 145 1b2de: 61 e0 ldi r22, 0x01 ; 1 1b2e0: 80 e0 ldi r24, 0x00 ; 0 1b2e2: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_putc_at(0, cursor_pos, '>'); 1b2e6: 4e e3 ldi r20, 0x3E ; 62 1b2e8: 6c 2f mov r22, r28 1b2ea: 80 e0 ldi r24, 0x00 ; 0 1b2ec: 0e 94 35 70 call 0xe06a ; 0xe06a _delay(100); 1b2f0: 64 e6 ldi r22, 0x64 ; 100 1b2f2: 70 e0 ldi r23, 0x00 ; 0 1b2f4: 80 e0 ldi r24, 0x00 ; 0 1b2f6: 90 e0 ldi r25, 0x00 ; 0 1b2f8: 0f 94 8d 3c call 0x2791a ; 0x2791a if (lcd_clicked()) 1b2fc: 0e 94 32 72 call 0xe464 ; 0xe464 1b300: 88 23 and r24, r24 1b302: 09 f4 brne .+2 ; 0x1b306 1b304: 81 cf rjmp .-254 ; 0x1b208 { KEEPALIVE_STATE(IN_HANDLER); 1b306: 82 e0 ldi r24, 0x02 ; 2 1b308: 80 93 96 02 sts 0x0296, r24 ; 0x800296 return(cursor_pos + first - 1); 1b30c: 8f ef ldi r24, 0xFF ; 255 1b30e: 8c 0f add r24, r28 1b310: 88 0d add r24, r8 } } } 1b312: df 91 pop r29 1b314: cf 91 pop r28 1b316: 1f 91 pop r17 1b318: 0f 91 pop r16 1b31a: ff 90 pop r15 1b31c: ef 90 pop r14 1b31e: df 90 pop r13 1b320: cf 90 pop r12 1b322: bf 90 pop r11 1b324: af 90 pop r10 1b326: 9f 90 pop r9 1b328: 8f 90 pop r8 1b32a: 7f 90 pop r7 1b32c: 6f 90 pop r6 1b32e: 5f 90 pop r5 1b330: 4f 90 pop r4 1b332: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1b334: cf 5f subi r28, 0xFF ; 255 1b336: 77 cf rjmp .-274 ; 0x1b226 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); 1b338: 87 e0 ldi r24, 0x07 ; 7 1b33a: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 1b33e: 85 cf rjmp .-246 ; 0x1b24a } } if (cursor_pos < 1) 1b340: c1 11 cpse r28, r1 1b342: 84 cf rjmp .-248 ; 0x1b24c { cursor_pos = 1; if (first > 0) 1b344: 18 14 cp r1, r8 1b346: 2c f4 brge .+10 ; 0x1b352 { first--; 1b348: 8a 94 dec r8 lcd_clear(); 1b34a: 0e 94 48 70 call 0xe090 ; 0xe090 } } if (cursor_pos < 1) { cursor_pos = 1; 1b34e: c1 e0 ldi r28, 0x01 ; 1 1b350: 7d cf rjmp .-262 ; 0x1b24c if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1b352: 87 e0 ldi r24, 0x07 ; 7 1b354: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 1b358: fa cf rjmp .-12 ; 0x1b34e cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 1b35a: c4 30 cpi r28, 0x04 ; 4 1b35c: 0c f0 brlt .+2 ; 0x1b360 1b35e: 6a cf rjmp .-300 ; 0x1b234 1b360: 75 cf rjmp .-278 ; 0x1b24c 0001b362 : } #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) { 1b362: 4f 92 push r4 1b364: 5f 92 push r5 1b366: 6f 92 push r6 1b368: 7f 92 push r7 1b36a: af 92 push r10 1b36c: bf 92 push r11 1b36e: cf 92 push r12 1b370: df 92 push r13 1b372: ef 92 push r14 1b374: ff 92 push r15 1b376: 0f 93 push r16 1b378: 1f 93 push r17 1b37a: cf 93 push r28 1b37c: df 93 push r29 1b37e: 24 e0 ldi r18, 0x04 ; 4 1b380: 30 e0 ldi r19, 0x00 ; 0 1b382: 41 e0 ldi r20, 0x01 ; 1 1b384: 50 e0 ldi r21, 0x00 ; 0 1b386: d9 01 movw r26, r18 1b388: a2 59 subi r26, 0x92 ; 146 1b38a: b4 47 sbci r27, 0x74 ; 116 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 1b38c: fd 01 movw r30, r26 1b38e: 65 91 lpm r22, Z+ 1b390: 74 91 lpm r23, Z 1b392: 86 17 cp r24, r22 1b394: 97 07 cpc r25, r23 1b396: 0c f0 brlt .+2 ; 0x1b39a 1b398: 66 c0 rjmp .+204 ; 0x1b466 { celsius = PGM_RD_W((*tt)[i-1][1]) + 1b39a: 41 50 subi r20, 0x01 ; 1 1b39c: 51 09 sbc r21, r1 1b39e: 44 0f add r20, r20 1b3a0: 55 1f adc r21, r21 1b3a2: 44 0f add r20, r20 1b3a4: 55 1f adc r21, r21 1b3a6: ea 01 movw r28, r20 1b3a8: c0 59 subi r28, 0x90 ; 144 1b3aa: d4 47 sbci r29, 0x74 ; 116 1b3ac: fe 01 movw r30, r28 1b3ae: 05 91 lpm r16, Z+ 1b3b0: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 1b3b2: 42 59 subi r20, 0x92 ; 146 1b3b4: 54 47 sbci r21, 0x74 ; 116 1b3b6: fa 01 movw r30, r20 1b3b8: 65 91 lpm r22, Z+ 1b3ba: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 1b3bc: f9 01 movw r30, r18 1b3be: e0 59 subi r30, 0x90 ; 144 1b3c0: f4 47 sbci r31, 0x74 ; 116 1b3c2: e5 90 lpm r14, Z+ 1b3c4: f4 90 lpm r15, Z 1b3c6: fe 01 movw r30, r28 1b3c8: c5 90 lpm r12, Z+ 1b3ca: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 1b3cc: fd 01 movw r30, r26 1b3ce: c5 91 lpm r28, Z+ 1b3d0: d4 91 lpm r29, Z 1b3d2: fa 01 movw r30, r20 1b3d4: a5 90 lpm r10, Z+ 1b3d6: 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])) * 1b3d8: 86 1b sub r24, r22 1b3da: 97 0b sbc r25, r23 1b3dc: bc 01 movw r22, r24 1b3de: 99 0f add r25, r25 1b3e0: 88 0b sbc r24, r24 1b3e2: 99 0b sbc r25, r25 1b3e4: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1b3e8: 2b 01 movw r4, r22 1b3ea: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 1b3ec: b7 01 movw r22, r14 1b3ee: 6c 19 sub r22, r12 1b3f0: 7d 09 sbc r23, r13 1b3f2: 07 2e mov r0, r23 1b3f4: 00 0c add r0, r0 1b3f6: 88 0b sbc r24, r24 1b3f8: 99 0b sbc r25, r25 1b3fa: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1b3fe: 9b 01 movw r18, r22 1b400: 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])) * 1b402: c3 01 movw r24, r6 1b404: b2 01 movw r22, r4 1b406: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1b40a: 6b 01 movw r12, r22 1b40c: 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])); 1b40e: be 01 movw r22, r28 1b410: 6a 19 sub r22, r10 1b412: 7b 09 sbc r23, r11 1b414: 07 2e mov r0, r23 1b416: 00 0c add r0, r0 1b418: 88 0b sbc r24, r24 1b41a: 99 0b sbc r25, r25 1b41c: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1b420: 9b 01 movw r18, r22 1b422: 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])) / 1b424: c7 01 movw r24, r14 1b426: b6 01 movw r22, r12 1b428: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1b42c: 6b 01 movw r12, r22 1b42e: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 1b430: b8 01 movw r22, r16 1b432: 11 0f add r17, r17 1b434: 88 0b sbc r24, r24 1b436: 99 0b sbc r25, r25 1b438: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1b43c: 9b 01 movw r18, r22 1b43e: ac 01 movw r20, r24 1b440: c7 01 movw r24, r14 1b442: b6 01 movw r22, r12 1b444: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__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; } 1b448: df 91 pop r29 1b44a: cf 91 pop r28 1b44c: 1f 91 pop r17 1b44e: 0f 91 pop r16 1b450: ff 90 pop r15 1b452: ef 90 pop r14 1b454: df 90 pop r13 1b456: cf 90 pop r12 1b458: bf 90 pop r11 1b45a: af 90 pop r10 1b45c: 7f 90 pop r7 1b45e: 6f 90 pop r6 1b460: 5f 90 pop r5 1b462: 4f 90 pop r4 1b464: 08 95 ret 1b466: 4f 5f subi r20, 0xFF ; 255 1b468: 5f 4f sbci r21, 0xFF ; 255 1b46a: 2c 5f subi r18, 0xFC ; 252 1b46c: 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 1b474: 88 cf rjmp .-240 ; 0x1b386 break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 1b476: ec ee ldi r30, 0xEC ; 236 1b478: fb e8 ldi r31, 0x8B ; 139 1b47a: 65 91 lpm r22, Z+ 1b47c: 74 91 lpm r23, Z 1b47e: 07 2e mov r0, r23 1b480: 00 0c add r0, r0 1b482: 88 0b sbc r24, r24 1b484: 99 0b sbc r25, r25 1b486: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1b48a: de cf rjmp .-68 ; 0x1b448 0001b48c : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 1b48c: 1f 93 push r17 1b48e: cf 93 push r28 1b490: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 1b492: e1 e0 ldi r30, 0x01 ; 1 1b494: f1 e0 ldi r31, 0x01 ; 1 1b496: 80 81 ld r24, Z 1b498: 8e 7f andi r24, 0xFE ; 254 1b49a: 80 83 st Z, r24 PORTH |= 0x01; 1b49c: e2 e0 ldi r30, 0x02 ; 2 1b49e: f1 e0 ldi r31, 0x01 ; 1 1b4a0: 80 81 ld r24, Z 1b4a2: 81 60 ori r24, 0x01 ; 1 1b4a4: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 1b4a6: e2 e2 ldi r30, 0x22 ; 34 1b4a8: f5 e0 ldi r31, 0x05 ; 5 1b4aa: 90 e1 ldi r25, 0x10 ; 16 1b4ac: 90 83 st Z, r25 ptr[1] = 0; 1b4ae: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 1b4b0: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 1b4b2: e0 ed ldi r30, 0xD0 ; 208 1b4b4: f0 e0 ldi r31, 0x00 ; 0 1b4b6: 80 81 ld r24, Z 1b4b8: 82 60 ori r24, 0x02 ; 2 1b4ba: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 1b4bc: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 1b4c0: e1 ed ldi r30, 0xD1 ; 209 1b4c2: f0 e0 ldi r31, 0x00 ; 0 1b4c4: 88 e1 ldi r24, 0x18 ; 24 1b4c6: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 1b4c8: 80 81 ld r24, Z 1b4ca: 80 68 ori r24, 0x80 ; 128 1b4cc: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 1b4ce: e2 e7 ldi r30, 0x72 ; 114 1b4d0: f2 e1 ldi r31, 0x12 ; 18 1b4d2: 82 eb ldi r24, 0xB2 ; 178 1b4d4: 99 e3 ldi r25, 0x39 ; 57 1b4d6: 91 87 std Z+9, r25 ; 0x09 1b4d8: 80 87 std Z+8, r24 ; 0x08 1b4da: 86 e2 ldi r24, 0x26 ; 38 1b4dc: 9a e3 ldi r25, 0x3A ; 58 1b4de: 93 87 std Z+11, r25 ; 0x0b 1b4e0: 82 87 std Z+10, r24 ; 0x0a 1b4e2: 13 e0 ldi r17, 0x03 ; 3 1b4e4: 13 83 std Z+3, r17 ; 0x03 1b4e6: 15 86 std Z+13, r1 ; 0x0d 1b4e8: 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); 1b4ea: 9f b7 in r25, 0x3f ; 63 1b4ec: f8 94 cli 1b4ee: e5 e0 ldi r30, 0x05 ; 5 1b4f0: f1 e0 ldi r31, 0x01 ; 1 1b4f2: 80 81 ld r24, Z 1b4f4: 80 62 ori r24, 0x20 ; 32 1b4f6: 80 83 st Z, r24 1b4f8: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(MMU_RST_PIN); // setup reset pin 1b4fa: e4 e0 ldi r30, 0x04 ; 4 1b4fc: f1 e0 ldi r31, 0x01 ; 1 1b4fe: 80 81 ld r24, Z 1b500: 80 62 ori r24, 0x20 ; 32 1b502: 80 83 st Z, r24 #endif //MMU_HWRESET reset(); 1b504: 0f 94 e3 c2 call 0x385c6 ; 0x385c6 mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 1b508: 83 e6 ldi r24, 0x63 ; 99 1b50a: 0f 94 9f 87 call 0x30f3e ; 0x30f3e retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 1b50e: 8f ef ldi r24, 0xFF ; 255 1b510: 96 ea ldi r25, 0xA6 ; 166 1b512: 0e 94 86 7b call 0xf70c ; 0xf70c retryAttempts = MAX_RETRIES; 1b516: c9 e2 ldi r28, 0x29 ; 41 1b518: d3 e1 ldi r29, 0x13 ; 19 1b51a: 10 93 7d 13 sts 0x137D, r17 ; 0x80137d } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 1b51e: 85 e9 ldi r24, 0x95 ; 149 1b520: 9a ea ldi r25, 0xAA ; 170 1b522: 0e 94 86 7b call 0xf70c ; 0xf70c /// @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; } 1b526: 8a e0 ldi r24, 0x0A ; 10 1b528: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 1b52a: 82 e0 ldi r24, 0x02 ; 2 1b52c: 80 93 98 13 sts 0x1398, r24 ; 0x801398 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 1b530: 81 e0 ldi r24, 0x01 ; 1 1b532: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 1b534: 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; 1b536: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 1b538: 86 e0 ldi r24, 0x06 ; 6 1b53a: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 1b53c: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 1b53e: df 91 pop r29 1b540: cf 91 pop r28 1b542: 1f 91 pop r17 1b544: 0d 94 72 98 jmp 0x330e4 ; 0x330e4 0001b548 : useU2X = false; } #endif // set up the first (original serial port) if (useU2X) { M_UCSRxA = 1 << M_U2Xx; 1b548: 22 e0 ldi r18, 0x02 ; 2 1b54a: 20 93 c0 00 sts 0x00C0, r18 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> M_UCSRxA = 0; baud_setting = (F_CPU / 8 / baud - 1) / 2; } // assign the baud_setting, a.k.a. ubbr (USART Baud Rate Register) M_UBRRxH = baud_setting >> 8; 1b54e: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> M_UBRRxL = baud_setting; 1b552: 90 e1 ldi r25, 0x10 ; 16 1b554: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> sbi(M_UCSRxB, M_RXENx); 1b558: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b55c: 80 61 ori r24, 0x10 ; 16 1b55e: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_TXENx); 1b562: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b566: 88 60 ori r24, 0x08 ; 8 1b568: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_RXCIEx); 1b56c: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b570: 80 68 ori r24, 0x80 ; 128 1b572: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> if (selectedSerialPort == 1) { //set up also the second serial port 1b576: 80 91 21 05 lds r24, 0x0521 ; 0x800521 1b57a: 81 30 cpi r24, 0x01 ; 1 1b57c: a9 f4 brne .+42 ; 0x1b5a8 if (useU2X) { UCSR1A = 1 << U2X1; 1b57e: 20 93 c8 00 sts 0x00C8, r18 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> UCSR1A = 0; baud_setting = (F_CPU / 8 / baud - 1) / 2; } // assign the baud_setting, a.k.a. ubbr (USART Baud Rate Register) UBRR1H = baud_setting >> 8; 1b582: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> UBRR1L = baud_setting; 1b586: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> sbi(UCSR1B, RXEN1); 1b58a: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b58e: 80 61 ori r24, 0x10 ; 16 1b590: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, TXEN1); 1b594: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b598: 88 60 ori r24, 0x08 ; 8 1b59a: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, RXCIE1); 1b59e: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b5a2: 80 68 ori r24, 0x80 ; 128 1b5a4: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> } } 1b5a8: 08 95 ret 0001b5aa : { 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) 1b5aa: 2f 92 push r2 1b5ac: 3f 92 push r3 1b5ae: 4f 92 push r4 1b5b0: 5f 92 push r5 1b5b2: 6f 92 push r6 1b5b4: 7f 92 push r7 1b5b6: 8f 92 push r8 1b5b8: 9f 92 push r9 1b5ba: af 92 push r10 1b5bc: bf 92 push r11 1b5be: cf 92 push r12 1b5c0: df 92 push r13 1b5c2: ef 92 push r14 1b5c4: ff 92 push r15 1b5c6: 0f 93 push r16 1b5c8: 1f 93 push r17 1b5ca: cf 93 push r28 1b5cc: df 93 push r29 1b5ce: 00 d0 rcall .+0 ; 0x1b5d0 1b5d0: 00 d0 rcall .+0 ; 0x1b5d2 1b5d2: 1f 92 push r1 1b5d4: cd b7 in r28, 0x3d ; 61 1b5d6: de b7 in r29, 0x3e ; 62 1b5d8: 69 83 std Y+1, r22 ; 0x01 1b5da: 49 01 movw r8, r18 1b5dc: 5a 01 movw r10, r20 1b5de: 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; 1b5e0: 68 2f mov r22, r24 1b5e2: 70 e0 ldi r23, 0x00 ; 0 1b5e4: 90 e0 ldi r25, 0x00 ; 0 1b5e6: 80 e0 ldi r24, 0x00 ; 0 1b5e8: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1b5ec: 24 e0 ldi r18, 0x04 ; 4 1b5ee: 32 e0 ldi r19, 0x02 ; 2 1b5f0: 41 e0 ldi r20, 0x01 ; 1 1b5f2: 5c e3 ldi r21, 0x3C ; 60 1b5f4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__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] 1b5f8: 20 91 b8 12 lds r18, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2a> 1b5fc: 30 91 b9 12 lds r19, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2b> 1b600: 40 91 ba 12 lds r20, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.394+0x2c> 1b604: 50 91 bb 12 lds r21, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.394+0x2d> 1b608: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1b60c: 6b 01 movw r12, r22 1b60e: 7c 01 movw r14, r24 dP *= (cur_heater_temp * U) + V; // linear temp. correction 1b610: 20 91 bc 12 lds r18, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.394+0x2e> 1b614: 30 91 bd 12 lds r19, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.394+0x2f> 1b618: 40 91 be 12 lds r20, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.394+0x30> 1b61c: 50 91 bf 12 lds r21, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.394+0x31> 1b620: c5 01 movw r24, r10 1b622: b4 01 movw r22, r8 1b624: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1b628: 20 91 c0 12 lds r18, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x32> 1b62c: 30 91 c1 12 lds r19, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x33> 1b630: 40 91 c2 12 lds r20, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x34> 1b634: 50 91 c3 12 lds r21, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x35> 1b638: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1b63c: a7 01 movw r20, r14 1b63e: 96 01 movw r18, r12 1b640: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1b644: 6b 01 movw r12, r22 1b646: 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; 1b648: 20 91 0e 13 lds r18, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 1b64c: 30 91 0f 13 lds r19, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 1b650: 40 91 10 13 lds r20, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 1b654: 50 91 11 13 lds r21, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> 1b658: c8 01 movw r24, r16 1b65a: b2 01 movw r22, r4 1b65c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1b660: 9b 01 movw r18, r22 1b662: 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 1b664: c5 01 movw r24, r10 1b666: b4 01 movw r22, r8 1b668: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__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) 1b66c: 39 81 ldd r19, Y+1 ; 0x01 1b66e: 24 e0 ldi r18, 0x04 ; 4 1b670: 32 9f mul r19, r18 1b672: f0 01 movw r30, r0 1b674: 11 24 eor r1, r1 1b676: e2 53 subi r30, 0x32 ; 50 1b678: 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 1b67a: 20 81 ld r18, Z 1b67c: 31 81 ldd r19, Z+1 ; 0x01 1b67e: 42 81 ldd r20, Z+2 ; 0x02 1b680: 53 81 ldd r21, Z+3 ; 0x03 1b682: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1b686: 9b 01 movw r18, r22 1b688: ac 01 movw r20, r24 float dT = (dP - dPl) * C_i; // expected temperature difference (K) 1b68a: c7 01 movw r24, r14 1b68c: b6 01 movw r22, r12 1b68e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1b692: 20 91 1b 13 lds r18, 0x131B ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.394+0x8d> 1b696: 30 91 1c 13 lds r19, 0x131C ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.394+0x8e> 1b69a: 40 91 1d 13 lds r20, 0x131D ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.394+0x8f> 1b69e: 50 91 1e 13 lds r21, 0x131E ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.394+0x90> 1b6a2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1b6a6: 6f 83 std Y+7, r22 ; 0x07 1b6a8: 79 83 std Y+1, r23 ; 0x01 1b6aa: 18 2f mov r17, r24 1b6ac: 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); 1b6ae: 20 91 af 12 lds r18, 0x12AF ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.394+0x21> 1b6b2: e2 2f mov r30, r18 1b6b4: f0 e0 ldi r31, 0x00 ; 0 1b6b6: 80 91 ae 12 lds r24, 0x12AE ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.394+0x20> 1b6ba: 81 50 subi r24, 0x01 ; 1 1b6bc: 99 0b sbc r25, r25 1b6be: e8 17 cp r30, r24 1b6c0: f9 07 cpc r31, r25 1b6c2: 09 f4 brne .+2 ; 0x1b6c6 1b6c4: f4 c0 rjmp .+488 ; 0x1b8ae 1b6c6: 2f 5f subi r18, 0xFF ; 255 1b6c8: 2e 83 std Y+6, r18 ; 0x06 float dT_lag = dT_lag_buf[dT_next_idx]; 1b6ca: 5e 81 ldd r21, Y+6 ; 0x06 1b6cc: 44 e0 ldi r20, 0x04 ; 4 1b6ce: 54 9f mul r21, r20 1b6d0: 10 01 movw r2, r0 1b6d2: 11 24 eor r1, r1 1b6d4: d1 01 movw r26, r2 1b6d6: a2 57 subi r26, 0x72 ; 114 1b6d8: bd 4e sbci r27, 0xED ; 237 1b6da: 2d 91 ld r18, X+ 1b6dc: 3d 91 ld r19, X+ 1b6de: 4d 91 ld r20, X+ 1b6e0: 5c 91 ld r21, X 1b6e2: 2a 83 std Y+2, r18 ; 0x02 1b6e4: 3b 83 std Y+3, r19 ; 0x03 1b6e6: 4c 83 std Y+4, r20 ; 0x04 1b6e8: 5d 83 std Y+5, r21 ; 0x05 float dT_lag_prev = dT_lag_buf[dT_lag_idx]; 1b6ea: ee 0f add r30, r30 1b6ec: ff 1f adc r31, r31 1b6ee: ee 0f add r30, r30 1b6f0: ff 1f adc r31, r31 1b6f2: e2 57 subi r30, 0x72 ; 114 1b6f4: fd 4e sbci r31, 0xED ; 237 1b6f6: 40 80 ld r4, Z 1b6f8: 51 80 ldd r5, Z+1 ; 0x01 1b6fa: 62 80 ldd r6, Z+2 ; 0x02 1b6fc: 73 80 ldd r7, Z+3 ; 0x03 float dT_f = iir_mul(dT_lag_prev, dT, fS, dT); 1b6fe: c0 90 c8 12 lds r12, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3a> 1b702: d0 90 c9 12 lds r13, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3b> 1b706: e0 90 ca 12 lds r14, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.394+0x3c> 1b70a: f0 90 cb 12 lds r15, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.394+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; 1b70e: 92 01 movw r18, r4 1b710: a3 01 movw r20, r6 1b712: b2 01 movw r22, r4 1b714: c3 01 movw r24, r6 1b716: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 1b71a: 88 23 and r24, r24 1b71c: 21 f0 breq .+8 ; 0x1b726 1b71e: 4f 80 ldd r4, Y+7 ; 0x07 1b720: 59 80 ldd r5, Y+1 ; 0x01 1b722: 61 2e mov r6, r17 1b724: 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; 1b726: a1 01 movw r20, r2 1b728: 42 57 subi r20, 0x72 ; 114 1b72a: 5d 4e sbci r21, 0xED ; 237 1b72c: 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); 1b72e: a7 01 movw r20, r14 1b730: 96 01 movw r18, r12 1b732: 60 e0 ldi r22, 0x00 ; 0 1b734: 70 e0 ldi r23, 0x00 ; 0 1b736: 80 e8 ldi r24, 0x80 ; 128 1b738: 9f e3 ldi r25, 0x3F ; 63 1b73a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1b73e: 92 01 movw r18, r4 1b740: a3 01 movw r20, r6 1b742: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1b746: 2b 01 movw r4, r22 1b748: 3c 01 movw r6, r24 1b74a: a7 01 movw r20, r14 1b74c: 96 01 movw r18, r12 1b74e: 6f 81 ldd r22, Y+7 ; 0x07 1b750: 79 81 ldd r23, Y+1 ; 0x01 1b752: 81 2f mov r24, r17 1b754: 90 2f mov r25, r16 1b756: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1b75a: 9b 01 movw r18, r22 1b75c: ac 01 movw r20, r24 1b75e: c3 01 movw r24, r6 1b760: b2 01 movw r22, r4 1b762: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__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; 1b766: f1 01 movw r30, r2 1b768: 60 83 st Z, r22 1b76a: 71 83 std Z+1, r23 ; 0x01 1b76c: 82 83 std Z+2, r24 ; 0x02 1b76e: 93 83 std Z+3, r25 ; 0x03 dT_lag_idx = dT_next_idx; 1b770: fe 81 ldd r31, Y+6 ; 0x06 1b772: f0 93 af 12 sts 0x12AF, r31 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.394+0x21> // calculate and filter dT_err float dT_err = (cur_heater_temp - T_prev) - dT_lag; 1b776: 20 91 b4 12 lds r18, 0x12B4 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x26> 1b77a: 30 91 b5 12 lds r19, 0x12B5 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x27> 1b77e: 40 91 b6 12 lds r20, 0x12B6 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x28> 1b782: 50 91 b7 12 lds r21, 0x12B7 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x29> 1b786: c5 01 movw r24, r10 1b788: b4 01 movw r22, r8 1b78a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1b78e: 2a 81 ldd r18, Y+2 ; 0x02 1b790: 3b 81 ldd r19, Y+3 ; 0x03 1b792: 4c 81 ldd r20, Y+4 ; 0x04 1b794: 5d 81 ldd r21, Y+5 ; 0x05 1b796: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1b79a: 2b 01 movw r4, r22 1b79c: 3c 01 movw r6, r24 float dT_err_f = iir_mul(dT_err_prev, dT_err, THERMAL_MODEL_fE, 0.); 1b79e: c0 90 b0 12 lds r12, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x22> 1b7a2: d0 90 b1 12 lds r13, 0x12B1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x23> 1b7a6: e0 90 b2 12 lds r14, 0x12B2 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x24> 1b7aa: f0 90 b3 12 lds r15, 0x12B3 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.394+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; 1b7ae: a7 01 movw r20, r14 1b7b0: 96 01 movw r18, r12 1b7b2: c7 01 movw r24, r14 1b7b4: b6 01 movw r22, r12 1b7b6: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 1b7ba: 88 23 and r24, r24 1b7bc: 19 f0 breq .+6 ; 0x1b7c4 1b7be: c1 2c mov r12, r1 1b7c0: d1 2c mov r13, r1 1b7c2: 76 01 movw r14, r12 return (a_ * (1.f - f)) + (b * f); 1b7c4: 23 e3 ldi r18, 0x33 ; 51 1b7c6: 33 e3 ldi r19, 0x33 ; 51 1b7c8: 43 e7 ldi r20, 0x73 ; 115 1b7ca: 5f e3 ldi r21, 0x3F ; 63 1b7cc: c7 01 movw r24, r14 1b7ce: b6 01 movw r22, r12 1b7d0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1b7d4: 6b 01 movw r12, r22 1b7d6: 7c 01 movw r14, r24 1b7d8: 2d ec ldi r18, 0xCD ; 205 1b7da: 3c ec ldi r19, 0xCC ; 204 1b7dc: 4c e4 ldi r20, 0x4C ; 76 1b7de: 5d e3 ldi r21, 0x3D ; 61 1b7e0: c3 01 movw r24, r6 1b7e2: b2 01 movw r22, r4 1b7e4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1b7e8: 9b 01 movw r18, r22 1b7ea: ac 01 movw r20, r24 1b7ec: c7 01 movw r24, r14 1b7ee: b6 01 movw r22, r12 1b7f0: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__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; 1b7f4: 80 92 b4 12 sts 0x12B4, r8 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x26> 1b7f8: 90 92 b5 12 sts 0x12B5, r9 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x27> 1b7fc: a0 92 b6 12 sts 0x12B6, r10 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x28> 1b800: b0 92 b7 12 sts 0x12B7, r11 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x29> dT_err_prev = dT_err_f; 1b804: 60 93 b0 12 sts 0x12B0, r22 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x22> 1b808: 70 93 b1 12 sts 0x12B1, r23 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x23> 1b80c: 80 93 b2 12 sts 0x12B2, r24 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x24> 1b810: 90 93 b3 12 sts 0x12B3, r25 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x25> // check and trigger errors flag_bits.error = (fabsf(dT_err_f) > err_s); 1b814: 6b 01 movw r12, r22 1b816: 7c 01 movw r14, r24 1b818: e8 94 clt 1b81a: f7 f8 bld r15, 7 1b81c: 21 e0 ldi r18, 0x01 ; 1 1b81e: 29 83 std Y+1, r18 ; 0x01 1b820: 20 91 23 13 lds r18, 0x1323 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.394+0x95> 1b824: 30 91 24 13 lds r19, 0x1324 ; 0x801324 <_ZN13thermal_modelL4dataE.lto_priv.394+0x96> 1b828: 40 91 25 13 lds r20, 0x1325 ; 0x801325 <_ZN13thermal_modelL4dataE.lto_priv.394+0x97> 1b82c: 50 91 26 13 lds r21, 0x1326 ; 0x801326 <_ZN13thermal_modelL4dataE.lto_priv.394+0x98> 1b830: c7 01 movw r24, r14 1b832: b6 01 movw r22, r12 1b834: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1b838: 18 16 cp r1, r24 1b83a: 0c f0 brlt .+2 ; 0x1b83e 1b83c: 19 82 std Y+1, r1 ; 0x01 1b83e: 80 91 1a 13 lds r24, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 1b842: 39 81 ldd r19, Y+1 ; 0x01 1b844: 30 fb bst r19, 0 1b846: 81 f9 bld r24, 1 1b848: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> flag_bits.warning = (fabsf(dT_err_f) > warn_s); 1b84c: 41 e0 ldi r20, 0x01 ; 1 1b84e: 49 83 std Y+1, r20 ; 0x01 1b850: 20 91 1f 13 lds r18, 0x131F ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.394+0x91> 1b854: 30 91 20 13 lds r19, 0x1320 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.394+0x92> 1b858: 40 91 21 13 lds r20, 0x1321 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.394+0x93> 1b85c: 50 91 22 13 lds r21, 0x1322 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.394+0x94> 1b860: c7 01 movw r24, r14 1b862: b6 01 movw r22, r12 1b864: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1b868: 18 16 cp r1, r24 1b86a: 0c f0 brlt .+2 ; 0x1b86e 1b86c: 19 82 std Y+1, r1 ; 0x01 1b86e: 80 91 1a 13 lds r24, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 1b872: 59 81 ldd r21, Y+1 ; 0x01 1b874: 50 fb bst r21, 0 1b876: 82 f9 bld r24, 2 1b878: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> } 1b87c: 27 96 adiw r28, 0x07 ; 7 1b87e: 0f b6 in r0, 0x3f ; 63 1b880: f8 94 cli 1b882: de bf out 0x3e, r29 ; 62 1b884: 0f be out 0x3f, r0 ; 63 1b886: cd bf out 0x3d, r28 ; 61 1b888: df 91 pop r29 1b88a: cf 91 pop r28 1b88c: 1f 91 pop r17 1b88e: 0f 91 pop r16 1b890: ff 90 pop r15 1b892: ef 90 pop r14 1b894: df 90 pop r13 1b896: cf 90 pop r12 1b898: bf 90 pop r11 1b89a: af 90 pop r10 1b89c: 9f 90 pop r9 1b89e: 8f 90 pop r8 1b8a0: 7f 90 pop r7 1b8a2: 6f 90 pop r6 1b8a4: 5f 90 pop r5 1b8a6: 4f 90 pop r4 1b8a8: 3f 90 pop r3 1b8aa: 2f 90 pop r2 1b8ac: 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); 1b8ae: 1e 82 std Y+6, r1 ; 0x06 1b8b0: 0c cf rjmp .-488 ; 0x1b6ca 0001b8b2 : float d = GOLDEN_RATIO * (bounds[1] - bounds[0]); points[0] = bounds[0] + d; points[1] = bounds[1] - d; } static float estimate(uint16_t samples, 1b8b2: 2f 92 push r2 1b8b4: 3f 92 push r3 1b8b6: 4f 92 push r4 1b8b8: 5f 92 push r5 1b8ba: 6f 92 push r6 1b8bc: 7f 92 push r7 1b8be: 8f 92 push r8 1b8c0: 9f 92 push r9 1b8c2: af 92 push r10 1b8c4: bf 92 push r11 1b8c6: cf 92 push r12 1b8c8: df 92 push r13 1b8ca: ef 92 push r14 1b8cc: ff 92 push r15 1b8ce: 0f 93 push r16 1b8d0: 1f 93 push r17 1b8d2: cf 93 push r28 1b8d4: df 93 push r29 1b8d6: cd b7 in r28, 0x3d ; 61 1b8d8: de b7 in r29, 0x3e ; 62 1b8da: a4 97 sbiw r28, 0x24 ; 36 1b8dc: 0f b6 in r0, 0x3f ; 63 1b8de: f8 94 cli 1b8e0: de bf out 0x3e, r29 ; 62 1b8e2: 0f be out 0x3f, r0 ; 63 1b8e4: cd bf out 0x3d, r28 ; 61 1b8e6: 9b 8f std Y+27, r25 ; 0x1b 1b8e8: 8a 8f std Y+26, r24 ; 0x1a 1b8ea: 7a 8b std Y+18, r23 ; 0x12 1b8ec: 69 8b std Y+17, r22 ; 0x11 1b8ee: 2b 8b std Y+19, r18 ; 0x13 1b8f0: 3c 8b std Y+20, r19 ; 0x14 1b8f2: 4d 8b std Y+21, r20 ; 0x15 1b8f4: 5e 8b std Y+22, r21 ; 0x16 1b8f6: 0c 8f std Y+28, r16 ; 0x1c 1b8f8: cd 8e std Y+29, r12 ; 0x1d 1b8fa: de 8e std Y+30, r13 ; 0x1e 1b8fc: ef 8e std Y+31, r14 ; 0x1f 1b8fe: 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; 1b900: 20 91 20 05 lds r18, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> 1b904: 29 8f std Y+25, r18 ; 0x19 thermal_model_reset_enabled(false); 1b906: 80 e0 ldi r24, 0x00 ; 0 1b908: 0f 94 9e 47 call 0x28f3c ; 0x28f3c float orig = *var; 1b90c: a9 89 ldd r26, Y+17 ; 0x11 1b90e: ba 89 ldd r27, Y+18 ; 0x12 1b910: 8d 91 ld r24, X+ 1b912: 9d 91 ld r25, X+ 1b914: 0d 90 ld r0, X+ 1b916: bc 91 ld r27, X 1b918: a0 2d mov r26, r0 1b91a: 89 a3 std Y+33, r24 ; 0x21 1b91c: 9a a3 std Y+34, r25 ; 0x22 1b91e: ab a3 std Y+35, r26 ; 0x23 1b920: bc a3 std Y+36, r27 ; 0x24 float e = NAN; float points[2]; float bounds[2] = {min, max}; 1b922: 80 e0 ldi r24, 0x00 ; 0 1b924: 90 e0 ldi r25, 0x00 ; 0 1b926: a0 ea ldi r26, 0xA0 ; 160 1b928: b0 e4 ldi r27, 0x40 ; 64 1b92a: 89 83 std Y+1, r24 ; 0x01 1b92c: 9a 83 std Y+2, r25 ; 0x02 1b92e: ab 83 std Y+3, r26 ; 0x03 1b930: bc 83 std Y+4, r27 ; 0x04 1b932: 8b 89 ldd r24, Y+19 ; 0x13 1b934: 9c 89 ldd r25, Y+20 ; 0x14 1b936: ad 89 ldd r26, Y+21 ; 0x15 1b938: be 89 ldd r27, Y+22 ; 0x16 1b93a: 8d 83 std Y+5, r24 ; 0x05 1b93c: 9e 83 std Y+6, r25 ; 0x06 1b93e: af 83 std Y+7, r26 ; 0x07 1b940: 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]); 1b942: 20 e0 ldi r18, 0x00 ; 0 1b944: 30 e0 ldi r19, 0x00 ; 0 1b946: 40 ea ldi r20, 0xA0 ; 160 1b948: 50 e4 ldi r21, 0x40 ; 64 1b94a: bc 01 movw r22, r24 1b94c: cd 01 movw r24, r26 1b94e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1b952: 2a e7 ldi r18, 0x7A ; 122 1b954: 37 e3 ldi r19, 0x37 ; 55 1b956: 4e e1 ldi r20, 0x1E ; 30 1b958: 5f e3 ldi r21, 0x3F ; 63 1b95a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1b95e: 6b 01 movw r12, r22 1b960: 7c 01 movw r14, r24 points[0] = bounds[0] + d; 1b962: 20 e0 ldi r18, 0x00 ; 0 1b964: 30 e0 ldi r19, 0x00 ; 0 1b966: 40 ea ldi r20, 0xA0 ; 160 1b968: 50 e4 ldi r21, 0x40 ; 64 1b96a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1b96e: 69 87 std Y+9, r22 ; 0x09 1b970: 7a 87 std Y+10, r23 ; 0x0a 1b972: 8b 87 std Y+11, r24 ; 0x0b 1b974: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1b976: a7 01 movw r20, r14 1b978: 96 01 movw r18, r12 1b97a: 6b 89 ldd r22, Y+19 ; 0x13 1b97c: 7c 89 ldd r23, Y+20 ; 0x14 1b97e: 8d 89 ldd r24, Y+21 ; 0x15 1b980: 9e 89 ldd r25, Y+22 ; 0x16 1b982: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1b986: 6d 87 std Y+13, r22 ; 0x0d 1b988: 7e 87 std Y+14, r23 ; 0x0e 1b98a: 8f 87 std Y+15, r24 ; 0x0f 1b98c: 98 8b std Y+16, r25 ; 0x10 1b98e: 31 2c mov r3, r1 1b990: 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); 1b992: 29 85 ldd r18, Y+9 ; 0x09 1b994: 3a 85 ldd r19, Y+10 ; 0x0a 1b996: 4b 85 ldd r20, Y+11 ; 0x0b 1b998: 5c 85 ldd r21, Y+12 ; 0x0c 1b99a: cd 8c ldd r12, Y+29 ; 0x1d 1b99c: de 8c ldd r13, Y+30 ; 0x1e 1b99e: ef 8c ldd r14, Y+31 ; 0x1f 1b9a0: f8 a0 ldd r15, Y+32 ; 0x20 1b9a2: 0c 8d ldd r16, Y+28 ; 0x1c 1b9a4: 69 89 ldd r22, Y+17 ; 0x11 1b9a6: 7a 89 ldd r23, Y+18 ; 0x12 1b9a8: 8a 8d ldd r24, Y+26 ; 0x1a 1b9aa: 9b 8d ldd r25, Y+27 ; 0x1b 1b9ac: 0f 94 e7 41 call 0x283ce ; 0x283ce 1b9b0: 4b 01 movw r8, r22 1b9b2: 5c 01 movw r10, r24 float c2 = cost_fn(samples, var, points[1], fan_pwm, ambient); 1b9b4: 2d 85 ldd r18, Y+13 ; 0x0d 1b9b6: 3e 85 ldd r19, Y+14 ; 0x0e 1b9b8: 4f 85 ldd r20, Y+15 ; 0x0f 1b9ba: 58 89 ldd r21, Y+16 ; 0x10 1b9bc: cd 8c ldd r12, Y+29 ; 0x1d 1b9be: de 8c ldd r13, Y+30 ; 0x1e 1b9c0: ef 8c ldd r14, Y+31 ; 0x1f 1b9c2: f8 a0 ldd r15, Y+32 ; 0x20 1b9c4: 0c 8d ldd r16, Y+28 ; 0x1c 1b9c6: 69 89 ldd r22, Y+17 ; 0x11 1b9c8: 7a 89 ldd r23, Y+18 ; 0x12 1b9ca: 8a 8d ldd r24, Y+26 ; 0x1a 1b9cc: 9b 8d ldd r25, Y+27 ; 0x1b 1b9ce: 0f 94 e7 41 call 0x283ce ; 0x283ce 1b9d2: 9b 01 movw r18, r22 1b9d4: ac 01 movw r20, r24 bool dir = (c2 < c1); 1b9d6: 11 e0 ldi r17, 0x01 ; 1 1b9d8: c5 01 movw r24, r10 1b9da: b4 01 movw r22, r8 1b9dc: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1b9e0: 18 16 cp r1, r24 1b9e2: 0c f0 brlt .+2 ; 0x1b9e6 1b9e4: 10 e0 ldi r17, 0x00 ; 0 bounds[dir] = points[!dir]; 1b9e6: 01 e0 ldi r16, 0x01 ; 1 1b9e8: 01 27 eor r16, r17 1b9ea: 80 2f mov r24, r16 1b9ec: 90 e0 ldi r25, 0x00 ; 0 1b9ee: e1 2f mov r30, r17 1b9f0: f0 e0 ldi r31, 0x00 ; 0 1b9f2: ee 0f add r30, r30 1b9f4: ff 1f adc r31, r31 1b9f6: ee 0f add r30, r30 1b9f8: ff 1f adc r31, r31 1b9fa: 41 e0 ldi r20, 0x01 ; 1 1b9fc: 50 e0 ldi r21, 0x00 ; 0 1b9fe: 4c 0f add r20, r28 1ba00: 5d 1f adc r21, r29 1ba02: 4e 0f add r20, r30 1ba04: 5f 1f adc r21, r31 1ba06: 8c 01 movw r16, r24 1ba08: 00 0f add r16, r16 1ba0a: 11 1f adc r17, r17 1ba0c: 00 0f add r16, r16 1ba0e: 11 1f adc r17, r17 1ba10: a1 e0 ldi r26, 0x01 ; 1 1ba12: b0 e0 ldi r27, 0x00 ; 0 1ba14: ac 0f add r26, r28 1ba16: bd 1f adc r27, r29 1ba18: 0a 0f add r16, r26 1ba1a: 1b 1f adc r17, r27 1ba1c: f8 01 movw r30, r16 1ba1e: 38 96 adiw r30, 0x08 ; 8 1ba20: f8 8f std Y+24, r31 ; 0x18 1ba22: ef 8b std Y+23, r30 ; 0x17 1ba24: f8 01 movw r30, r16 1ba26: 80 85 ldd r24, Z+8 ; 0x08 1ba28: 91 85 ldd r25, Z+9 ; 0x09 1ba2a: a2 85 ldd r26, Z+10 ; 0x0a 1ba2c: b3 85 ldd r27, Z+11 ; 0x0b 1ba2e: fa 01 movw r30, r20 1ba30: 80 83 st Z, r24 1ba32: 91 83 std Z+1, r25 ; 0x01 1ba34: a2 83 std Z+2, r26 ; 0x02 1ba36: 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]); 1ba38: 8d 80 ldd r8, Y+5 ; 0x05 1ba3a: 9e 80 ldd r9, Y+6 ; 0x06 1ba3c: af 80 ldd r10, Y+7 ; 0x07 1ba3e: b8 84 ldd r11, Y+8 ; 0x08 1ba40: c9 80 ldd r12, Y+1 ; 0x01 1ba42: da 80 ldd r13, Y+2 ; 0x02 1ba44: eb 80 ldd r14, Y+3 ; 0x03 1ba46: fc 80 ldd r15, Y+4 ; 0x04 1ba48: a7 01 movw r20, r14 1ba4a: 96 01 movw r18, r12 1ba4c: c5 01 movw r24, r10 1ba4e: b4 01 movw r22, r8 1ba50: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1ba54: 2a e7 ldi r18, 0x7A ; 122 1ba56: 37 e3 ldi r19, 0x37 ; 55 1ba58: 4e e1 ldi r20, 0x1E ; 30 1ba5a: 5f e3 ldi r21, 0x3F ; 63 1ba5c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1ba60: 2b 01 movw r4, r22 1ba62: 3c 01 movw r6, r24 points[0] = bounds[0] + d; 1ba64: ac 01 movw r20, r24 1ba66: 9b 01 movw r18, r22 1ba68: c7 01 movw r24, r14 1ba6a: b6 01 movw r22, r12 1ba6c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1ba70: 69 87 std Y+9, r22 ; 0x09 1ba72: 7a 87 std Y+10, r23 ; 0x0a 1ba74: 8b 87 std Y+11, r24 ; 0x0b 1ba76: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1ba78: a3 01 movw r20, r6 1ba7a: 92 01 movw r18, r4 1ba7c: c5 01 movw r24, r10 1ba7e: b4 01 movw r22, r8 1ba80: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1ba84: 6d 87 std Y+13, r22 ; 0x0d 1ba86: 7e 87 std Y+14, r23 ; 0x0e 1ba88: 8f 87 std Y+15, r24 ; 0x0f 1ba8a: 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]; 1ba8c: d8 01 movw r26, r16 1ba8e: 18 96 adiw r26, 0x08 ; 8 1ba90: 4c 90 ld r4, X 1ba92: ef 89 ldd r30, Y+23 ; 0x17 1ba94: f8 8d ldd r31, Y+24 ; 0x18 1ba96: 51 80 ldd r5, Z+1 ; 0x01 1ba98: 62 80 ldd r6, Z+2 ; 0x02 1ba9a: 73 80 ldd r7, Z+3 ; 0x03 e = (1-GOLDEN_RATIO) * fabsf((bounds[0]-bounds[1]) / x); 1ba9c: a5 01 movw r20, r10 1ba9e: 94 01 movw r18, r8 1baa0: c7 01 movw r24, r14 1baa2: b6 01 movw r22, r12 1baa4: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1baa8: 24 2d mov r18, r4 1baaa: 35 2d mov r19, r5 1baac: 46 2d mov r20, r6 1baae: 57 2d mov r21, r7 1bab0: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1bab4: 9f 77 andi r25, 0x7F ; 127 1bab6: 2c e0 ldi r18, 0x0C ; 12 1bab8: 31 e9 ldi r19, 0x91 ; 145 1baba: 43 ec ldi r20, 0xC3 ; 195 1babc: 5e e3 ldi r21, 0x3E ; 62 1babe: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1bac2: 6b 01 movw r12, r22 1bac4: 7c 01 movw r14, r24 1bac6: 5b 01 movw r10, r22 1bac8: 8c 01 movw r16, r24 printf_P(PSTR("TM iter:%u v:%.2f e:%.3f\n"), it, x, e); 1baca: ff 92 push r15 1bacc: 8f 93 push r24 1bace: df 92 push r13 1bad0: 6f 93 push r22 1bad2: 7f 92 push r7 1bad4: 6f 92 push r6 1bad6: 5f 92 push r5 1bad8: 4f 92 push r4 1bada: 3f 92 push r3 1badc: 2f 92 push r2 1bade: 2a e4 ldi r18, 0x4A ; 74 1bae0: 31 e9 ldi r19, 0x91 ; 145 1bae2: 3f 93 push r19 1bae4: 2f 93 push r18 1bae6: 0f 94 1d dc call 0x3b83a ; 0x3b83a if(e < thr) { 1baea: 0f b6 in r0, 0x3f ; 63 1baec: f8 94 cli 1baee: de bf out 0x3e, r29 ; 62 1baf0: 0f be out 0x3f, r0 ; 63 1baf2: cd bf out 0x3d, r28 ; 61 1baf4: 2a e0 ldi r18, 0x0A ; 10 1baf6: 37 ed ldi r19, 0xD7 ; 215 1baf8: 43 e2 ldi r20, 0x23 ; 35 1bafa: 5c e3 ldi r21, 0x3C ; 60 1bafc: 6c 2d mov r22, r12 1bafe: 7d 2d mov r23, r13 1bb00: 8e 2d mov r24, r14 1bb02: 9f 2d mov r25, r15 1bb04: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1bb08: 87 ff sbrs r24, 7 1bb0a: 42 c0 rjmp .+132 ; 0x1bb90 if(x == min || x == max) { 1bb0c: 20 e0 ldi r18, 0x00 ; 0 1bb0e: 30 e0 ldi r19, 0x00 ; 0 1bb10: 40 ea ldi r20, 0xA0 ; 160 1bb12: 50 e4 ldi r21, 0x40 ; 64 1bb14: 64 2d mov r22, r4 1bb16: 75 2d mov r23, r5 1bb18: 86 2d mov r24, r6 1bb1a: 97 2d mov r25, r7 1bb1c: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1bb20: 88 23 and r24, r24 1bb22: f1 f1 breq .+124 ; 0x1bba0 1bb24: 24 2d mov r18, r4 1bb26: 35 2d mov r19, r5 1bb28: 46 2d mov r20, r6 1bb2a: 57 2d mov r21, r7 1bb2c: 6b 89 ldd r22, Y+19 ; 0x13 1bb2e: 7c 89 ldd r23, Y+20 ; 0x14 1bb30: 8d 89 ldd r24, Y+21 ; 0x15 1bb32: 9e 89 ldd r25, Y+22 ; 0x16 1bb34: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1bb38: 88 23 and r24, r24 1bb3a: 91 f1 breq .+100 ; 0x1bba0 // real value likely outside of the search boundaries break; } *var = x; 1bb3c: 84 2d mov r24, r4 1bb3e: 95 2d mov r25, r5 1bb40: a6 2d mov r26, r6 1bb42: b7 2d mov r27, r7 1bb44: e9 89 ldd r30, Y+17 ; 0x11 1bb46: fa 89 ldd r31, Y+18 ; 0x12 1bb48: 80 83 st Z, r24 1bb4a: 91 83 std Z+1, r25 ; 0x01 1bb4c: a2 83 std Z+2, r26 ; 0x02 1bb4e: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1bb50: 89 8d ldd r24, Y+25 ; 0x19 1bb52: 0f 94 9e 47 call 0x28f3c ; 0x28f3c SERIAL_ECHOLNPGM("TM estimation did not converge"); *var = orig; thermal_model_reset_enabled(was_enabled); return NAN; } 1bb56: 6a 2d mov r22, r10 1bb58: 7b 2d mov r23, r11 1bb5a: 80 2f mov r24, r16 1bb5c: 91 2f mov r25, r17 1bb5e: a4 96 adiw r28, 0x24 ; 36 1bb60: 0f b6 in r0, 0x3f ; 63 1bb62: f8 94 cli 1bb64: de bf out 0x3e, r29 ; 62 1bb66: 0f be out 0x3f, r0 ; 63 1bb68: cd bf out 0x3d, r28 ; 61 1bb6a: df 91 pop r29 1bb6c: cf 91 pop r28 1bb6e: 1f 91 pop r17 1bb70: 0f 91 pop r16 1bb72: ff 90 pop r15 1bb74: ef 90 pop r14 1bb76: df 90 pop r13 1bb78: cf 90 pop r12 1bb7a: bf 90 pop r11 1bb7c: af 90 pop r10 1bb7e: 9f 90 pop r9 1bb80: 8f 90 pop r8 1bb82: 7f 90 pop r7 1bb84: 6f 90 pop r6 1bb86: 5f 90 pop r5 1bb88: 4f 90 pop r4 1bb8a: 3f 90 pop r3 1bb8c: 2f 90 pop r2 1bb8e: 08 95 ret 1bb90: ff ef ldi r31, 0xFF ; 255 1bb92: 2f 1a sub r2, r31 1bb94: 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) { 1bb96: 2e e1 ldi r18, 0x1E ; 30 1bb98: 22 16 cp r2, r18 1bb9a: 31 04 cpc r3, r1 1bb9c: 09 f0 breq .+2 ; 0x1bba0 1bb9e: f9 ce rjmp .-526 ; 0x1b992 thermal_model_reset_enabled(was_enabled); return e; } } SERIAL_ECHOLNPGM("TM estimation did not converge"); 1bba0: 8b e2 ldi r24, 0x2B ; 43 1bba2: 91 e9 ldi r25, 0x91 ; 145 1bba4: 0e 94 86 7b call 0xf70c ; 0xf70c *var = orig; 1bba8: 89 a1 ldd r24, Y+33 ; 0x21 1bbaa: 9a a1 ldd r25, Y+34 ; 0x22 1bbac: ab a1 ldd r26, Y+35 ; 0x23 1bbae: bc a1 ldd r27, Y+36 ; 0x24 1bbb0: e9 89 ldd r30, Y+17 ; 0x11 1bbb2: fa 89 ldd r31, Y+18 ; 0x12 1bbb4: 80 83 st Z, r24 1bbb6: 91 83 std Z+1, r25 ; 0x01 1bbb8: a2 83 std Z+2, r26 ; 0x02 1bbba: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1bbbc: 89 8d ldd r24, Y+25 ; 0x19 1bbbe: 0f 94 9e 47 call 0x28f3c ; 0x28f3c return NAN; 1bbc2: a1 2c mov r10, r1 1bbc4: b1 2c mov r11, r1 1bbc6: 00 ec ldi r16, 0xC0 ; 192 1bbc8: 1f e7 ldi r17, 0x7F ; 127 1bbca: c5 cf rjmp .-118 ; 0x1bb56 0001bbcc : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 1bbcc: ef 92 push r14 1bbce: ff 92 push r15 1bbd0: 0f 93 push r16 1bbd2: 1f 93 push r17 1bbd4: cf 93 push r28 1bbd6: df 93 push r29 1bbd8: 00 d0 rcall .+0 ; 0x1bbda 1bbda: 1f 92 push r1 1bbdc: 1f 92 push r1 1bbde: cd b7 in r28, 0x3d ; 61 1bbe0: de b7 in r29, 0x3e ; 62 1bbe2: 08 2f mov r16, r24 1bbe4: 16 2f mov r17, r22 1bbe6: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 1bbe8: 0f 94 20 88 call 0x31040 ; 0x31040 1bbec: 88 23 and r24, r24 1bbee: d9 f0 breq .+54 ; 0x1bc26 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) { 1bbf0: 0b 30 cpi r16, 0x0B ; 11 1bbf2: 29 f1 breq .+74 ; 0x1bc3e 1bbf4: 04 31 cpi r16, 0x14 ; 20 1bbf6: 31 f1 breq .+76 ; 0x1bc44 /// @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()) { 1bbf8: 87 e5 ldi r24, 0x57 ; 87 1bbfa: e8 2e mov r14, r24 1bbfc: e9 82 std Y+1, r14 ; 0x01 1bbfe: 0a 83 std Y+2, r16 ; 0x02 1bc00: 1b 83 std Y+3, r17 ; 0x03 1bc02: fc 82 std Y+4, r15 ; 0x04 1bc04: ce 01 movw r24, r28 1bc06: 01 96 adiw r24, 0x01 ; 1 1bc08: 0f 94 b2 c2 call 0x38564 ; 0x38564 1bc0c: 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)); 1bc0e: 47 e5 ldi r20, 0x57 ; 87 1bc10: 50 2f mov r21, r16 1bc12: 61 2f mov r22, r17 1bc14: 7f 2d mov r23, r15 1bc16: 0f 94 48 98 call 0x33090 ; 0x33090 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)); 1bc1a: 60 e0 ldi r22, 0x00 ; 0 1bc1c: 80 e0 ldi r24, 0x00 ; 0 1bc1e: 0f 94 6c 9f call 0x33ed8 ; 0x33ed8 1bc22: 88 23 and r24, r24 1bc24: 59 f3 breq .-42 ; 0x1bbfc return true; } 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: df 91 pop r29 1bc32: cf 91 pop r28 1bc34: 1f 91 pop r17 1bc36: 0f 91 pop r16 1bc38: ff 90 pop r15 1bc3a: ef 90 pop r14 1bc3c: 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); 1bc3e: 10 93 75 13 sts 0x1375, r17 ; 0x801375 1bc42: da cf rjmp .-76 ; 0x1bbf8 break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 1bc44: 10 93 76 13 sts 0x1376, r17 ; 0x801376 1bc48: d7 cf rjmp .-82 ; 0x1bbf8 0001bc4a : #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) 1bc4a: 82 30 cpi r24, 0x02 ; 2 1bc4c: 91 05 cpc r25, r1 1bc4e: 38 f0 brcs .+14 ; 0x1bc5e // 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 1bc50: 88 0f add r24, r24 1bc52: 99 1f adc r25, r25 1bc54: 88 0f add r24, r24 1bc56: 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, 1bc58: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 1bc5a: 01 97 sbiw r24, 0x01 ; 1 1bc5c: f1 f7 brne .-4 ; 0x1bc5a "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 1bc5e: 08 95 ret 0001bc60 : SREG = oldSREG; } int digitalRead(uint8_t pin) { 1bc60: cf 93 push r28 1bc62: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1bc64: 28 2f mov r18, r24 1bc66: 30 e0 ldi r19, 0x00 ; 0 1bc68: f9 01 movw r30, r18 1bc6a: e2 5b subi r30, 0xB2 ; 178 1bc6c: f0 47 sbci r31, 0x70 ; 112 1bc6e: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1bc70: f9 01 movw r30, r18 1bc72: e8 50 subi r30, 0x08 ; 8 1bc74: f1 47 sbci r31, 0x71 ; 113 1bc76: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1bc78: f9 01 movw r30, r18 1bc7a: ee 55 subi r30, 0x5E ; 94 1bc7c: f1 47 sbci r31, 0x71 ; 113 1bc7e: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 1bc80: cc 23 and r28, r28 1bc82: a1 f0 breq .+40 ; 0x1bcac // 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); 1bc84: 81 11 cpse r24, r1 1bc86: 0e 94 a7 ce call 0x19d4e ; 0x19d4e if (*portInputRegister(port) & bit) return HIGH; 1bc8a: ec 2f mov r30, r28 1bc8c: f0 e0 ldi r31, 0x00 ; 0 1bc8e: ee 0f add r30, r30 1bc90: ff 1f adc r31, r31 1bc92: e8 57 subi r30, 0x78 ; 120 1bc94: f1 47 sbci r31, 0x71 ; 113 1bc96: a5 91 lpm r26, Z+ 1bc98: b4 91 lpm r27, Z 1bc9a: ec 91 ld r30, X 1bc9c: ed 23 and r30, r29 1bc9e: 81 e0 ldi r24, 0x01 ; 1 1bca0: 90 e0 ldi r25, 0x00 ; 0 1bca2: 09 f4 brne .+2 ; 0x1bca6 1bca4: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1bca6: df 91 pop r29 1bca8: cf 91 pop r28 1bcaa: 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; 1bcac: 80 e0 ldi r24, 0x00 ; 0 1bcae: 90 e0 ldi r25, 0x00 ; 0 1bcb0: fa cf rjmp .-12 ; 0x1bca6 0001bcb2 : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1bcb2: 1f 93 push r17 1bcb4: cf 93 push r28 1bcb6: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1bcb8: 28 2f mov r18, r24 1bcba: 30 e0 ldi r19, 0x00 ; 0 1bcbc: f9 01 movw r30, r18 1bcbe: e2 5b subi r30, 0xB2 ; 178 1bcc0: f0 47 sbci r31, 0x70 ; 112 1bcc2: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1bcc4: f9 01 movw r30, r18 1bcc6: e8 50 subi r30, 0x08 ; 8 1bcc8: f1 47 sbci r31, 0x71 ; 113 1bcca: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1bccc: f9 01 movw r30, r18 1bcce: ee 55 subi r30, 0x5E ; 94 1bcd0: f1 47 sbci r31, 0x71 ; 113 1bcd2: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1bcd4: cc 23 and r28, r28 1bcd6: a9 f0 breq .+42 ; 0x1bd02 1bcd8: 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); 1bcda: 81 11 cpse r24, r1 1bcdc: 0e 94 a7 ce call 0x19d4e ; 0x19d4e out = portOutputRegister(port); 1bce0: ec 2f mov r30, r28 1bce2: f0 e0 ldi r31, 0x00 ; 0 1bce4: ee 0f add r30, r30 1bce6: ff 1f adc r31, r31 1bce8: e2 59 subi r30, 0x92 ; 146 1bcea: f1 47 sbci r31, 0x71 ; 113 1bcec: a5 91 lpm r26, Z+ 1bcee: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1bcf0: 8f b7 in r24, 0x3f ; 63 cli(); 1bcf2: f8 94 cli if (val == LOW) { *out &= ~bit; 1bcf4: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1bcf6: 11 11 cpse r17, r1 1bcf8: 08 c0 rjmp .+16 ; 0x1bd0a *out &= ~bit; 1bcfa: d0 95 com r29 1bcfc: de 23 and r29, r30 } else { *out |= bit; 1bcfe: dc 93 st X, r29 } SREG = oldSREG; 1bd00: 8f bf out 0x3f, r24 ; 63 } 1bd02: df 91 pop r29 1bd04: cf 91 pop r28 1bd06: 1f 91 pop r17 1bd08: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1bd0a: de 2b or r29, r30 1bd0c: f8 cf rjmp .-16 ; 0x1bcfe 0001bd0e : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1bd0e: cf 93 push r28 1bd10: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1bd12: 90 e0 ldi r25, 0x00 ; 0 1bd14: fc 01 movw r30, r24 1bd16: e8 50 subi r30, 0x08 ; 8 1bd18: f1 47 sbci r31, 0x71 ; 113 1bd1a: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1bd1c: 8e 55 subi r24, 0x5E ; 94 1bd1e: 91 47 sbci r25, 0x71 ; 113 1bd20: fc 01 movw r30, r24 1bd22: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1bd24: 88 23 and r24, r24 1bd26: d1 f0 breq .+52 ; 0x1bd5c // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1bd28: 90 e0 ldi r25, 0x00 ; 0 1bd2a: 88 0f add r24, r24 1bd2c: 99 1f adc r25, r25 1bd2e: fc 01 movw r30, r24 1bd30: ec 5a subi r30, 0xAC ; 172 1bd32: f1 47 sbci r31, 0x71 ; 113 1bd34: a5 91 lpm r26, Z+ 1bd36: b4 91 lpm r27, Z out = portOutputRegister(port); 1bd38: fc 01 movw r30, r24 1bd3a: e2 59 subi r30, 0x92 ; 146 1bd3c: f1 47 sbci r31, 0x71 ; 113 1bd3e: c5 91 lpm r28, Z+ 1bd40: d4 91 lpm r29, Z if (mode == INPUT) { 1bd42: 61 11 cpse r22, r1 1bd44: 0e c0 rjmp .+28 ; 0x1bd62 uint8_t oldSREG = SREG; 1bd46: 9f b7 in r25, 0x3f ; 63 cli(); 1bd48: f8 94 cli *reg &= ~bit; 1bd4a: 8c 91 ld r24, X 1bd4c: e2 2f mov r30, r18 1bd4e: e0 95 com r30 1bd50: 8e 23 and r24, r30 1bd52: 8c 93 st X, r24 *out &= ~bit; 1bd54: 28 81 ld r18, Y 1bd56: e2 23 and r30, r18 1bd58: e8 83 st Y, r30 SREG = oldSREG; 1bd5a: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 1bd5c: df 91 pop r29 1bd5e: cf 91 pop r28 1bd60: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 1bd62: 8f b7 in r24, 0x3f ; 63 cli(); 1bd64: f8 94 cli *reg |= bit; 1bd66: ec 91 ld r30, X 1bd68: e2 2b or r30, r18 1bd6a: ec 93 st X, r30 SREG = oldSREG; 1bd6c: 8f bf out 0x3f, r24 ; 63 1bd6e: f6 cf rjmp .-20 ; 0x1bd5c 0001bd70 : // 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) { 1bd70: 1f 93 push r17 1bd72: cf 93 push r28 1bd74: df 93 push r29 1bd76: 18 2f mov r17, r24 1bd78: 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); 1bd7a: 61 e0 ldi r22, 0x01 ; 1 1bd7c: 0e 94 87 de call 0x1bd0e ; 0x1bd0e if (val == 0) 1bd80: 20 97 sbiw r28, 0x00 ; 0 1bd82: 39 f4 brne .+14 ; 0x1bd92 { digitalWrite(pin, LOW); 1bd84: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 1bd86: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 1bd88: df 91 pop r29 1bd8a: cf 91 pop r28 1bd8c: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 1bd8e: 0c 94 59 de jmp 0x1bcb2 ; 0x1bcb2 pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 1bd92: cf 3f cpi r28, 0xFF ; 255 1bd94: d1 05 cpc r29, r1 1bd96: 11 f4 brne .+4 ; 0x1bd9c { digitalWrite(pin, HIGH); 1bd98: 61 e0 ldi r22, 0x01 ; 1 1bd9a: f5 cf rjmp .-22 ; 0x1bd86 } else { switch(digitalPinToTimer(pin)) 1bd9c: e1 2f mov r30, r17 1bd9e: f0 e0 ldi r31, 0x00 ; 0 1bda0: e2 5b subi r30, 0xB2 ; 178 1bda2: f0 47 sbci r31, 0x70 ; 112 1bda4: e4 91 lpm r30, Z 1bda6: e1 50 subi r30, 0x01 ; 1 1bda8: e2 31 cpi r30, 0x12 ; 18 1bdaa: 08 f0 brcs .+2 ; 0x1bdae 1bdac: b3 c0 rjmp .+358 ; 0x1bf14 1bdae: f0 e0 ldi r31, 0x00 ; 0 1bdb0: 88 27 eor r24, r24 1bdb2: e2 52 subi r30, 0x22 ; 34 1bdb4: f1 42 sbci r31, 0x21 ; 33 1bdb6: 8f 4f sbci r24, 0xFF ; 255 1bdb8: 0d 94 6b de jmp 0x3bcd6 ; 0x3bcd6 <__tablejump2__> 1bdbc: f0 de rcall .-544 ; 0x1bb9e 1bdbe: f8 de rcall .-528 ; 0x1bbb0 1bdc0: fd de rcall .-518 ; 0x1bbbc 1bdc2: 07 df rcall .-498 ; 0x1bbd2 1bdc4: 11 df rcall .-478 ; 0x1bbe8 1bdc6: 8a df rcall .-236 ; 0x1bcdc 1bdc8: 1b df rcall .-458 ; 0x1bc00 1bdca: 23 df rcall .-442 ; 0x1bc12 1bdcc: 2b df rcall .-426 ; 0x1bc24 1bdce: 35 df rcall .-406 ; 0x1bc3a 1bdd0: 3f df rcall .-386 ; 0x1bc50 1bdd2: 49 df rcall .-366 ; 0x1bc66 1bdd4: 58 df rcall .-336 ; 0x1bc86 1bdd6: 62 df rcall .-316 ; 0x1bc9c 1bdd8: 8a df rcall .-236 ; 0x1bcee 1bdda: 6c df rcall .-296 ; 0x1bcb4 1bddc: 76 df rcall .-276 ; 0x1bcca 1bdde: 80 df rcall .-256 ; 0x1bce0 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1bde0: 84 b5 in r24, 0x24 ; 36 1bde2: 80 68 ori r24, 0x80 ; 128 1bde4: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1bde6: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1bde8: df 91 pop r29 1bdea: cf 91 pop r28 1bdec: 1f 91 pop r17 1bdee: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1bdf0: 84 b5 in r24, 0x24 ; 36 1bdf2: 80 62 ori r24, 0x20 ; 32 1bdf4: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1bdf6: c8 bd out 0x28, r28 ; 40 1bdf8: f7 cf rjmp .-18 ; 0x1bde8 #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1bdfa: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1bdfe: 80 68 ori r24, 0x80 ; 128 1be00: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1be04: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1be08: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1be0c: ed cf rjmp .-38 ; 0x1bde8 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1be0e: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1be12: 80 62 ori r24, 0x20 ; 32 1be14: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1be18: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1be1c: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1be20: e3 cf rjmp .-58 ; 0x1bde8 #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1be22: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1be26: 88 60 ori r24, 0x08 ; 8 1be28: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1be2c: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1be30: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1be34: d9 cf rjmp .-78 ; 0x1bde8 #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1be36: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1be3a: 80 68 ori r24, 0x80 ; 128 1be3c: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 1be40: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 1be44: d1 cf rjmp .-94 ; 0x1bde8 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 1be46: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1be4a: 80 62 ori r24, 0x20 ; 32 1be4c: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 1be50: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 1be54: c9 cf rjmp .-110 ; 0x1bde8 #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 1be56: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1be5a: 80 68 ori r24, 0x80 ; 128 1be5c: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 1be60: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1be64: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 1be68: bf cf rjmp .-130 ; 0x1bde8 #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 1be6a: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1be6e: 80 62 ori r24, 0x20 ; 32 1be70: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 1be74: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 1be78: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 1be7c: b5 cf rjmp .-150 ; 0x1bde8 #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 1be7e: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1be82: 88 60 ori r24, 0x08 ; 8 1be84: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 1be88: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 1be8c: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 1be90: ab cf rjmp .-170 ; 0x1bde8 #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 1be92: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1be96: 80 68 ori r24, 0x80 ; 128 1be98: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1be9c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1bea0: 8f 7b andi r24, 0xBF ; 191 1bea2: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1bea6: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1beaa: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1beae: 9c cf rjmp .-200 ; 0x1bde8 #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1beb0: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1beb4: 80 62 ori r24, 0x20 ; 32 1beb6: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1beba: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1bebe: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1bec2: 92 cf rjmp .-220 ; 0x1bde8 #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1bec4: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1bec8: 88 60 ori r24, 0x08 ; 8 1beca: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1bece: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1bed2: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1bed6: 88 cf rjmp .-240 ; 0x1bde8 #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1bed8: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1bedc: 80 68 ori r24, 0x80 ; 128 1bede: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1bee2: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1bee6: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1beea: 7e cf rjmp .-260 ; 0x1bde8 #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1beec: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1bef0: 80 62 ori r24, 0x20 ; 32 1bef2: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1bef6: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1befa: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1befe: 74 cf rjmp .-280 ; 0x1bde8 #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1bf00: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1bf04: 88 60 ori r24, 0x08 ; 8 1bf06: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1bf0a: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1bf0e: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1bf12: 6a cf rjmp .-300 ; 0x1bde8 break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1bf14: c0 38 cpi r28, 0x80 ; 128 1bf16: d1 05 cpc r29, r1 1bf18: 0c f0 brlt .+2 ; 0x1bf1c 1bf1a: 3e cf rjmp .-388 ; 0x1bd98 1bf1c: 33 cf rjmp .-410 ; 0x1bd84 0001bf1e : } } /// 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){ 1bf1e: 4f 92 push r4 1bf20: 5f 92 push r5 1bf22: 6f 92 push r6 1bf24: 7f 92 push r7 1bf26: 8f 92 push r8 1bf28: 9f 92 push r9 1bf2a: af 92 push r10 1bf2c: bf 92 push r11 1bf2e: cf 92 push r12 1bf30: df 92 push r13 1bf32: ef 92 push r14 1bf34: ff 92 push r15 1bf36: 0f 93 push r16 1bf38: 1f 93 push r17 1bf3a: cf 93 push r28 1bf3c: 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 1bf3e: 86 b9 out 0x06, r24 ; 6 1bf40: fa 01 movw r30, r20 1bf42: e0 80 ld r14, Z 1bf44: 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){ 1bf46: 16 16 cp r1, r22 1bf48: 17 06 cpc r1, r23 1bf4a: b4 f4 brge .+44 ; 0x1bf78 1bf4c: e2 16 cp r14, r18 1bf4e: f3 06 cpc r15, r19 1bf50: 99 f4 brne .+38 ; 0x1bf78 delayMicroseconds(delay_us); 1bf52: c7 01 movw r24, r14 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 1bf54: df 91 pop r29 1bf56: cf 91 pop r28 1bf58: 1f 91 pop r17 1bf5a: 0f 91 pop r16 1bf5c: ff 90 pop r15 1bf5e: ef 90 pop r14 1bf60: df 90 pop r13 1bf62: cf 90 pop r12 1bf64: bf 90 pop r11 1bf66: af 90 pop r10 1bf68: 9f 90 pop r9 1bf6a: 8f 90 pop r8 1bf6c: 7f 90 pop r7 1bf6e: 6f 90 pop r6 1bf70: 5f 90 pop r5 1bf72: 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); 1bf74: 0c 94 25 de jmp 0x1bc4a ; 0x1bc4a 1bf78: 89 01 movw r16, r18 1bf7a: 6a 01 movw r12, r20 1bf7c: eb 01 movw r28, r22 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 1bf7e: b7 01 movw r22, r14 1bf80: 90 e0 ldi r25, 0x00 ; 0 1bf82: 80 e0 ldi r24, 0x00 ; 0 1bf84: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 1bf88: 2d eb ldi r18, 0xBD ; 189 1bf8a: 37 e3 ldi r19, 0x37 ; 55 1bf8c: 46 e8 ldi r20, 0x86 ; 134 1bf8e: 55 e3 ldi r21, 0x35 ; 53 1bf90: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1bf94: 4b 01 movw r8, r22 1bf96: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1bf98: be 01 movw r22, r28 1bf9a: 0d 2e mov r0, r29 1bf9c: 00 0c add r0, r0 1bf9e: 88 0b sbc r24, r24 1bfa0: 99 0b sbc r25, r25 1bfa2: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1bfa6: a5 01 movw r20, r10 1bfa8: 94 01 movw r18, r8 1bfaa: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1bfae: 2b 01 movw r4, r22 1bfb0: 3c 01 movw r6, r24 1bfb2: a5 01 movw r20, r10 1bfb4: 94 01 movw r18, r8 1bfb6: 6a e0 ldi r22, 0x0A ; 10 1bfb8: 77 ed ldi r23, 0xD7 ; 215 1bfba: 83 e2 ldi r24, 0x23 ; 35 1bfbc: 9c e3 ldi r25, 0x3C ; 60 1bfbe: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1bfc2: 9b 01 movw r18, r22 1bfc4: ac 01 movw r20, r24 1bfc6: c3 01 movw r24, r6 1bfc8: b2 01 movw r22, r4 1bfca: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1bfce: 4b 01 movw r8, r22 1bfd0: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1bfd2: 2a e0 ldi r18, 0x0A ; 10 1bfd4: 37 ed ldi r19, 0xD7 ; 215 1bfd6: 43 e2 ldi r20, 0x23 ; 35 1bfd8: 5e e3 ldi r21, 0x3E ; 62 1bfda: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1bfde: 18 16 cp r1, r24 1bfe0: dc f5 brge .+118 ; 0x1c058 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)); 1bfe2: a5 01 movw r20, r10 1bfe4: 94 01 movw r18, r8 1bfe6: 6a e0 ldi r22, 0x0A ; 10 1bfe8: 77 ed ldi r23, 0xD7 ; 215 1bfea: 83 e2 ldi r24, 0x23 ; 35 1bfec: 9c e3 ldi r25, 0x3C ; 60 1bfee: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1bff2: 20 e0 ldi r18, 0x00 ; 0 1bff4: 34 e2 ldi r19, 0x24 ; 36 1bff6: 44 e7 ldi r20, 0x74 ; 116 1bff8: 59 e4 ldi r21, 0x49 ; 73 1bffa: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__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); 1bffe: 20 e0 ldi r18, 0x00 ; 0 1c000: 30 e0 ldi r19, 0x00 ; 0 1c002: 40 e0 ldi r20, 0x00 ; 0 1c004: 5f e3 ldi r21, 0x3F ; 63 1c006: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1c00a: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 1c00e: 5b 01 movw r10, r22 1c010: 60 17 cp r22, r16 1c012: 71 07 cpc r23, r17 1c014: 08 f4 brcc .+2 ; 0x1c018 1c016: 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){ 1c018: ea 14 cp r14, r10 1c01a: fb 04 cpc r15, r11 1c01c: 31 f4 brne .+12 ; 0x1c02a 1c01e: 20 97 sbiw r28, 0x00 ; 0 1c020: 21 f0 breq .+8 ; 0x1c02a if (acc > 0) 1c022: fc f0 brlt .+62 ; 0x1c062 t1--; 1c024: f1 e0 ldi r31, 0x01 ; 1 1c026: af 1a sub r10, r31 1c028: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1c02a: c5 01 movw r24, r10 1c02c: 0e 94 25 de call 0x1bc4a ; 0x1bc4a delay_us = t1; 1c030: f6 01 movw r30, r12 1c032: b1 82 std Z+1, r11 ; 0x01 1c034: a0 82 st Z, r10 } 1c036: df 91 pop r29 1c038: cf 91 pop r28 1c03a: 1f 91 pop r17 1c03c: 0f 91 pop r16 1c03e: ff 90 pop r15 1c040: ef 90 pop r14 1c042: df 90 pop r13 1c044: cf 90 pop r12 1c046: bf 90 pop r11 1c048: af 90 pop r10 1c04a: 9f 90 pop r9 1c04c: 8f 90 pop r8 1c04e: 7f 90 pop r7 1c050: 6f 90 pop r6 1c052: 5f 90 pop r5 1c054: 4f 90 pop r4 1c056: 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 1c058: 80 e1 ldi r24, 0x10 ; 16 1c05a: a8 2e mov r10, r24 1c05c: 87 e2 ldi r24, 0x27 ; 39 1c05e: b8 2e mov r11, r24 1c060: db cf rjmp .-74 ; 0x1c018 /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 1c062: 8f ef ldi r24, 0xFF ; 255 1c064: a8 1a sub r10, r24 1c066: b8 0a sbc r11, r24 1c068: e0 cf rjmp .-64 ; 0x1c02a 0001c06a : /// 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){ 1c06a: 2f 92 push r2 1c06c: 3f 92 push r3 1c06e: 4f 92 push r4 1c070: 5f 92 push r5 1c072: 6f 92 push r6 1c074: 7f 92 push r7 1c076: 8f 92 push r8 1c078: 9f 92 push r9 1c07a: af 92 push r10 1c07c: bf 92 push r11 1c07e: cf 92 push r12 1c080: df 92 push r13 1c082: ef 92 push r14 1c084: ff 92 push r15 1c086: 0f 93 push r16 1c088: 1f 93 push r17 1c08a: cf 93 push r28 1c08c: df 93 push r29 1c08e: 00 d0 rcall .+0 ; 0x1c090 1c090: cd b7 in r28, 0x3d ; 61 1c092: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 1c094: f9 01 movw r30, r18 1c096: e0 80 ld r14, Z 1c098: f1 80 ldd r15, Z+1 ; 0x01 1c09a: e1 14 cp r14, r1 1c09c: f1 04 cpc r15, r1 1c09e: 09 f4 brne .+2 ; 0x1c0a2 1c0a0: 6b c0 rjmp .+214 ; 0x1c178 1c0a2: 16 16 cp r1, r22 1c0a4: 17 06 cpc r1, r23 1c0a6: 0c f0 brlt .+2 ; 0x1c0aa 1c0a8: 67 c0 rjmp .+206 ; 0x1c178 1c0aa: 19 01 movw r2, r18 1c0ac: 5b 83 std Y+3, r21 ; 0x03 1c0ae: 4a 83 std Y+2, r20 ; 0x02 1c0b0: 6b 01 movw r12, r22 1c0b2: 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)); 1c0b4: fa 01 movw r30, r20 1c0b6: 00 81 ld r16, Z 1c0b8: 11 81 ldd r17, Z+1 ; 0x01 1c0ba: b8 01 movw r22, r16 1c0bc: 90 e0 ldi r25, 0x00 ; 0 1c0be: 80 e0 ldi r24, 0x00 ; 0 1c0c0: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 1c0c4: 4b 01 movw r8, r22 1c0c6: 5c 01 movw r10, r24 1c0c8: b6 01 movw r22, r12 1c0ca: 0d 2c mov r0, r13 1c0cc: 00 0c add r0, r0 1c0ce: 88 0b sbc r24, r24 1c0d0: 99 0b sbc r25, r25 1c0d2: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1c0d6: 2b 01 movw r4, r22 1c0d8: 3c 01 movw r6, r24 1c0da: a5 01 movw r20, r10 1c0dc: 94 01 movw r18, r8 1c0de: c5 01 movw r24, r10 1c0e0: b4 01 movw r22, r8 1c0e2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1c0e6: 9b 01 movw r18, r22 1c0e8: ac 01 movw r20, r24 1c0ea: c3 01 movw r24, r6 1c0ec: b2 01 movw r22, r4 1c0ee: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1c0f2: 9b 01 movw r18, r22 1c0f4: ac 01 movw r20, r24 1c0f6: 6a e0 ldi r22, 0x0A ; 10 1c0f8: 77 ed ldi r23, 0xD7 ; 215 1c0fa: 83 ea ldi r24, 0xA3 ; 163 1c0fc: 9b e3 ldi r25, 0x3B ; 59 1c0fe: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__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); 1c102: 20 e0 ldi r18, 0x00 ; 0 1c104: 30 e0 ldi r19, 0x00 ; 0 1c106: 40 e0 ldi r20, 0x00 ; 0 1c108: 5f e3 ldi r21, 0x3F ; 63 1c10a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1c10e: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__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){ 1c112: 6e 15 cp r22, r14 1c114: 7f 05 cpc r23, r15 1c116: 28 f5 brcc .+74 ; 0x1c162 1c118: f9 81 ldd r31, Y+1 ; 0x01 1c11a: f6 b9 out 0x06, r31 ; 6 /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); 1c11c: ea 81 ldd r30, Y+2 ; 0x02 1c11e: fb 81 ldd r31, Y+3 ; 0x03 1c120: 80 81 ld r24, Z 1c122: 91 81 ldd r25, Z+1 ; 0x01 1c124: 0e 94 25 de call 0x1bc4a ; 0x1bc4a } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1c128: f1 01 movw r30, r2 1c12a: 80 81 ld r24, Z 1c12c: 91 81 ldd r25, Z+1 ; 0x01 1c12e: 01 97 sbiw r24, 0x01 ; 1 1c130: 91 83 std Z+1, r25 ; 0x01 1c132: 80 83 st Z, r24 return true; 1c134: 81 e0 ldi r24, 0x01 ; 1 } 1c136: 0f 90 pop r0 1c138: 0f 90 pop r0 1c13a: 0f 90 pop r0 1c13c: df 91 pop r29 1c13e: cf 91 pop r28 1c140: 1f 91 pop r17 1c142: 0f 91 pop r16 1c144: ff 90 pop r15 1c146: ef 90 pop r14 1c148: df 90 pop r13 1c14a: cf 90 pop r12 1c14c: bf 90 pop r11 1c14e: af 90 pop r10 1c150: 9f 90 pop r9 1c152: 8f 90 pop r8 1c154: 7f 90 pop r7 1c156: 6f 90 pop r6 1c158: 5f 90 pop r5 1c15a: 4f 90 pop r4 1c15c: 3f 90 pop r3 1c15e: 2f 90 pop r2 1c160: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 1c162: 66 27 eor r22, r22 1c164: 77 27 eor r23, r23 1c166: 6c 19 sub r22, r12 1c168: 7d 09 sbc r23, r13 1c16a: 98 01 movw r18, r16 1c16c: 4a 81 ldd r20, Y+2 ; 0x02 1c16e: 5b 81 ldd r21, Y+3 ; 0x03 1c170: 89 81 ldd r24, Y+1 ; 0x01 1c172: 0e 94 8f df call 0x1bf1e ; 0x1bf1e 1c176: d8 cf rjmp .-80 ; 0x1c128 /// 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; 1c178: 80 e0 ldi r24, 0x00 ; 0 1c17a: dd cf rjmp .-70 ; 0x1c136 0001c17c : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 1c17c: 0f 93 push r16 1c17e: 1f 93 push r17 1c180: cf 93 push r28 1c182: df 93 push r29 1c184: 18 2f mov r17, r24 1c186: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1c188: d1 e0 ldi r29, 0x01 ; 1 1c18a: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 1c18c: 81 2f mov r24, r17 1c18e: 8d 23 and r24, r29 1c190: 29 f0 breq .+10 ; 0x1c19c sm4_set_dir(i, dir & mask); 1c192: 60 2f mov r22, r16 1c194: 6d 23 and r22, r29 1c196: 8c 2f mov r24, r28 1c198: 0f 94 3c 6a call 0x2d478 ; 0x2d478 } } } 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) { 1c19c: cf 5f subi r28, 0xFF ; 255 1c19e: dd 0f add r29, r29 1c1a0: c3 30 cpi r28, 0x03 ; 3 1c1a2: a1 f7 brne .-24 ; 0x1c18c if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1c1a4: df 91 pop r29 1c1a6: cf 91 pop r28 1c1a8: 1f 91 pop r17 1c1aa: 0f 91 pop r16 1c1ac: 08 95 ret 0001c1ae : //@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) { 1c1ae: 8f 92 push r8 1c1b0: 9f 92 push r9 1c1b2: af 92 push r10 1c1b4: bf 92 push r11 1c1b6: cf 92 push r12 1c1b8: df 92 push r13 1c1ba: ef 92 push r14 1c1bc: ff 92 push r15 1c1be: 30 e0 ldi r19, 0x00 ; 0 1c1c0: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1c1c2: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1c1c4: 48 2f mov r20, r24 1c1c6: 49 23 and r20, r25 1c1c8: 19 f1 breq .+70 ; 0x1c210 count_position[i] += dir & mask ? -1L : 1L; 1c1ca: a9 01 movw r20, r18 1c1cc: 44 0f add r20, r20 1c1ce: 55 1f adc r21, r21 1c1d0: 44 0f add r20, r20 1c1d2: 55 1f adc r21, r21 1c1d4: fa 01 movw r30, r20 1c1d6: ec 59 subi r30, 0x9C ; 156 1c1d8: f8 4f sbci r31, 0xF8 ; 248 1c1da: c0 80 ld r12, Z 1c1dc: d1 80 ldd r13, Z+1 ; 0x01 1c1de: e2 80 ldd r14, Z+2 ; 0x02 1c1e0: f3 80 ldd r15, Z+3 ; 0x03 1c1e2: 76 2f mov r23, r22 1c1e4: 79 23 and r23, r25 1c1e6: 81 2c mov r8, r1 1c1e8: 91 2c mov r9, r1 1c1ea: 54 01 movw r10, r8 1c1ec: 83 94 inc r8 1c1ee: 77 23 and r23, r23 1c1f0: 21 f0 breq .+8 ; 0x1c1fa 1c1f2: 88 24 eor r8, r8 1c1f4: 8a 94 dec r8 1c1f6: 98 2c mov r9, r8 1c1f8: 54 01 movw r10, r8 1c1fa: c8 0c add r12, r8 1c1fc: d9 1c adc r13, r9 1c1fe: ea 1c adc r14, r10 1c200: fb 1c adc r15, r11 1c202: 4c 59 subi r20, 0x9C ; 156 1c204: 58 4f sbci r21, 0xF8 ; 248 1c206: fa 01 movw r30, r20 1c208: c0 82 st Z, r12 1c20a: d1 82 std Z+1, r13 ; 0x01 1c20c: e2 82 std Z+2, r14 ; 0x02 1c20e: 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) { 1c210: 99 0f add r25, r25 1c212: 2f 5f subi r18, 0xFF ; 255 1c214: 3f 4f sbci r19, 0xFF ; 255 1c216: 23 30 cpi r18, 0x03 ; 3 1c218: 31 05 cpc r19, r1 1c21a: a1 f6 brne .-88 ; 0x1c1c4 if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1c21c: ff 90 pop r15 1c21e: ef 90 pop r14 1c220: df 90 pop r13 1c222: cf 90 pop r12 1c224: bf 90 pop r11 1c226: af 90 pop r10 1c228: 9f 90 pop r9 1c22a: 8f 90 pop r8 1c22c: 08 95 ret 0001c22e : /// 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) { 1c22e: 2f 92 push r2 1c230: 3f 92 push r3 1c232: 4f 92 push r4 1c234: 5f 92 push r5 1c236: 6f 92 push r6 1c238: 7f 92 push r7 1c23a: 8f 92 push r8 1c23c: 9f 92 push r9 1c23e: af 92 push r10 1c240: bf 92 push r11 1c242: cf 92 push r12 1c244: df 92 push r13 1c246: ef 92 push r14 1c248: ff 92 push r15 1c24a: 0f 93 push r16 1c24c: 1f 93 push r17 1c24e: cf 93 push r28 1c250: df 93 push r29 1c252: 00 d0 rcall .+0 ; 0x1c254 1c254: 00 d0 rcall .+0 ; 0x1c256 1c256: cd b7 in r28, 0x3d ; 61 1c258: 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]; 1c25a: c0 90 64 07 lds r12, 0x0764 ; 0x800764 1c25e: d0 90 65 07 lds r13, 0x0765 ; 0x800765 1c262: e0 90 66 07 lds r14, 0x0766 ; 0x800766 1c266: f0 90 67 07 lds r15, 0x0767 ; 0x800767 1c26a: 7c 01 movw r14, r24 1c26c: ec 18 sub r14, r12 1c26e: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 1c270: 80 91 68 07 lds r24, 0x0768 ; 0x800768 1c274: 90 91 69 07 lds r25, 0x0769 ; 0x800769 1c278: a0 91 6a 07 lds r26, 0x076A ; 0x80076a 1c27c: b0 91 6b 07 lds r27, 0x076B ; 0x80076b 1c280: 68 1b sub r22, r24 1c282: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 1c284: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 1c288: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 1c28c: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 1c290: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 1c294: fa 01 movw r30, r20 1c296: e8 1b sub r30, r24 1c298: f9 0b sbc r31, r25 1c29a: fa 83 std Y+2, r31 ; 0x02 1c29c: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1c29e: fb 01 movw r30, r22 1c2a0: ff 0f add r31, r31 1c2a2: ee 0b sbc r30, r30 1c2a4: ff 0f add r31, r31 1c2a6: fe 2f mov r31, r30 1c2a8: ee 1f adc r30, r30 1c2aa: e2 70 andi r30, 0x02 ; 2 1c2ac: 89 81 ldd r24, Y+1 ; 0x01 1c2ae: 9a 81 ldd r25, Y+2 ; 0x02 1c2b0: 88 e0 ldi r24, 0x08 ; 8 1c2b2: 98 02 muls r25, r24 1c2b4: 81 2d mov r24, r1 1c2b6: 99 0b sbc r25, r25 1c2b8: 11 24 eor r1, r1 1c2ba: 84 70 andi r24, 0x04 ; 4 1c2bc: e8 2b or r30, r24 1c2be: 8f 2d mov r24, r15 1c2c0: 88 1f adc r24, r24 1c2c2: 88 27 eor r24, r24 1c2c4: 88 1f adc r24, r24 1c2c6: e8 2b or r30, r24 1c2c8: e0 93 fb 03 sts 0x03FB, r30 ; 0x8003fb asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1c2cc: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1c2d0: 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; 1c2d2: 8a e0 ldi r24, 0x0A ; 10 1c2d4: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 1; //set X direction bit 1c2d6: e0 fd sbrc r30, 0 1c2d8: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 2) portL |= 2; //set Y direction bit 1c2da: e1 fd sbrc r30, 1 1c2dc: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 4) portL |= 4; //set Z direction bit 1c2de: e2 fd sbrc r30, 2 1c2e0: 94 60 ori r25, 0x04 ; 4 if (dir_bits & 8) portL |= 64; //set E direction bit 1c2e2: 90 64 ori r25, 0x40 ; 64 #endif PORTL = portL; 1c2e4: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1c2e8: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1c2ea: 8e e0 ldi r24, 0x0E ; 14 1c2ec: 9f ec ldi r25, 0xCF ; 207 1c2ee: 01 11 cpse r16, r1 1c2f0: 02 c0 rjmp .+4 ; 0x1c2f6 1c2f2: 90 e0 ldi r25, 0x00 ; 0 1c2f4: 80 e0 ldi r24, 0x00 ; 0 1c2f6: 90 93 69 05 sts 0x0569, r25 ; 0x800569 1c2fa: 80 93 68 05 sts 0x0568, r24 ; 0x800568 xyzcal_sm4_delay = delay_us; 1c2fe: 30 93 fa 03 sts 0x03FA, r19 ; 0x8003fa 1c302: 20 93 f9 03 sts 0x03F9, r18 ; 0x8003f9 // uint32_t u = _micros(); bool ret = sm4_line_xyz_ui(abs(x), abs(y), abs(z)) ? true : false; 1c306: 29 81 ldd r18, Y+1 ; 0x01 1c308: 3a 81 ldd r19, Y+2 ; 0x02 1c30a: 3e 83 std Y+6, r19 ; 0x06 1c30c: 2d 83 std Y+5, r18 ; 0x05 1c30e: 37 ff sbrs r19, 7 1c310: 05 c0 rjmp .+10 ; 0x1c31c 1c312: 31 95 neg r19 1c314: 21 95 neg r18 1c316: 31 09 sbc r19, r1 1c318: 3e 83 std Y+6, r19 ; 0x06 1c31a: 2d 83 std Y+5, r18 ; 0x05 1c31c: 8b 01 movw r16, r22 1c31e: 77 ff sbrs r23, 7 1c320: 03 c0 rjmp .+6 ; 0x1c328 1c322: 11 95 neg r17 1c324: 01 95 neg r16 1c326: 11 09 sbc r17, r1 1c328: f7 fe sbrs r15, 7 1c32a: 03 c0 rjmp .+6 ; 0x1c332 1c32c: f1 94 neg r15 1c32e: e1 94 neg r14 1c330: 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); 1c332: 98 01 movw r18, r16 1c334: d8 01 movw r26, r16 1c336: 0f 94 73 de call 0x3bce6 ; 0x3bce6 <__mulhisi3> 1c33a: 4b 01 movw r8, r22 1c33c: 5c 01 movw r10, r24 1c33e: 2d 81 ldd r18, Y+5 ; 0x05 1c340: 3e 81 ldd r19, Y+6 ; 0x06 1c342: d9 01 movw r26, r18 1c344: 0f 94 73 de call 0x3bce6 ; 0x3bce6 <__mulhisi3> 1c348: 86 0e add r8, r22 1c34a: 97 1e adc r9, r23 1c34c: a8 1e adc r10, r24 1c34e: b9 1e adc r11, r25 1c350: 97 01 movw r18, r14 1c352: d7 01 movw r26, r14 1c354: 0f 94 73 de call 0x3bce6 ; 0x3bce6 <__mulhisi3> 1c358: 68 0d add r22, r8 1c35a: 79 1d adc r23, r9 1c35c: 8a 1d adc r24, r10 1c35e: 9b 1d adc r25, r11 1c360: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 1c364: 0f 94 51 e2 call 0x3c4a2 ; 0x3c4a2 1c368: 20 e0 ldi r18, 0x00 ; 0 1c36a: 30 e0 ldi r19, 0x00 ; 0 1c36c: 40 e0 ldi r20, 0x00 ; 0 1c36e: 5f e3 ldi r21, 0x3F ; 63 1c370: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1c374: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 1c378: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 1c37a: 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; 1c37c: 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; 1c37e: 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; 1c380: 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; 1c382: 1c 82 std Y+4, r1 ; 0x04 1c384: 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; 1c386: 31 2c mov r3, r1 1c388: 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; 1c38a: 1a 82 std Y+2, r1 ; 0x02 1c38c: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 1c38e: 61 14 cp r6, r1 1c390: 71 04 cpc r7, r1 1c392: 09 f4 brne .+2 ; 0x1c396 1c394: 47 c0 rjmp .+142 ; 0x1c424 if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1c396: e0 91 68 05 lds r30, 0x0568 ; 0x800568 1c39a: f0 91 69 05 lds r31, 0x0569 ; 0x800569 1c39e: 30 97 sbiw r30, 0x00 ; 0 1c3a0: e9 f5 brne .+122 ; 0x1c41c uint8_t sm = 0; //step mask 1c3a2: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1c3a4: ec 14 cp r14, r12 1c3a6: fd 04 cpc r15, r13 1c3a8: 40 f0 brcs .+16 ; 0x1c3ba sm |= 1; cx += dd; 1c3aa: c4 0c add r12, r4 1c3ac: d5 1c adc r13, r5 x++; 1c3ae: 89 81 ldd r24, Y+1 ; 0x01 1c3b0: 9a 81 ldd r25, Y+2 ; 0x02 1c3b2: 01 96 adiw r24, 0x01 ; 1 1c3b4: 9a 83 std Y+2, r25 ; 0x02 1c3b6: 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; 1c3b8: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1c3ba: 0a 15 cp r16, r10 1c3bc: 1b 05 cpc r17, r11 1c3be: 30 f0 brcs .+12 ; 0x1c3cc sm |= 2; 1c3c0: 82 60 ori r24, 0x02 ; 2 cy += dd; 1c3c2: a4 0c add r10, r4 1c3c4: b5 1c adc r11, r5 y++; 1c3c6: 9f ef ldi r25, 0xFF ; 255 1c3c8: 29 1a sub r2, r25 1c3ca: 39 0a sbc r3, r25 } if (cz <= dz){ 1c3cc: ed 81 ldd r30, Y+5 ; 0x05 1c3ce: fe 81 ldd r31, Y+6 ; 0x06 1c3d0: e8 15 cp r30, r8 1c3d2: f9 05 cpc r31, r9 1c3d4: 48 f0 brcs .+18 ; 0x1c3e8 sm |= 4; 1c3d6: 84 60 ori r24, 0x04 ; 4 cz += dd; 1c3d8: 84 0c add r8, r4 1c3da: 95 1c adc r9, r5 z++; 1c3dc: 2b 81 ldd r18, Y+3 ; 0x03 1c3de: 3c 81 ldd r19, Y+4 ; 0x04 1c3e0: 2f 5f subi r18, 0xFF ; 255 1c3e2: 3f 4f sbci r19, 0xFF ; 255 1c3e4: 3c 83 std Y+4, r19 ; 0x04 1c3e6: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1c3e8: ce 18 sub r12, r14 1c3ea: df 08 sbc r13, r15 cy -= dy; 1c3ec: a0 1a sub r10, r16 1c3ee: b1 0a sbc r11, r17 cz -= dz; 1c3f0: ed 81 ldd r30, Y+5 ; 0x05 1c3f2: fe 81 ldd r31, Y+6 ; 0x06 1c3f4: 8e 1a sub r8, r30 1c3f6: 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 1c3f8: 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); 1c3fa: e0 91 64 05 lds r30, 0x0564 ; 0x800564 1c3fe: f0 91 65 05 lds r31, 0x0565 ; 0x800565 1c402: 30 97 sbiw r30, 0x00 ; 0 1c404: d1 f1 breq .+116 ; 0x1c47a 1c406: b2 01 movw r22, r4 1c408: c3 01 movw r24, r6 1c40a: 19 95 eicall if (delay) delayMicroseconds(delay); 1c40c: 00 97 sbiw r24, 0x00 ; 0 1c40e: 11 f0 breq .+4 ; 0x1c414 1c410: 0e 94 25 de call 0x1bc4a ; 0x1bc4a nd--; 1c414: f1 e0 ldi r31, 0x01 ; 1 1c416: 6f 1a sub r6, r31 1c418: 71 08 sbc r7, r1 1c41a: b9 cf rjmp .-142 ; 0x1c38e 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; 1c41c: 19 95 eicall 1c41e: 88 23 and r24, r24 1c420: 09 f4 brne .+2 ; 0x1c424 1c422: bf cf rjmp .-130 ; 0x1c3a2 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) 1c424: e0 91 66 05 lds r30, 0x0566 ; 0x800566 1c428: f0 91 67 05 lds r31, 0x0567 ; 0x800567 1c42c: 30 97 sbiw r30, 0x00 ; 0 1c42e: 41 f0 breq .+16 ; 0x1c440 (*sm4_update_pos_cb)(x, y, z, 0); 1c430: 30 e0 ldi r19, 0x00 ; 0 1c432: 20 e0 ldi r18, 0x00 ; 0 1c434: 4b 81 ldd r20, Y+3 ; 0x03 1c436: 5c 81 ldd r21, Y+4 ; 0x04 1c438: b1 01 movw r22, r2 1c43a: 89 81 ldd r24, Y+1 ; 0x01 1c43c: 9a 81 ldd r25, Y+2 ; 0x02 1c43e: 19 95 eicall 1c440: 81 e0 ldi r24, 0x01 ; 1 1c442: 67 28 or r6, r7 1c444: 09 f4 brne .+2 ; 0x1c448 1c446: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 1c448: 26 96 adiw r28, 0x06 ; 6 1c44a: 0f b6 in r0, 0x3f ; 63 1c44c: f8 94 cli 1c44e: de bf out 0x3e, r29 ; 62 1c450: 0f be out 0x3f, r0 ; 63 1c452: cd bf out 0x3d, r28 ; 61 1c454: df 91 pop r29 1c456: cf 91 pop r28 1c458: 1f 91 pop r17 1c45a: 0f 91 pop r16 1c45c: ff 90 pop r15 1c45e: ef 90 pop r14 1c460: df 90 pop r13 1c462: cf 90 pop r12 1c464: bf 90 pop r11 1c466: af 90 pop r10 1c468: 9f 90 pop r9 1c46a: 8f 90 pop r8 1c46c: 7f 90 pop r7 1c46e: 6f 90 pop r6 1c470: 5f 90 pop r5 1c472: 4f 90 pop r4 1c474: 3f 90 pop r3 1c476: 2f 90 pop r2 1c478: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 1c47a: 84 ef ldi r24, 0xF4 ; 244 1c47c: 91 e0 ldi r25, 0x01 ; 1 1c47e: c8 cf rjmp .-112 ; 0x1c410 0001c480 : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 1c480: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 1c482: 0d b4 in r0, 0x2d ; 45 1c484: 07 fe sbrs r0, 7 1c486: fd cf rjmp .-6 ; 0x1c482 return SPDR; 1c488: 8e b5 in r24, 0x2e ; 46 } 1c48a: 08 95 ret 0001c48c : _CS_HIGH(); } uint8_t xflash_rd_status_reg(void) { _CS_LOW(); 1c48c: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_RD_STATUS_REG); // send command 0x90 1c48e: 85 e0 ldi r24, 0x05 ; 5 1c490: 0e 94 40 e2 call 0x1c480 ; 0x1c480 uint8_t val = _SPI_RX(); // receive value 1c494: 8f ef ldi r24, 0xFF ; 255 1c496: 0e 94 40 e2 call 0x1c480 ; 0x1c480 _CS_HIGH(); 1c49a: 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) ; 1c49c: 80 fd sbrc r24, 0 1c49e: f6 cf rjmp .-20 ; 0x1c48c } 1c4a0: 08 95 ret 0001c4a2 : _CS_HIGH(); return val; } static void xflash_send_cmdaddr(uint8_t cmd, uint32_t addr) { 1c4a2: 1f 93 push r17 1c4a4: cf 93 push r28 1c4a6: df 93 push r29 1c4a8: ea 01 movw r28, r20 1c4aa: 16 2f mov r17, r22 _SPI_TX(cmd); // send command 0x03 1c4ac: 0e 94 40 e2 call 0x1c480 ; 0x1c480 _SPI_TX(((uint8_t*)&addr)[2]); // send addr bits 16..23 1c4b0: 81 2f mov r24, r17 1c4b2: 0e 94 40 e2 call 0x1c480 ; 0x1c480 _SPI_TX(((uint8_t*)&addr)[1]); // send addr bits 8..15 1c4b6: 8d 2f mov r24, r29 1c4b8: 0e 94 40 e2 call 0x1c480 ; 0x1c480 _SPI_TX(((uint8_t*)&addr)[0]); // send addr bits 0..7 1c4bc: 8c 2f mov r24, r28 } 1c4be: df 91 pop r29 1c4c0: cf 91 pop r28 1c4c2: 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 1c4c4: 0c 94 40 e2 jmp 0x1c480 ; 0x1c480 0001c4c8 : _CS_HIGH(); } void xflash_erase(uint8_t cmd, uint32_t addr) { _CS_LOW(); 1c4c8: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(cmd, addr); 1c4ca: 0e 94 51 e2 call 0x1c4a2 ; 0x1c4a2 _CS_HIGH(); 1c4ce: 45 9a sbi 0x08, 5 ; 8 } 1c4d0: 08 95 ret 0001c4d2 : *(data++) = _SPI_RX(); _CS_HIGH(); } void xflash_page_program(uint32_t addr, uint8_t* data, uint16_t cnt) { 1c4d2: ef 92 push r14 1c4d4: ff 92 push r15 1c4d6: 0f 93 push r16 1c4d8: 1f 93 push r17 1c4da: cf 93 push r28 1c4dc: df 93 push r29 1c4de: 7a 01 movw r14, r20 1c4e0: 89 01 movw r16, r18 _CS_LOW(); 1c4e2: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1c4e4: ab 01 movw r20, r22 1c4e6: bc 01 movw r22, r24 1c4e8: 82 e0 ldi r24, 0x02 ; 2 1c4ea: 0e 94 51 e2 call 0x1c4a2 ; 0x1c4a2 1c4ee: e7 01 movw r28, r14 1c4f0: 0e 0d add r16, r14 1c4f2: 1f 1d adc r17, r15 while (cnt--) // send data 1c4f4: c0 17 cp r28, r16 1c4f6: d1 07 cpc r29, r17 1c4f8: 41 f4 brne .+16 ; 0x1c50a _SPI_TX(*(data++)); _CS_HIGH(); 1c4fa: 45 9a sbi 0x08, 5 ; 8 } 1c4fc: df 91 pop r29 1c4fe: cf 91 pop r28 1c500: 1f 91 pop r17 1c502: 0f 91 pop r16 1c504: ff 90 pop r15 1c506: ef 90 pop r14 1c508: 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++)); 1c50a: 89 91 ld r24, Y+ 1c50c: 0e 94 40 e2 call 0x1c480 ; 0x1c480 1c510: f1 cf rjmp .-30 ; 0x1c4f4 0001c512 : _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) { 1c512: ef 92 push r14 1c514: ff 92 push r15 1c516: 0f 93 push r16 1c518: 1f 93 push r17 1c51a: cf 93 push r28 1c51c: df 93 push r29 1c51e: 7a 01 movw r14, r20 1c520: 89 01 movw r16, r18 _CS_LOW(); 1c522: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_RD_DATA, addr); 1c524: ab 01 movw r20, r22 1c526: bc 01 movw r22, r24 1c528: 83 e0 ldi r24, 0x03 ; 3 1c52a: 0e 94 51 e2 call 0x1c4a2 ; 0x1c4a2 1c52e: e7 01 movw r28, r14 1c530: 0e 0d add r16, r14 1c532: 1f 1d adc r17, r15 while (cnt--) // receive data 1c534: c0 17 cp r28, r16 1c536: d1 07 cpc r29, r17 1c538: 41 f4 brne .+16 ; 0x1c54a *(data++) = _SPI_RX(); _CS_HIGH(); 1c53a: 45 9a sbi 0x08, 5 ; 8 } 1c53c: df 91 pop r29 1c53e: cf 91 pop r28 1c540: 1f 91 pop r17 1c542: 0f 91 pop r16 1c544: ff 90 pop r15 1c546: ef 90 pop r14 1c548: 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(); 1c54a: 8f ef ldi r24, 0xFF ; 255 1c54c: 0e 94 40 e2 call 0x1c480 ; 0x1c480 1c550: 89 93 st Y+, r24 1c552: f0 cf rjmp .-32 ; 0x1c534 0001c554 : #include "asm.h" #include "xflash.h" #include "Marlin.h" // for softReset bool xfdump_check_state(dump_crash_reason* reason) { 1c554: 0f 93 push r16 1c556: 1f 93 push r17 1c558: cf 93 push r28 1c55a: df 93 push r29 1c55c: 00 d0 rcall .+0 ; 0x1c55e 1c55e: 1f 92 push r1 1c560: cd b7 in r28, 0x3d ; 61 1c562: de b7 in r29, 0x3e ; 62 1c564: 8c 01 movw r16, r24 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c566: 8c e5 ldi r24, 0x5C ; 92 1c568: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c56a: 1d bc out 0x2d, r1 ; 45 uint32_t magic; XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), 1c56c: 24 e0 ldi r18, 0x04 ; 4 1c56e: 30 e0 ldi r19, 0x00 ; 0 1c570: ae 01 movw r20, r28 1c572: 4f 5f subi r20, 0xFF ; 255 1c574: 5f 4f sbci r21, 0xFF ; 255 1c576: 60 e0 ldi r22, 0x00 ; 0 1c578: 70 ed ldi r23, 0xD0 ; 208 1c57a: 83 e0 ldi r24, 0x03 ; 3 1c57c: 90 e0 ldi r25, 0x00 ; 0 1c57e: 0e 94 89 e2 call 0x1c512 ; 0x1c512 (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) 1c582: 89 81 ldd r24, Y+1 ; 0x01 1c584: 9a 81 ldd r25, Y+2 ; 0x02 1c586: ab 81 ldd r26, Y+3 ; 0x03 1c588: bc 81 ldd r27, Y+4 ; 0x04 1c58a: 87 34 cpi r24, 0x47 ; 71 1c58c: 95 45 sbci r25, 0x55 ; 85 1c58e: a2 45 sbci r26, 0x52 ; 82 1c590: b5 45 sbci r27, 0x55 ; 85 1c592: 71 f4 brne .+28 ; 0x1c5b0 return false; if (reason) 1c594: 01 15 cp r16, r1 1c596: 11 05 cpc r17, r1 1c598: 49 f0 breq .+18 ; 0x1c5ac { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), 1c59a: 21 e0 ldi r18, 0x01 ; 1 1c59c: 30 e0 ldi r19, 0x00 ; 0 1c59e: a8 01 movw r20, r16 1c5a0: 65 e0 ldi r22, 0x05 ; 5 1c5a2: 70 ed ldi r23, 0xD0 ; 208 1c5a4: 83 e0 ldi r24, 0x03 ; 3 1c5a6: 90 e0 ldi r25, 0x00 ; 0 1c5a8: 0e 94 89 e2 call 0x1c512 ; 0x1c512 (uint8_t*)reason, sizeof(*reason)); } return true; 1c5ac: 81 e0 ldi r24, 0x01 ; 1 1c5ae: 01 c0 rjmp .+2 ; 0x1c5b2 XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) return false; 1c5b0: 80 e0 ldi r24, 0x00 ; 0 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), (uint8_t*)reason, sizeof(*reason)); } return true; } 1c5b2: 0f 90 pop r0 1c5b4: 0f 90 pop r0 1c5b6: 0f 90 pop r0 1c5b8: 0f 90 pop r0 1c5ba: df 91 pop r29 1c5bc: cf 91 pop r28 1c5be: 1f 91 pop r17 1c5c0: 0f 91 pop r16 1c5c2: 08 95 ret 0001c5c4 : return 1; } void xflash_enable_wr(void) { _CS_LOW(); 1c5c4: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_ENABLE_WR); // send command 0x06 1c5c6: 86 e0 ldi r24, 0x06 ; 6 1c5c8: 0e 94 40 e2 call 0x1c480 ; 0x1c480 _CS_HIGH(); 1c5cc: 45 9a sbi 0x08, 5 ; 8 } 1c5ce: 08 95 ret 0001c5d0 : } } static void __attribute__((noinline)) xfdump_dump_core(dump_header_t& hdr, uint32_t addr, uint8_t* buf, uint16_t cnt) { 1c5d0: 4f 92 push r4 1c5d2: 5f 92 push r5 1c5d4: 6f 92 push r6 1c5d6: 7f 92 push r7 1c5d8: 8f 92 push r8 1c5da: 9f 92 push r9 1c5dc: af 92 push r10 1c5de: bf 92 push r11 1c5e0: ef 92 push r14 1c5e2: ff 92 push r15 1c5e4: 0f 93 push r16 1c5e6: 1f 93 push r17 1c5e8: cf 93 push r28 1c5ea: df 93 push r29 1c5ec: 7c 01 movw r14, r24 1c5ee: 4a 01 movw r8, r20 1c5f0: 5b 01 movw r10, r22 1c5f2: e9 01 movw r28, r18 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c5f4: 8c e5 ldi r24, 0x5C ; 92 1c5f6: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c5f8: 1d bc out 0x2d, r1 ; 45 } static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; 1c5fa: 41 2c mov r4, r1 1c5fc: 80 ed ldi r24, 0xD0 ; 208 1c5fe: 58 2e mov r5, r24 1c600: 83 e0 ldi r24, 0x03 ; 3 1c602: 68 2e mov r6, r24 1c604: 71 2c mov r7, r1 addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) { xflash_enable_wr(); 1c606: 0e 94 e2 e2 call 0x1c5c4 ; 0x1c5c4 _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 1c60a: b3 01 movw r22, r6 1c60c: a2 01 movw r20, r4 1c60e: 80 e2 ldi r24, 0x20 ; 32 1c610: 0e 94 64 e2 call 0x1c4c8 ; 0x1c4c8 xflash_sector_erase(addr); xflash_wait_busy(); 1c614: 0e 94 46 e2 call 0x1c48c ; 0x1c48c static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) 1c618: 80 e1 ldi r24, 0x10 ; 16 1c61a: 58 0e add r5, r24 1c61c: 61 1c adc r6, r1 1c61e: 71 1c adc r7, r1 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; 1c620: 41 14 cp r4, r1 1c622: 51 04 cpc r5, r1 1c624: e4 e0 ldi r30, 0x04 ; 4 1c626: 6e 06 cpc r6, r30 1c628: 71 04 cpc r7, r1 1c62a: 69 f7 brne .-38 ; 0x1c606 // start by clearing all sectors (we need all of them in any case) xfdump_erase(); // sample SP/PC hdr.sp = SP; 1c62c: 8d b7 in r24, 0x3d ; 61 1c62e: 9e b7 in r25, 0x3e ; 62 1c630: f7 01 movw r30, r14 1c632: 93 87 std Z+11, r25 ; 0x0b 1c634: 82 87 std Z+10, r24 ; 0x0a "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); 1c636: 00 d0 rcall .+0 ; 0x1c638 1c638: 8f 91 pop r24 1c63a: 9f 91 pop r25 1c63c: af 91 pop r26 hdr.pc = GETPC(); 1c63e: b0 e0 ldi r27, 0x00 ; 0 1c640: 86 83 std Z+6, r24 ; 0x06 1c642: 97 83 std Z+7, r25 ; 0x07 1c644: a0 87 std Z+8, r26 ; 0x08 1c646: 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(); 1c648: 0e 94 e2 e2 call 0x1c5c4 ; 0x1c5c4 xflash_page_program(DUMP_OFFSET, (uint8_t*)&hdr, sizeof(hdr)); 1c64c: 2c e0 ldi r18, 0x0C ; 12 1c64e: 30 e0 ldi r19, 0x00 ; 0 1c650: a7 01 movw r20, r14 1c652: 60 e0 ldi r22, 0x00 ; 0 1c654: 70 ed ldi r23, 0xD0 ; 208 1c656: 83 e0 ldi r24, 0x03 ; 3 1c658: 90 e0 ldi r25, 0x00 ; 0 1c65a: 0e 94 69 e2 call 0x1c4d2 ; 0x1c4d2 xflash_wait_busy(); 1c65e: 0e 94 46 e2 call 0x1c48c ; 0x1c48c void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) { xflash_enable_wr(); 1c662: 0e 94 e2 e2 call 0x1c5c4 ; 0x1c5c4 _CS_LOW(); 1c666: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1c668: b5 01 movw r22, r10 1c66a: a4 01 movw r20, r8 1c66c: 82 e0 ldi r24, 0x02 ; 2 1c66e: 0e 94 51 e2 call 0x1c4a2 ; 0x1c4a2 1c672: fe 01 movw r30, r28 while(1) { // send data _SPI_TX(*(data++)); 1c674: 21 96 adiw r28, 0x01 ; 1 1c676: 80 81 ld r24, Z 1c678: 0e 94 40 e2 call 0x1c480 ; 0x1c480 if(!--cnt || !(++addr & 0xFF)) 1c67c: 01 50 subi r16, 0x01 ; 1 1c67e: 11 09 sbc r17, r1 1c680: 41 f0 breq .+16 ; 0x1c692 1c682: ff ef ldi r31, 0xFF ; 255 1c684: 8f 1a sub r8, r31 1c686: 9f 0a sbc r9, r31 1c688: af 0a sbc r10, r31 1c68a: bf 0a sbc r11, r31 _CS_LOW(); xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); while(1) { // send data _SPI_TX(*(data++)); 1c68c: fe 01 movw r30, r28 if(!--cnt || !(++addr & 0xFF)) 1c68e: 81 10 cpse r8, r1 1c690: f1 cf rjmp .-30 ; 0x1c674 { // on a page boundary or end of write _CS_HIGH(); 1c692: 45 9a sbi 0x08, 5 ; 8 xflash_wait_busy(); 1c694: 0e 94 46 e2 call 0x1c48c ; 0x1c48c _CS_HIGH(); } void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) 1c698: 01 15 cp r16, r1 1c69a: 11 05 cpc r17, r1 1c69c: 11 f7 brne .-60 ; 0x1c662 // write data static_assert(sizeof(dump_t::data) <= RAMEND+1, "dump area size insufficient"); xflash_multipage_program(addr, buf, cnt); } 1c69e: df 91 pop r29 1c6a0: cf 91 pop r28 1c6a2: 1f 91 pop r17 1c6a4: 0f 91 pop r16 1c6a6: ff 90 pop r15 1c6a8: ef 90 pop r14 1c6aa: bf 90 pop r11 1c6ac: af 90 pop r10 1c6ae: 9f 90 pop r9 1c6b0: 8f 90 pop r8 1c6b2: 7f 90 pop r7 1c6b4: 6f 90 pop r6 1c6b6: 5f 90 pop r5 1c6b8: 4f 90 pop r4 1c6ba: 08 95 ret 0001c6bc : (uint8_t*)RAMSTART, RAMSIZE); } void xfdump_full_dump_and_reset(dump_crash_reason reason) { 1c6bc: cf 93 push r28 1c6be: df 93 push r29 1c6c0: cd b7 in r28, 0x3d ; 61 1c6c2: de b7 in r29, 0x3e ; 62 1c6c4: 2c 97 sbiw r28, 0x0c ; 12 1c6c6: 0f b6 in r0, 0x3f ; 63 1c6c8: f8 94 cli 1c6ca: de bf out 0x3e, r29 ; 62 1c6cc: 0f be out 0x3f, r0 ; 63 1c6ce: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1c6d0: 47 e4 ldi r20, 0x47 ; 71 1c6d2: 55 e5 ldi r21, 0x55 ; 85 1c6d4: 62 e5 ldi r22, 0x52 ; 82 1c6d6: 75 e5 ldi r23, 0x55 ; 85 1c6d8: 49 83 std Y+1, r20 ; 0x01 1c6da: 5a 83 std Y+2, r21 ; 0x02 1c6dc: 6b 83 std Y+3, r22 ; 0x03 1c6de: 7c 83 std Y+4, r23 ; 0x04 buf.regs_present = true; 1c6e0: 91 e0 ldi r25, 0x01 ; 1 1c6e2: 9d 83 std Y+5, r25 ; 0x05 buf.crash_reason = (uint8_t)reason; 1c6e4: 8e 83 std Y+6, r24 ; 0x06 // disable interrupts for a cleaner register dump cli(); 1c6e6: f8 94 cli 1c6e8: 88 e1 ldi r24, 0x18 ; 24 1c6ea: 9d e0 ldi r25, 0x0D ; 13 1c6ec: 0f b6 in r0, 0x3f ; 63 1c6ee: f8 94 cli 1c6f0: a8 95 wdr 1c6f2: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1c6f6: 0f be out 0x3f, r0 ; 63 1c6f8: 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); 1c6fc: 00 e0 ldi r16, 0x00 ; 0 1c6fe: 12 e2 ldi r17, 0x22 ; 34 1c700: 30 e0 ldi r19, 0x00 ; 0 1c702: 20 e0 ldi r18, 0x00 ; 0 1c704: 40 e0 ldi r20, 0x00 ; 0 1c706: 51 ed ldi r21, 0xD1 ; 209 1c708: 63 e0 ldi r22, 0x03 ; 3 1c70a: 70 e0 ldi r23, 0x00 ; 0 1c70c: ce 01 movw r24, r28 1c70e: 01 96 adiw r24, 0x01 ; 1 1c710: 0e 94 e8 e2 call 0x1c5d0 ; 0x1c5d0 // force a reset even sooner softReset(); 1c714: 0e 94 81 68 call 0xd102 ; 0xd102 0001c718 : xflash_multipage_program(addr, buf, cnt); } void xfdump_dump() { 1c718: 0f 93 push r16 1c71a: 1f 93 push r17 1c71c: cf 93 push r28 1c71e: df 93 push r29 1c720: cd b7 in r28, 0x3d ; 61 1c722: de b7 in r29, 0x3e ; 62 1c724: 2c 97 sbiw r28, 0x0c ; 12 1c726: 0f b6 in r0, 0x3f ; 63 1c728: f8 94 cli 1c72a: de bf out 0x3e, r29 ; 62 1c72c: 0f be out 0x3f, r0 ; 63 1c72e: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1c730: 87 e4 ldi r24, 0x47 ; 71 1c732: 95 e5 ldi r25, 0x55 ; 85 1c734: a2 e5 ldi r26, 0x52 ; 82 1c736: b5 e5 ldi r27, 0x55 ; 85 1c738: 89 83 std Y+1, r24 ; 0x01 1c73a: 9a 83 std Y+2, r25 ; 0x02 1c73c: ab 83 std Y+3, r26 ; 0x03 1c73e: bc 83 std Y+4, r27 ; 0x04 buf.regs_present = false; 1c740: 1d 82 std Y+5, r1 ; 0x05 buf.crash_reason = (uint8_t)dump_crash_reason::manual; 1c742: 1e 82 std Y+6, r1 ; 0x06 // write sram only xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data.sram), 1c744: 00 e0 ldi r16, 0x00 ; 0 1c746: 10 e2 ldi r17, 0x20 ; 32 1c748: 20 e0 ldi r18, 0x00 ; 0 1c74a: 32 e0 ldi r19, 0x02 ; 2 1c74c: 40 e0 ldi r20, 0x00 ; 0 1c74e: 53 ed ldi r21, 0xD3 ; 211 1c750: 63 e0 ldi r22, 0x03 ; 3 1c752: 70 e0 ldi r23, 0x00 ; 0 1c754: ce 01 movw r24, r28 1c756: 01 96 adiw r24, 0x01 ; 1 1c758: 0e 94 e8 e2 call 0x1c5d0 ; 0x1c5d0 (uint8_t*)RAMSTART, RAMSIZE); } 1c75c: 2c 96 adiw r28, 0x0c ; 12 1c75e: 0f b6 in r0, 0x3f ; 63 1c760: f8 94 cli 1c762: de bf out 0x3e, r29 ; 62 1c764: 0f be out 0x3f, r0 ; 63 1c766: cd bf out 0x3d, r28 ; 61 1c768: df 91 pop r29 1c76a: cf 91 pop r28 1c76c: 1f 91 pop r17 1c76e: 0f 91 pop r16 1c770: 08 95 ret 0001c772 : int xflash_mfrid_devid(void); int8_t xflash_init(void) { 1c772: cf 93 push r28 _CS_HIGH(); 1c774: 45 9a sbi 0x08, 5 ; 8 SET_OUTPUT(XFLASH_PIN_CS); 1c776: 3d 9a sbi 0x07, 5 ; 7 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c778: 8c e5 ldi r24, 0x5C ; 92 1c77a: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c77c: 1d bc out 0x2d, r1 ; 45 _CS_HIGH(); } int xflash_mfrid_devid(void) { _CS_LOW(); 1c77e: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_MFRID_DEVID); // send command 0x90 1c780: 80 e9 ldi r24, 0x90 ; 144 1c782: 0e 94 40 e2 call 0x1c480 ; 0x1c480 uint8_t cnt = 3; // 3 address bytes while (cnt--) // send address bytes _SPI_TX(0x00); 1c786: 80 e0 ldi r24, 0x00 ; 0 1c788: 0e 94 40 e2 call 0x1c480 ; 0x1c480 1c78c: 80 e0 ldi r24, 0x00 ; 0 1c78e: 0e 94 40 e2 call 0x1c480 ; 0x1c480 1c792: 80 e0 ldi r24, 0x00 ; 0 1c794: 0e 94 40 e2 call 0x1c480 ; 0x1c480 uint8_t xflash_mfrid = _SPI_RX(); // receive mfrid 1c798: 8f ef ldi r24, 0xFF ; 255 1c79a: 0e 94 40 e2 call 0x1c480 ; 0x1c480 1c79e: c8 2f mov r28, r24 uint8_t xflash_devid = _SPI_RX(); // receive devid 1c7a0: 8f ef ldi r24, 0xFF ; 255 1c7a2: 0e 94 40 e2 call 0x1c480 ; 0x1c480 1c7a6: 98 2f mov r25, r24 _CS_HIGH(); 1c7a8: 45 9a sbi 0x08, 5 ; 8 return ((xflash_mfrid == _MFRID_W25X20CL) && (xflash_devid == _DEVID_W25X20CL)) || 1c7aa: cf 3e cpi r28, 0xEF ; 239 1c7ac: 11 f0 breq .+4 ; 0x1c7b2 1c7ae: c8 3c cpi r28, 0xC8 ; 200 1c7b0: 19 f4 brne .+6 ; 0x1c7b8 1c7b2: 81 e0 ldi r24, 0x01 ; 1 1c7b4: 91 31 cpi r25, 0x11 ; 17 1c7b6: 09 f0 breq .+2 ; 0x1c7ba int8_t xflash_init(void) { _CS_HIGH(); SET_OUTPUT(XFLASH_PIN_CS); XFLASH_SPI_ENTER(); if (!xflash_mfrid_devid()) return 0; 1c7b8: 80 e0 ldi r24, 0x00 ; 0 return 1; } 1c7ba: cf 91 pop r28 1c7bc: 08 95 ret 0001c7be : class IR_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return !READ(IR_SENSOR_PIN); } 1c7be: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 1c7c2: 80 95 com r24 1c7c4: 81 70 andi r24, 0x01 ; 1 1c7c6: 08 95 ret 0001c7c8 : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 1c7c8: 1f 93 push r17 1c7ca: cf 93 push r28 1c7cc: df 93 push r29 MENU_BEGIN(); 1c7ce: 0f 94 da ce call 0x39db4 ; 0x39db4 1c7d2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 #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); 1c7d6: 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 1c7d8: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1c7da: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1c7de: 84 30 cpi r24, 0x04 ; 4 1c7e0: 08 f0 brcs .+2 ; 0x1c7e4 1c7e2: 3d c2 rjmp .+1146 ; 0x1cc5e 1c7e4: 10 92 18 05 sts 0x0518, r1 ; 0x800518 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 1c7e8: 86 ed ldi r24, 0xD6 ; 214 1c7ea: 9c e3 ldi r25, 0x3C ; 60 1c7ec: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c7f0: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a 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)) { 1c7f4: 0e 94 16 69 call 0xd22c ; 0xd22c 1c7f8: 81 11 cpse r24, r1 1c7fa: 19 c0 rjmp .+50 ; 0x1c82e 1c7fc: 0e 94 b0 68 call 0xd160 ; 0xd160 1c800: 81 11 cpse r24, r1 1c802: 15 c0 rjmp .+42 ; 0x1c82e 1c804: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 1c808: 81 11 cpse r24, r1 1c80a: 11 c0 rjmp .+34 ; 0x1c82e #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 1c80c: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 <_ZL13printer_state.lto_priv.395> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 1c810: 83 30 cpi r24, 0x03 ; 3 1c812: 09 f0 breq .+2 ; 0x1c816 1c814: 51 c0 rjmp .+162 ; 0x1c8b8 1c816: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 1c81a: 88 23 and r24, r24 1c81c: 41 f0 breq .+16 ; 0x1c82e MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 1c81e: 8c ec ldi r24, 0xCC ; 204 1c820: 9c e3 ldi r25, 0x3C ; 60 1c822: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c826: 67 e1 ldi r22, 0x17 ; 23 1c828: 72 ed ldi r23, 0xD2 ; 210 } else if ((GetPrinterState() == PrinterState::HostPrintingFinished) && M79_timer_get_status()) { MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1c82a: 0f 94 57 ce call 0x39cae ; 0x39cae } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 1c82e: 0e 94 00 69 call 0xd200 ; 0xd200 1c832: 88 23 and r24, r24 1c834: 81 f0 breq .+32 ; 0x1c856 1c836: 0e 94 c5 68 call 0xd18a ; 0xd18a 1c83a: 81 11 cpse r24, r1 1c83c: 04 c0 rjmp .+8 ; 0x1c846 1c83e: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 1c842: 84 30 cpi r24, 0x04 ; 4 1c844: 41 f4 brne .+16 ; 0x1c856 MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 1c846: 8c eb ldi r24, 0xBC ; 188 1c848: 9c e3 ldi r25, 0x3C ; 60 1c84a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c84e: 68 ea ldi r22, 0xA8 ; 168 1c850: 7a e3 ldi r23, 0x3A ; 58 1c852: 0f 94 08 d1 call 0x3a210 ; 0x3a210 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { 1c856: 0e 94 b0 68 call 0xd160 ; 0xd160 1c85a: 81 11 cpse r24, r1 1c85c: 61 c0 rjmp .+194 ; 0x1c920 } //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); 1c85e: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 1c862: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 1c866: 89 1b sub r24, r25 1c868: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1c86a: a9 f5 brne .+106 ; 0x1c8d6 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 1c86c: 0e 94 16 69 call 0xd22c ; 0xd22c 1c870: 81 11 cpse r24, r1 1c872: 31 c0 rjmp .+98 ; 0x1c8d6 #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1c874: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1c878: 82 30 cpi r24, 0x02 ; 2 1c87a: 69 f1 breq .+90 ; 0x1c8d6 #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 1c87c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c880: 81 11 cpse r24, r1 1c882: 31 c0 rjmp .+98 ; 0x1c8e6 MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 1c884: 8b ea ldi r24, 0xAB ; 171 1c886: 9c e3 ldi r25, 0x3C ; 60 1c888: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c88c: 6c ed ldi r22, 0xDC ; 220 1c88e: 79 e3 ldi r23, 0x39 ; 57 1c890: 0f 94 08 d1 call 0x3a210 ; 0x3a210 if (M79_timer_get_status()) { 1c894: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.464> 1c898: 88 23 and r24, r24 1c89a: 29 f1 breq .+74 ; 0x1c8e6 #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 1c89c: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 <_ZL13printer_state.lto_priv.395> 1c8a0: 81 30 cpi r24, 0x01 ; 1 1c8a2: 09 f0 breq .+2 ; 0x1c8a6 1c8a4: 7e c0 rjmp .+252 ; 0x1c9a2 MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 1c8a6: 8b e9 ldi r24, 0x9B ; 155 1c8a8: 9c e3 ldi r25, 0x3C ; 60 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 1c8aa: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c8ae: 6e ea ldi r22, 0xAE ; 174 1c8b0: 7f ec ldi r23, 0xCF ; 207 1c8b2: 0f 94 57 ce call 0x39cae ; 0x39cae 1c8b6: 17 c0 rjmp .+46 ; 0x1c8e6 // 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()) { 1c8b8: 84 30 cpi r24, 0x04 ; 4 1c8ba: 09 f0 breq .+2 ; 0x1c8be 1c8bc: b8 cf rjmp .-144 ; 0x1c82e 1c8be: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.464> 1c8c2: 88 23 and r24, r24 1c8c4: 09 f4 brne .+2 ; 0x1c8c8 1c8c6: b3 cf rjmp .-154 ; 0x1c82e MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1c8c8: 8c ec ldi r24, 0xCC ; 204 1c8ca: 9c e3 ldi r25, 0x3C ; 60 1c8cc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c8d0: 68 ea ldi r22, 0xA8 ; 168 1c8d2: 7f ec ldi r23, 0xCF ; 207 1c8d4: aa cf rjmp .-172 ; 0x1c82a 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); 1c8d6: 85 eb ldi r24, 0xB5 ; 181 1c8d8: 9c e3 ldi r25, 0x3C ; 60 1c8da: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c8de: 6e e0 ldi r22, 0x0E ; 14 1c8e0: 74 ed ldi r23, 0xD4 ; 212 1c8e2: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #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) { 1c8e6: c0 91 59 0e lds r28, 0x0E59 ; 0x800e59 1c8ea: 0e 94 ba 68 call 0xd174 ; 0xd174 1c8ee: c1 11 cpse r28, r1 1c8f0: 17 c0 rjmp .+46 ; 0x1c920 1c8f2: 90 91 58 0e lds r25, 0x0E58 ; 0x800e58 1c8f6: 91 11 cpse r25, r1 1c8f8: 13 c0 rjmp .+38 ; 0x1c920 1c8fa: 81 11 cpse r24, r1 1c8fc: 15 c0 rjmp .+42 ; 0x1c928 1c8fe: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1c902: 81 11 cpse r24, r1 1c904: 0d c0 rjmp .+26 ; 0x1c920 if (usb_timer.running()) { 1c906: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c90a: 88 23 and r24, r24 1c90c: 09 f4 brne .+2 ; 0x1c910 1c90e: 4c c0 rjmp .+152 ; 0x1c9a8 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 1c910: 81 e8 ldi r24, 0x81 ; 129 1c912: 9c e3 ldi r25, 0x3C ; 60 1c914: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c918: 6a e0 ldi r22, 0x0A ; 10 1c91a: 7b e3 ldi r23, 0x3B ; 59 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1c91c: 0f 94 57 ce call 0x39cae ; 0x39cae } } } if (printingIsPaused() 1c920: 0e 94 ba 68 call 0xd174 ; 0xd174 && !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) { 1c924: 88 23 and r24, r24 1c926: f1 f0 breq .+60 ; 0x1c964 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1c928: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 1c92c: 81 11 cpse r24, r1 1c92e: 1a c0 rjmp .+52 ; 0x1c964 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1c930: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1c934: 82 30 cpi r24, 0x02 ; 2 1c936: b1 f0 breq .+44 ; 0x1c964 #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 1c938: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1c93c: 82 30 cpi r24, 0x02 ; 2 1c93e: 21 f4 brne .+8 ; 0x1c948 1c940: 90 91 5a 0e lds r25, 0x0E5A ; 0x800e5a 1c944: 99 23 and r25, r25 1c946: 71 f0 breq .+28 ; 0x1c964 && custom_message_type != CustomMsg::Resuming) { 1c948: 90 91 75 07 lds r25, 0x0775 ; 0x800775 1c94c: 98 30 cpi r25, 0x08 ; 8 1c94e: 51 f0 breq .+20 ; 0x1c964 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 1c950: 81 11 cpse r24, r1 1c952: 36 c0 rjmp .+108 ; 0x1c9c0 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 1c954: 82 e7 ldi r24, 0x72 ; 114 1c956: 9c e3 ldi r25, 0x3C ; 60 1c958: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c95c: 68 e6 ldi r22, 0x68 ; 104 1c95e: 7a e3 ldi r23, 0x3A ; 58 } 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); 1c960: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 1c964: 0e 94 c5 68 call 0xd18a ; 0xd18a && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1c968: 81 11 cpse r24, r1 1c96a: 08 c0 rjmp .+16 ; 0x1c97c 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())) 1c96c: 0e 94 ba 68 call 0xd174 ; 0xd174 1c970: 81 11 cpse r24, r1 1c972: 04 c0 rjmp .+8 ; 0x1c97c 1c974: 0e 94 b0 68 call 0xd160 ; 0xd160 1c978: 88 23 and r24, r24 1c97a: 41 f0 breq .+16 ; 0x1c98c && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1c97c: 80 91 75 07 lds r24, 0x0775 ; 0x800775 1c980: 81 30 cpi r24, 0x01 ; 1 1c982: 21 f0 breq .+8 ; 0x1c98c 1c984: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1c988: 88 23 and r24, r24 1c98a: 39 f1 breq .+78 ; 0x1c9da MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } #ifdef THERMAL_MODEL else if(Stopped) { 1c98c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c990: 88 23 and r24, r24 1c992: 59 f1 breq .+86 ; 0x1c9ea MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1c994: 81 e6 ldi r24, 0x61 ; 97 1c996: 9c e3 ldi r25, 0x3C ; 60 1c998: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c99c: 6a e3 ldi r22, 0x3A ; 58 1c99e: 7b e3 ldi r23, 0x3B ; 59 1c9a0: 22 c0 rjmp .+68 ; 0x1c9e6 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); 1c9a2: 8f e8 ldi r24, 0x8F ; 143 1c9a4: 9c e3 ldi r25, 0x3C ; 60 1c9a6: 81 cf rjmp .-254 ; 0x1c8aa } } 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) { 1c9a8: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 1c9ac: 88 23 and r24, r24 1c9ae: 09 f4 brne .+2 ; 0x1c9b2 1c9b0: b7 cf rjmp .-146 ; 0x1c920 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1c9b2: 81 e8 ldi r24, 0x81 ; 129 1c9b4: 9c e3 ldi r25, 0x3C ; 60 1c9b6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c9ba: 62 ea ldi r22, 0xA2 ; 162 1c9bc: 7b e3 ldi r23, 0x3B ; 59 1c9be: ae cf rjmp .-164 ; 0x1c91c #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())) { 1c9c0: 81 30 cpi r24, 0x01 ; 1 1c9c2: 81 f6 brne .-96 ; 0x1c964 1c9c4: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.464> 1c9c8: 88 23 and r24, r24 1c9ca: 61 f2 breq .-104 ; 0x1c964 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 1c9cc: 82 e7 ldi r24, 0x72 ; 114 1c9ce: 9c e3 ldi r25, 0x3C ; 60 1c9d0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c9d4: 6c ed ldi r22, 0xDC ; 220 1c9d6: 7a e3 ldi r23, 0x3A ; 58 1c9d8: c3 cf rjmp .-122 ; 0x1c960 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 1c9da: 8e ec ldi r24, 0xCE ; 206 1c9dc: 9d e3 ldi r25, 0x3D ; 61 1c9de: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1c9e2: 60 e2 ldi r22, 0x20 ; 32 1c9e4: 72 ed ldi r23, 0xD2 ; 210 } #ifdef THERMAL_MODEL else if(Stopped) { MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1c9e6: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } #endif // only allow starting SD print if hardware errors (temperature or fan) are cleared if (!printer_recovering() && !printer_active() && !get_temp_error() 1c9ea: 0e 94 b0 68 call 0xd160 ; 0xd160 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1c9ee: 81 11 cpse r24, r1 1c9f0: 9e c0 rjmp .+316 ; 0x1cb2e 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() 1c9f2: 0e 94 16 69 call 0xd22c ; 0xd22c 1c9f6: 81 11 cpse r24, r1 1c9f8: 9a c0 rjmp .+308 ; 0x1cb2e 1c9fa: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 1c9fe: 81 11 cpse r24, r1 1ca00: 96 c0 rjmp .+300 ; 0x1cb2e #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1ca02: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1ca06: 82 30 cpi r24, 0x02 ; 2 1ca08: 09 f4 brne .+2 ; 0x1ca0c 1ca0a: 91 c0 rjmp .+290 ; 0x1cb2e #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 1ca0c: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 1ca10: 81 11 cpse r24, r1 1ca12: 05 c0 rjmp .+10 ; 0x1ca1e || lcd_commands_type != LcdCommands::Idle) { 1ca14: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 1ca18: 88 23 and r24, r24 1ca1a: 09 f4 brne .+2 ; 0x1ca1e 1ca1c: b9 c0 rjmp .+370 ; 0x1cb90 if (!card.isFileOpen()) { 1ca1e: 80 91 01 17 lds r24, 0x1701 ; 0x801701 1ca22: 81 11 cpse r24, r1 1ca24: 12 c0 rjmp .+36 ; 0x1ca4a if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 1ca26: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ca2a: 81 11 cpse r24, r1 1ca2c: 0e c0 rjmp .+28 ; 0x1ca4a 1ca2e: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 1ca32: 81 11 cpse r24, r1 1ca34: 0a c0 rjmp .+20 ; 0x1ca4a bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 1ca36: d0 93 dd 03 sts 0x03DD, r29 ; 0x8003dd MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 1ca3a: 81 e5 ldi r24, 0x51 ; 81 1ca3c: 9c e3 ldi r25, 0x3C ; 60 1ca3e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1ca42: 6e ed ldi r22, 0xDE ; 222 1ca44: 79 e3 ldi r23, 0x39 ; 57 1ca46: 0f 94 08 d1 call 0x3a210 ; 0x3a210 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)); 1ca4a: 81 ea ldi r24, 0xA1 ; 161 1ca4c: 9d e0 ldi r25, 0x0D ; 13 1ca4e: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1ca52: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 1ca54: 0e 94 5a 78 call 0xf0b4 ; 0xf0b4 if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 1ca58: 87 fd sbrc r24, 7 1ca5a: 09 c0 rjmp .+18 ; 0x1ca6e 1ca5c: c8 17 cp r28, r24 1ca5e: 39 f0 breq .+14 ; 0x1ca6e MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1ca60: c1 02 muls r28, r17 1ca62: c0 01 movw r24, r0 1ca64: 11 24 eor r1, r1 1ca66: 87 5b subi r24, 0xB7 ; 183 1ca68: 92 4f sbci r25, 0xF2 ; 242 1ca6a: 0e 94 cc d0 call 0x1a198 ; 0x1a198 } #ifdef QUICK_NOZZLE_CHANGE SETTINGS_NOZZLE; 1ca6e: 80 91 ee 04 lds r24, 0x04EE ; 0x8004ee 1ca72: 8c 33 cpi r24, 0x3C ; 60 1ca74: 09 f4 brne .+2 ; 0x1ca78 1ca76: b0 c0 rjmp .+352 ; 0x1cbd8 1ca78: 08 f0 brcs .+2 ; 0x1ca7c 1ca7a: 93 c0 rjmp .+294 ; 0x1cba2 1ca7c: 89 31 cpi r24, 0x19 ; 25 1ca7e: 09 f4 brne .+2 ; 0x1ca82 1ca80: 9f c0 rjmp .+318 ; 0x1cbc0 1ca82: 88 32 cpi r24, 0x28 ; 40 1ca84: 09 f4 brne .+2 ; 0x1ca88 1ca86: 92 c0 rjmp .+292 ; 0x1cbac #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 1ca88: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1ca8c: 81 11 cpse r24, r1 1ca8e: 4f c0 rjmp .+158 ; 0x1cb2e 1ca90: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1ca94: 81 11 cpse r24, r1 1ca96: 4b c0 rjmp .+150 ; 0x1cb2e if (MMU2::mmu2.Enabled()) { 1ca98: 80 91 98 13 lds r24, 0x1398 ; 0x801398 1ca9c: 81 30 cpi r24, 0x01 ; 1 1ca9e: 09 f0 breq .+2 ; 0x1caa2 1caa0: af c0 rjmp .+350 ; 0x1cc00 if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 1caa2: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 1caa6: 81 11 cpse r24, r1 1caa8: 0c c0 rjmp .+24 ; 0x1cac2 1caaa: 0e 94 df e3 call 0x1c7be ; 0x1c7be 1caae: 81 11 cpse r24, r1 1cab0: 08 c0 rjmp .+16 ; 0x1cac2 // 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); 1cab2: 87 e2 ldi r24, 0x27 ; 39 1cab4: 9c e3 ldi r25, 0x3C ; 60 1cab6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1caba: 68 ed ldi r22, 0xD8 ; 216 1cabc: 77 ed ldi r23, 0xD7 ; 215 1cabe: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 1cac2: 86 e1 ldi r24, 0x16 ; 22 1cac4: 9c e3 ldi r25, 0x3C ; 60 1cac6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1caca: 6f e0 ldi r22, 0x0F ; 15 1cacc: 78 ed ldi r23, 0xD8 ; 216 1cace: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 1cad2: 84 e0 ldi r24, 0x04 ; 4 1cad4: 9c e3 ldi r25, 0x3C ; 60 1cad6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cada: 62 e1 ldi r22, 0x12 ; 18 1cadc: 78 ed ldi r23, 0xD8 ; 216 1cade: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 1cae2: 87 e2 ldi r24, 0x27 ; 39 1cae4: 9d e5 ldi r25, 0x5D ; 93 1cae6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1caea: 65 e1 ldi r22, 0x15 ; 21 1caec: 78 ed ldi r23, 0xD8 ; 216 1caee: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 1caf2: 8e ec ldi r24, 0xCE ; 206 1caf4: 9e e0 ldi r25, 0x0E ; 14 1caf6: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1cafa: 88 23 and r24, r24 1cafc: 41 f0 breq .+16 ; 0x1cb0e MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 1cafe: 88 e1 ldi r24, 0x18 ; 24 1cb00: 9d e5 ldi r25, 0x5D ; 93 1cb02: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cb06: 68 e1 ldi r22, 0x18 ; 24 1cb08: 78 ed ldi r23, 0xD8 ; 216 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); 1cb0a: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 1cb0e: 88 eb ldi r24, 0xB8 ; 184 1cb10: 9d e3 ldi r25, 0x3D ; 61 1cb12: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cb16: 6e e5 ldi r22, 0x5E ; 94 1cb18: 7b e3 ldi r23, 0x3B ; 59 1cb1a: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 1cb1e: 82 ed ldi r24, 0xD2 ; 210 1cb20: 9b e3 ldi r25, 0x3B ; 59 1cb22: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cb26: 65 e5 ldi r22, 0x55 ; 85 1cb28: 73 ed ldi r23, 0xD3 ; 211 1cb2a: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 1cb2e: 85 ec ldi r24, 0xC5 ; 197 1cb30: 9b e3 ldi r25, 0x3B ; 59 1cb32: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cb36: 6a ec ldi r22, 0xCA ; 202 1cb38: 7a e3 ldi r23, 0x3A ; 58 1cb3a: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 1cb3e: 88 eb ldi r24, 0xB8 ; 184 1cb40: 9b e3 ldi r25, 0x3B ; 59 1cb42: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cb46: 6c e2 ldi r22, 0x2C ; 44 1cb48: 7a e3 ldi r23, 0x3A ; 58 1cb4a: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #endif if (MMU2::mmu2.Enabled()) { 1cb4e: 80 91 98 13 lds r24, 0x1398 ; 0x801398 1cb52: 81 30 cpi r24, 0x01 ; 1 1cb54: 41 f4 brne .+16 ; 0x1cb66 MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 1cb56: 87 ea ldi r24, 0xA7 ; 167 1cb58: 9b e3 ldi r25, 0x3B ; 59 1cb5a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cb5e: 66 e8 ldi r22, 0x86 ; 134 1cb60: 7b e3 ldi r23, 0x3B ; 59 1cb62: 0f 94 08 d1 call 0x3a210 ; 0x3a210 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); 1cb66: 8d e9 ldi r24, 0x9D ; 157 1cb68: 9b e3 ldi r25, 0x3B ; 59 1cb6a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cb6e: 6c ef ldi r22, 0xFC ; 252 1cb70: 7a e3 ldi r23, 0x3A ; 58 1cb72: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_END(); 1cb76: 0f 94 ae ce call 0x39d5c ; 0x39d5c //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1cb7a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1cb7e: 8f 5f subi r24, 0xFF ; 255 1cb80: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1cb84: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1cb88: 8f 5f subi r24, 0xFF ; 255 1cb8a: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1cb8e: 25 ce rjmp .-950 ; 0x1c7da #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 1cb90: d0 93 dd 03 sts 0x03DD, r29 ; 0x8003dd MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 1cb94: 84 e4 ldi r24, 0x44 ; 68 1cb96: 9c e3 ldi r25, 0x3C ; 60 1cb98: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cb9c: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a 1cba0: 54 cf rjmp .-344 ; 0x1ca4a 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; 1cba2: 80 35 cpi r24, 0x50 ; 80 1cba4: 19 f1 breq .+70 ; 0x1cbec 1cba6: 8f 3f cpi r24, 0xFF ; 255 1cba8: 09 f0 breq .+2 ; 0x1cbac 1cbaa: 6e cf rjmp .-292 ; 0x1ca88 1cbac: 88 e3 ldi r24, 0x38 ; 56 1cbae: 9c e3 ldi r25, 0x3C ; 60 1cbb0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cbb4: 22 e0 ldi r18, 0x02 ; 2 1cbb6: 4c e0 ldi r20, 0x0C ; 12 1cbb8: 5a e3 ldi r21, 0x3A ; 58 1cbba: 6c ef ldi r22, 0xFC ; 252 1cbbc: 7b e8 ldi r23, 0x8B ; 139 1cbbe: 09 c0 rjmp .+18 ; 0x1cbd2 1cbc0: 88 e3 ldi r24, 0x38 ; 56 1cbc2: 9c e3 ldi r25, 0x3C ; 60 1cbc4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cbc8: 22 e0 ldi r18, 0x02 ; 2 1cbca: 4c e0 ldi r20, 0x0C ; 12 1cbcc: 5a e3 ldi r21, 0x3A ; 58 1cbce: 61 e0 ldi r22, 0x01 ; 1 1cbd0: 7c e8 ldi r23, 0x8C ; 140 1cbd2: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 1cbd6: 58 cf rjmp .-336 ; 0x1ca88 1cbd8: 88 e3 ldi r24, 0x38 ; 56 1cbda: 9c e3 ldi r25, 0x3C ; 60 1cbdc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cbe0: 22 e0 ldi r18, 0x02 ; 2 1cbe2: 4c e0 ldi r20, 0x0C ; 12 1cbe4: 5a e3 ldi r21, 0x3A ; 58 1cbe6: 67 ef ldi r22, 0xF7 ; 247 1cbe8: 7b e8 ldi r23, 0x8B ; 139 1cbea: f3 cf rjmp .-26 ; 0x1cbd2 1cbec: 88 e3 ldi r24, 0x38 ; 56 1cbee: 9c e3 ldi r25, 0x3C ; 60 1cbf0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cbf4: 22 e0 ldi r18, 0x02 ; 2 1cbf6: 4c e0 ldi r20, 0x0C ; 12 1cbf8: 5a e3 ldi r21, 0x3A ; 58 1cbfa: 62 ef ldi r22, 0xF2 ; 242 1cbfc: 7b e8 ldi r23, 0x8B ; 139 1cbfe: e9 cf rjmp .-46 ; 0x1cbd2 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 1cc00: 80 91 88 17 lds r24, 0x1788 ; 0x801788 1cc04: 88 23 and r24, r24 1cc06: e1 f0 breq .+56 ; 0x1cc40 if (!fsensor.getAutoLoadEnabled()) { 1cc08: 80 91 89 17 lds r24, 0x1789 ; 0x801789 1cc0c: 81 11 cpse r24, r1 1cc0e: 08 c0 rjmp .+16 ; 0x1cc20 MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1cc10: 84 ef ldi r24, 0xF4 ; 244 1cc12: 9b e3 ldi r25, 0x3B ; 59 1cc14: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cc18: 62 e9 ldi r22, 0x92 ; 146 1cc1a: 7b e3 ldi r23, 0x3B ; 59 1cc1c: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } if (!fsensor.getFilamentPresent()) { 1cc20: 0e 94 df e3 call 0x1c7be ; 0x1c7be 1cc24: 81 11 cpse r24, r1 1cc26: 14 c0 rjmp .+40 ; 0x1cc50 if (fsensor.getAutoLoadEnabled()) { 1cc28: 80 91 89 17 lds r24, 0x1789 ; 0x801789 1cc2c: 88 23 and r24, r24 1cc2e: 09 f4 brne .+2 ; 0x1cc32 1cc30: 6e cf rjmp .-292 ; 0x1cb0e MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 1cc32: 80 ee ldi r24, 0xE0 ; 224 1cc34: 9b e3 ldi r25, 0x3B ; 59 1cc36: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cc3a: 6c ea ldi r22, 0xAC ; 172 1cc3c: 79 e3 ldi r23, 0x39 ; 57 1cc3e: 65 cf rjmp .-310 ; 0x1cb0a } 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); 1cc40: 84 ef ldi r24, 0xF4 ; 244 1cc42: 9b e3 ldi r25, 0x3B ; 59 1cc44: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cc48: 62 e9 ldi r22, 0x92 ; 146 1cc4a: 7b e3 ldi r23, 0x3B ; 59 1cc4c: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 1cc50: 84 e0 ldi r24, 0x04 ; 4 1cc52: 9c e3 ldi r25, 0x3C ; 60 1cc54: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cc58: 62 e9 ldi r22, 0x92 ; 146 1cc5a: 7a e3 ldi r23, 0x3A ; 58 1cc5c: 56 cf rjmp .-340 ; 0x1cb0a #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 1cc5e: df 91 pop r29 1cc60: cf 91 pop r28 1cc62: 1f 91 pop r17 1cc64: 08 95 ret 0001cc66 : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 1cc66: cf 93 push r28 1cc68: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1cc6a: 86 ea ldi r24, 0xA6 ; 166 1cc6c: 9c e0 ldi r25, 0x0C ; 12 1cc6e: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 status &= ~components; 1cc72: c0 95 com r28 1cc74: 6c 2f mov r22, r28 1cc76: 68 23 and r22, r24 1cc78: 86 ea ldi r24, 0xA6 ; 166 1cc7a: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1cc7c: cf 91 pop r28 1cc7e: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0001cc82 : } } } static void lcd_reset_sheet() { 1cc82: 1f 93 push r17 1cc84: cf 93 push r28 1cc86: df 93 push r29 1cc88: 00 d0 rcall .+0 ; 0x1cc8a 1cc8a: 00 d0 rcall .+0 ; 0x1cc8c 1cc8c: 1f 92 push r1 1cc8e: 1f 92 push r1 1cc90: cd b7 in r28, 0x3d ; 61 1cc92: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 1cc94: be 01 movw r22, r28 1cc96: 6f 5f subi r22, 0xFF ; 255 1cc98: 7f 4f sbci r23, 0xFF ; 255 1cc9a: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 1cc9e: 0e 94 7c 78 call 0xf0f8 ; 0xf0f8 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 1cca2: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 1cca6: 1b e0 ldi r17, 0x0B ; 11 1cca8: 81 9f mul r24, r17 1ccaa: c0 01 movw r24, r0 1ccac: 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); 1ccae: 6f ef ldi r22, 0xFF ; 255 1ccb0: 7f ef ldi r23, 0xFF ; 255 1ccb2: 80 5b subi r24, 0xB0 ; 176 1ccb4: 92 4f sbci r25, 0xF2 ; 242 1ccb6: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 1ccba: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 1ccbe: 61 9f mul r22, r17 1ccc0: b0 01 movw r22, r0 1ccc2: 11 24 eor r1, r1 1ccc4: 67 5b subi r22, 0xB7 ; 183 1ccc6: 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); 1ccc8: 47 e0 ldi r20, 0x07 ; 7 1ccca: 50 e0 ldi r21, 0x00 ; 0 1cccc: ce 01 movw r24, r28 1ccce: 01 96 adiw r24, 0x01 ; 1 1ccd0: 0f 94 6f dd call 0x3bade ; 0x3bade if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 1ccd4: 81 ea ldi r24, 0xA1 ; 161 1ccd6: 9d e0 ldi r25, 0x0D ; 13 1ccd8: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1ccdc: 90 91 de 03 lds r25, 0x03DE ; 0x8003de 1cce0: 89 13 cpse r24, r25 1cce2: 0a c0 rjmp .+20 ; 0x1ccf8 { eeprom_switch_to_next_sheet(); 1cce4: 0e 94 6e 78 call 0xf0dc ; 0xf0dc if (-1 == eeprom_next_initialized_sheet(0)) 1cce8: 80 e0 ldi r24, 0x00 ; 0 1ccea: 0e 94 5a 78 call 0xf0b4 ; 0xf0b4 1ccee: 8f 3f cpi r24, 0xFF ; 255 1ccf0: 19 f4 brne .+6 ; 0x1ccf8 calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1ccf2: 80 e1 ldi r24, 0x10 ; 16 1ccf4: 0e 94 33 e6 call 0x1cc66 ; 0x1cc66 } menu_back(); 1ccf8: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 } 1ccfc: 28 96 adiw r28, 0x08 ; 8 1ccfe: 0f b6 in r0, 0x3f ; 63 1cd00: f8 94 cli 1cd02: de bf out 0x3e, r29 ; 62 1cd04: 0f be out 0x3f, r0 ; 63 1cd06: cd bf out 0x3d, r28 ; 61 1cd08: df 91 pop r29 1cd0a: cf 91 pop r28 1cd0c: 1f 91 pop r17 1cd0e: 08 95 ret 0001cd10 : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 1cd10: cf 93 push r28 1cd12: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1cd14: 86 ea ldi r24, 0xA6 ; 166 1cd16: 9c e0 ldi r25, 0x0C ; 12 1cd18: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 status |= components; 1cd1c: 68 2f mov r22, r24 1cd1e: 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); 1cd20: 86 ea ldi r24, 0xA6 ; 166 1cd22: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1cd24: cf 91 pop r28 1cd26: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0001cd2a : //! @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) 1cd2a: 2f 92 push r2 1cd2c: 3f 92 push r3 1cd2e: 4f 92 push r4 1cd30: 5f 92 push r5 1cd32: 6f 92 push r6 1cd34: 7f 92 push r7 1cd36: 8f 92 push r8 1cd38: 9f 92 push r9 1cd3a: af 92 push r10 1cd3c: bf 92 push r11 1cd3e: cf 92 push r12 1cd40: df 92 push r13 1cd42: ef 92 push r14 1cd44: ff 92 push r15 1cd46: 0f 93 push r16 1cd48: 1f 93 push r17 1cd4a: cf 93 push r28 1cd4c: df 93 push r29 1cd4e: cd b7 in r28, 0x3d ; 61 1cd50: de b7 in r29, 0x3e ; 62 1cd52: ce 5c subi r28, 0xCE ; 206 1cd54: d1 09 sbc r29, r1 1cd56: 0f b6 in r0, 0x3f ; 63 1cd58: f8 94 cli 1cd5a: de bf out 0x3e, r29 ; 62 1cd5c: 0f be out 0x3f, r0 ; 63 1cd5e: cd bf out 0x3d, r28 ; 61 1cd60: 18 2f mov r17, r24 { bool final_result = false; #ifdef TMC2130 FORCE_HIGH_POWER_START; 1cd62: 81 e0 ldi r24, 0x01 ; 1 1cd64: 0e 94 e5 67 call 0xcfca ; 0xcfca #endif // TMC2130 FORCE_BL_ON_START; 1cd68: 81 e0 ldi r24, 0x01 ; 1 1cd6a: 0e 94 f4 8b call 0x117e8 ; 0x117e8 // Only Z calibration? if (!onlyZ) 1cd6e: 11 11 cpse r17, r1 1cd70: 04 c0 rjmp .+8 ; 0x1cd7a { disable_heater(); 1cd72: 0f 94 52 44 call 0x288a4 ; 0x288a4 eeprom_adjust_bed_reset(); //reset bed level correction 1cd76: 0e 94 a3 78 call 0xf146 ; 0xf146 } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 1cd7a: 80 e0 ldi r24, 0x00 ; 0 1cd7c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 // Let the planner use the uncorrected coordinates. mbl.reset(); 1cd80: 0f 94 e9 8b call 0x317d2 ; 0x317d2 // 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(); 1cd84: 0f 94 7a cb call 0x396f4 ; 0x396f4 babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 1cd88: 10 92 6b 05 sts 0x056B, r1 ; 0x80056b <_ZL13babystepLoadZ.lto_priv.514+0x1> 1cd8c: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a <_ZL13babystepLoadZ.lto_priv.514> // 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)); 1cd90: e0 e4 ldi r30, 0x40 ; 64 1cd92: f7 e0 ldi r31, 0x07 ; 7 1cd94: 83 e0 ldi r24, 0x03 ; 3 1cd96: df 01 movw r26, r30 1cd98: 1d 92 st X+, r1 1cd9a: 8a 95 dec r24 1cd9c: e9 f7 brne .-6 ; 0x1cd98 // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 1cd9e: 81 e0 ldi r24, 0x01 ; 1 1cda0: 0e 94 1d 68 call 0xd03a ; 0xd03a 1cda4: c7 55 subi r28, 0x57 ; 87 1cda6: df 4f sbci r29, 0xFF ; 255 1cda8: 99 83 std Y+1, r25 ; 0x01 1cdaa: 88 83 st Y, r24 1cdac: c9 5a subi r28, 0xA9 ; 169 1cdae: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 1cdb0: 8a e0 ldi r24, 0x0A ; 10 1cdb2: 9a e4 ldi r25, 0x4A ; 74 1cdb4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cdb8: 0f 94 80 34 call 0x26900 ; 0x26900 raise_z_above(MESH_HOME_Z_SEARCH); 1cdbc: 60 e0 ldi r22, 0x00 ; 0 1cdbe: 70 e0 ldi r23, 0x00 ; 0 1cdc0: 80 ea ldi r24, 0xA0 ; 160 1cdc2: 90 e4 ldi r25, 0x40 ; 64 1cdc4: 0e 94 95 6f call 0xdf2a ; 0xdf2a } /**/ void home_xy() { set_destination_to_current(); 1cdc8: 0e 94 6f 69 call 0xd2de ; 0xd2de homeaxis(X_AXIS); 1cdcc: 50 e0 ldi r21, 0x00 ; 0 1cdce: 40 e0 ldi r20, 0x00 ; 0 1cdd0: 61 e0 ldi r22, 0x01 ; 1 1cdd2: 80 e0 ldi r24, 0x00 ; 0 1cdd4: 0e 94 76 7c call 0xf8ec ; 0xf8ec homeaxis(Y_AXIS); 1cdd8: 50 e0 ldi r21, 0x00 ; 0 1cdda: 40 e0 ldi r20, 0x00 ; 0 1cddc: 61 e0 ldi r22, 0x01 ; 1 1cdde: 81 e0 ldi r24, 0x01 ; 1 1cde0: 0e 94 76 7c call 0xf8ec ; 0xf8ec plan_set_position_curposXYZE(); 1cde4: 0f 94 1d b9 call 0x3723a ; 0x3723a endstops_hit_on_purpose(); 1cde8: 0f 94 71 63 call 0x2c6e2 ; 0x2c6e2 1cdec: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> 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; 1cdf0: 20 e0 ldi r18, 0x00 ; 0 1cdf2: 30 e0 ldi r19, 0x00 ; 0 1cdf4: 40 ea ldi r20, 0xA0 ; 160 1cdf6: 50 e4 ldi r21, 0x40 ; 64 1cdf8: 60 91 43 07 lds r22, 0x0743 ; 0x800743 1cdfc: 70 91 44 07 lds r23, 0x0744 ; 0x800744 1ce00: 80 91 45 07 lds r24, 0x0745 ; 0x800745 1ce04: 90 91 46 07 lds r25, 0x0746 ; 0x800746 1ce08: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1ce0c: 60 93 43 07 sts 0x0743, r22 ; 0x800743 1ce10: 70 93 44 07 sts 0x0744, r23 ; 0x800744 1ce14: 80 93 45 07 sts 0x0745, r24 ; 0x800745 1ce18: 90 93 46 07 sts 0x0746, r25 ; 0x800746 current_position[Y_AXIS] += 5; 1ce1c: 20 e0 ldi r18, 0x00 ; 0 1ce1e: 30 e0 ldi r19, 0x00 ; 0 1ce20: 40 ea ldi r20, 0xA0 ; 160 1ce22: 50 e4 ldi r21, 0x40 ; 64 1ce24: 60 91 47 07 lds r22, 0x0747 ; 0x800747 1ce28: 70 91 48 07 lds r23, 0x0748 ; 0x800748 1ce2c: 80 91 49 07 lds r24, 0x0749 ; 0x800749 1ce30: 90 91 4a 07 lds r25, 0x074A ; 0x80074a 1ce34: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1ce38: 60 93 47 07 sts 0x0747, r22 ; 0x800747 1ce3c: 70 93 48 07 sts 0x0748, r23 ; 0x800748 1ce40: 80 93 49 07 sts 0x0749, r24 ; 0x800749 1ce44: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1ce48: 60 e0 ldi r22, 0x00 ; 0 1ce4a: 70 e0 ldi r23, 0x00 ; 0 1ce4c: 80 ea ldi r24, 0xA0 ; 160 1ce4e: 91 e4 ldi r25, 0x41 ; 65 1ce50: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 1ce54: 0f 94 27 58 call 0x2b04e ; 0x2b04e // Let the user move the Z axes up to the end stoppers. #ifdef TMC2130 if (calibrate_z_auto()) 1ce58: 0e 94 73 74 call 0xe8e6 ; 0xe8e6 1ce5c: e5 96 adiw r28, 0x35 ; 53 1ce5e: 8f af std Y+63, r24 ; 0x3f 1ce60: e5 97 sbiw r28, 0x35 ; 53 1ce62: 81 11 cpse r24, r1 1ce64: 04 c0 rjmp .+8 ; 0x1ce6e //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 1ce66: e5 96 adiw r28, 0x35 ; 53 1ce68: 1f ae std Y+63, r1 ; 0x3f 1ce6a: e5 97 sbiw r28, 0x35 ; 53 1ce6c: 0d c3 rjmp .+1562 ; 0x1d488 { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 1ce6e: 8e ec ldi r24, 0xCE ; 206 1ce70: 99 e4 ldi r25, 0x49 ; 73 1ce72: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1ce76: 0f 94 07 35 call 0x26a0e ; 0x26a0e if(onlyZ){ 1ce7a: 11 23 and r17, r17 1ce7c: 09 f4 brne .+2 ; 0x1ce80 1ce7e: df c2 rjmp .+1470 ; 0x1d43e prompt_steel_sheet_on_bed(true); 1ce80: 81 e0 ldi r24, 0x01 ; 1 1ce82: 0f 94 71 66 call 0x2cce2 ; 0x2cce2 lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 1ce86: 8c e9 ldi r24, 0x9C ; 156 1ce88: 99 e4 ldi r25, 0x49 ; 73 1ce8a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1ce8e: 0f 94 80 34 call 0x26900 ; 0x26900 lcd_puts_at_P(0,3,_n("1/9")); 1ce92: 47 e3 ldi r20, 0x37 ; 55 1ce94: 5f e6 ldi r21, 0x6F ; 111 }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")); 1ce96: 63 e0 ldi r22, 0x03 ; 3 1ce98: 80 e0 ldi r24, 0x00 ; 0 1ce9a: 0e 94 29 70 call 0xe052 ; 0xe052 } refresh_cmd_timeout(); 1ce9e: 0e 94 f8 67 call 0xcff0 ; 0xcff0 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 1cea2: 11 11 cpse r17, r1 1cea4: 1b c0 rjmp .+54 ; 0x1cedc { KEEPALIVE_STATE(PAUSED_FOR_USER); 1cea6: 84 e0 ldi r24, 0x04 ; 4 1cea8: 80 93 96 02 sts 0x0296, r24 ; 0x800296 prompt_steel_sheet_on_bed(false); 1ceac: 80 e0 ldi r24, 0x00 ; 0 1ceae: 0f 94 71 66 call 0x2cce2 ; 0x2cce2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 1ceb2: 82 ee ldi r24, 0xE2 ; 226 1ceb4: 98 e4 ldi r25, 0x48 ; 72 1ceb6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1ceba: 0f 94 07 35 call 0x26a0e ; 0x26a0e KEEPALIVE_STATE(IN_HANDLER); 1cebe: 82 e0 ldi r24, 0x02 ; 2 1cec0: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 1cec4: 8a e7 ldi r24, 0x7A ; 122 1cec6: 99 e4 ldi r25, 0x49 ; 73 1cec8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cecc: 0f 94 80 34 call 0x26900 ; 0x26900 lcd_puts_at_P(0,3,_n("1/4")); 1ced0: 4f e2 ldi r20, 0x2F ; 47 1ced2: 5f e6 ldi r21, 0x6F ; 111 1ced4: 63 e0 ldi r22, 0x03 ; 3 1ced6: 80 e0 ldi r24, 0x00 ; 0 1ced8: 0e 94 29 70 call 0xe052 ; 0xe052 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 1cedc: 00 91 8f 02 lds r16, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; 1cee0: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 1cee4: 60 e0 ldi r22, 0x00 ; 0 1cee6: 70 e0 ldi r23, 0x00 ; 0 1cee8: 80 e8 ldi r24, 0x80 ; 128 1ceea: 9f eb ldi r25, 0xBF ; 191 1ceec: 0e 94 16 6f call 0xde2c ; 0xde2c // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1cef0: c1 2c mov r12, r1 1cef2: d1 2c mov r13, r1 1cef4: b0 ea ldi r27, 0xA0 ; 160 1cef6: eb 2e mov r14, r27 1cef8: b0 e4 ldi r27, 0x40 ; 64 1cefa: fb 2e mov r15, r27 1cefc: c0 92 4b 07 sts 0x074B, r12 ; 0x80074b 1cf00: d0 92 4c 07 sts 0x074C, r13 ; 0x80074c 1cf04: e0 92 4d 07 sts 0x074D, r14 ; 0x80074d 1cf08: f0 92 4e 07 sts 0x074E, r15 ; 0x80074e 1cf0c: 81 e0 ldi r24, 0x01 ; 1 1cf0e: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 1cf12: 84 e0 ldi r24, 0x04 ; 4 1cf14: 0f 94 8e 3a call 0x2751c ; 0x2751c #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1cf18: 60 e0 ldi r22, 0x00 ; 0 1cf1a: 70 e0 ldi r23, 0x00 ; 0 1cf1c: 80 ea ldi r24, 0xA0 ; 160 1cf1e: 91 e4 ldi r25, 0x41 ; 65 1cf20: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 1cf24: 0f 94 27 58 call 0x2b04e ; 0x2b04e #ifdef TMC2130 tmc2130_home_exit(); 1cf28: 0f 94 5f 3a call 0x274be ; 0x274be 1cf2c: 00 93 8f 02 sts 0x028F, r16 ; 0x80028f <_ZL14check_endstops.lto_priv.389> #endif //TMC2130 enable_endstops(endstops_enabled); if ((st_get_position_mm(Z_AXIS) <= (MESH_HOME_Z_SEARCH + HOME_Z_SEARCH_THRESHOLD)) && 1cf30: 82 e0 ldi r24, 0x02 ; 2 1cf32: 0f 94 13 58 call 0x2b026 ; 0x2b026 1cf36: 2d ec ldi r18, 0xCD ; 205 1cf38: 3c ec ldi r19, 0xCC ; 204 1cf3a: 44 ea ldi r20, 0xA4 ; 164 1cf3c: 50 e4 ldi r21, 0x40 ; 64 1cf3e: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1cf42: 18 16 cp r1, r24 1cf44: 0c f4 brge .+2 ; 0x1cf48 1cf46: 84 c2 rjmp .+1288 ; 0x1d450 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 1cf48: 82 e0 ldi r24, 0x02 ; 2 1cf4a: 0f 94 13 58 call 0x2b026 ; 0x2b026 #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)) && 1cf4e: 23 e3 ldi r18, 0x33 ; 51 1cf50: 33 e3 ldi r19, 0x33 ; 51 1cf52: 4b e9 ldi r20, 0x9B ; 155 1cf54: 50 e4 ldi r21, 0x40 ; 64 1cf56: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1cf5a: 87 fd sbrc r24, 7 1cf5c: 79 c2 rjmp .+1266 ; 0x1d450 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 1cf5e: 11 11 cpse r17, r1 1cf60: 7c c2 rjmp .+1272 ; 0x1d45a } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1cf62: 80 e1 ldi r24, 0x10 ; 16 1cf64: 0e 94 33 e6 call 0x1cc66 ; 0x1cc66 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 1cf68: 81 ea ldi r24, 0xA1 ; 161 1cf6a: 9d e0 ldi r25, 0x0D ; 13 1cf6c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1cf70: bb e0 ldi r27, 0x0B ; 11 1cf72: 8b 9f mul r24, r27 1cf74: c0 01 movw r24, r0 1cf76: 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); 1cf78: 70 e0 ldi r23, 0x00 ; 0 1cf7a: 60 e0 ldi r22, 0x00 ; 0 1cf7c: 80 5b subi r24, 0xB0 ; 176 1cf7e: 92 4f sbci r25, 0xF2 ; 242 1cf80: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a } 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(); 1cf84: 0e 94 f8 67 call 0xcff0 ; 0xcff0 // 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); 1cf88: e1 ea ldi r30, 0xA1 ; 161 1cf8a: f3 e1 ldi r31, 0x13 ; 19 1cf8c: 84 ec ldi r24, 0xC4 ; 196 1cf8e: df 01 movw r26, r30 1cf90: 1d 92 st X+, r1 1cf92: 8a 95 dec r24 1cf94: e9 f7 brne .-6 ; 0x1cf90 { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 1cf96: 81 e3 ldi r24, 0x31 ; 49 1cf98: 93 e9 ldi r25, 0x93 ; 147 1cf9a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 MYSERIAL.println(int(iteration + 1)); 1cf9e: 81 e0 ldi r24, 0x01 ; 1 1cfa0: 90 e0 ldi r25, 0x00 ; 0 1cfa2: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 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)); 1cfa6: 8a e7 ldi r24, 0x7A ; 122 1cfa8: 99 e4 ldi r25, 0x49 ; 73 1cfaa: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1cfae: 0f 94 80 34 call 0x26900 ; 0x26900 #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; 1cfb2: c0 92 4b 07 sts 0x074B, r12 ; 0x80074b 1cfb6: d0 92 4c 07 sts 0x074C, r13 ; 0x80074c 1cfba: e0 92 4d 07 sts 0x074D, r14 ; 0x80074d 1cfbe: f0 92 4e 07 sts 0x074E, r15 ; 0x80074e 1cfc2: b2 e0 ldi r27, 0x02 ; 2 1cfc4: e1 96 adiw r28, 0x31 ; 49 1cfc6: bf af std Y+63, r27 ; 0x3f 1cfc8: e1 97 sbiw r28, 0x31 ; 49 1cfca: 2c e0 ldi r18, 0x0C ; 12 1cfcc: 33 e9 ldi r19, 0x93 ; 147 1cfce: cd 56 subi r28, 0x6D ; 109 1cfd0: df 4f sbci r29, 0xFF ; 255 1cfd2: 39 83 std Y+1, r19 ; 0x01 1cfd4: 28 83 st Y, r18 1cfd6: c3 59 subi r28, 0x93 ; 147 1cfd8: d0 40 sbci r29, 0x00 ; 0 1cfda: 40 ea ldi r20, 0xA0 ; 160 1cfdc: 53 e1 ldi r21, 0x13 ; 19 1cfde: cf 56 subi r28, 0x6F ; 111 1cfe0: df 4f sbci r29, 0xFF ; 255 1cfe2: 59 83 std Y+1, r21 ; 0x01 1cfe4: 48 83 st Y, r20 1cfe6: c1 59 subi r28, 0x91 ; 145 1cfe8: d0 40 sbci r29, 0x00 ; 0 1cfea: a0 96 adiw r28, 0x20 ; 32 1cfec: 5f af std Y+63, r21 ; 0x3f 1cfee: 4e af std Y+62, r20 ; 0x3e 1cff0: a0 97 sbiw r28, 0x20 ; 32 1cff2: e0 96 adiw r28, 0x30 ; 48 1cff4: 3f af std Y+63, r19 ; 0x3f 1cff6: 2e af std Y+62, r18 ; 0x3e 1cff8: 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; 1cffa: a7 96 adiw r28, 0x27 ; 39 1cffc: 1f ae std Y+63, r1 ; 0x3f 1cffe: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 1d000: 31 2c mov r3, r1 1d002: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 1d004: 0e 94 f8 67 call 0xcff0 ; 0xcff0 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 1d008: 63 e0 ldi r22, 0x03 ; 3 1d00a: 80 e0 ldi r24, 0x00 ; 0 1d00c: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_printf_P(PSTR("%d/4"),(k+1)); 1d010: bf ef ldi r27, 0xFF ; 255 1d012: 2b 1a sub r2, r27 1d014: 3b 0a sbc r3, r27 1d016: 3f 92 push r3 1d018: 2f 92 push r2 1d01a: ec e2 ldi r30, 0x2C ; 44 1d01c: f3 e9 ldi r31, 0x93 ; 147 1d01e: ff 93 push r31 1d020: ef 93 push r30 1d022: 0e 94 ee 6f call 0xdfdc ; 0xdfdc } #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); 1d026: 65 e5 ldi r22, 0x55 ; 85 1d028: 75 e5 ldi r23, 0x55 ; 85 1d02a: 85 e5 ldi r24, 0x55 ; 85 1d02c: 91 e4 ldi r25, 0x41 ; 65 1d02e: 0f 94 1a c3 call 0x38634 ; 0x38634 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); 1d032: e0 96 adiw r28, 0x30 ; 48 1d034: ee ad ldd r30, Y+62 ; 0x3e 1d036: ff ad ldd r31, Y+63 ; 0x3f 1d038: e0 97 sbiw r28, 0x30 ; 48 1d03a: 85 91 lpm r24, Z+ 1d03c: 95 91 lpm r25, Z+ 1d03e: a5 91 lpm r26, Z+ 1d040: b4 91 lpm r27, Z 1d042: 80 93 43 07 sts 0x0743, r24 ; 0x800743 1d046: 90 93 44 07 sts 0x0744, r25 ; 0x800744 1d04a: a0 93 45 07 sts 0x0745, r26 ; 0x800745 1d04e: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 1d052: e0 96 adiw r28, 0x30 ; 48 1d054: ee ad ldd r30, Y+62 ; 0x3e 1d056: ff ad ldd r31, Y+63 ; 0x3f 1d058: e0 97 sbiw r28, 0x30 ; 48 1d05a: 34 96 adiw r30, 0x04 ; 4 1d05c: 85 91 lpm r24, Z+ 1d05e: 95 91 lpm r25, Z+ 1d060: a5 91 lpm r26, Z+ 1d062: b4 91 lpm r27, Z 1d064: 80 93 47 07 sts 0x0747, r24 ; 0x800747 1d068: 90 93 48 07 sts 0x0748, r25 ; 0x800748 1d06c: a0 93 49 07 sts 0x0749, r26 ; 0x800749 1d070: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a MYSERIAL.print(current_position[Z_AXIS], 5); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY go_to_current(homing_feedrate[X_AXIS] / 60.f); 1d074: 60 e0 ldi r22, 0x00 ; 0 1d076: 70 e0 ldi r23, 0x00 ; 0 1d078: 88 e4 ldi r24, 0x48 ; 72 1d07a: 92 e4 ldi r25, 0x42 ; 66 1d07c: 0f 94 1a c3 call 0x38634 ; 0x38634 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 1d080: 41 e9 ldi r20, 0x91 ; 145 1d082: 51 e9 ldi r21, 0x91 ; 145 1d084: 5f 93 push r21 1d086: 4f 93 push r20 1d088: 0f 94 1d dc call 0x3b83a ; 0x3b83a lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 1d08c: 40 e8 ldi r20, 0x80 ; 128 1d08e: 51 e9 ldi r21, 0x91 ; 145 1d090: 63 e0 ldi r22, 0x03 ; 3 1d092: 84 e0 ldi r24, 0x04 ; 4 1d094: 0e 94 29 70 call 0xe052 ; 0xe052 // disable heaters and stop motion before we initialize sm4 disable_heater(); 1d098: 0f 94 52 44 call 0x288a4 ; 0x288a4 st_synchronize(); 1d09c: 0f 94 27 58 call 0x2b04e ; 0x2b04e // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 1d0a0: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1d0a4: 8d 7f andi r24, 0xFD ; 253 1d0a6: 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" ); 1d0aa: 0f b6 in r0, 0x3f ; 63 1d0ac: f8 94 cli 1d0ae: a8 95 wdr 1d0b0: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d0b4: 88 61 ori r24, 0x18 ; 24 1d0b6: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d0ba: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d0be: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 1d0c0: 10 92 69 05 sts 0x0569, r1 ; 0x800569 1d0c4: 10 92 68 05 sts 0x0568, r1 ; 0x800568 sm4_update_pos_cb = xyzcal_update_pos; 1d0c8: 82 e1 ldi r24, 0x12 ; 18 1d0ca: 9f ec ldi r25, 0xCF ; 207 1d0cc: 90 93 67 05 sts 0x0567, r25 ; 0x800567 1d0d0: 80 93 66 05 sts 0x0566, r24 ; 0x800566 sm4_calc_delay_cb = xyzcal_calc_delay; 1d0d4: a2 ea ldi r26, 0xA2 ; 162 1d0d6: be ec ldi r27, 0xCE ; 206 1d0d8: b0 93 65 05 sts 0x0565, r27 ; 0x800565 1d0dc: a0 93 64 05 sts 0x0564, r26 ; 0x800564 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]); 1d0e0: 00 91 6c 07 lds r16, 0x076C ; 0x80076c 1d0e4: 10 91 6d 07 lds r17, 0x076D ; 0x80076d 1d0e8: 20 91 6e 07 lds r18, 0x076E ; 0x80076e 1d0ec: 30 91 6f 07 lds r19, 0x076F ; 0x80076f 1d0f0: 40 91 68 07 lds r20, 0x0768 ; 0x800768 1d0f4: 50 91 69 07 lds r21, 0x0769 ; 0x800769 1d0f8: 60 91 6a 07 lds r22, 0x076A ; 0x80076a 1d0fc: 70 91 6b 07 lds r23, 0x076B ; 0x80076b 1d100: 80 91 64 07 lds r24, 0x0764 ; 0x800764 1d104: 90 91 65 07 lds r25, 0x0765 ; 0x800765 1d108: a0 91 66 07 lds r26, 0x0766 ; 0x800766 1d10c: b0 91 67 07 lds r27, 0x0767 ; 0x800767 1d110: 3f 93 push r19 1d112: 2f 93 push r18 1d114: 1f 93 push r17 1d116: 0f 93 push r16 1d118: 7f 93 push r23 1d11a: 6f 93 push r22 1d11c: 5f 93 push r21 1d11e: 4f 93 push r20 1d120: bf 93 push r27 1d122: af 93 push r26 1d124: 9f 93 push r25 1d126: 8f 93 push r24 1d128: e0 e3 ldi r30, 0x30 ; 48 1d12a: f2 e9 ldi r31, 0x92 ; 146 1d12c: ff 93 push r31 1d12e: ef 93 push r30 1d130: 0f 94 1d dc call 0x3b83a ; 0x3b83a int16_t x0 = _X; 1d134: 40 90 64 07 lds r4, 0x0764 ; 0x800764 1d138: 50 90 65 07 lds r5, 0x0765 ; 0x800765 1d13c: 60 90 66 07 lds r6, 0x0766 ; 0x800766 1d140: 70 90 67 07 lds r7, 0x0767 ; 0x800767 1d144: b4 2c mov r11, r4 1d146: a5 2c mov r10, r5 int16_t y0 = _Y; 1d148: 80 91 68 07 lds r24, 0x0768 ; 0x800768 1d14c: 90 91 69 07 lds r25, 0x0769 ; 0x800769 1d150: a0 91 6a 07 lds r26, 0x076A ; 0x80076a 1d154: b0 91 6b 07 lds r27, 0x076B ; 0x80076b 1d158: a6 96 adiw r28, 0x26 ; 38 1d15a: 8c af std Y+60, r24 ; 0x3c 1d15c: 9d af std Y+61, r25 ; 0x3d 1d15e: ae af std Y+62, r26 ; 0x3e 1d160: bf af std Y+63, r27 ; 0x3f 1d162: a6 97 sbiw r28, 0x26 ; 38 1d164: a3 96 adiw r28, 0x23 ; 35 1d166: 9f ac ldd r9, Y+63 ; 0x3f 1d168: a3 97 sbiw r28, 0x23 ; 35 1d16a: a4 96 adiw r28, 0x24 ; 36 1d16c: 8f ac ldd r8, Y+63 ; 0x3f 1d16e: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 1d170: c0 90 6c 07 lds r12, 0x076C ; 0x80076c 1d174: d0 90 6d 07 lds r13, 0x076D ; 0x80076d 1d178: e0 90 6e 07 lds r14, 0x076E ; 0x80076e 1d17c: f0 90 6f 07 lds r15, 0x076F ; 0x80076f 1d180: 0f b6 in r0, 0x3f ; 63 1d182: f8 94 cli 1d184: de bf out 0x3e, r29 ; 62 1d186: 0f be out 0x3f, r0 ; 63 1d188: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 1d18a: b5 e0 ldi r27, 0x05 ; 5 1d18c: cb 16 cp r12, r27 1d18e: b7 ef ldi r27, 0xF7 ; 247 1d190: db 06 cpc r13, r27 1d192: 0c f4 brge .+2 ; 0x1d196 1d194: d9 c1 rjmp .+946 ; 0x1d548 } 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; 1d196: 1a 82 std Y+2, r1 ; 0x02 1d198: 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); 1d19a: 1f 92 push r1 1d19c: 1f 92 push r1 1d19e: e3 e0 ldi r30, 0x03 ; 3 1d1a0: ef 93 push r30 1d1a2: f4 e8 ldi r31, 0x84 ; 132 1d1a4: ff 93 push r31 1d1a6: 1f 92 push r1 1d1a8: 24 e6 ldi r18, 0x64 ; 100 1d1aa: 2f 93 push r18 1d1ac: df 92 push r13 1d1ae: cf 92 push r12 1d1b0: 8f 92 push r8 1d1b2: 9f 92 push r9 1d1b4: af 92 push r10 1d1b6: bf 92 push r11 1d1b8: 47 ea ldi r20, 0xA7 ; 167 1d1ba: 51 e9 ldi r21, 0x91 ; 145 1d1bc: 5f 93 push r21 1d1be: 4f 93 push r20 1d1c0: 0f 94 1d dc call 0x3b83a ; 0x3b83a if (!ret && (ad < 720)) 1d1c4: 0f b6 in r0, 0x3f ; 63 1d1c6: f8 94 cli 1d1c8: de bf out 0x3e, r29 ; 62 1d1ca: 0f be out 0x3f, r0 ; 63 1d1cc: cd bf out 0x3d, r28 ; 61 1d1ce: 89 81 ldd r24, Y+1 ; 0x01 1d1d0: 9a 81 ldd r25, Y+2 ; 0x02 1d1d2: 80 3d cpi r24, 0xD0 ; 208 1d1d4: 92 40 sbci r25, 0x02 ; 2 1d1d6: 08 f4 brcc .+2 ; 0x1d1da 1d1d8: 82 c1 rjmp .+772 ; 0x1d4de if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 1d1da: 89 81 ldd r24, Y+1 ; 0x01 1d1dc: 9a 81 ldd r25, Y+2 ; 0x02 1d1de: 80 3a cpi r24, 0xA0 ; 160 1d1e0: 95 40 sbci r25, 0x05 ; 5 1d1e2: 10 f0 brcs .+4 ; 0x1d1e8 1d1e4: 0c 94 ef f7 jmp 0x1efde ; 0x1efde if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 1d1e8: 9e 01 movw r18, r28 1d1ea: 2f 5f subi r18, 0xFF ; 255 1d1ec: 3f 4f sbci r19, 0xFF ; 255 1d1ee: 79 01 movw r14, r18 1d1f0: 10 e0 ldi r17, 0x00 ; 0 1d1f2: 00 e0 ldi r16, 0x00 ; 0 1d1f4: 2c e7 ldi r18, 0x7C ; 124 1d1f6: 3c ef ldi r19, 0xFC ; 252 1d1f8: a6 01 movw r20, r12 1d1fa: 44 56 subi r20, 0x64 ; 100 1d1fc: 51 09 sbc r21, r1 1d1fe: 69 2d mov r22, r9 1d200: 78 2d mov r23, r8 1d202: 8b 2d mov r24, r11 1d204: 9a 2d mov r25, r10 1d206: 0f 94 e1 94 call 0x329c2 ; 0x329c2 1d20a: 88 23 and r24, r24 1d20c: 11 f4 brne .+4 ; 0x1d212 1d20e: 0c 94 ef f7 jmp 0x1efde ; 0x1efde ad += 720; 1d212: 89 81 ldd r24, Y+1 ; 0x01 1d214: 9a 81 ldd r25, Y+2 ; 0x02 1d216: 80 53 subi r24, 0x30 ; 48 1d218: 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); 1d21a: c0 90 6c 07 lds r12, 0x076C ; 0x80076c 1d21e: d0 90 6d 07 lds r13, 0x076D ; 0x80076d 1d222: e0 90 6e 07 lds r14, 0x076E ; 0x80076e 1d226: f0 90 6f 07 lds r15, 0x076F ; 0x80076f 1d22a: 00 91 68 07 lds r16, 0x0768 ; 0x800768 1d22e: 10 91 69 07 lds r17, 0x0769 ; 0x800769 1d232: 20 91 6a 07 lds r18, 0x076A ; 0x80076a 1d236: 30 91 6b 07 lds r19, 0x076B ; 0x80076b 1d23a: 40 91 64 07 lds r20, 0x0764 ; 0x800764 1d23e: 50 91 65 07 lds r21, 0x0765 ; 0x800765 1d242: 60 91 66 07 lds r22, 0x0766 ; 0x800766 1d246: 70 91 67 07 lds r23, 0x0767 ; 0x800767 1d24a: 9f 93 push r25 1d24c: 8f 93 push r24 1d24e: df 92 push r13 1d250: cf 92 push r12 1d252: 1f 93 push r17 1d254: 0f 93 push r16 1d256: 5f 93 push r21 1d258: 4f 93 push r20 1d25a: 8c e0 ldi r24, 0x0C ; 12 1d25c: 92 e9 ldi r25, 0x92 ; 146 1d25e: 9f 93 push r25 1d260: 8f 93 push r24 1d262: 0f 94 1d dc call 0x3b83a ; 0x3b83a /// 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); 1d266: 40 91 6c 07 lds r20, 0x076C ; 0x80076c 1d26a: 50 91 6d 07 lds r21, 0x076D ; 0x80076d 1d26e: 60 91 6e 07 lds r22, 0x076E ; 0x80076e 1d272: 70 91 6f 07 lds r23, 0x076F ; 0x80076f 1d276: 48 54 subi r20, 0x48 ; 72 1d278: 51 09 sbc r21, r1 1d27a: 00 e0 ldi r16, 0x00 ; 0 1d27c: 28 ec ldi r18, 0xC8 ; 200 1d27e: 30 e0 ldi r19, 0x00 ; 0 1d280: a3 96 adiw r28, 0x23 ; 35 1d282: 6f ad ldd r22, Y+63 ; 0x3f 1d284: a3 97 sbiw r28, 0x23 ; 35 1d286: a4 96 adiw r28, 0x24 ; 36 1d288: 7f ad ldd r23, Y+63 ; 0x3f 1d28a: a4 97 sbiw r28, 0x24 ; 36 1d28c: c2 01 movw r24, r4 1d28e: 0e 94 17 e1 call 0x1c22e ; 0x1c22e /// 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; 1d292: 20 91 64 07 lds r18, 0x0764 ; 0x800764 1d296: 30 91 65 07 lds r19, 0x0765 ; 0x800765 1d29a: 40 91 66 07 lds r20, 0x0766 ; 0x800766 1d29e: 50 91 67 07 lds r21, 0x0767 ; 0x800767 1d2a2: 6e 96 adiw r28, 0x1e ; 30 1d2a4: 2c af std Y+60, r18 ; 0x3c 1d2a6: 3d af std Y+61, r19 ; 0x3d 1d2a8: 4e af std Y+62, r20 ; 0x3e 1d2aa: 5f af std Y+63, r21 ; 0x3f 1d2ac: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 1d2ae: 80 91 68 07 lds r24, 0x0768 ; 0x800768 1d2b2: 90 91 69 07 lds r25, 0x0769 ; 0x800769 1d2b6: a0 91 6a 07 lds r26, 0x076A ; 0x80076a 1d2ba: b0 91 6b 07 lds r27, 0x076B ; 0x80076b 1d2be: ae 96 adiw r28, 0x2e ; 46 1d2c0: 8c af std Y+60, r24 ; 0x3c 1d2c2: 9d af std Y+61, r25 ; 0x3d 1d2c4: ae af std Y+62, r26 ; 0x3e 1d2c6: bf af std Y+63, r27 ; 0x3f 1d2c8: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 1d2ca: 20 91 6c 07 lds r18, 0x076C ; 0x80076c 1d2ce: 30 91 6d 07 lds r19, 0x076D ; 0x80076d 1d2d2: 40 91 6e 07 lds r20, 0x076E ; 0x80076e 1d2d6: 50 91 6f 07 lds r21, 0x076F ; 0x80076f 1d2da: e9 96 adiw r28, 0x39 ; 57 1d2dc: 2c af std Y+60, r18 ; 0x3c 1d2de: 3d af std Y+61, r19 ; 0x3d 1d2e0: 4e af std Y+62, r20 ; 0x3e 1d2e2: 5f af std Y+63, r21 ; 0x3f 1d2e4: e9 97 sbiw r28, 0x39 ; 57 1d2e6: a6 e7 ldi r26, 0x76 ; 118 1d2e8: bb e0 ldi r27, 0x0B ; 11 1d2ea: 0f b6 in r0, 0x3f ; 63 1d2ec: f8 94 cli 1d2ee: de bf out 0x3e, r29 ; 62 1d2f0: 0f be out 0x3f, r0 ; 63 1d2f2: cd bf out 0x3d, r28 ; 61 1d2f4: 90 e0 ldi r25, 0x00 ; 0 1d2f6: 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)); 1d2f8: fc 01 movw r30, r24 1d2fa: e9 55 subi r30, 0x59 ; 89 1d2fc: fd 46 sbci r31, 0x6D ; 109 1d2fe: 25 91 lpm r18, Z+ 1d300: 34 91 lpm r19, Z 1d302: 2d 93 st X+, r18 1d304: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 1d306: fc 01 movw r30, r24 1d308: e1 57 subi r30, 0x71 ; 113 1d30a: fd 46 sbci r31, 0x6D ; 109 1d30c: 25 91 lpm r18, Z+ 1d30e: 34 91 lpm r19, Z 1d310: 57 96 adiw r26, 0x17 ; 23 1d312: 3c 93 st X, r19 1d314: 2e 93 st -X, r18 1d316: 56 97 sbiw r26, 0x16 ; 22 1d318: 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++){ 1d31a: 88 31 cpi r24, 0x18 ; 24 1d31c: 91 05 cpc r25, r1 1d31e: 61 f7 brne .-40 ; 0x1d2f8 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); 1d320: e7 96 adiw r28, 0x37 ; 55 1d322: 4e ad ldd r20, Y+62 ; 0x3e 1d324: 5f ad ldd r21, Y+63 ; 0x3f 1d326: e7 97 sbiw r28, 0x37 ; 55 1d328: ac 96 adiw r28, 0x2c ; 44 1d32a: 6e ad ldd r22, Y+62 ; 0x3e 1d32c: 7f ad ldd r23, Y+63 ; 0x3f 1d32e: ac 97 sbiw r28, 0x2c ; 44 1d330: 6c 96 adiw r28, 0x1c ; 28 1d332: 8e ad ldd r24, Y+62 ; 0x3e 1d334: 9f ad ldd r25, Y+63 ; 0x3f 1d336: 6c 97 sbiw r28, 0x1c ; 28 1d338: 0f 94 69 91 call 0x322d2 ; 0x322d2 1d33c: 26 e7 ldi r18, 0x76 ; 118 1d33e: 37 e0 ldi r19, 0x07 ; 7 1d340: a4 96 adiw r28, 0x24 ; 36 1d342: 3f af std Y+63, r19 ; 0x3f 1d344: 2e af std Y+62, r18 ; 0x3e 1d346: a4 97 sbiw r28, 0x24 ; 36 1d348: 79 01 movw r14, r18 1d34a: f0 e2 ldi r31, 0x20 ; 32 1d34c: 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]); 1d34e: a2 e5 ldi r26, 0x52 ; 82 1d350: ca 2e mov r12, r26 1d352: a2 e9 ldi r26, 0x92 ; 146 1d354: da 2e mov r13, r26 } DBG(endl); 1d356: 09 ee ldi r16, 0xE9 ; 233 1d358: 15 ea ldi r17, 0xA5 ; 165 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); 1d35a: 57 01 movw r10, r14 1d35c: e0 e2 ldi r30, 0x20 ; 32 1d35e: 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]); 1d360: d5 01 movw r26, r10 1d362: 8d 91 ld r24, X+ 1d364: 5d 01 movw r10, r26 1d366: 1f 92 push r1 1d368: 8f 93 push r24 1d36a: df 92 push r13 1d36c: cf 92 push r12 1d36e: 0f 94 1d dc call 0x3b83a ; 0x3b83a 1d372: 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){ 1d374: 0f 90 pop r0 1d376: 0f 90 pop r0 1d378: 0f 90 pop r0 1d37a: 0f 90 pop r0 1d37c: 81 10 cpse r8, r1 1d37e: f0 cf rjmp .-32 ; 0x1d360 DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 1d380: 1f 93 push r17 1d382: 0f 93 push r16 1d384: 0f 94 1d dc call 0x3b83a ; 0x3b83a 1d388: 9a 94 dec r9 1d38a: b0 e2 ldi r27, 0x20 ; 32 1d38c: eb 0e add r14, r27 1d38e: 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){ 1d390: 0f 90 pop r0 1d392: 0f 90 pop r0 1d394: 91 10 cpse r9, r1 1d396: e1 cf rjmp .-62 ; 0x1d35a for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 1d398: 1f 93 push r17 1d39a: 0f 93 push r16 1d39c: 0f 94 1d dc call 0x3b83a ; 0x3b83a 1d3a0: 66 e7 ldi r22, 0x76 ; 118 1d3a2: 7b e0 ldi r23, 0x0B ; 11 1d3a4: 0f 90 pop r0 1d3a6: 0f 90 pop r0 1d3a8: e6 e7 ldi r30, 0x76 ; 118 1d3aa: f7 e0 ldi r31, 0x07 ; 7 /// magic constants that define normality const int16_t threshold_total = 900; const int threshold_extreme = 50; int16_t mins = 0; int16_t maxs = 0; 1d3ac: 90 e0 ldi r25, 0x00 ; 0 1d3ae: 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; 1d3b0: 50 e0 ldi r21, 0x00 ; 0 1d3b2: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 1d3b4: 21 91 ld r18, Z+ 1d3b6: 21 11 cpse r18, r1 1d3b8: 07 c3 rjmp .+1550 ; 0x1d9c8 ++mins; 1d3ba: 4f 5f subi r20, 0xFF ; 255 1d3bc: 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){ 1d3be: 6e 17 cp r22, r30 1d3c0: 7f 07 cpc r23, r31 1d3c2: c1 f7 brne .-16 ; 0x1d3b4 ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 1d3c4: 9a 01 movw r18, r20 1d3c6: 28 0f add r18, r24 1d3c8: 39 1f adc r19, r25 1d3ca: 25 38 cpi r18, 0x85 ; 133 1d3cc: 33 40 sbci r19, 0x03 ; 3 1d3ce: a4 f0 brlt .+40 ; 0x1d3f8 && mins > threshold_extreme 1d3d0: 43 33 cpi r20, 0x33 ; 51 1d3d2: 51 05 cpc r21, r1 1d3d4: 8c f0 brlt .+34 ; 0x1d3f8 && maxs > threshold_extreme 1d3d6: 83 33 cpi r24, 0x33 ; 51 1d3d8: 91 05 cpc r25, r1 1d3da: 74 f0 brlt .+28 ; 0x1d3f8 ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 1d3dc: 20 e0 ldi r18, 0x00 ; 0 1d3de: 34 e0 ldi r19, 0x04 ; 4 1d3e0: 24 1b sub r18, r20 1d3e2: 35 0b sbc r19, r21 1d3e4: 28 1b sub r18, r24 1d3e6: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 1d3e8: 24 17 cp r18, r20 1d3ea: 35 07 cpc r19, r21 1d3ec: 2c f4 brge .+10 ; 0x1d3f8 } 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; 1d3ee: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 1d3f0: 28 17 cp r18, r24 1d3f2: 39 07 cpc r19, r25 1d3f4: 0c f4 brge .+2 ; 0x1d3f8 1d3f6: d8 c0 rjmp .+432 ; 0x1d5a8 } /// 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; 1d3f8: 66 96 adiw r28, 0x16 ; 22 1d3fa: 1f ae std Y+63, r1 ; 0x3f 1d3fc: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 1d3fe: 62 96 adiw r28, 0x12 ; 18 1d400: 1f ae std Y+63, r1 ; 0x3f 1d402: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 1d404: 22 96 adiw r28, 0x02 ; 2 1d406: 1f ae std Y+63, r1 ; 0x3f 1d408: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 1d40a: 19 82 std Y+1, r1 ; 0x01 /// Searches for best match of pattern by shifting it /// Returns rate of match and the best location /// max match = 132, min match = 0 uint8_t xyzcal_find_pattern_12x12_in_32x32(uint8_t* pixels, uint16_t* pattern, uint8_t* pc, uint8_t* pr){ if (!pixels || !pattern || !pc || !pr) 1d40c: 86 e7 ldi r24, 0x76 ; 118 1d40e: 97 e0 ldi r25, 0x07 ; 7 1d410: 89 2b or r24, r25 1d412: 99 f0 breq .+38 ; 0x1d43a 1d414: 86 e7 ldi r24, 0x76 ; 118 1d416: 9b e0 ldi r25, 0x0B ; 11 return -1; 1d418: 0f ef ldi r16, 0xFF ; 255 /// Searches for best match of pattern by shifting it /// Returns rate of match and the best location /// max match = 132, min match = 0 uint8_t xyzcal_find_pattern_12x12_in_32x32(uint8_t* pixels, uint16_t* pattern, uint8_t* pc, uint8_t* pr){ if (!pixels || !pattern || !pc || !pr) 1d41a: 00 97 sbiw r24, 0x00 ; 0 1d41c: 49 f0 breq .+18 ; 0x1d430 1d41e: ae 01 movw r20, r28 1d420: 4f 5a subi r20, 0xAF ; 175 1d422: 5f 4f sbci r21, 0xFF ; 255 1d424: be 01 movw r22, r28 1d426: 6b 5a subi r22, 0xAB ; 171 1d428: 7f 4f sbci r23, 0xFF ; 255 1d42a: 0f 94 8c 90 call 0x32118 ; 0x32118 1d42e: 08 2f mov r16, r24 1d430: 8e e8 ldi r24, 0x8E ; 142 1d432: 9b e0 ldi r25, 0x0B ; 11 1d434: 89 2b or r24, r25 1d436: 09 f0 breq .+2 ; 0x1d43a 1d438: cc c2 rjmp .+1432 ; 0x1d9d2 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; 1d43a: 8f ef ldi r24, 0xFF ; 255 1d43c: dc c2 rjmp .+1464 ; 0x1d9f6 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)); 1d43e: 8a e7 ldi r24, 0x7A ; 122 1d440: 99 e4 ldi r25, 0x49 ; 73 1d442: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1d446: 0f 94 80 34 call 0x26900 ; 0x26900 lcd_puts_at_P(0,3,_n("1/4")); 1d44a: 43 e3 ldi r20, 0x33 ; 51 1d44c: 5f e6 ldi r21, 0x6F ; 111 1d44e: 23 cd rjmp .-1466 ; 0x1ce96 } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 1d450: 8d e3 ldi r24, 0x3D ; 61 1d452: 93 e9 ldi r25, 0x93 ; 147 // 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); 1d454: 0f 94 07 35 call 0x26a0e ; 0x26a0e 1d458: 06 cd rjmp .-1524 ; 0x1ce66 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); 1d45a: c7 55 subi r28, 0x57 ; 87 1d45c: df 4f sbci r29, 0xFF ; 255 1d45e: 88 81 ld r24, Y 1d460: 99 81 ldd r25, Y+1 ; 0x01 1d462: c9 5a subi r28, 0xA9 ; 169 1d464: d0 40 sbci r29, 0x00 ; 0 1d466: 0e 94 03 68 call 0xd006 ; 0xd006 // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 1d46a: 0f 94 df cb call 0x397be ; 0x397be // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 1d46e: 0f 94 7d c9 call 0x392fa ; 0x392fa //FIXME bool result = sample_mesh_and_store_reference(); 1d472: 0f 94 8c c7 call 0x38f18 ; 0x38f18 1d476: e5 96 adiw r28, 0x35 ; 53 1d478: 8f af std Y+63, r24 ; 0x3f 1d47a: e5 97 sbiw r28, 0x35 ; 53 if (result) 1d47c: 88 23 and r24, r24 1d47e: 09 f4 brne .+2 ; 0x1d482 1d480: f2 cc rjmp .-1564 ; 0x1ce66 { calibration_status_set(CALIBRATION_STATUS_Z); 1d482: 84 e0 ldi r24, 0x04 ; 4 1d484: 0e 94 88 e6 call 0x1cd10 ; 0x1cd10 } else { // Timeouted. } lcd_update_enable(true); 1d488: 81 e0 ldi r24, 0x01 ; 1 1d48a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 #ifdef TMC2130 FORCE_HIGH_POWER_END; 1d48e: 80 e0 ldi r24, 0x00 ; 0 1d490: 0e 94 e5 67 call 0xcfca ; 0xcfca #endif // TMC2130 FORCE_BL_ON_END; 1d494: 80 e0 ldi r24, 0x00 ; 0 1d496: 0e 94 f4 8b call 0x117e8 ; 0x117e8 return final_result; } 1d49a: e5 96 adiw r28, 0x35 ; 53 1d49c: 8f ad ldd r24, Y+63 ; 0x3f 1d49e: e5 97 sbiw r28, 0x35 ; 53 1d4a0: c2 53 subi r28, 0x32 ; 50 1d4a2: df 4f sbci r29, 0xFF ; 255 1d4a4: 0f b6 in r0, 0x3f ; 63 1d4a6: f8 94 cli 1d4a8: de bf out 0x3e, r29 ; 62 1d4aa: 0f be out 0x3f, r0 ; 63 1d4ac: cd bf out 0x3d, r28 ; 61 1d4ae: df 91 pop r29 1d4b0: cf 91 pop r28 1d4b2: 1f 91 pop r17 1d4b4: 0f 91 pop r16 1d4b6: ff 90 pop r15 1d4b8: ef 90 pop r14 1d4ba: df 90 pop r13 1d4bc: cf 90 pop r12 1d4be: bf 90 pop r11 1d4c0: af 90 pop r10 1d4c2: 9f 90 pop r9 1d4c4: 8f 90 pop r8 1d4c6: 7f 90 pop r7 1d4c8: 6f 90 pop r6 1d4ca: 5f 90 pop r5 1d4cc: 4f 90 pop r4 1d4ce: 3f 90 pop r3 1d4d0: 2f 90 pop r2 1d4d2: 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) { 1d4d4: e1 e0 ldi r30, 0x01 ; 1 1d4d6: e1 96 adiw r28, 0x31 ; 49 1d4d8: ef af std Y+63, r30 ; 0x3f 1d4da: e1 97 sbiw r28, 0x31 ; 49 1d4dc: 76 cd rjmp .-1300 ; 0x1cfca 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) 1d4de: fe 01 movw r30, r28 1d4e0: 31 96 adiw r30, 0x01 ; 1 1d4e2: 7f 01 movw r14, r30 1d4e4: 10 e0 ldi r17, 0x00 ; 0 1d4e6: 00 e0 ldi r16, 0x00 ; 0 1d4e8: 24 e8 ldi r18, 0x84 ; 132 1d4ea: 33 e0 ldi r19, 0x03 ; 3 1d4ec: a6 01 movw r20, r12 1d4ee: 69 2d mov r22, r9 1d4f0: 78 2d mov r23, r8 1d4f2: 8b 2d mov r24, r11 1d4f4: 9a 2d mov r25, r10 1d4f6: 0f 94 e1 94 call 0x329c2 ; 0x329c2 ad += 0; if (!ret && (ad < 1440)) 1d4fa: 88 23 and r24, r24 1d4fc: 09 f4 brne .+2 ; 0x1d500 1d4fe: 6d ce rjmp .-806 ; 0x1d1da 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; 1d500: 89 81 ldd r24, Y+1 ; 0x01 1d502: 9a 81 ldd r25, Y+2 ; 0x02 1d504: 8a ce rjmp .-748 ; 0x1d21a 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)) 1d506: 89 81 ldd r24, Y+1 ; 0x01 1d508: 9a 81 ldd r25, Y+2 ; 0x02 1d50a: 80 34 cpi r24, 0x40 ; 64 1d50c: 9b 40 sbci r25, 0x0B ; 11 1d50e: b8 f4 brcc .+46 ; 0x1d53e if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 1d510: ce 01 movw r24, r28 1d512: 01 96 adiw r24, 0x01 ; 1 1d514: 7c 01 movw r14, r24 1d516: 04 eb ldi r16, 0xB4 ; 180 1d518: 10 e0 ldi r17, 0x00 ; 0 1d51a: 2c e7 ldi r18, 0x7C ; 124 1d51c: 3c ef ldi r19, 0xFC ; 252 1d51e: a6 01 movw r20, r12 1d520: 4c 52 subi r20, 0x2C ; 44 1d522: 51 40 sbci r21, 0x01 ; 1 1d524: 69 2d mov r22, r9 1d526: 78 2d mov r23, r8 1d528: 8b 2d mov r24, r11 1d52a: 9a 2d mov r25, r10 1d52c: 0f 94 e1 94 call 0x329c2 ; 0x329c2 1d530: 88 23 and r24, r24 1d532: 29 f0 breq .+10 ; 0x1d53e ad += 2160; 1d534: 89 81 ldd r24, Y+1 ; 0x01 1d536: 9a 81 ldd r25, Y+2 ; 0x02 1d538: 80 59 subi r24, 0x90 ; 144 1d53a: 97 4f sbci r25, 0xF7 ; 247 1d53c: 6e ce rjmp .-804 ; 0x1d21a /// 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; 1d53e: 90 e9 ldi r25, 0x90 ; 144 1d540: c9 1a sub r12, r25 1d542: 91 e0 ldi r25, 0x01 ; 1 1d544: d9 0a sbc r13, r25 1d546: 21 ce rjmp .-958 ; 0x1d18a } //@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]); 1d548: 00 91 6c 07 lds r16, 0x076C ; 0x80076c 1d54c: 10 91 6d 07 lds r17, 0x076D ; 0x80076d 1d550: 20 91 6e 07 lds r18, 0x076E ; 0x80076e 1d554: 30 91 6f 07 lds r19, 0x076F ; 0x80076f 1d558: 40 91 68 07 lds r20, 0x0768 ; 0x800768 1d55c: 50 91 69 07 lds r21, 0x0769 ; 0x800769 1d560: 60 91 6a 07 lds r22, 0x076A ; 0x80076a 1d564: 70 91 6b 07 lds r23, 0x076B ; 0x80076b 1d568: 80 91 64 07 lds r24, 0x0764 ; 0x800764 1d56c: 90 91 65 07 lds r25, 0x0765 ; 0x800765 1d570: a0 91 66 07 lds r26, 0x0766 ; 0x800766 1d574: b0 91 67 07 lds r27, 0x0767 ; 0x800767 1d578: 3f 93 push r19 1d57a: 2f 93 push r18 1d57c: 1f 93 push r17 1d57e: 0f 93 push r16 1d580: 7f 93 push r23 1d582: 6f 93 push r22 1d584: 5f 93 push r21 1d586: 4f 93 push r20 1d588: bf 93 push r27 1d58a: af 93 push r26 1d58c: 9f 93 push r25 1d58e: 8f 93 push r24 1d590: 8f ed ldi r24, 0xDF ; 223 1d592: 91 e9 ldi r25, 0x91 ; 145 1d594: 9f 93 push r25 1d596: 8f 93 push r24 1d598: 0f 94 1d dc call 0x3b83a ; 0x3b83a 1d59c: 0f b6 in r0, 0x3f ; 63 1d59e: f8 94 cli 1d5a0: de bf out 0x3e, r29 ; 62 1d5a2: 0f be out 0x3f, r0 ; 63 1d5a4: 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; 1d5a6: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 1d5a8: 8f eb ldi r24, 0xBF ; 191 1d5aa: 92 e9 ldi r25, 0x92 ; 146 1d5ac: 9f 93 push r25 1d5ae: 8f 93 push r24 1d5b0: 0f 94 1d dc call 0x3b83a ; 0x3b83a lcd_set_cursor(4,3); 1d5b4: 63 e0 ldi r22, 0x03 ; 3 1d5b6: 84 e0 ldi r24, 0x04 ; 4 1d5b8: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_space(16); 1d5bc: 80 e1 ldi r24, 0x10 ; 16 1d5be: 0e 94 0b 70 call 0xe016 ; 0xe016 // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 1d5c2: 0f 94 90 ba call 0x37520 ; 0x37520 : "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" ); 1d5c6: 88 e1 ldi r24, 0x18 ; 24 1d5c8: 98 e2 ldi r25, 0x28 ; 40 1d5ca: 0f b6 in r0, 0x3f ; 63 1d5cc: f8 94 cli 1d5ce: a8 95 wdr 1d5d0: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d5d4: 0f be out 0x3f, r0 ; 63 1d5d6: 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); 1d5da: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d5de: 80 64 ori r24, 0x40 ; 64 1d5e0: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 1d5e4: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1d5e8: 82 60 ori r24, 0x02 ; 2 1d5ea: 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){ 1d5ee: 0f 90 pop r0 1d5f0: 0f 90 pop r0 1d5f2: 1d 3f cpi r17, 0xFD ; 253 1d5f4: 09 f4 brne .+2 ; 0x1d5f8 1d5f6: 64 c3 rjmp .+1736 ; 0x1dcc0 1d5f8: 1f 3f cpi r17, 0xFF ; 255 1d5fa: 11 f4 brne .+4 ; 0x1d600 1d5fc: 0c 94 ab f7 jmp 0x1ef56 ; 0x1ef56 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); 1d600: 20 e0 ldi r18, 0x00 ; 0 1d602: 30 e0 ldi r19, 0x00 ; 0 1d604: a9 01 movw r20, r18 1d606: a0 96 adiw r28, 0x20 ; 32 1d608: ee ad ldd r30, Y+62 ; 0x3e 1d60a: ff ad ldd r31, Y+63 ; 0x3f 1d60c: a0 97 sbiw r28, 0x20 ; 32 1d60e: 61 81 ldd r22, Z+1 ; 0x01 1d610: 72 81 ldd r23, Z+2 ; 0x02 1d612: 83 81 ldd r24, Z+3 ; 0x03 1d614: 94 81 ldd r25, Z+4 ; 0x04 1d616: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 1d61a: 20 91 43 07 lds r18, 0x0743 ; 0x800743 1d61e: 30 91 44 07 lds r19, 0x0744 ; 0x800744 1d622: 40 91 45 07 lds r20, 0x0745 ; 0x800745 1d626: 50 91 46 07 lds r21, 0x0746 ; 0x800746 1d62a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1d62e: a0 96 adiw r28, 0x20 ; 32 1d630: ae ad ldd r26, Y+62 ; 0x3e 1d632: bf ad ldd r27, Y+63 ; 0x3f 1d634: a0 97 sbiw r28, 0x20 ; 32 1d636: 11 96 adiw r26, 0x01 ; 1 1d638: 6d 93 st X+, r22 1d63a: 7d 93 st X+, r23 1d63c: 8d 93 st X+, r24 1d63e: 9c 93 st X, r25 1d640: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 1d642: c0 90 47 07 lds r12, 0x0747 ; 0x800747 1d646: d0 90 48 07 lds r13, 0x0748 ; 0x800748 1d64a: e0 90 49 07 lds r14, 0x0749 ; 0x800749 1d64e: f0 90 4a 07 lds r15, 0x074A ; 0x80074a 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); 1d652: 20 e0 ldi r18, 0x00 ; 0 1d654: 30 e0 ldi r19, 0x00 ; 0 1d656: a9 01 movw r20, r18 1d658: 15 96 adiw r26, 0x05 ; 5 1d65a: 6d 91 ld r22, X+ 1d65c: 7d 91 ld r23, X+ 1d65e: 8d 91 ld r24, X+ 1d660: 9c 91 ld r25, X 1d662: 18 97 sbiw r26, 0x08 ; 8 1d664: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 1d668: a7 01 movw r20, r14 1d66a: 96 01 movw r18, r12 1d66c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1d670: a0 96 adiw r28, 0x20 ; 32 1d672: ee ad ldd r30, Y+62 ; 0x3e 1d674: ff ad ldd r31, Y+63 ; 0x3f 1d676: a0 97 sbiw r28, 0x20 ; 32 1d678: 65 83 std Z+5, r22 ; 0x05 1d67a: 76 83 std Z+6, r23 ; 0x06 1d67c: 87 83 std Z+7, r24 ; 0x07 1d67e: 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) 1d680: 20 e0 ldi r18, 0x00 ; 0 1d682: 30 e0 ldi r19, 0x00 ; 0 1d684: 40 e8 ldi r20, 0x80 ; 128 1d686: 50 ec ldi r21, 0xC0 ; 192 1d688: c7 01 movw r24, r14 1d68a: b6 01 movw r22, r12 1d68c: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1d690: 87 ff sbrs r24, 7 1d692: 0c c0 rjmp .+24 ; 0x1d6ac current_position[Y_AXIS] = Y_MIN_POS; 1d694: 80 e0 ldi r24, 0x00 ; 0 1d696: 90 e0 ldi r25, 0x00 ; 0 1d698: a0 e8 ldi r26, 0x80 ; 128 1d69a: b0 ec ldi r27, 0xC0 ; 192 1d69c: 80 93 47 07 sts 0x0747, r24 ; 0x800747 1d6a0: 90 93 48 07 sts 0x0748, r25 ; 0x800748 1d6a4: a0 93 49 07 sts 0x0749, r26 ; 0x800749 1d6a8: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a // 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; 1d6ac: 20 e0 ldi r18, 0x00 ; 0 1d6ae: 30 e0 ldi r19, 0x00 ; 0 1d6b0: 40 e4 ldi r20, 0x40 ; 64 1d6b2: 50 e4 ldi r21, 0x40 ; 64 1d6b4: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 1d6b8: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 1d6bc: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 1d6c0: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 1d6c4: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1d6c8: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 1d6cc: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 1d6d0: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 1d6d4: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e 1d6d8: e0 96 adiw r28, 0x30 ; 48 1d6da: 2e ad ldd r18, Y+62 ; 0x3e 1d6dc: 3f ad ldd r19, Y+63 ; 0x3f 1d6de: e0 97 sbiw r28, 0x30 ; 48 1d6e0: 28 5f subi r18, 0xF8 ; 248 1d6e2: 3f 4f sbci r19, 0xFF ; 255 1d6e4: e0 96 adiw r28, 0x30 ; 48 1d6e6: 3f af std Y+63, r19 ; 0x3f 1d6e8: 2e af std Y+62, r18 ; 0x3e 1d6ea: e0 97 sbiw r28, 0x30 ; 48 1d6ec: a0 96 adiw r28, 0x20 ; 32 1d6ee: 4e ad ldd r20, Y+62 ; 0x3e 1d6f0: 5f ad ldd r21, Y+63 ; 0x3f 1d6f2: a0 97 sbiw r28, 0x20 ; 32 1d6f4: 48 5f subi r20, 0xF8 ; 248 1d6f6: 5f 4f sbci r21, 0xFF ; 255 1d6f8: a0 96 adiw r28, 0x20 ; 32 1d6fa: 5f af std Y+63, r21 ; 0x3f 1d6fc: 4e af std Y+62, r20 ; 0x3e 1d6fe: 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) { 1d700: 54 e0 ldi r21, 0x04 ; 4 1d702: 25 16 cp r2, r21 1d704: 31 04 cpc r3, r1 1d706: 09 f0 breq .+2 ; 0x1d70a 1d708: 7d cc rjmp .-1798 ; 0x1d004 go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 1d70a: a7 96 adiw r28, 0x27 ; 39 1d70c: 6f ad ldd r22, Y+63 ; 0x3f 1d70e: a7 97 sbiw r28, 0x27 ; 39 1d710: 66 23 and r22, r22 1d712: 31 f0 breq .+12 ; 0x1d720 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) { 1d714: e1 96 adiw r28, 0x31 ; 49 1d716: 8f ad ldd r24, Y+63 ; 0x3f 1d718: e1 97 sbiw r28, 0x31 ; 49 1d71a: 81 30 cpi r24, 0x01 ; 1 1d71c: 09 f0 breq .+2 ; 0x1d720 1d71e: da ce rjmp .-588 ; 0x1d4d4 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 1d720: 8e e0 ldi r24, 0x0E ; 14 1d722: 9f e6 ldi r25, 0x6F ; 111 1d724: 9f 93 push r25 1d726: 8f 93 push r24 1d728: 0f 94 1d dc call 0x3b83a ; 0x3b83a delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 1d72c: 90 e0 ldi r25, 0x00 ; 0 1d72e: 80 e0 ldi r24, 0x00 ; 0 1d730: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 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) { 1d734: 0f 90 pop r0 1d736: 0f 90 pop r0 1d738: 20 e0 ldi r18, 0x00 ; 0 1d73a: 30 e0 ldi r19, 0x00 ; 0 1d73c: 40 e9 ldi r20, 0x90 ; 144 1d73e: 50 ec ldi r21, 0xC0 ; 192 1d740: 60 91 a5 13 lds r22, 0x13A5 ; 0x8013a5 1d744: 70 91 a6 13 lds r23, 0x13A6 ; 0x8013a6 1d748: 80 91 a7 13 lds r24, 0x13A7 ; 0x8013a7 1d74c: 90 91 a8 13 lds r25, 0x13A8 ; 0x8013a8 1d750: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1d754: 87 ff sbrs r24, 7 1d756: bb c2 rjmp .+1398 ; 0x1dcce too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 1d758: 8b e0 ldi r24, 0x0B ; 11 1d75a: 93 e9 ldi r25, 0x93 ; 147 1d75c: 0e 94 86 7b call 0xf70c ; 0xf70c SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 1d760: 89 ed ldi r24, 0xD9 ; 217 1d762: 92 e9 ldi r25, 0x92 ; 146 1d764: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1d768: 60 91 a5 13 lds r22, 0x13A5 ; 0x8013a5 1d76c: 70 91 a6 13 lds r23, 0x13A6 ; 0x8013a6 1d770: 80 91 a7 13 lds r24, 0x13A7 ; 0x8013a7 1d774: 90 91 a8 13 lds r25, 0x13A8 ; 0x8013a8 1d778: 42 e0 ldi r20, 0x02 ; 2 1d77a: 0f 94 e7 d5 call 0x3abce ; 0x3abce MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 1d77e: 85 ed ldi r24, 0xD5 ; 213 1d780: 92 e9 ldi r25, 0x92 ; 146 1d782: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 1d786: 60 e0 ldi r22, 0x00 ; 0 1d788: 70 e0 ldi r23, 0x00 ; 0 1d78a: 80 e9 ldi r24, 0x90 ; 144 1d78c: 90 ec ldi r25, 0xC0 ; 192 1d78e: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e 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 1d792: 92 e0 ldi r25, 0x02 ; 2 1d794: af 96 adiw r28, 0x2f ; 47 1d796: 9f af std Y+63, r25 ; 0x3f 1d798: 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; 1d79a: 10 92 d1 13 sts 0x13D1, r1 ; 0x8013d1 1d79e: 10 92 d2 13 sts 0x13D2, r1 ; 0x8013d2 1d7a2: 10 92 d3 13 sts 0x13D3, r1 ; 0x8013d3 1d7a6: 10 92 d4 13 sts 0x13D4, r1 ; 0x8013d4 cntr[1] = 0.f; 1d7aa: 10 92 d5 13 sts 0x13D5, r1 ; 0x8013d5 1d7ae: 10 92 d6 13 sts 0x13D6, r1 ; 0x8013d6 1d7b2: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 1d7b6: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 1d7ba: a4 e6 ldi r26, 0x64 ; 100 1d7bc: e6 96 adiw r28, 0x36 ; 54 1d7be: af af std Y+63, r26 ; 0x3f 1d7c0: 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; 1d7c2: a2 96 adiw r28, 0x22 ; 34 1d7c4: 1c ae std Y+60, r1 ; 0x3c 1d7c6: 1d ae std Y+61, r1 ; 0x3d 1d7c8: 1e ae std Y+62, r1 ; 0x3e 1d7ca: 1f ae std Y+63, r1 ; 0x3f 1d7cc: 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; 1d7ce: a6 96 adiw r28, 0x26 ; 38 1d7d0: 1c ae std Y+60, r1 ; 0x3c 1d7d2: 1d ae std Y+61, r1 ; 0x3d 1d7d4: 1e ae std Y+62, r1 ; 0x3e 1d7d6: 1f ae std Y+63, r1 ; 0x3f 1d7d8: 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 }; 1d7da: fe 01 movw r30, r28 1d7dc: 31 96 adiw r30, 0x01 ; 1 1d7de: 68 96 adiw r28, 0x18 ; 24 1d7e0: ff af std Y+63, r31 ; 0x3f 1d7e2: ee af std Y+62, r30 ; 0x3e 1d7e4: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 1d7e6: 9e 01 movw r18, r28 1d7e8: 2f 5b subi r18, 0xBF ; 191 1d7ea: 3f 4f sbci r19, 0xFF ; 255 1d7ec: 6a 96 adiw r28, 0x1a ; 26 1d7ee: 3f af std Y+63, r19 ; 0x3f 1d7f0: 2e af std Y+62, r18 ; 0x3e 1d7f2: 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; 1d7f4: a6 96 adiw r28, 0x26 ; 38 1d7f6: 6c ad ldd r22, Y+60 ; 0x3c 1d7f8: 7d ad ldd r23, Y+61 ; 0x3d 1d7fa: 8e ad ldd r24, Y+62 ; 0x3e 1d7fc: 9f ad ldd r25, Y+63 ; 0x3f 1d7fe: a6 97 sbiw r28, 0x26 ; 38 1d800: 0f 94 7d df call 0x3befa ; 0x3befa 1d804: 6e 96 adiw r28, 0x1e ; 30 1d806: 6c af std Y+60, r22 ; 0x3c 1d808: 7d af std Y+61, r23 ; 0x3d 1d80a: 8e af std Y+62, r24 ; 0x3e 1d80c: 9f af std Y+63, r25 ; 0x3f 1d80e: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 1d810: a6 96 adiw r28, 0x26 ; 38 1d812: 6c ad ldd r22, Y+60 ; 0x3c 1d814: 7d ad ldd r23, Y+61 ; 0x3d 1d816: 8e ad ldd r24, Y+62 ; 0x3e 1d818: 9f ad ldd r25, Y+63 ; 0x3f 1d81a: a6 97 sbiw r28, 0x26 ; 38 1d81c: 0f 94 43 e2 call 0x3c486 ; 0x3c486 1d820: cb 57 subi r28, 0x7B ; 123 1d822: df 4f sbci r29, 0xFF ; 255 1d824: 68 83 st Y, r22 1d826: 79 83 std Y+1, r23 ; 0x01 1d828: 8a 83 std Y+2, r24 ; 0x02 1d82a: 9b 83 std Y+3, r25 ; 0x03 1d82c: c5 58 subi r28, 0x85 ; 133 1d82e: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 1d830: a2 96 adiw r28, 0x22 ; 34 1d832: 6c ad ldd r22, Y+60 ; 0x3c 1d834: 7d ad ldd r23, Y+61 ; 0x3d 1d836: 8e ad ldd r24, Y+62 ; 0x3e 1d838: 9f ad ldd r25, Y+63 ; 0x3f 1d83a: a2 97 sbiw r28, 0x22 ; 34 1d83c: 0f 94 7d df call 0x3befa ; 0x3befa 1d840: c7 57 subi r28, 0x77 ; 119 1d842: df 4f sbci r29, 0xFF ; 255 1d844: 68 83 st Y, r22 1d846: 79 83 std Y+1, r23 ; 0x01 1d848: 8a 83 std Y+2, r24 ; 0x02 1d84a: 9b 83 std Y+3, r25 ; 0x03 1d84c: c9 58 subi r28, 0x89 ; 137 1d84e: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 1d850: a2 96 adiw r28, 0x22 ; 34 1d852: 6c ad ldd r22, Y+60 ; 0x3c 1d854: 7d ad ldd r23, Y+61 ; 0x3d 1d856: 8e ad ldd r24, Y+62 ; 0x3e 1d858: 9f ad ldd r25, Y+63 ; 0x3f 1d85a: a2 97 sbiw r28, 0x22 ; 34 1d85c: 0f 94 43 e2 call 0x3c486 ; 0x3c486 1d860: cb 56 subi r28, 0x6B ; 107 1d862: df 4f sbci r29, 0xFF ; 255 1d864: 68 83 st Y, r22 1d866: 79 83 std Y+1, r23 ; 0x01 1d868: 8a 83 std Y+2, r24 ; 0x02 1d86a: 9b 83 std Y+3, r25 ; 0x03 1d86c: c5 59 subi r28, 0x95 ; 149 1d86e: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 1d870: 68 96 adiw r28, 0x18 ; 24 1d872: ae ad ldd r26, Y+62 ; 0x3e 1d874: bf ad ldd r27, Y+63 ; 0x3f 1d876: 68 97 sbiw r28, 0x18 ; 24 1d878: e0 e4 ldi r30, 0x40 ; 64 1d87a: 1d 92 st X+, r1 1d87c: ea 95 dec r30 1d87e: e9 f7 brne .-6 ; 0x1d87a float b[4] = { 0.f }; 1d880: 80 e1 ldi r24, 0x10 ; 16 1d882: 6a 96 adiw r28, 0x1a ; 26 1d884: ae ad ldd r26, Y+62 ; 0x3e 1d886: bf ad ldd r27, Y+63 ; 0x3f 1d888: 6a 97 sbiw r28, 0x1a ; 26 1d88a: 1d 92 st X+, r1 1d88c: 8a 95 dec r24 1d88e: e9 f7 brne .-6 ; 0x1d88a float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 1d890: 90 e0 ldi r25, 0x00 ; 0 1d892: 80 e0 ldi r24, 0x00 ; 0 1d894: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 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); 1d898: 20 91 d1 13 lds r18, 0x13D1 ; 0x8013d1 1d89c: 30 91 d2 13 lds r19, 0x13D2 ; 0x8013d2 1d8a0: 40 91 d3 13 lds r20, 0x13D3 ; 0x8013d3 1d8a4: 50 91 d4 13 lds r21, 0x13D4 ; 0x8013d4 1d8a8: c5 55 subi r28, 0x55 ; 85 1d8aa: df 4f sbci r29, 0xFF ; 255 1d8ac: 28 83 st Y, r18 1d8ae: 39 83 std Y+1, r19 ; 0x01 1d8b0: 4a 83 std Y+2, r20 ; 0x02 1d8b2: 5b 83 std Y+3, r21 ; 0x03 1d8b4: cb 5a subi r28, 0xAB ; 171 1d8b6: 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); 1d8b8: 80 91 d5 13 lds r24, 0x13D5 ; 0x8013d5 1d8bc: 90 91 d6 13 lds r25, 0x13D6 ; 0x8013d6 1d8c0: a0 91 d7 13 lds r26, 0x13D7 ; 0x8013d7 1d8c4: b0 91 d8 13 lds r27, 0x13D8 ; 0x8013d8 1d8c8: c1 55 subi r28, 0x51 ; 81 1d8ca: df 4f sbci r29, 0xFF ; 255 1d8cc: 88 83 st Y, r24 1d8ce: 99 83 std Y+1, r25 ; 0x01 1d8d0: aa 83 std Y+2, r26 ; 0x02 1d8d2: bb 83 std Y+3, r27 ; 0x03 1d8d4: cf 5a subi r28, 0xAF ; 175 1d8d6: d0 40 sbci r29, 0x00 ; 0 1d8d8: de 01 movw r26, r28 1d8da: af 5b subi r26, 0xBF ; 191 1d8dc: bf 4f sbci r27, 0xFF ; 255 1d8de: c7 56 subi r28, 0x67 ; 103 1d8e0: df 4f sbci r29, 0xFF ; 255 1d8e2: b9 83 std Y+1, r27 ; 0x01 1d8e4: a8 83 st Y, r26 1d8e6: c9 59 subi r28, 0x99 ; 153 1d8e8: d0 40 sbci r29, 0x00 ; 0 1d8ea: fe 01 movw r30, r28 1d8ec: 31 96 adiw r30, 0x01 ; 1 1d8ee: ac 96 adiw r28, 0x2c ; 44 1d8f0: ff af std Y+63, r31 ; 0x3f 1d8f2: ee af std Y+62, r30 ; 0x3e 1d8f4: 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) { 1d8f6: 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])); 1d8f8: cb 56 subi r28, 0x6B ; 107 1d8fa: df 4f sbci r29, 0xFF ; 255 1d8fc: 28 81 ld r18, Y 1d8fe: 39 81 ldd r19, Y+1 ; 0x01 1d900: 4a 81 ldd r20, Y+2 ; 0x02 1d902: 5b 81 ldd r21, Y+3 ; 0x03 1d904: c5 59 subi r28, 0x95 ; 149 1d906: d0 40 sbci r29, 0x00 ; 0 1d908: 50 58 subi r21, 0x80 ; 128 1d90a: ed 96 adiw r28, 0x3d ; 61 1d90c: 2c af std Y+60, r18 ; 0x3c 1d90e: 3d af std Y+61, r19 ; 0x3d 1d910: 4e af std Y+62, r20 ; 0x3e 1d912: 5f af std Y+63, r21 ; 0x3f 1d914: 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])); 1d916: c7 57 subi r28, 0x77 ; 119 1d918: df 4f sbci r29, 0xFF ; 255 1d91a: 88 81 ld r24, Y 1d91c: 99 81 ldd r25, Y+1 ; 0x01 1d91e: aa 81 ldd r26, Y+2 ; 0x02 1d920: bb 81 ldd r27, Y+3 ; 0x03 1d922: c9 58 subi r28, 0x89 ; 137 1d924: d0 40 sbci r29, 0x00 ; 0 1d926: b0 58 subi r27, 0x80 ; 128 1d928: c3 58 subi r28, 0x83 ; 131 1d92a: df 4f sbci r29, 0xFF ; 255 1d92c: 88 83 st Y, r24 1d92e: 99 83 std Y+1, r25 ; 0x01 1d930: aa 83 std Y+2, r26 ; 0x02 1d932: bb 83 std Y+3, r27 ; 0x03 1d934: cd 57 subi r28, 0x7D ; 125 1d936: 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]) : 1d938: cb 57 subi r28, 0x7B ; 123 1d93a: df 4f sbci r29, 0xFF ; 255 1d93c: 28 81 ld r18, Y 1d93e: 39 81 ldd r19, Y+1 ; 0x01 1d940: 4a 81 ldd r20, Y+2 ; 0x02 1d942: 5b 81 ldd r21, Y+3 ; 0x03 1d944: c5 58 subi r28, 0x85 ; 133 1d946: d0 40 sbci r29, 0x00 ; 0 1d948: 50 58 subi r21, 0x80 ; 128 1d94a: cf 57 subi r28, 0x7F ; 127 1d94c: df 4f sbci r29, 0xFF ; 255 1d94e: 28 83 st Y, r18 1d950: 39 83 std Y+1, r19 ; 0x01 1d952: 4a 83 std Y+2, r20 ; 0x02 1d954: 5b 83 std Y+3, r21 ; 0x03 1d956: c1 58 subi r28, 0x81 ; 129 1d958: 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) { 1d95a: ac 96 adiw r28, 0x2c ; 44 1d95c: 2e ac ldd r2, Y+62 ; 0x3e 1d95e: 3f ac ldd r3, Y+63 ; 0x3f 1d960: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 1d962: 10 e0 ldi r17, 0x00 ; 0 1d964: 60 ea ldi r22, 0xA0 ; 160 1d966: 46 2e mov r4, r22 1d968: 63 e1 ldi r22, 0x13 ; 19 1d96a: 56 2e mov r5, r22 1d96c: 74 e0 ldi r23, 0x04 ; 4 1d96e: 77 2e mov r7, r23 acc = 0; 1d970: c1 2c mov r12, r1 1d972: d1 2c mov r13, r1 1d974: 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) { 1d976: 01 30 cpi r16, 0x01 ; 1 1d978: 11 f4 brne .+4 ; 0x1d97e 1d97a: 0c 94 63 f8 jmp 0x1f0c6 ; 0x1f0c6 1d97e: 11 30 cpi r17, 0x01 ; 1 1d980: 11 f4 brne .+4 ; 0x1d986 1d982: 0c 94 11 f8 jmp 0x1f022 ; 0x1f022 float a = (r == 0) ? 1.f : 1d986: 00 23 and r16, r16 1d988: 11 f4 brne .+4 ; 0x1d98e 1d98a: 0c 94 51 f8 jmp 0x1f0a2 ; 0x1f0a2 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1d98e: 02 30 cpi r16, 0x02 ; 2 1d990: 09 f0 breq .+2 ; 0x1d994 1d992: a1 c1 rjmp .+834 ; 0x1dcd6 1d994: d2 01 movw r26, r4 1d996: 11 96 adiw r26, 0x01 ; 1 1d998: 2d 91 ld r18, X+ 1d99a: 3d 91 ld r19, X+ 1d99c: 4d 91 ld r20, X+ 1d99e: 5c 91 ld r21, X 1d9a0: 14 97 sbiw r26, 0x04 ; 4 1d9a2: cf 57 subi r28, 0x7F ; 127 1d9a4: df 4f sbci r29, 0xFF ; 255 1d9a6: 68 81 ld r22, Y 1d9a8: 79 81 ldd r23, Y+1 ; 0x01 1d9aa: 8a 81 ldd r24, Y+2 ; 0x02 1d9ac: 9b 81 ldd r25, Y+3 ; 0x03 1d9ae: c1 58 subi r28, 0x81 ; 129 1d9b0: d0 40 sbci r29, 0x00 ; 0 1d9b2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1d9b6: 4b 01 movw r8, r22 1d9b8: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1d9ba: 11 11 cpse r17, r1 1d9bc: 9a c1 rjmp .+820 ; 0x1dcf2 1d9be: 60 e0 ldi r22, 0x00 ; 0 1d9c0: 70 e0 ldi r23, 0x00 ; 0 1d9c2: 80 e8 ldi r24, 0x80 ; 128 1d9c4: 9f e3 ldi r25, 0x3F ; 63 1d9c6: aa c1 rjmp .+852 ; 0x1dd1c int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 1d9c8: 2f 3f cpi r18, 0xFF ; 255 1d9ca: 09 f0 breq .+2 ; 0x1d9ce 1d9cc: f8 cc rjmp .-1552 ; 0x1d3be ++maxs; 1d9ce: 01 96 adiw r24, 0x01 ; 1 1d9d0: f6 cc rjmp .-1556 ; 0x1d3be 1d9d2: ae 01 movw r20, r28 1d9d4: 4f 5f subi r20, 0xFF ; 255 1d9d6: 5f 4f sbci r21, 0xFF ; 255 1d9d8: be 01 movw r22, r28 1d9da: 6f 5b subi r22, 0xBF ; 191 1d9dc: 7f 4f sbci r23, 0xFF ; 255 1d9de: 8e e8 ldi r24, 0x8E ; 142 1d9e0: 9b e0 ldi r25, 0x0B ; 11 1d9e2: 0f 94 8c 90 call 0x32118 ; 0x32118 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; 1d9e6: 66 96 adiw r28, 0x16 ; 22 1d9e8: 6f ad ldd r22, Y+63 ; 0x3f 1d9ea: 66 97 sbiw r28, 0x16 ; 22 row = r08; 1d9ec: 62 96 adiw r28, 0x12 ; 18 1d9ee: 1f ad ldd r17, Y+63 ; 0x3f 1d9f0: 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){ 1d9f2: 80 17 cp r24, r16 1d9f4: 28 f0 brcs .+10 ; 0x1da00 col = c08; row = r08; return match08; } col = c10; 1d9f6: 22 96 adiw r28, 0x02 ; 2 1d9f8: 6f ad ldd r22, Y+63 ; 0x3f 1d9fa: 22 97 sbiw r28, 0x02 ; 2 row = r10; 1d9fc: 19 81 ldd r17, Y+1 ; 0x01 1d9fe: 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){ 1da00: 08 35 cpi r16, 0x58 ; 88 1da02: 08 f4 brcc .+2 ; 0x1da06 1da04: 5b c1 rjmp .+694 ; 0x1dcbc /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 1da06: 70 e0 ldi r23, 0x00 ; 0 1da08: 90 e0 ldi r25, 0x00 ; 0 1da0a: 80 e0 ldi r24, 0x00 ; 0 1da0c: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1da10: 20 e0 ldi r18, 0x00 ; 0 1da12: 30 e0 ldi r19, 0x00 ; 0 1da14: 40 eb ldi r20, 0xB0 ; 176 1da16: 50 e4 ldi r21, 0x40 ; 64 1da18: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1da1c: 2b 01 movw r4, r22 1da1e: 3c 01 movw r6, r24 1da20: 65 96 adiw r28, 0x15 ; 21 1da22: 4c ae std Y+60, r4 ; 0x3c 1da24: 5d ae std Y+61, r5 ; 0x3d 1da26: 6e ae std Y+62, r6 ; 0x3e 1da28: 7f ae std Y+63, r7 ; 0x3f 1da2a: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 1da2c: 61 2f mov r22, r17 1da2e: 70 e0 ldi r23, 0x00 ; 0 1da30: 90 e0 ldi r25, 0x00 ; 0 1da32: 80 e0 ldi r24, 0x00 ; 0 1da34: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1da38: 20 e0 ldi r18, 0x00 ; 0 1da3a: 30 e0 ldi r19, 0x00 ; 0 1da3c: 40 eb ldi r20, 0xB0 ; 176 1da3e: 50 e4 ldi r21, 0x40 ; 64 1da40: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1da44: 4b 01 movw r8, r22 1da46: 5c 01 movw r10, r24 1da48: 25 96 adiw r28, 0x05 ; 5 1da4a: 8c ae std Y+60, r8 ; 0x3c 1da4c: 9d ae std Y+61, r9 ; 0x3d 1da4e: ae ae std Y+62, r10 ; 0x3e 1da50: bf ae std Y+63, r11 ; 0x3f 1da52: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 1da54: 20 e0 ldi r18, 0x00 ; 0 1da56: 30 e0 ldi r19, 0x00 ; 0 1da58: 40 e9 ldi r20, 0x90 ; 144 1da5a: 50 e4 ldi r21, 0x40 ; 64 1da5c: 29 83 std Y+1, r18 ; 0x01 1da5e: 3a 83 std Y+2, r19 ; 0x02 1da60: 4b 83 std Y+3, r20 ; 0x03 1da62: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 1da64: ae 01 movw r20, r28 1da66: 4f 5f subi r20, 0xFF ; 255 1da68: 5f 4f sbci r21, 0xFF ; 255 1da6a: be 01 movw r22, r28 1da6c: 6f 5b subi r22, 0xBF ; 191 1da6e: 7f 4f sbci r23, 0xFF ; 255 1da70: ce 01 movw r24, r28 1da72: 8f 5a subi r24, 0xAF ; 175 1da74: 9f 4f sbci r25, 0xFF ; 255 1da76: 0f 94 41 8d call 0x31a82 ; 0x31a82 if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 1da7a: a3 01 movw r20, r6 1da7c: 92 01 movw r18, r4 1da7e: 65 96 adiw r28, 0x15 ; 21 1da80: 6c ad ldd r22, Y+60 ; 0x3c 1da82: 7d ad ldd r23, Y+61 ; 0x3d 1da84: 8e ad ldd r24, Y+62 ; 0x3e 1da86: 9f ad ldd r25, Y+63 ; 0x3f 1da88: 65 97 sbiw r28, 0x15 ; 21 1da8a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1da8e: 6b 01 movw r12, r22 1da90: 7c 01 movw r14, r24 1da92: 9f 77 andi r25, 0x7F ; 127 1da94: 20 e0 ldi r18, 0x00 ; 0 1da96: 30 e0 ldi r19, 0x00 ; 0 1da98: 40 e4 ldi r20, 0x40 ; 64 1da9a: 50 e4 ldi r21, 0x40 ; 64 1da9c: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1daa0: 18 16 cp r1, r24 1daa2: 34 f1 brlt .+76 ; 0x1daf0 1daa4: a5 01 movw r20, r10 1daa6: 94 01 movw r18, r8 1daa8: 25 96 adiw r28, 0x05 ; 5 1daaa: 6c ad ldd r22, Y+60 ; 0x3c 1daac: 7d ad ldd r23, Y+61 ; 0x3d 1daae: 8e ad ldd r24, Y+62 ; 0x3e 1dab0: 9f ad ldd r25, Y+63 ; 0x3f 1dab2: 25 97 sbiw r28, 0x05 ; 5 1dab4: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1dab8: 9f 77 andi r25, 0x7F ; 127 1daba: 20 e0 ldi r18, 0x00 ; 0 1dabc: 30 e0 ldi r19, 0x00 ; 0 1dabe: 40 e4 ldi r20, 0x40 ; 64 1dac0: 50 e4 ldi r21, 0x40 ; 64 1dac2: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1dac6: 18 16 cp r1, r24 1dac8: 9c f0 brlt .+38 ; 0x1daf0 1daca: 20 e0 ldi r18, 0x00 ; 0 1dacc: 30 e0 ldi r19, 0x00 ; 0 1dace: 40 ea ldi r20, 0xA0 ; 160 1dad0: 50 e4 ldi r21, 0x40 ; 64 1dad2: 69 81 ldd r22, Y+1 ; 0x01 1dad4: 7a 81 ldd r23, Y+2 ; 0x02 1dad6: 8b 81 ldd r24, Y+3 ; 0x03 1dad8: 9c 81 ldd r25, Y+4 ; 0x04 1dada: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1dade: 9f 77 andi r25, 0x7F ; 127 1dae0: 20 e0 ldi r18, 0x00 ; 0 1dae2: 30 e0 ldi r19, 0x00 ; 0 1dae4: 40 e4 ldi r20, 0x40 ; 64 1dae6: 50 e4 ldi r21, 0x40 ; 64 1dae8: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1daec: 18 16 cp r1, r24 1daee: bc f5 brge .+110 ; 0x1db5e //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 1daf0: 20 e0 ldi r18, 0x00 ; 0 1daf2: 30 e0 ldi r19, 0x00 ; 0 1daf4: 40 ea ldi r20, 0xA0 ; 160 1daf6: 50 e4 ldi r21, 0x40 ; 64 1daf8: 69 81 ldd r22, Y+1 ; 0x01 1dafa: 7a 81 ldd r23, Y+2 ; 0x02 1dafc: 8b 81 ldd r24, Y+3 ; 0x03 1dafe: 9c 81 ldd r25, Y+4 ; 0x04 1db00: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1db04: 9f 93 push r25 1db06: 8f 93 push r24 1db08: 7f 93 push r23 1db0a: 6f 93 push r22 1db0c: a5 01 movw r20, r10 1db0e: 94 01 movw r18, r8 1db10: 25 96 adiw r28, 0x05 ; 5 1db12: 6c ad ldd r22, Y+60 ; 0x3c 1db14: 7d ad ldd r23, Y+61 ; 0x3d 1db16: 8e ad ldd r24, Y+62 ; 0x3e 1db18: 9f ad ldd r25, Y+63 ; 0x3f 1db1a: 25 97 sbiw r28, 0x05 ; 5 1db1c: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1db20: 9f 93 push r25 1db22: 8f 93 push r24 1db24: 7f 93 push r23 1db26: 6f 93 push r22 1db28: ff 92 push r15 1db2a: ef 92 push r14 1db2c: df 92 push r13 1db2e: cf 92 push r12 1db30: 83 e7 ldi r24, 0x73 ; 115 1db32: 92 e9 ldi r25, 0x92 ; 146 1db34: 9f 93 push r25 1db36: 8f 93 push r24 1db38: 0f 94 1d dc call 0x3b83a ; 0x3b83a /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 1db3c: 65 96 adiw r28, 0x15 ; 21 1db3e: 4c ae std Y+60, r4 ; 0x3c 1db40: 5d ae std Y+61, r5 ; 0x3d 1db42: 6e ae std Y+62, r6 ; 0x3e 1db44: 7f ae std Y+63, r7 ; 0x3f 1db46: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 1db48: 25 96 adiw r28, 0x05 ; 5 1db4a: 8c ae std Y+60, r8 ; 0x3c 1db4c: 9d ae std Y+61, r9 ; 0x3d 1db4e: ae ae std Y+62, r10 ; 0x3e 1db50: bf ae std Y+63, r11 ; 0x3f 1db52: 25 97 sbiw r28, 0x05 ; 5 1db54: 0f b6 in r0, 0x3f ; 63 1db56: f8 94 cli 1db58: de bf out 0x3e, r29 ; 62 1db5a: 0f be out 0x3f, r0 ; 63 1db5c: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 1db5e: 20 e0 ldi r18, 0x00 ; 0 1db60: 30 e0 ldi r19, 0x00 ; 0 1db62: 48 e7 ldi r20, 0x78 ; 120 1db64: 51 e4 ldi r21, 0x41 ; 65 1db66: 65 96 adiw r28, 0x15 ; 21 1db68: 6c ad ldd r22, Y+60 ; 0x3c 1db6a: 7d ad ldd r23, Y+61 ; 0x3d 1db6c: 8e ad ldd r24, Y+62 ; 0x3e 1db6e: 9f ad ldd r25, Y+63 ; 0x3f 1db70: 65 97 sbiw r28, 0x15 ; 21 1db72: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1db76: 20 e0 ldi r18, 0x00 ; 0 1db78: 30 e0 ldi r19, 0x00 ; 0 1db7a: 40 e8 ldi r20, 0x80 ; 128 1db7c: 52 e4 ldi r21, 0x42 ; 66 1db7e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1db82: 6b 01 movw r12, r22 1db84: 7c 01 movw r14, r24 1db86: 6c 96 adiw r28, 0x1c ; 28 1db88: ae ad ldd r26, Y+62 ; 0x3e 1db8a: bf ad ldd r27, Y+63 ; 0x3f 1db8c: 6c 97 sbiw r28, 0x1c ; 28 1db8e: bd 01 movw r22, r26 1db90: bb 0f add r27, r27 1db92: 88 0b sbc r24, r24 1db94: 99 0b sbc r25, r25 1db96: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1db9a: 9b 01 movw r18, r22 1db9c: ac 01 movw r20, r24 1db9e: c7 01 movw r24, r14 1dba0: b6 01 movw r22, r12 1dba2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1dba6: 6b 01 movw r12, r22 1dba8: 7c 01 movw r14, r24 1dbaa: 65 96 adiw r28, 0x15 ; 21 1dbac: cc ae std Y+60, r12 ; 0x3c 1dbae: dd ae std Y+61, r13 ; 0x3d 1dbb0: ee ae std Y+62, r14 ; 0x3e 1dbb2: ff ae std Y+63, r15 ; 0x3f 1dbb4: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 1dbb6: 20 e0 ldi r18, 0x00 ; 0 1dbb8: 30 e0 ldi r19, 0x00 ; 0 1dbba: 48 e7 ldi r20, 0x78 ; 120 1dbbc: 51 e4 ldi r21, 0x41 ; 65 1dbbe: 25 96 adiw r28, 0x05 ; 5 1dbc0: 6c ad ldd r22, Y+60 ; 0x3c 1dbc2: 7d ad ldd r23, Y+61 ; 0x3d 1dbc4: 8e ad ldd r24, Y+62 ; 0x3e 1dbc6: 9f ad ldd r25, Y+63 ; 0x3f 1dbc8: 25 97 sbiw r28, 0x05 ; 5 1dbca: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1dbce: 20 e0 ldi r18, 0x00 ; 0 1dbd0: 30 e0 ldi r19, 0x00 ; 0 1dbd2: 40 e8 ldi r20, 0x80 ; 128 1dbd4: 52 e4 ldi r21, 0x42 ; 66 1dbd6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1dbda: 4b 01 movw r8, r22 1dbdc: 5c 01 movw r10, r24 1dbde: ac 96 adiw r28, 0x2c ; 44 1dbe0: ee ad ldd r30, Y+62 ; 0x3e 1dbe2: ff ad ldd r31, Y+63 ; 0x3f 1dbe4: ac 97 sbiw r28, 0x2c ; 44 1dbe6: bf 01 movw r22, r30 1dbe8: ff 0f add r31, r31 1dbea: 88 0b sbc r24, r24 1dbec: 99 0b sbc r25, r25 1dbee: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 1dbf2: 9b 01 movw r18, r22 1dbf4: ac 01 movw r20, r24 1dbf6: c5 01 movw r24, r10 1dbf8: b4 01 movw r22, r8 1dbfa: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1dbfe: 25 96 adiw r28, 0x05 ; 5 1dc00: 6c af std Y+60, r22 ; 0x3c 1dc02: 7d af std Y+61, r23 ; 0x3d 1dc04: 8e af std Y+62, r24 ; 0x3e 1dc06: 9f af std Y+63, r25 ; 0x3f 1dc08: 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; 1dc0a: 2a e0 ldi r18, 0x0A ; 10 1dc0c: 37 ed ldi r19, 0xD7 ; 215 1dc0e: 43 e2 ldi r20, 0x23 ; 35 1dc10: 5c e3 ldi r21, 0x3C ; 60 1dc12: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__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)); 1dc16: 9f 93 push r25 1dc18: 8f 93 push r24 1dc1a: 7f 93 push r23 1dc1c: 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; 1dc1e: 2a e0 ldi r18, 0x0A ; 10 1dc20: 37 ed ldi r19, 0xD7 ; 215 1dc22: 43 e2 ldi r20, 0x23 ; 35 1dc24: 5c e3 ldi r21, 0x3C ; 60 1dc26: c7 01 movw r24, r14 1dc28: b6 01 movw r22, r12 1dc2a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__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)); 1dc2e: 9f 93 push r25 1dc30: 8f 93 push r24 1dc32: 7f 93 push r23 1dc34: 6f 93 push r22 1dc36: 87 e5 ldi r24, 0x57 ; 87 1dc38: 92 e9 ldi r25, 0x92 ; 146 1dc3a: 9f 93 push r25 1dc3c: 8f 93 push r24 1dc3e: 0f 94 1d dc call 0x3b83a ; 0x3b83a uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 1dc42: 20 e0 ldi r18, 0x00 ; 0 1dc44: 30 e0 ldi r19, 0x00 ; 0 1dc46: 40 e0 ldi r20, 0x00 ; 0 1dc48: 5f e3 ldi r21, 0x3F ; 63 1dc4a: 25 96 adiw r28, 0x05 ; 5 1dc4c: 6c ad ldd r22, Y+60 ; 0x3c 1dc4e: 7d ad ldd r23, Y+61 ; 0x3d 1dc50: 8e ad ldd r24, Y+62 ; 0x3e 1dc52: 9f ad ldd r25, Y+63 ; 0x3f 1dc54: 25 97 sbiw r28, 0x05 ; 5 1dc56: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1dc5a: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 1dc5e: 6b 01 movw r12, r22 1dc60: 20 e0 ldi r18, 0x00 ; 0 1dc62: 30 e0 ldi r19, 0x00 ; 0 1dc64: 40 e0 ldi r20, 0x00 ; 0 1dc66: 5f e3 ldi r21, 0x3F ; 63 1dc68: 65 96 adiw r28, 0x15 ; 21 1dc6a: 6c ad ldd r22, Y+60 ; 0x3c 1dc6c: 7d ad ldd r23, Y+61 ; 0x3d 1dc6e: 8e ad ldd r24, Y+62 ; 0x3e 1dc70: 9f ad ldd r25, Y+63 ; 0x3f 1dc72: 65 97 sbiw r28, 0x15 ; 21 1dc74: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1dc78: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 1dc7c: 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); 1dc7e: 00 e0 ldi r16, 0x00 ; 0 1dc80: 28 ec ldi r18, 0xC8 ; 200 1dc82: 30 e0 ldi r19, 0x00 ; 0 1dc84: e7 96 adiw r28, 0x37 ; 55 1dc86: 4e ad ldd r20, Y+62 ; 0x3e 1dc88: 5f ad ldd r21, Y+63 ; 0x3f 1dc8a: e7 97 sbiw r28, 0x37 ; 55 1dc8c: b6 01 movw r22, r12 1dc8e: 0e 94 17 e1 call 0x1c22e ; 0x1c22e 1dc92: 0f b6 in r0, 0x3f ; 63 1dc94: f8 94 cli 1dc96: de bf out 0x3e, r29 ; 62 1dc98: 0f be out 0x3f, r0 ; 63 1dc9a: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 1dc9c: 10 e0 ldi r17, 0x00 ; 0 1dc9e: 86 e5 ldi r24, 0x56 ; 86 1dca0: 9e e0 ldi r25, 0x0E ; 14 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 1dca2: a4 96 adiw r28, 0x24 ; 36 1dca4: ae ad ldd r26, Y+62 ; 0x3e 1dca6: bf ad ldd r27, Y+63 ; 0x3f 1dca8: a4 97 sbiw r28, 0x24 ; 36 1dcaa: 1d 92 st X+, r1 1dcac: a4 96 adiw r28, 0x24 ; 36 1dcae: bf af std Y+63, r27 ; 0x3f 1dcb0: ae af std Y+62, r26 ; 0x3e 1dcb2: 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++) 1dcb4: 8a 17 cp r24, r26 1dcb6: 9b 07 cpc r25, r27 1dcb8: a1 f7 brne .-24 ; 0x1dca2 1dcba: 76 cc rjmp .-1812 ; 0x1d5a8 /// 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; 1dcbc: 1f ef ldi r17, 0xFF ; 255 1dcbe: ef cf rjmp .-34 ; 0x1dc9e 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; 1dcc0: e5 96 adiw r28, 0x35 ; 53 1dcc2: bf ad ldd r27, Y+63 ; 0x3f 1dcc4: e5 97 sbiw r28, 0x35 ; 53 1dcc6: a7 96 adiw r28, 0x27 ; 39 1dcc8: bf af std Y+63, r27 ; 0x3f 1dcca: a7 97 sbiw r28, 0x27 ; 39 1dccc: 99 cc rjmp .-1742 ; 0x1d600 // 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; 1dcce: af 96 adiw r28, 0x2f ; 47 1dcd0: 1f ae std Y+63, r1 ; 0x3f 1dcd2: af 97 sbiw r28, 0x2f ; 47 1dcd4: 62 cd rjmp .-1340 ; 0x1d79a 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]) : 1dcd6: f2 01 movw r30, r4 1dcd8: 25 81 ldd r18, Z+5 ; 0x05 1dcda: 36 81 ldd r19, Z+6 ; 0x06 1dcdc: 47 81 ldd r20, Z+7 ; 0x07 1dcde: 50 85 ldd r21, Z+8 ; 0x08 1dce0: c3 58 subi r28, 0x83 ; 131 1dce2: df 4f sbci r29, 0xFF ; 255 1dce4: 68 81 ld r22, Y 1dce6: 79 81 ldd r23, Y+1 ; 0x01 1dce8: 8a 81 ldd r24, Y+2 ; 0x02 1dcea: 9b 81 ldd r25, Y+3 ; 0x03 1dcec: cd 57 subi r28, 0x7D ; 125 1dcee: d0 40 sbci r29, 0x00 ; 0 1dcf0: 60 ce rjmp .-832 ; 0x1d9b2 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 1dcf2: 12 30 cpi r17, 0x02 ; 2 1dcf4: 11 f0 breq .+4 ; 0x1dcfa 1dcf6: 0c 94 52 f7 jmp 0x1eea4 ; 0x1eea4 1dcfa: d2 01 movw r26, r4 1dcfc: 11 96 adiw r26, 0x01 ; 1 1dcfe: 2d 91 ld r18, X+ 1dd00: 3d 91 ld r19, X+ 1dd02: 4d 91 ld r20, X+ 1dd04: 5c 91 ld r21, X 1dd06: 14 97 sbiw r26, 0x04 ; 4 1dd08: cf 57 subi r28, 0x7F ; 127 1dd0a: df 4f sbci r29, 0xFF ; 255 1dd0c: 68 81 ld r22, Y 1dd0e: 79 81 ldd r23, Y+1 ; 0x01 1dd10: 8a 81 ldd r24, Y+2 ; 0x02 1dd12: 9b 81 ldd r25, Y+3 ; 0x03 1dd14: c1 58 subi r28, 0x81 ; 129 1dd16: d0 40 sbci r29, 0x00 ; 0 1dd18: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 1dd1c: 9b 01 movw r18, r22 1dd1e: ac 01 movw r20, r24 1dd20: c5 01 movw r24, r10 1dd22: b4 01 movw r22, r8 1dd24: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1dd28: 9b 01 movw r18, r22 1dd2a: ac 01 movw r20, r24 1dd2c: c7 01 movw r24, r14 1dd2e: b6 01 movw r22, r12 1dd30: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1dd34: 6b 01 movw r12, r22 1dd36: 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) { 1dd38: 01 11 cpse r16, r1 1dd3a: 0c 94 5f f8 jmp 0x1f0be ; 0x1f0be 1dd3e: 7a 94 dec r7 1dd40: f8 e0 ldi r31, 0x08 ; 8 1dd42: 4f 0e add r4, r31 1dd44: 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) { 1dd46: 71 10 cpse r7, r1 1dd48: 16 ce rjmp .-980 ; 0x1d976 (-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; 1dd4a: d1 01 movw r26, r2 1dd4c: cd 92 st X+, r12 1dd4e: dd 92 st X+, r13 1dd50: ed 92 st X+, r14 1dd52: fd 92 st X+, r15 1dd54: 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) { 1dd56: 1f 5f subi r17, 0xFF ; 255 1dd58: 14 30 cpi r17, 0x04 ; 4 1dd5a: 09 f0 breq .+2 ; 0x1dd5e 1dd5c: 03 ce rjmp .-1018 ; 0x1d964 1dd5e: 3c e0 ldi r19, 0x0C ; 12 1dd60: 23 2e mov r2, r19 1dd62: 33 e9 ldi r19, 0x93 ; 147 1dd64: 33 2e mov r3, r19 1dd66: e0 ea ldi r30, 0xA0 ; 160 1dd68: f3 e1 ldi r31, 0x13 ; 19 1dd6a: a8 96 adiw r28, 0x28 ; 40 1dd6c: ff af std Y+63, r31 ; 0x3f 1dd6e: ee af std Y+62, r30 ; 0x3e 1dd70: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 1dd72: c3 57 subi r28, 0x73 ; 115 1dd74: df 4f sbci r29, 0xFF ; 255 1dd76: 18 82 st Y, r1 1dd78: cd 58 subi r28, 0x8D ; 141 1dd7a: d0 40 sbci r29, 0x00 ; 0 1dd7c: c3 56 subi r28, 0x63 ; 99 1dd7e: df 4f sbci r29, 0xFF ; 255 1dd80: 18 82 st Y, r1 1dd82: cd 59 subi r28, 0x9D ; 157 1dd84: d0 40 sbci r29, 0x00 ; 0 1dd86: cf 55 subi r28, 0x5F ; 95 1dd88: df 4f sbci r29, 0xFF ; 255 1dd8a: 18 82 st Y, r1 1dd8c: c1 5a subi r28, 0xA1 ; 161 1dd8e: d0 40 sbci r29, 0x00 ; 0 1dd90: 10 e0 ldi r17, 0x00 ; 0 1dd92: a8 96 adiw r28, 0x28 ; 40 1dd94: ae ad ldd r26, Y+62 ; 0x3e 1dd96: bf ad ldd r27, Y+63 ; 0x3f 1dd98: a8 97 sbiw r28, 0x28 ; 40 1dd9a: 11 96 adiw r26, 0x01 ; 1 1dd9c: 2d 91 ld r18, X+ 1dd9e: 3d 91 ld r19, X+ 1dda0: 4d 91 ld r20, X+ 1dda2: 5c 91 ld r21, X 1dda4: 14 97 sbiw r26, 0x04 ; 4 1dda6: e4 96 adiw r28, 0x34 ; 52 1dda8: 2c af std Y+60, r18 ; 0x3c 1ddaa: 3d af std Y+61, r19 ; 0x3d 1ddac: 4e af std Y+62, r20 ; 0x3e 1ddae: 5f af std Y+63, r21 ; 0x3f 1ddb0: e4 97 sbiw r28, 0x34 ; 52 1ddb2: 15 96 adiw r26, 0x05 ; 5 1ddb4: 4d 90 ld r4, X+ 1ddb6: 5d 90 ld r5, X+ 1ddb8: 6d 90 ld r6, X+ 1ddba: 7c 90 ld r7, X 1ddbc: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1ddbe: 00 23 and r16, r16 1ddc0: 11 f4 brne .+4 ; 0x1ddc6 1ddc2: 0c 94 85 f7 jmp 0x1ef0a ; 0x1ef0a ((r == 1) ? 0.f : 1ddc6: 81 2c mov r8, r1 1ddc8: 91 2c mov r9, r1 1ddca: 54 01 movw r10, r8 1ddcc: 01 30 cpi r16, 0x01 ; 1 1ddce: 81 f0 breq .+32 ; 0x1ddf0 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1ddd0: 02 30 cpi r16, 0x02 ; 2 1ddd2: 11 f0 breq .+4 ; 0x1ddd8 1ddd4: 0c 94 79 f7 jmp 0x1eef2 ; 0x1eef2 1ddd8: cf 57 subi r28, 0x7F ; 127 1ddda: df 4f sbci r29, 0xFF ; 255 1dddc: 68 81 ld r22, Y 1ddde: 79 81 ldd r23, Y+1 ; 0x01 1dde0: 8a 81 ldd r24, Y+2 ; 0x02 1dde2: 9b 81 ldd r25, Y+3 ; 0x03 1dde4: c1 58 subi r28, 0x81 ; 129 1dde6: d0 40 sbci r29, 0x00 ; 0 1dde8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1ddec: 4b 01 movw r8, r22 1ddee: 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); 1ddf0: e4 96 adiw r28, 0x34 ; 52 1ddf2: 2c ad ldd r18, Y+60 ; 0x3c 1ddf4: 3d ad ldd r19, Y+61 ; 0x3d 1ddf6: 4e ad ldd r20, Y+62 ; 0x3e 1ddf8: 5f ad ldd r21, Y+63 ; 0x3f 1ddfa: e4 97 sbiw r28, 0x34 ; 52 1ddfc: 6e 96 adiw r28, 0x1e ; 30 1ddfe: 6c ad ldd r22, Y+60 ; 0x3c 1de00: 7d ad ldd r23, Y+61 ; 0x3d 1de02: 8e ad ldd r24, Y+62 ; 0x3e 1de04: 9f ad ldd r25, Y+63 ; 0x3f 1de06: 6e 97 sbiw r28, 0x1e ; 30 1de08: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1de0c: 6b 01 movw r12, r22 1de0e: 7c 01 movw r14, r24 1de10: f1 01 movw r30, r2 1de12: 25 91 lpm r18, Z+ 1de14: 35 91 lpm r19, Z+ 1de16: 45 91 lpm r20, Z+ 1de18: 54 91 lpm r21, Z 1de1a: cb 55 subi r28, 0x5B ; 91 1de1c: df 4f sbci r29, 0xFF ; 255 1de1e: 28 83 st Y, r18 1de20: 39 83 std Y+1, r19 ; 0x01 1de22: 4a 83 std Y+2, r20 ; 0x02 1de24: 5b 83 std Y+3, r21 ; 0x03 1de26: c5 5a subi r28, 0xA5 ; 165 1de28: d0 40 sbci r29, 0x00 ; 0 1de2a: a3 01 movw r20, r6 1de2c: 92 01 movw r18, r4 1de2e: cb 56 subi r28, 0x6B ; 107 1de30: df 4f sbci r29, 0xFF ; 255 1de32: 68 81 ld r22, Y 1de34: 79 81 ldd r23, Y+1 ; 0x01 1de36: 8a 81 ldd r24, Y+2 ; 0x02 1de38: 9b 81 ldd r25, Y+3 ; 0x03 1de3a: c5 59 subi r28, 0x95 ; 149 1de3c: d0 40 sbci r29, 0x00 ; 0 1de3e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1de42: 9b 01 movw r18, r22 1de44: ac 01 movw r20, r24 1de46: c7 01 movw r24, r14 1de48: b6 01 movw r22, r12 1de4a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1de4e: c5 55 subi r28, 0x55 ; 85 1de50: df 4f sbci r29, 0xFF ; 255 1de52: 28 81 ld r18, Y 1de54: 39 81 ldd r19, Y+1 ; 0x01 1de56: 4a 81 ldd r20, Y+2 ; 0x02 1de58: 5b 81 ldd r21, Y+3 ; 0x03 1de5a: cb 5a subi r28, 0xAB ; 171 1de5c: d0 40 sbci r29, 0x00 ; 0 1de5e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1de62: cb 55 subi r28, 0x5B ; 91 1de64: df 4f sbci r29, 0xFF ; 255 1de66: 28 81 ld r18, Y 1de68: 39 81 ldd r19, Y+1 ; 0x01 1de6a: 4a 81 ldd r20, Y+2 ; 0x02 1de6c: 5b 81 ldd r21, Y+3 ; 0x03 1de6e: c5 5a subi r28, 0xA5 ; 165 1de70: d0 40 sbci r29, 0x00 ; 0 1de72: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 1de76: a5 01 movw r20, r10 1de78: 94 01 movw r18, r8 1de7a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1de7e: c3 57 subi r28, 0x73 ; 115 1de80: df 4f sbci r29, 0xFF ; 255 1de82: 28 81 ld r18, Y 1de84: cd 58 subi r28, 0x8D ; 141 1de86: d0 40 sbci r29, 0x00 ; 0 1de88: c3 56 subi r28, 0x63 ; 99 1de8a: df 4f sbci r29, 0xFF ; 255 1de8c: 38 81 ld r19, Y 1de8e: cd 59 subi r28, 0x9D ; 157 1de90: d0 40 sbci r29, 0x00 ; 0 1de92: cf 55 subi r28, 0x5F ; 95 1de94: df 4f sbci r29, 0xFF ; 255 1de96: 48 81 ld r20, Y 1de98: c1 5a subi r28, 0xA1 ; 161 1de9a: d0 40 sbci r29, 0x00 ; 0 1de9c: 51 2f mov r21, r17 1de9e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1dea2: c3 57 subi r28, 0x73 ; 115 1dea4: df 4f sbci r29, 0xFF ; 255 1dea6: 68 83 st Y, r22 1dea8: 79 83 std Y+1, r23 ; 0x01 1deaa: 8a 83 std Y+2, r24 ; 0x02 1deac: 9b 83 std Y+3, r25 ; 0x03 1deae: cd 58 subi r28, 0x8D ; 141 1deb0: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 1deb2: 00 23 and r16, r16 1deb4: 11 f4 brne .+4 ; 0x1deba 1deb6: 0c 94 8d f7 jmp 0x1ef1a ; 0x1ef1a ((r == 1) ? 1.f : 1deba: 01 30 cpi r16, 0x01 ; 1 1debc: 11 f4 brne .+4 ; 0x1dec2 1debe: 0c 94 92 f7 jmp 0x1ef24 ; 0x1ef24 ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1dec2: 02 30 cpi r16, 0x02 ; 2 1dec4: 61 f0 breq .+24 ; 0x1dede 1dec6: a3 01 movw r20, r6 1dec8: 92 01 movw r18, r4 1deca: ed 96 adiw r28, 0x3d ; 61 1decc: 6c ad ldd r22, Y+60 ; 0x3c 1dece: 7d ad ldd r23, Y+61 ; 0x3d 1ded0: 8e ad ldd r24, Y+62 ; 0x3e 1ded2: 9f ad ldd r25, Y+63 ; 0x3f 1ded4: ed 97 sbiw r28, 0x3d ; 61 1ded6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1deda: 6b 01 movw r12, r22 1dedc: 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); 1dede: f1 01 movw r30, r2 1dee0: 34 96 adiw r30, 0x04 ; 4 1dee2: 85 90 lpm r8, Z+ 1dee4: 95 90 lpm r9, Z+ 1dee6: a5 90 lpm r10, Z+ 1dee8: b4 90 lpm r11, Z 1deea: e4 96 adiw r28, 0x34 ; 52 1deec: 2c ad ldd r18, Y+60 ; 0x3c 1deee: 3d ad ldd r19, Y+61 ; 0x3d 1def0: 4e ad ldd r20, Y+62 ; 0x3e 1def2: 5f ad ldd r21, Y+63 ; 0x3f 1def4: e4 97 sbiw r28, 0x34 ; 52 1def6: cb 57 subi r28, 0x7B ; 123 1def8: df 4f sbci r29, 0xFF ; 255 1defa: 68 81 ld r22, Y 1defc: 79 81 ldd r23, Y+1 ; 0x01 1defe: 8a 81 ldd r24, Y+2 ; 0x02 1df00: 9b 81 ldd r25, Y+3 ; 0x03 1df02: c5 58 subi r28, 0x85 ; 133 1df04: d0 40 sbci r29, 0x00 ; 0 1df06: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1df0a: e4 96 adiw r28, 0x34 ; 52 1df0c: 6c af std Y+60, r22 ; 0x3c 1df0e: 7d af std Y+61, r23 ; 0x3d 1df10: 8e af std Y+62, r24 ; 0x3e 1df12: 9f af std Y+63, r25 ; 0x3f 1df14: e4 97 sbiw r28, 0x34 ; 52 1df16: a3 01 movw r20, r6 1df18: 92 01 movw r18, r4 1df1a: c7 57 subi r28, 0x77 ; 119 1df1c: df 4f sbci r29, 0xFF ; 255 1df1e: 68 81 ld r22, Y 1df20: 79 81 ldd r23, Y+1 ; 0x01 1df22: 8a 81 ldd r24, Y+2 ; 0x02 1df24: 9b 81 ldd r25, Y+3 ; 0x03 1df26: c9 58 subi r28, 0x89 ; 137 1df28: d0 40 sbci r29, 0x00 ; 0 1df2a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1df2e: 9b 01 movw r18, r22 1df30: ac 01 movw r20, r24 1df32: e4 96 adiw r28, 0x34 ; 52 1df34: 6c ad ldd r22, Y+60 ; 0x3c 1df36: 7d ad ldd r23, Y+61 ; 0x3d 1df38: 8e ad ldd r24, Y+62 ; 0x3e 1df3a: 9f ad ldd r25, Y+63 ; 0x3f 1df3c: e4 97 sbiw r28, 0x34 ; 52 1df3e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1df42: c1 55 subi r28, 0x51 ; 81 1df44: df 4f sbci r29, 0xFF ; 255 1df46: 28 81 ld r18, Y 1df48: 39 81 ldd r19, Y+1 ; 0x01 1df4a: 4a 81 ldd r20, Y+2 ; 0x02 1df4c: 5b 81 ldd r21, Y+3 ; 0x03 1df4e: cf 5a subi r28, 0xAF ; 175 1df50: d0 40 sbci r29, 0x00 ; 0 1df52: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1df56: a5 01 movw r20, r10 1df58: 94 01 movw r18, r8 1df5a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 1df5e: a7 01 movw r20, r14 1df60: 96 01 movw r18, r12 1df62: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1df66: c3 57 subi r28, 0x73 ; 115 1df68: df 4f sbci r29, 0xFF ; 255 1df6a: 28 81 ld r18, Y 1df6c: 39 81 ldd r19, Y+1 ; 0x01 1df6e: 4a 81 ldd r20, Y+2 ; 0x02 1df70: 5b 81 ldd r21, Y+3 ; 0x03 1df72: cd 58 subi r28, 0x8D ; 141 1df74: d0 40 sbci r29, 0x00 ; 0 1df76: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1df7a: c3 57 subi r28, 0x73 ; 115 1df7c: df 4f sbci r29, 0xFF ; 255 1df7e: 68 83 st Y, r22 1df80: cd 58 subi r28, 0x8D ; 141 1df82: d0 40 sbci r29, 0x00 ; 0 1df84: c3 56 subi r28, 0x63 ; 99 1df86: df 4f sbci r29, 0xFF ; 255 1df88: 78 83 st Y, r23 1df8a: cd 59 subi r28, 0x9D ; 157 1df8c: d0 40 sbci r29, 0x00 ; 0 1df8e: cf 55 subi r28, 0x5F ; 95 1df90: df 4f sbci r29, 0xFF ; 255 1df92: 88 83 st Y, r24 1df94: c1 5a subi r28, 0xA1 ; 161 1df96: d0 40 sbci r29, 0x00 ; 0 1df98: 19 2f mov r17, r25 1df9a: a8 96 adiw r28, 0x28 ; 40 1df9c: 4e ad ldd r20, Y+62 ; 0x3e 1df9e: 5f ad ldd r21, Y+63 ; 0x3f 1dfa0: a8 97 sbiw r28, 0x28 ; 40 1dfa2: 48 5f subi r20, 0xF8 ; 248 1dfa4: 5f 4f sbci r21, 0xFF ; 255 1dfa6: a8 96 adiw r28, 0x28 ; 40 1dfa8: 5f af std Y+63, r21 ; 0x3f 1dfaa: 4e af std Y+62, r20 ; 0x3e 1dfac: a8 97 sbiw r28, 0x28 ; 40 1dfae: 58 e0 ldi r21, 0x08 ; 8 1dfb0: 25 0e add r2, r21 1dfb2: 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) { 1dfb4: a0 ec ldi r26, 0xC0 ; 192 1dfb6: b3 e1 ldi r27, 0x13 ; 19 1dfb8: a8 96 adiw r28, 0x28 ; 40 1dfba: ee ad ldd r30, Y+62 ; 0x3e 1dfbc: ff ad ldd r31, Y+63 ; 0x3f 1dfbe: a8 97 sbiw r28, 0x28 ; 40 1dfc0: ae 17 cp r26, r30 1dfc2: bf 07 cpc r27, r31 1dfc4: 09 f0 breq .+2 ; 0x1dfc8 1dfc6: e5 ce rjmp .-566 ; 0x1dd92 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; 1dfc8: 90 58 subi r25, 0x80 ; 128 1dfca: c7 56 subi r28, 0x67 ; 103 1dfcc: df 4f sbci r29, 0xFF ; 255 1dfce: a8 81 ld r26, Y 1dfd0: b9 81 ldd r27, Y+1 ; 0x01 1dfd2: c9 59 subi r28, 0x99 ; 153 1dfd4: d0 40 sbci r29, 0x00 ; 0 1dfd6: 6d 93 st X+, r22 1dfd8: 7d 93 st X+, r23 1dfda: 8d 93 st X+, r24 1dfdc: 9d 93 st X+, r25 1dfde: c7 56 subi r28, 0x67 ; 103 1dfe0: df 4f sbci r29, 0xFF ; 255 1dfe2: b9 83 std Y+1, r27 ; 0x01 1dfe4: a8 83 st Y, r26 1dfe6: c9 59 subi r28, 0x99 ; 153 1dfe8: 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) { 1dfea: 0f 5f subi r16, 0xFF ; 255 1dfec: ac 96 adiw r28, 0x2c ; 44 1dfee: ee ad ldd r30, Y+62 ; 0x3e 1dff0: ff ad ldd r31, Y+63 ; 0x3f 1dff2: ac 97 sbiw r28, 0x2c ; 44 1dff4: 70 96 adiw r30, 0x10 ; 16 1dff6: ac 96 adiw r28, 0x2c ; 44 1dff8: ff af std Y+63, r31 ; 0x3f 1dffa: ee af std Y+62, r30 ; 0x3e 1dffc: ac 97 sbiw r28, 0x2c ; 44 1dffe: 04 30 cpi r16, 0x04 ; 4 1e000: 09 f0 breq .+2 ; 0x1e004 1e002: ab cc rjmp .-1706 ; 0x1d95a } // 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]; 1e004: 25 96 adiw r28, 0x05 ; 5 1e006: 2c ad ldd r18, Y+60 ; 0x3c 1e008: 3d ad ldd r19, Y+61 ; 0x3d 1e00a: 4e ad ldd r20, Y+62 ; 0x3e 1e00c: 5f ad ldd r21, Y+63 ; 0x3f 1e00e: 25 97 sbiw r28, 0x05 ; 5 1e010: ae 96 adiw r28, 0x2e ; 46 1e012: 2c af std Y+60, r18 ; 0x3c 1e014: 3d af std Y+61, r19 ; 0x3d 1e016: 4e af std Y+62, r20 ; 0x3e 1e018: 5f af std Y+63, r21 ; 0x3f 1e01a: ae 97 sbiw r28, 0x2e ; 46 1e01c: 8d 81 ldd r24, Y+5 ; 0x05 1e01e: 9e 81 ldd r25, Y+6 ; 0x06 1e020: af 81 ldd r26, Y+7 ; 0x07 1e022: b8 85 ldd r27, Y+8 ; 0x08 1e024: e4 96 adiw r28, 0x34 ; 52 1e026: 8c af std Y+60, r24 ; 0x3c 1e028: 9d af std Y+61, r25 ; 0x3d 1e02a: ae af std Y+62, r26 ; 0x3e 1e02c: bf af std Y+63, r27 ; 0x3f 1e02e: e4 97 sbiw r28, 0x34 ; 52 1e030: 29 85 ldd r18, Y+9 ; 0x09 1e032: 3a 85 ldd r19, Y+10 ; 0x0a 1e034: 4b 85 ldd r20, Y+11 ; 0x0b 1e036: 5c 85 ldd r21, Y+12 ; 0x0c 1e038: ed 96 adiw r28, 0x3d ; 61 1e03a: 2c af std Y+60, r18 ; 0x3c 1e03c: 3d af std Y+61, r19 ; 0x3d 1e03e: 4e af std Y+62, r20 ; 0x3e 1e040: 5f af std Y+63, r21 ; 0x3f 1e042: ed 97 sbiw r28, 0x3d ; 61 1e044: 8d 85 ldd r24, Y+13 ; 0x0d 1e046: 9e 85 ldd r25, Y+14 ; 0x0e 1e048: af 85 ldd r26, Y+15 ; 0x0f 1e04a: b8 89 ldd r27, Y+16 ; 0x10 1e04c: c3 58 subi r28, 0x83 ; 131 1e04e: df 4f sbci r29, 0xFF ; 255 1e050: 88 83 st Y, r24 1e052: 99 83 std Y+1, r25 ; 0x01 1e054: aa 83 std Y+2, r26 ; 0x02 1e056: bb 83 std Y+3, r27 ; 0x03 1e058: cd 57 subi r28, 0x7D ; 125 1e05a: d0 40 sbci r29, 0x00 ; 0 1e05c: 29 81 ldd r18, Y+1 ; 0x01 1e05e: 3a 81 ldd r19, Y+2 ; 0x02 1e060: 4b 81 ldd r20, Y+3 ; 0x03 1e062: 5c 81 ldd r21, Y+4 ; 0x04 1e064: cf 57 subi r28, 0x7F ; 127 1e066: df 4f sbci r29, 0xFF ; 255 1e068: 28 83 st Y, r18 1e06a: 39 83 std Y+1, r19 ; 0x01 1e06c: 4a 83 std Y+2, r20 ; 0x02 1e06e: 5b 83 std Y+3, r21 ; 0x03 1e070: c1 58 subi r28, 0x81 ; 129 1e072: 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]; 1e074: 29 96 adiw r28, 0x09 ; 9 1e076: 8c ad ldd r24, Y+60 ; 0x3c 1e078: 9d ad ldd r25, Y+61 ; 0x3d 1e07a: ae ad ldd r26, Y+62 ; 0x3e 1e07c: bf ad ldd r27, Y+63 ; 0x3f 1e07e: 29 97 sbiw r28, 0x09 ; 9 1e080: cb 57 subi r28, 0x7B ; 123 1e082: df 4f sbci r29, 0xFF ; 255 1e084: 88 83 st Y, r24 1e086: 99 83 std Y+1, r25 ; 0x01 1e088: aa 83 std Y+2, r26 ; 0x02 1e08a: bb 83 std Y+3, r27 ; 0x03 1e08c: c5 58 subi r28, 0x85 ; 133 1e08e: d0 40 sbci r29, 0x00 ; 0 1e090: 29 89 ldd r18, Y+17 ; 0x11 1e092: 3a 89 ldd r19, Y+18 ; 0x12 1e094: 4b 89 ldd r20, Y+19 ; 0x13 1e096: 5c 89 ldd r21, Y+20 ; 0x14 1e098: c7 57 subi r28, 0x77 ; 119 1e09a: df 4f sbci r29, 0xFF ; 255 1e09c: 28 83 st Y, r18 1e09e: 39 83 std Y+1, r19 ; 0x01 1e0a0: 4a 83 std Y+2, r20 ; 0x02 1e0a2: 5b 83 std Y+3, r21 ; 0x03 1e0a4: c9 58 subi r28, 0x89 ; 137 1e0a6: d0 40 sbci r29, 0x00 ; 0 1e0a8: 89 8d ldd r24, Y+25 ; 0x19 1e0aa: 9a 8d ldd r25, Y+26 ; 0x1a 1e0ac: ab 8d ldd r26, Y+27 ; 0x1b 1e0ae: bc 8d ldd r27, Y+28 ; 0x1c 1e0b0: cb 56 subi r28, 0x6B ; 107 1e0b2: df 4f sbci r29, 0xFF ; 255 1e0b4: 88 83 st Y, r24 1e0b6: 99 83 std Y+1, r25 ; 0x01 1e0b8: aa 83 std Y+2, r26 ; 0x02 1e0ba: bb 83 std Y+3, r27 ; 0x03 1e0bc: c5 59 subi r28, 0x95 ; 149 1e0be: d0 40 sbci r29, 0x00 ; 0 1e0c0: 2d 8d ldd r18, Y+29 ; 0x1d 1e0c2: 3e 8d ldd r19, Y+30 ; 0x1e 1e0c4: 4f 8d ldd r20, Y+31 ; 0x1f 1e0c6: 58 a1 ldd r21, Y+32 ; 0x20 1e0c8: c7 56 subi r28, 0x67 ; 103 1e0ca: df 4f sbci r29, 0xFF ; 255 1e0cc: 28 83 st Y, r18 1e0ce: 39 83 std Y+1, r19 ; 0x01 1e0d0: 4a 83 std Y+2, r20 ; 0x02 1e0d2: 5b 83 std Y+3, r21 ; 0x03 1e0d4: c9 59 subi r28, 0x99 ; 153 1e0d6: d0 40 sbci r29, 0x00 ; 0 1e0d8: 8d 89 ldd r24, Y+21 ; 0x15 1e0da: 9e 89 ldd r25, Y+22 ; 0x16 1e0dc: af 89 ldd r26, Y+23 ; 0x17 1e0de: b8 8d ldd r27, Y+24 ; 0x18 1e0e0: c3 57 subi r28, 0x73 ; 115 1e0e2: df 4f sbci r29, 0xFF ; 255 1e0e4: 88 83 st Y, r24 1e0e6: 99 83 std Y+1, r25 ; 0x01 1e0e8: aa 83 std Y+2, r26 ; 0x02 1e0ea: bb 83 std Y+3, r27 ; 0x03 1e0ec: cd 58 subi r28, 0x8D ; 141 1e0ee: 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]; 1e0f0: 2d 96 adiw r28, 0x0d ; 13 1e0f2: 2c ad ldd r18, Y+60 ; 0x3c 1e0f4: 3d ad ldd r19, Y+61 ; 0x3d 1e0f6: 4e ad ldd r20, Y+62 ; 0x3e 1e0f8: 5f ad ldd r21, Y+63 ; 0x3f 1e0fa: 2d 97 sbiw r28, 0x0d ; 13 1e0fc: c3 56 subi r28, 0x63 ; 99 1e0fe: df 4f sbci r29, 0xFF ; 255 1e100: 28 83 st Y, r18 1e102: 39 83 std Y+1, r19 ; 0x01 1e104: 4a 83 std Y+2, r20 ; 0x02 1e106: 5b 83 std Y+3, r21 ; 0x03 1e108: cd 59 subi r28, 0x9D ; 157 1e10a: d0 40 sbci r29, 0x00 ; 0 1e10c: 89 a1 ldd r24, Y+33 ; 0x21 1e10e: 9a a1 ldd r25, Y+34 ; 0x22 1e110: ab a1 ldd r26, Y+35 ; 0x23 1e112: bc a1 ldd r27, Y+36 ; 0x24 1e114: cf 55 subi r28, 0x5F ; 95 1e116: df 4f sbci r29, 0xFF ; 255 1e118: 88 83 st Y, r24 1e11a: 99 83 std Y+1, r25 ; 0x01 1e11c: aa 83 std Y+2, r26 ; 0x02 1e11e: bb 83 std Y+3, r27 ; 0x03 1e120: c1 5a subi r28, 0xA1 ; 161 1e122: d0 40 sbci r29, 0x00 ; 0 1e124: 2d a1 ldd r18, Y+37 ; 0x25 1e126: 3e a1 ldd r19, Y+38 ; 0x26 1e128: 4f a1 ldd r20, Y+39 ; 0x27 1e12a: 58 a5 ldd r21, Y+40 ; 0x28 1e12c: cb 55 subi r28, 0x5B ; 91 1e12e: df 4f sbci r29, 0xFF ; 255 1e130: 28 83 st Y, r18 1e132: 39 83 std Y+1, r19 ; 0x01 1e134: 4a 83 std Y+2, r20 ; 0x02 1e136: 5b 83 std Y+3, r21 ; 0x03 1e138: c5 5a subi r28, 0xA5 ; 165 1e13a: d0 40 sbci r29, 0x00 ; 0 1e13c: 8d a5 ldd r24, Y+45 ; 0x2d 1e13e: 9e a5 ldd r25, Y+46 ; 0x2e 1e140: af a5 ldd r26, Y+47 ; 0x2f 1e142: b8 a9 ldd r27, Y+48 ; 0x30 1e144: cd 54 subi r28, 0x4D ; 77 1e146: df 4f sbci r29, 0xFF ; 255 1e148: 88 83 st Y, r24 1e14a: 99 83 std Y+1, r25 ; 0x01 1e14c: aa 83 std Y+2, r26 ; 0x02 1e14e: bb 83 std Y+3, r27 ; 0x03 1e150: c3 5b subi r28, 0xB3 ; 179 1e152: d0 40 sbci r29, 0x00 ; 0 1e154: 29 a5 ldd r18, Y+41 ; 0x29 1e156: 3a a5 ldd r19, Y+42 ; 0x2a 1e158: 4b a5 ldd r20, Y+43 ; 0x2b 1e15a: 5c a5 ldd r21, Y+44 ; 0x2c 1e15c: c9 54 subi r28, 0x49 ; 73 1e15e: df 4f sbci r29, 0xFF ; 255 1e160: 28 83 st Y, r18 1e162: 39 83 std Y+1, r19 ; 0x01 1e164: 4a 83 std Y+2, r20 ; 0x02 1e166: 5b 83 std Y+3, r21 ; 0x03 1e168: c7 5b subi r28, 0xB7 ; 183 1e16a: 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]; 1e16c: 61 96 adiw r28, 0x11 ; 17 1e16e: 8c ad ldd r24, Y+60 ; 0x3c 1e170: 9d ad ldd r25, Y+61 ; 0x3d 1e172: ae ad ldd r26, Y+62 ; 0x3e 1e174: bf ad ldd r27, Y+63 ; 0x3f 1e176: 61 97 sbiw r28, 0x11 ; 17 1e178: c5 54 subi r28, 0x45 ; 69 1e17a: df 4f sbci r29, 0xFF ; 255 1e17c: 88 83 st Y, r24 1e17e: 99 83 std Y+1, r25 ; 0x01 1e180: aa 83 std Y+2, r26 ; 0x02 1e182: bb 83 std Y+3, r27 ; 0x03 1e184: cb 5b subi r28, 0xBB ; 187 1e186: d0 40 sbci r29, 0x00 ; 0 1e188: 29 a9 ldd r18, Y+49 ; 0x31 1e18a: 3a a9 ldd r19, Y+50 ; 0x32 1e18c: 4b a9 ldd r20, Y+51 ; 0x33 1e18e: 5c a9 ldd r21, Y+52 ; 0x34 1e190: c1 54 subi r28, 0x41 ; 65 1e192: df 4f sbci r29, 0xFF ; 255 1e194: 28 83 st Y, r18 1e196: 39 83 std Y+1, r19 ; 0x01 1e198: 4a 83 std Y+2, r20 ; 0x02 1e19a: 5b 83 std Y+3, r21 ; 0x03 1e19c: cf 5b subi r28, 0xBF ; 191 1e19e: d0 40 sbci r29, 0x00 ; 0 1e1a0: 8d a9 ldd r24, Y+53 ; 0x35 1e1a2: 9e a9 ldd r25, Y+54 ; 0x36 1e1a4: af a9 ldd r26, Y+55 ; 0x37 1e1a6: b8 ad ldd r27, Y+56 ; 0x38 1e1a8: cd 53 subi r28, 0x3D ; 61 1e1aa: df 4f sbci r29, 0xFF ; 255 1e1ac: 88 83 st Y, r24 1e1ae: 99 83 std Y+1, r25 ; 0x01 1e1b0: aa 83 std Y+2, r26 ; 0x02 1e1b2: bb 83 std Y+3, r27 ; 0x03 1e1b4: c3 5c subi r28, 0xC3 ; 195 1e1b6: d0 40 sbci r29, 0x00 ; 0 1e1b8: 29 ad ldd r18, Y+57 ; 0x39 1e1ba: 3a ad ldd r19, Y+58 ; 0x3a 1e1bc: 4b ad ldd r20, Y+59 ; 0x3b 1e1be: 5c ad ldd r21, Y+60 ; 0x3c 1e1c0: c9 53 subi r28, 0x39 ; 57 1e1c2: df 4f sbci r29, 0xFF ; 255 1e1c4: 28 83 st Y, r18 1e1c6: 39 83 std Y+1, r19 ; 0x01 1e1c8: 4a 83 std Y+2, r20 ; 0x02 1e1ca: 5b 83 std Y+3, r21 ; 0x03 1e1cc: c7 5c subi r28, 0xC7 ; 199 1e1ce: d0 40 sbci r29, 0x00 ; 0 1e1d0: 21 96 adiw r28, 0x01 ; 1 1e1d2: 8c ad ldd r24, Y+60 ; 0x3c 1e1d4: 9d ad ldd r25, Y+61 ; 0x3d 1e1d6: ae ad ldd r26, Y+62 ; 0x3e 1e1d8: bf ad ldd r27, Y+63 ; 0x3f 1e1da: 21 97 sbiw r28, 0x01 ; 1 1e1dc: c5 53 subi r28, 0x35 ; 53 1e1de: df 4f sbci r29, 0xFF ; 255 1e1e0: 88 83 st Y, r24 1e1e2: 99 83 std Y+1, r25 ; 0x01 1e1e4: aa 83 std Y+2, r26 ; 0x02 1e1e6: bb 83 std Y+3, r27 ; 0x03 1e1e8: cb 5c subi r28, 0xCB ; 203 1e1ea: d0 40 sbci r29, 0x00 ; 0 1e1ec: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 1e1ee: c1 2c mov r12, r1 1e1f0: d1 2c mov r13, r1 1e1f2: 76 01 movw r14, r12 1e1f4: 46 01 movw r8, r12 1e1f6: 57 01 movw r10, r14 1e1f8: 26 01 movw r4, r12 1e1fa: 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]; 1e1fc: a3 01 movw r20, r6 1e1fe: 92 01 movw r18, r4 1e200: e4 96 adiw r28, 0x34 ; 52 1e202: 6c ad ldd r22, Y+60 ; 0x3c 1e204: 7d ad ldd r23, Y+61 ; 0x3d 1e206: 8e ad ldd r24, Y+62 ; 0x3e 1e208: 9f ad ldd r25, Y+63 ; 0x3f 1e20a: e4 97 sbiw r28, 0x34 ; 52 1e20c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e210: 9b 01 movw r18, r22 1e212: ac 01 movw r20, r24 1e214: ae 96 adiw r28, 0x2e ; 46 1e216: 6c ad ldd r22, Y+60 ; 0x3c 1e218: 7d ad ldd r23, Y+61 ; 0x3d 1e21a: 8e ad ldd r24, Y+62 ; 0x3e 1e21c: 9f ad ldd r25, Y+63 ; 0x3f 1e21e: ae 97 sbiw r28, 0x2e ; 46 1e220: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e224: 2b 01 movw r4, r22 1e226: 3c 01 movw r6, r24 1e228: a5 01 movw r20, r10 1e22a: 94 01 movw r18, r8 1e22c: ed 96 adiw r28, 0x3d ; 61 1e22e: 6c ad ldd r22, Y+60 ; 0x3c 1e230: 7d ad ldd r23, Y+61 ; 0x3d 1e232: 8e ad ldd r24, Y+62 ; 0x3e 1e234: 9f ad ldd r25, Y+63 ; 0x3f 1e236: ed 97 sbiw r28, 0x3d ; 61 1e238: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e23c: 9b 01 movw r18, r22 1e23e: ac 01 movw r20, r24 1e240: c3 01 movw r24, r6 1e242: b2 01 movw r22, r4 1e244: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e248: 2b 01 movw r4, r22 1e24a: 3c 01 movw r6, r24 1e24c: a7 01 movw r20, r14 1e24e: 96 01 movw r18, r12 1e250: c3 58 subi r28, 0x83 ; 131 1e252: df 4f sbci r29, 0xFF ; 255 1e254: 68 81 ld r22, Y 1e256: 79 81 ldd r23, Y+1 ; 0x01 1e258: 8a 81 ldd r24, Y+2 ; 0x02 1e25a: 9b 81 ldd r25, Y+3 ; 0x03 1e25c: cd 57 subi r28, 0x7D ; 125 1e25e: d0 40 sbci r29, 0x00 ; 0 1e260: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e264: 9b 01 movw r18, r22 1e266: ac 01 movw r20, r24 1e268: c3 01 movw r24, r6 1e26a: b2 01 movw r22, r4 1e26c: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e270: cf 57 subi r28, 0x7F ; 127 1e272: df 4f sbci r29, 0xFF ; 255 1e274: 28 81 ld r18, Y 1e276: 39 81 ldd r19, Y+1 ; 0x01 1e278: 4a 81 ldd r20, Y+2 ; 0x02 1e27a: 5b 81 ldd r21, Y+3 ; 0x03 1e27c: c1 58 subi r28, 0x81 ; 129 1e27e: d0 40 sbci r29, 0x00 ; 0 1e280: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1e284: 6e 96 adiw r28, 0x1e ; 30 1e286: 6c af std Y+60, r22 ; 0x3c 1e288: 7d af std Y+61, r23 ; 0x3d 1e28a: 8e af std Y+62, r24 ; 0x3e 1e28c: 9f af std Y+63, r25 ; 0x3f 1e28e: 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]; 1e290: c7 57 subi r28, 0x77 ; 119 1e292: df 4f sbci r29, 0xFF ; 255 1e294: 28 81 ld r18, Y 1e296: 39 81 ldd r19, Y+1 ; 0x01 1e298: 4a 81 ldd r20, Y+2 ; 0x02 1e29a: 5b 81 ldd r21, Y+3 ; 0x03 1e29c: c9 58 subi r28, 0x89 ; 137 1e29e: d0 40 sbci r29, 0x00 ; 0 1e2a0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e2a4: 9b 01 movw r18, r22 1e2a6: ac 01 movw r20, r24 1e2a8: cb 57 subi r28, 0x7B ; 123 1e2aa: df 4f sbci r29, 0xFF ; 255 1e2ac: 68 81 ld r22, Y 1e2ae: 79 81 ldd r23, Y+1 ; 0x01 1e2b0: 8a 81 ldd r24, Y+2 ; 0x02 1e2b2: 9b 81 ldd r25, Y+3 ; 0x03 1e2b4: c5 58 subi r28, 0x85 ; 133 1e2b6: d0 40 sbci r29, 0x00 ; 0 1e2b8: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e2bc: 2b 01 movw r4, r22 1e2be: 3c 01 movw r6, r24 1e2c0: a5 01 movw r20, r10 1e2c2: 94 01 movw r18, r8 1e2c4: cb 56 subi r28, 0x6B ; 107 1e2c6: df 4f sbci r29, 0xFF ; 255 1e2c8: 68 81 ld r22, Y 1e2ca: 79 81 ldd r23, Y+1 ; 0x01 1e2cc: 8a 81 ldd r24, Y+2 ; 0x02 1e2ce: 9b 81 ldd r25, Y+3 ; 0x03 1e2d0: c5 59 subi r28, 0x95 ; 149 1e2d2: d0 40 sbci r29, 0x00 ; 0 1e2d4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e2d8: 9b 01 movw r18, r22 1e2da: ac 01 movw r20, r24 1e2dc: c3 01 movw r24, r6 1e2de: b2 01 movw r22, r4 1e2e0: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e2e4: 4b 01 movw r8, r22 1e2e6: 5c 01 movw r10, r24 1e2e8: a7 01 movw r20, r14 1e2ea: 96 01 movw r18, r12 1e2ec: c7 56 subi r28, 0x67 ; 103 1e2ee: df 4f sbci r29, 0xFF ; 255 1e2f0: 68 81 ld r22, Y 1e2f2: 79 81 ldd r23, Y+1 ; 0x01 1e2f4: 8a 81 ldd r24, Y+2 ; 0x02 1e2f6: 9b 81 ldd r25, Y+3 ; 0x03 1e2f8: c9 59 subi r28, 0x99 ; 153 1e2fa: d0 40 sbci r29, 0x00 ; 0 1e2fc: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e300: 9b 01 movw r18, r22 1e302: ac 01 movw r20, r24 1e304: c5 01 movw r24, r10 1e306: b4 01 movw r22, r8 1e308: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e30c: c3 57 subi r28, 0x73 ; 115 1e30e: df 4f sbci r29, 0xFF ; 255 1e310: 28 81 ld r18, Y 1e312: 39 81 ldd r19, Y+1 ; 0x01 1e314: 4a 81 ldd r20, Y+2 ; 0x02 1e316: 5b 81 ldd r21, Y+3 ; 0x03 1e318: cd 58 subi r28, 0x8D ; 141 1e31a: d0 40 sbci r29, 0x00 ; 0 1e31c: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1e320: 2b 01 movw r4, r22 1e322: 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]; 1e324: cf 55 subi r28, 0x5F ; 95 1e326: df 4f sbci r29, 0xFF ; 255 1e328: 28 81 ld r18, Y 1e32a: 39 81 ldd r19, Y+1 ; 0x01 1e32c: 4a 81 ldd r20, Y+2 ; 0x02 1e32e: 5b 81 ldd r21, Y+3 ; 0x03 1e330: c1 5a subi r28, 0xA1 ; 161 1e332: d0 40 sbci r29, 0x00 ; 0 1e334: 6e 96 adiw r28, 0x1e ; 30 1e336: 6c ad ldd r22, Y+60 ; 0x3c 1e338: 7d ad ldd r23, Y+61 ; 0x3d 1e33a: 8e ad ldd r24, Y+62 ; 0x3e 1e33c: 9f ad ldd r25, Y+63 ; 0x3f 1e33e: 6e 97 sbiw r28, 0x1e ; 30 1e340: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e344: 9b 01 movw r18, r22 1e346: ac 01 movw r20, r24 1e348: c3 56 subi r28, 0x63 ; 99 1e34a: df 4f sbci r29, 0xFF ; 255 1e34c: 68 81 ld r22, Y 1e34e: 79 81 ldd r23, Y+1 ; 0x01 1e350: 8a 81 ldd r24, Y+2 ; 0x02 1e352: 9b 81 ldd r25, Y+3 ; 0x03 1e354: cd 59 subi r28, 0x9D ; 157 1e356: d0 40 sbci r29, 0x00 ; 0 1e358: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e35c: 4b 01 movw r8, r22 1e35e: 5c 01 movw r10, r24 1e360: cb 55 subi r28, 0x5B ; 91 1e362: df 4f sbci r29, 0xFF ; 255 1e364: 28 81 ld r18, Y 1e366: 39 81 ldd r19, Y+1 ; 0x01 1e368: 4a 81 ldd r20, Y+2 ; 0x02 1e36a: 5b 81 ldd r21, Y+3 ; 0x03 1e36c: c5 5a subi r28, 0xA5 ; 165 1e36e: d0 40 sbci r29, 0x00 ; 0 1e370: c3 01 movw r24, r6 1e372: b2 01 movw r22, r4 1e374: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e378: 9b 01 movw r18, r22 1e37a: ac 01 movw r20, r24 1e37c: c5 01 movw r24, r10 1e37e: b4 01 movw r22, r8 1e380: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e384: 4b 01 movw r8, r22 1e386: 5c 01 movw r10, r24 1e388: a7 01 movw r20, r14 1e38a: 96 01 movw r18, r12 1e38c: cd 54 subi r28, 0x4D ; 77 1e38e: df 4f sbci r29, 0xFF ; 255 1e390: 68 81 ld r22, Y 1e392: 79 81 ldd r23, Y+1 ; 0x01 1e394: 8a 81 ldd r24, Y+2 ; 0x02 1e396: 9b 81 ldd r25, Y+3 ; 0x03 1e398: c3 5b subi r28, 0xB3 ; 179 1e39a: d0 40 sbci r29, 0x00 ; 0 1e39c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e3a0: 9b 01 movw r18, r22 1e3a2: ac 01 movw r20, r24 1e3a4: c5 01 movw r24, r10 1e3a6: b4 01 movw r22, r8 1e3a8: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e3ac: c9 54 subi r28, 0x49 ; 73 1e3ae: df 4f sbci r29, 0xFF ; 255 1e3b0: 28 81 ld r18, Y 1e3b2: 39 81 ldd r19, Y+1 ; 0x01 1e3b4: 4a 81 ldd r20, Y+2 ; 0x02 1e3b6: 5b 81 ldd r21, Y+3 ; 0x03 1e3b8: c7 5b subi r28, 0xB7 ; 183 1e3ba: d0 40 sbci r29, 0x00 ; 0 1e3bc: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1e3c0: 4b 01 movw r8, r22 1e3c2: 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]; 1e3c4: c1 54 subi r28, 0x41 ; 65 1e3c6: df 4f sbci r29, 0xFF ; 255 1e3c8: 28 81 ld r18, Y 1e3ca: 39 81 ldd r19, Y+1 ; 0x01 1e3cc: 4a 81 ldd r20, Y+2 ; 0x02 1e3ce: 5b 81 ldd r21, Y+3 ; 0x03 1e3d0: cf 5b subi r28, 0xBF ; 191 1e3d2: d0 40 sbci r29, 0x00 ; 0 1e3d4: 6e 96 adiw r28, 0x1e ; 30 1e3d6: 6c ad ldd r22, Y+60 ; 0x3c 1e3d8: 7d ad ldd r23, Y+61 ; 0x3d 1e3da: 8e ad ldd r24, Y+62 ; 0x3e 1e3dc: 9f ad ldd r25, Y+63 ; 0x3f 1e3de: 6e 97 sbiw r28, 0x1e ; 30 1e3e0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e3e4: 9b 01 movw r18, r22 1e3e6: ac 01 movw r20, r24 1e3e8: c5 54 subi r28, 0x45 ; 69 1e3ea: df 4f sbci r29, 0xFF ; 255 1e3ec: 68 81 ld r22, Y 1e3ee: 79 81 ldd r23, Y+1 ; 0x01 1e3f0: 8a 81 ldd r24, Y+2 ; 0x02 1e3f2: 9b 81 ldd r25, Y+3 ; 0x03 1e3f4: cb 5b subi r28, 0xBB ; 187 1e3f6: d0 40 sbci r29, 0x00 ; 0 1e3f8: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e3fc: 6b 01 movw r12, r22 1e3fe: 7c 01 movw r14, r24 1e400: cd 53 subi r28, 0x3D ; 61 1e402: df 4f sbci r29, 0xFF ; 255 1e404: 28 81 ld r18, Y 1e406: 39 81 ldd r19, Y+1 ; 0x01 1e408: 4a 81 ldd r20, Y+2 ; 0x02 1e40a: 5b 81 ldd r21, Y+3 ; 0x03 1e40c: c3 5c subi r28, 0xC3 ; 195 1e40e: d0 40 sbci r29, 0x00 ; 0 1e410: c3 01 movw r24, r6 1e412: b2 01 movw r22, r4 1e414: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e418: 9b 01 movw r18, r22 1e41a: ac 01 movw r20, r24 1e41c: c7 01 movw r24, r14 1e41e: b6 01 movw r22, r12 1e420: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e424: 6b 01 movw r12, r22 1e426: 7c 01 movw r14, r24 1e428: c9 53 subi r28, 0x39 ; 57 1e42a: df 4f sbci r29, 0xFF ; 255 1e42c: 28 81 ld r18, Y 1e42e: 39 81 ldd r19, Y+1 ; 0x01 1e430: 4a 81 ldd r20, Y+2 ; 0x02 1e432: 5b 81 ldd r21, Y+3 ; 0x03 1e434: c7 5c subi r28, 0xC7 ; 199 1e436: d0 40 sbci r29, 0x00 ; 0 1e438: c5 01 movw r24, r10 1e43a: b4 01 movw r22, r8 1e43c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e440: 9b 01 movw r18, r22 1e442: ac 01 movw r20, r24 1e444: c7 01 movw r24, r14 1e446: b6 01 movw r22, r12 1e448: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e44c: c5 53 subi r28, 0x35 ; 53 1e44e: df 4f sbci r29, 0xFF ; 255 1e450: 28 81 ld r18, Y 1e452: 39 81 ldd r19, Y+1 ; 0x01 1e454: 4a 81 ldd r20, Y+2 ; 0x02 1e456: 5b 81 ldd r21, Y+3 ; 0x03 1e458: cb 5c subi r28, 0xCB ; 203 1e45a: d0 40 sbci r29, 0x00 ; 0 1e45c: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1e460: 6b 01 movw r12, r22 1e462: 7c 01 movw r14, r24 1e464: 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) { 1e466: 09 f0 breq .+2 ; 0x1e46a 1e468: c9 ce rjmp .-622 ; 0x1e1fc // 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]; 1e46a: 6e 96 adiw r28, 0x1e ; 30 1e46c: 2c ad ldd r18, Y+60 ; 0x3c 1e46e: 3d ad ldd r19, Y+61 ; 0x3d 1e470: 4e ad ldd r20, Y+62 ; 0x3e 1e472: 5f ad ldd r21, Y+63 ; 0x3f 1e474: 6e 97 sbiw r28, 0x1e ; 30 1e476: c5 55 subi r28, 0x55 ; 85 1e478: df 4f sbci r29, 0xFF ; 255 1e47a: 68 81 ld r22, Y 1e47c: 79 81 ldd r23, Y+1 ; 0x01 1e47e: 8a 81 ldd r24, Y+2 ; 0x02 1e480: 9b 81 ldd r25, Y+3 ; 0x03 1e482: cb 5a subi r28, 0xAB ; 171 1e484: d0 40 sbci r29, 0x00 ; 0 1e486: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1e48a: 60 93 d1 13 sts 0x13D1, r22 ; 0x8013d1 1e48e: 70 93 d2 13 sts 0x13D2, r23 ; 0x8013d2 1e492: 80 93 d3 13 sts 0x13D3, r24 ; 0x8013d3 1e496: 90 93 d4 13 sts 0x13D4, r25 ; 0x8013d4 cntr[1] += h[1]; 1e49a: a3 01 movw r20, r6 1e49c: 92 01 movw r18, r4 1e49e: c1 55 subi r28, 0x51 ; 81 1e4a0: df 4f sbci r29, 0xFF ; 255 1e4a2: 68 81 ld r22, Y 1e4a4: 79 81 ldd r23, Y+1 ; 0x01 1e4a6: 8a 81 ldd r24, Y+2 ; 0x02 1e4a8: 9b 81 ldd r25, Y+3 ; 0x03 1e4aa: cf 5a subi r28, 0xAF ; 175 1e4ac: d0 40 sbci r29, 0x00 ; 0 1e4ae: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1e4b2: 60 93 d5 13 sts 0x13D5, r22 ; 0x8013d5 1e4b6: 70 93 d6 13 sts 0x13D6, r23 ; 0x8013d6 1e4ba: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 1e4be: 90 93 d8 13 sts 0x13D8, r25 ; 0x8013d8 a1 += h[2]; 1e4c2: a5 01 movw r20, r10 1e4c4: 94 01 movw r18, r8 1e4c6: a6 96 adiw r28, 0x26 ; 38 1e4c8: 6c ad ldd r22, Y+60 ; 0x3c 1e4ca: 7d ad ldd r23, Y+61 ; 0x3d 1e4cc: 8e ad ldd r24, Y+62 ; 0x3e 1e4ce: 9f ad ldd r25, Y+63 ; 0x3f 1e4d0: a6 97 sbiw r28, 0x26 ; 38 1e4d2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1e4d6: a6 96 adiw r28, 0x26 ; 38 1e4d8: 6c af std Y+60, r22 ; 0x3c 1e4da: 7d af std Y+61, r23 ; 0x3d 1e4dc: 8e af std Y+62, r24 ; 0x3e 1e4de: 9f af std Y+63, r25 ; 0x3f 1e4e0: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 1e4e2: a7 01 movw r20, r14 1e4e4: 96 01 movw r18, r12 1e4e6: a2 96 adiw r28, 0x22 ; 34 1e4e8: 6c ad ldd r22, Y+60 ; 0x3c 1e4ea: 7d ad ldd r23, Y+61 ; 0x3d 1e4ec: 8e ad ldd r24, Y+62 ; 0x3e 1e4ee: 9f ad ldd r25, Y+63 ; 0x3f 1e4f0: a2 97 sbiw r28, 0x22 ; 34 1e4f2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1e4f6: a2 96 adiw r28, 0x22 ; 34 1e4f8: 6c af std Y+60, r22 ; 0x3c 1e4fa: 7d af std Y+61, r23 ; 0x3d 1e4fc: 8e af std Y+62, r24 ; 0x3e 1e4fe: 9f af std Y+63, r25 ; 0x3f 1e500: a2 97 sbiw r28, 0x22 ; 34 1e502: e6 96 adiw r28, 0x36 ; 54 1e504: 9f ad ldd r25, Y+63 ; 0x3f 1e506: e6 97 sbiw r28, 0x36 ; 54 1e508: 91 50 subi r25, 0x01 ; 1 1e50a: e6 96 adiw r28, 0x36 ; 54 1e50c: 9f af std Y+63, r25 ; 0x3f 1e50e: 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) { 1e510: 91 11 cpse r25, r1 1e512: 70 c9 rjmp .-3360 ; 0x1d7f4 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1e514: a6 96 adiw r28, 0x26 ; 38 1e516: 6c ad ldd r22, Y+60 ; 0x3c 1e518: 7d ad ldd r23, Y+61 ; 0x3d 1e51a: 8e ad ldd r24, Y+62 ; 0x3e 1e51c: 9f ad ldd r25, Y+63 ; 0x3f 1e51e: a6 97 sbiw r28, 0x26 ; 38 1e520: 0f 94 7d df call 0x3befa ; 0x3befa 1e524: 60 93 c1 13 sts 0x13C1, r22 ; 0x8013c1 1e528: 70 93 c2 13 sts 0x13C2, r23 ; 0x8013c2 1e52c: 80 93 c3 13 sts 0x13C3, r24 ; 0x8013c3 1e530: 90 93 c4 13 sts 0x13C4, r25 ; 0x8013c4 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1e534: a6 96 adiw r28, 0x26 ; 38 1e536: 6c ad ldd r22, Y+60 ; 0x3c 1e538: 7d ad ldd r23, Y+61 ; 0x3d 1e53a: 8e ad ldd r24, Y+62 ; 0x3e 1e53c: 9f ad ldd r25, Y+63 ; 0x3f 1e53e: a6 97 sbiw r28, 0x26 ; 38 1e540: 0f 94 43 e2 call 0x3c486 ; 0x3c486 1e544: 60 93 c5 13 sts 0x13C5, r22 ; 0x8013c5 1e548: 70 93 c6 13 sts 0x13C6, r23 ; 0x8013c6 1e54c: 80 93 c7 13 sts 0x13C7, r24 ; 0x8013c7 1e550: 90 93 c8 13 sts 0x13C8, r25 ; 0x8013c8 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 1e554: a2 96 adiw r28, 0x22 ; 34 1e556: 6c ad ldd r22, Y+60 ; 0x3c 1e558: 7d ad ldd r23, Y+61 ; 0x3d 1e55a: 8e ad ldd r24, Y+62 ; 0x3e 1e55c: 9f ad ldd r25, Y+63 ; 0x3f 1e55e: a2 97 sbiw r28, 0x22 ; 34 1e560: 0f 94 43 e2 call 0x3c486 ; 0x3c486 1e564: 90 58 subi r25, 0x80 ; 128 1e566: 60 93 c9 13 sts 0x13C9, r22 ; 0x8013c9 1e56a: 70 93 ca 13 sts 0x13CA, r23 ; 0x8013ca 1e56e: 80 93 cb 13 sts 0x13CB, r24 ; 0x8013cb 1e572: 90 93 cc 13 sts 0x13CC, r25 ; 0x8013cc vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 1e576: a2 96 adiw r28, 0x22 ; 34 1e578: 6c ad ldd r22, Y+60 ; 0x3c 1e57a: 7d ad ldd r23, Y+61 ; 0x3d 1e57c: 8e ad ldd r24, Y+62 ; 0x3e 1e57e: 9f ad ldd r25, Y+63 ; 0x3f 1e580: a2 97 sbiw r28, 0x22 ; 34 1e582: 0f 94 7d df call 0x3befa ; 0x3befa 1e586: 60 93 cd 13 sts 0x13CD, r22 ; 0x8013cd 1e58a: 70 93 ce 13 sts 0x13CE, r23 ; 0x8013ce 1e58e: 80 93 cf 13 sts 0x13CF, r24 ; 0x8013cf 1e592: 90 93 d0 13 sts 0x13D0, r25 ; 0x8013d0 BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 1e596: a6 96 adiw r28, 0x26 ; 38 1e598: 2c ad ldd r18, Y+60 ; 0x3c 1e59a: 3d ad ldd r19, Y+61 ; 0x3d 1e59c: 4e ad ldd r20, Y+62 ; 0x3e 1e59e: 5f ad ldd r21, Y+63 ; 0x3f 1e5a0: a6 97 sbiw r28, 0x26 ; 38 1e5a2: a2 96 adiw r28, 0x22 ; 34 1e5a4: 6c ad ldd r22, Y+60 ; 0x3c 1e5a6: 7d ad ldd r23, Y+61 ; 0x3d 1e5a8: 8e ad ldd r24, Y+62 ; 0x3e 1e5aa: 9f ad ldd r25, Y+63 ; 0x3f 1e5ac: a2 97 sbiw r28, 0x22 ; 34 1e5ae: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e5b2: 4b 01 movw r8, r22 1e5b4: 5c 01 movw r10, r24 1e5b6: 7c 01 movw r14, r24 1e5b8: 6b 01 movw r12, r22 1e5ba: e8 94 clt 1e5bc: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 1e5be: 21 ee ldi r18, 0xE1 ; 225 1e5c0: 3e e2 ldi r19, 0x2E ; 46 1e5c2: 45 e6 ldi r20, 0x65 ; 101 1e5c4: 52 e4 ldi r21, 0x42 ; 66 1e5c6: a2 96 adiw r28, 0x22 ; 34 1e5c8: 6c ad ldd r22, Y+60 ; 0x3c 1e5ca: 7d ad ldd r23, Y+61 ; 0x3d 1e5cc: 8e ad ldd r24, Y+62 ; 0x3e 1e5ce: 9f ad ldd r25, Y+63 ; 0x3f 1e5d0: a2 97 sbiw r28, 0x22 ; 34 1e5d2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e5d6: 9f 93 push r25 1e5d8: 8f 93 push r24 1e5da: 7f 93 push r23 1e5dc: 6f 93 push r22 1e5de: 21 ee ldi r18, 0xE1 ; 225 1e5e0: 3e e2 ldi r19, 0x2E ; 46 1e5e2: 45 e6 ldi r20, 0x65 ; 101 1e5e4: 52 e4 ldi r21, 0x42 ; 66 1e5e6: c5 01 movw r24, r10 1e5e8: b4 01 movw r22, r8 1e5ea: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e5ee: 9f 93 push r25 1e5f0: 8f 93 push r24 1e5f2: 7f 93 push r23 1e5f4: 6f 93 push r22 1e5f6: 8a eb ldi r24, 0xBA ; 186 1e5f8: 9e e6 ldi r25, 0x6E ; 110 1e5fa: 9f 93 push r25 1e5fc: 8f 93 push r24 1e5fe: 0f 94 1d dc call 0x3b83a ; 0x3b83a if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1e602: b7 01 movw r22, r14 1e604: a6 01 movw r20, r12 1e606: 80 e6 ldi r24, 0x60 ; 96 1e608: 9f e0 ldi r25, 0x0F ; 15 1e60a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 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) 1e60e: 0f b6 in r0, 0x3f ; 63 1e610: f8 94 cli 1e612: de bf out 0x3e, r29 ; 62 1e614: 0f be out 0x3f, r0 ; 63 1e616: cd bf out 0x3d, r28 ; 61 1e618: 2f e1 ldi r18, 0x1F ; 31 1e61a: 32 e4 ldi r19, 0x42 ; 66 1e61c: 49 e0 ldi r20, 0x09 ; 9 1e61e: 5b e3 ldi r21, 0x3B ; 59 1e620: c7 01 movw r24, r14 1e622: b6 01 movw r22, r12 1e624: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__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; 1e628: 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) 1e62a: 18 16 cp r1, r24 1e62c: 64 f4 brge .+24 ; 0x1e646 result = (angleDiff > bed_skew_angle_extreme) ? 1e62e: 25 e3 ldi r18, 0x35 ; 53 1e630: 3a ef ldi r19, 0xFA ; 250 1e632: 4e e8 ldi r20, 0x8E ; 142 1e634: 5b e3 ldi r21, 0x3B ; 59 1e636: c7 01 movw r24, r14 1e638: b6 01 movw r22, r12 1e63a: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1e63e: 12 e0 ldi r17, 0x02 ; 2 1e640: 18 16 cp r1, r24 1e642: 0c f0 brlt .+2 ; 0x1e646 1e644: 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 || 1e646: 25 e3 ldi r18, 0x35 ; 53 1e648: 3a ef ldi r19, 0xFA ; 250 1e64a: 4e e8 ldi r20, 0x8E ; 142 1e64c: 5b e3 ldi r21, 0x3B ; 59 1e64e: a6 96 adiw r28, 0x26 ; 38 1e650: 6c ad ldd r22, Y+60 ; 0x3c 1e652: 7d ad ldd r23, Y+61 ; 0x3d 1e654: 8e ad ldd r24, Y+62 ; 0x3e 1e656: 9f ad ldd r25, Y+63 ; 0x3f 1e658: a6 97 sbiw r28, 0x26 ; 38 1e65a: 9f 77 andi r25, 0x7F ; 127 1e65c: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1e660: 18 16 cp r1, r24 1e662: 0c f4 brge .+2 ; 0x1e666 1e664: 67 c4 rjmp .+2254 ; 0x1ef34 1e666: 25 e3 ldi r18, 0x35 ; 53 1e668: 3a ef ldi r19, 0xFA ; 250 1e66a: 4e e8 ldi r20, 0x8E ; 142 1e66c: 5b e3 ldi r21, 0x3B ; 59 1e66e: a2 96 adiw r28, 0x22 ; 34 1e670: 6c ad ldd r22, Y+60 ; 0x3c 1e672: 7d ad ldd r23, Y+61 ; 0x3d 1e674: 8e ad ldd r24, Y+62 ; 0x3e 1e676: 9f ad ldd r25, Y+63 ; 0x3f 1e678: a2 97 sbiw r28, 0x22 ; 34 1e67a: 9f 77 andi r25, 0x7F ; 127 1e67c: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1e680: 18 16 cp r1, r24 1e682: 0c f4 brge .+2 ; 0x1e686 1e684: 57 c4 rjmp .+2222 ; 0x1ef34 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]; 1e686: 20 91 c1 13 lds r18, 0x13C1 ; 0x8013c1 1e68a: 30 91 c2 13 lds r19, 0x13C2 ; 0x8013c2 1e68e: 40 91 c3 13 lds r20, 0x13C3 ; 0x8013c3 1e692: 50 91 c4 13 lds r21, 0x13C4 ; 0x8013c4 1e696: ae 96 adiw r28, 0x2e ; 46 1e698: 2c af std Y+60, r18 ; 0x3c 1e69a: 3d af std Y+61, r19 ; 0x3d 1e69c: 4e af std Y+62, r20 ; 0x3e 1e69e: 5f af std Y+63, r21 ; 0x3f 1e6a0: ae 97 sbiw r28, 0x2e ; 46 1e6a2: 80 91 c9 13 lds r24, 0x13C9 ; 0x8013c9 1e6a6: 90 91 ca 13 lds r25, 0x13CA ; 0x8013ca 1e6aa: a0 91 cb 13 lds r26, 0x13CB ; 0x8013cb 1e6ae: b0 91 cc 13 lds r27, 0x13CC ; 0x8013cc 1e6b2: e9 96 adiw r28, 0x39 ; 57 1e6b4: 8c af std Y+60, r24 ; 0x3c 1e6b6: 9d af std Y+61, r25 ; 0x3d 1e6b8: ae af std Y+62, r26 ; 0x3e 1e6ba: bf af std Y+63, r27 ; 0x3f 1e6bc: e9 97 sbiw r28, 0x39 ; 57 1e6be: 20 91 d1 13 lds r18, 0x13D1 ; 0x8013d1 1e6c2: 30 91 d2 13 lds r19, 0x13D2 ; 0x8013d2 1e6c6: 40 91 d3 13 lds r20, 0x13D3 ; 0x8013d3 1e6ca: 50 91 d4 13 lds r21, 0x13D4 ; 0x8013d4 1e6ce: e4 96 adiw r28, 0x34 ; 52 1e6d0: 2c af std Y+60, r18 ; 0x3c 1e6d2: 3d af std Y+61, r19 ; 0x3d 1e6d4: 4e af std Y+62, r20 ; 0x3e 1e6d6: 5f af std Y+63, r21 ; 0x3f 1e6d8: 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]; 1e6da: 80 91 c5 13 lds r24, 0x13C5 ; 0x8013c5 1e6de: 90 91 c6 13 lds r25, 0x13C6 ; 0x8013c6 1e6e2: a0 91 c7 13 lds r26, 0x13C7 ; 0x8013c7 1e6e6: b0 91 c8 13 lds r27, 0x13C8 ; 0x8013c8 1e6ea: ed 96 adiw r28, 0x3d ; 61 1e6ec: 8c af std Y+60, r24 ; 0x3c 1e6ee: 9d af std Y+61, r25 ; 0x3d 1e6f0: ae af std Y+62, r26 ; 0x3e 1e6f2: bf af std Y+63, r27 ; 0x3f 1e6f4: ed 97 sbiw r28, 0x3d ; 61 1e6f6: 20 91 cd 13 lds r18, 0x13CD ; 0x8013cd 1e6fa: 30 91 ce 13 lds r19, 0x13CE ; 0x8013ce 1e6fe: 40 91 cf 13 lds r20, 0x13CF ; 0x8013cf 1e702: 50 91 d0 13 lds r21, 0x13D0 ; 0x8013d0 1e706: c3 58 subi r28, 0x83 ; 131 1e708: df 4f sbci r29, 0xFF ; 255 1e70a: 28 83 st Y, r18 1e70c: 39 83 std Y+1, r19 ; 0x01 1e70e: 4a 83 std Y+2, r20 ; 0x02 1e710: 5b 83 std Y+3, r21 ; 0x03 1e712: cd 57 subi r28, 0x7D ; 125 1e714: d0 40 sbci r29, 0x00 ; 0 1e716: 80 91 d5 13 lds r24, 0x13D5 ; 0x8013d5 1e71a: 90 91 d6 13 lds r25, 0x13D6 ; 0x8013d6 1e71e: a0 91 d7 13 lds r26, 0x13D7 ; 0x8013d7 1e722: b0 91 d8 13 lds r27, 0x13D8 ; 0x8013d8 1e726: cf 57 subi r28, 0x7F ; 127 1e728: df 4f sbci r29, 0xFF ; 255 1e72a: 88 83 st Y, r24 1e72c: 99 83 std Y+1, r25 ; 0x01 1e72e: aa 83 std Y+2, r26 ; 0x02 1e730: bb 83 std Y+3, r27 ; 0x03 1e732: c1 58 subi r28, 0x81 ; 129 1e734: d0 40 sbci r29, 0x00 ; 0 1e736: ac e0 ldi r26, 0x0C ; 12 1e738: b3 e9 ldi r27, 0x93 ; 147 1e73a: 6c 96 adiw r28, 0x1c ; 28 1e73c: bf af std Y+63, r27 ; 0x3f 1e73e: ae af std Y+62, r26 ; 0x3e 1e740: 6c 97 sbiw r28, 0x1c ; 28 1e742: 80 ea ldi r24, 0xA0 ; 160 1e744: 28 2e mov r2, r24 1e746: 83 e1 ldi r24, 0x13 ; 19 1e748: 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]; 1e74a: f1 01 movw r30, r2 1e74c: c1 80 ldd r12, Z+1 ; 0x01 1e74e: d2 80 ldd r13, Z+2 ; 0x02 1e750: e3 80 ldd r14, Z+3 ; 0x03 1e752: f4 80 ldd r15, Z+4 ; 0x04 1e754: 45 80 ldd r4, Z+5 ; 0x05 1e756: 56 80 ldd r5, Z+6 ; 0x06 1e758: 67 80 ldd r6, Z+7 ; 0x07 1e75a: 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; 1e75c: 6c 96 adiw r28, 0x1c ; 28 1e75e: ee ad ldd r30, Y+62 ; 0x3e 1e760: ff ad ldd r31, Y+63 ; 0x3f 1e762: 6c 97 sbiw r28, 0x1c ; 28 1e764: 25 91 lpm r18, Z+ 1e766: 35 91 lpm r19, Z+ 1e768: 45 91 lpm r20, Z+ 1e76a: 54 91 lpm r21, Z 1e76c: cb 57 subi r28, 0x7B ; 123 1e76e: df 4f sbci r29, 0xFF ; 255 1e770: 28 83 st Y, r18 1e772: 39 83 std Y+1, r19 ; 0x01 1e774: 4a 83 std Y+2, r20 ; 0x02 1e776: 5b 83 std Y+3, r21 ; 0x03 1e778: c5 58 subi r28, 0x85 ; 133 1e77a: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 1e77c: 6c 96 adiw r28, 0x1c ; 28 1e77e: ee ad ldd r30, Y+62 ; 0x3e 1e780: ff ad ldd r31, Y+63 ; 0x3f 1e782: 6c 97 sbiw r28, 0x1c ; 28 1e784: 34 96 adiw r30, 0x04 ; 4 1e786: 85 90 lpm r8, Z+ 1e788: 95 90 lpm r9, Z+ 1e78a: a5 90 lpm r10, Z+ 1e78c: 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]; 1e78e: ed 96 adiw r28, 0x3d ; 61 1e790: 2c ad ldd r18, Y+60 ; 0x3c 1e792: 3d ad ldd r19, Y+61 ; 0x3d 1e794: 4e ad ldd r20, Y+62 ; 0x3e 1e796: 5f ad ldd r21, Y+63 ; 0x3f 1e798: ed 97 sbiw r28, 0x3d ; 61 1e79a: c7 01 movw r24, r14 1e79c: b6 01 movw r22, r12 1e79e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e7a2: c7 57 subi r28, 0x77 ; 119 1e7a4: df 4f sbci r29, 0xFF ; 255 1e7a6: 68 83 st Y, r22 1e7a8: 79 83 std Y+1, r23 ; 0x01 1e7aa: 8a 83 std Y+2, r24 ; 0x02 1e7ac: 9b 83 std Y+3, r25 ; 0x03 1e7ae: c9 58 subi r28, 0x89 ; 137 1e7b0: d0 40 sbci r29, 0x00 ; 0 1e7b2: c3 58 subi r28, 0x83 ; 131 1e7b4: df 4f sbci r29, 0xFF ; 255 1e7b6: 28 81 ld r18, Y 1e7b8: 39 81 ldd r19, Y+1 ; 0x01 1e7ba: 4a 81 ldd r20, Y+2 ; 0x02 1e7bc: 5b 81 ldd r21, Y+3 ; 0x03 1e7be: cd 57 subi r28, 0x7D ; 125 1e7c0: d0 40 sbci r29, 0x00 ; 0 1e7c2: c3 01 movw r24, r6 1e7c4: b2 01 movw r22, r4 1e7c6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e7ca: 9b 01 movw r18, r22 1e7cc: ac 01 movw r20, r24 1e7ce: c7 57 subi r28, 0x77 ; 119 1e7d0: df 4f sbci r29, 0xFF ; 255 1e7d2: 68 81 ld r22, Y 1e7d4: 79 81 ldd r23, Y+1 ; 0x01 1e7d6: 8a 81 ldd r24, Y+2 ; 0x02 1e7d8: 9b 81 ldd r25, Y+3 ; 0x03 1e7da: c9 58 subi r28, 0x89 ; 137 1e7dc: d0 40 sbci r29, 0x00 ; 0 1e7de: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1e7e2: cf 57 subi r28, 0x7F ; 127 1e7e4: df 4f sbci r29, 0xFF ; 255 1e7e6: 28 81 ld r18, Y 1e7e8: 39 81 ldd r19, Y+1 ; 0x01 1e7ea: 4a 81 ldd r20, Y+2 ; 0x02 1e7ec: 5b 81 ldd r21, Y+3 ; 0x03 1e7ee: c1 58 subi r28, 0x81 ; 129 1e7f0: d0 40 sbci r29, 0x00 ; 0 1e7f2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1e7f6: 9b 01 movw r18, r22 1e7f8: 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; 1e7fa: c5 01 movw r24, r10 1e7fc: b4 01 movw r22, r8 1e7fe: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1e802: 4b 01 movw r8, r22 1e804: 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]; 1e806: a7 01 movw r20, r14 1e808: 96 01 movw r18, r12 1e80a: ae 96 adiw r28, 0x2e ; 46 1e80c: 6c ad ldd r22, Y+60 ; 0x3c 1e80e: 7d ad ldd r23, Y+61 ; 0x3d 1e810: 8e ad ldd r24, Y+62 ; 0x3e 1e812: 9f ad ldd r25, Y+63 ; 0x3f 1e814: ae 97 sbiw r28, 0x2e ; 46 1e816: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e81a: 6b 01 movw r12, r22 1e81c: 7c 01 movw r14, r24 1e81e: a3 01 movw r20, r6 1e820: 92 01 movw r18, r4 1e822: e9 96 adiw r28, 0x39 ; 57 1e824: 6c ad ldd r22, Y+60 ; 0x3c 1e826: 7d ad ldd r23, Y+61 ; 0x3d 1e828: 8e ad ldd r24, Y+62 ; 0x3e 1e82a: 9f ad ldd r25, Y+63 ; 0x3f 1e82c: e9 97 sbiw r28, 0x39 ; 57 1e82e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e832: 9b 01 movw r18, r22 1e834: ac 01 movw r20, r24 1e836: c7 01 movw r24, r14 1e838: b6 01 movw r22, r12 1e83a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1e83e: e4 96 adiw r28, 0x34 ; 52 1e840: 2c ad ldd r18, Y+60 ; 0x3c 1e842: 3d ad ldd r19, Y+61 ; 0x3d 1e844: 4e ad ldd r20, Y+62 ; 0x3e 1e846: 5f ad ldd r21, Y+63 ; 0x3f 1e848: e4 97 sbiw r28, 0x34 ; 52 1e84a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1e84e: 9b 01 movw r18, r22 1e850: 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; 1e852: cb 57 subi r28, 0x7B ; 123 1e854: df 4f sbci r29, 0xFF ; 255 1e856: 68 81 ld r22, Y 1e858: 79 81 ldd r23, Y+1 ; 0x01 1e85a: 8a 81 ldd r24, Y+2 ; 0x02 1e85c: 9b 81 ldd r25, Y+3 ; 0x03 1e85e: c5 58 subi r28, 0x85 ; 133 1e860: d0 40 sbci r29, 0x00 ; 0 1e862: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 1e866: a5 01 movw r20, r10 1e868: 94 01 movw r18, r8 1e86a: 0f 94 1f e1 call 0x3c23e ; 0x3c23e } 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) { 1e86e: 2d ec ldi r18, 0xCD ; 205 1e870: 3c ec ldi r19, 0xCC ; 204 1e872: 4c e4 ldi r20, 0x4C ; 76 1e874: 5f e3 ldi r21, 0x3F ; 63 1e876: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1e87a: 18 16 cp r1, r24 1e87c: 0c f4 brge .+2 ; 0x1e880 result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 1e87e: 1e ef ldi r17, 0xFE ; 254 1e880: 38 e0 ldi r19, 0x08 ; 8 1e882: 23 0e add r2, r19 1e884: 31 1c adc r3, r1 1e886: 6c 96 adiw r28, 0x1c ; 28 1e888: 4e ad ldd r20, Y+62 ; 0x3e 1e88a: 5f ad ldd r21, Y+63 ; 0x3f 1e88c: 6c 97 sbiw r28, 0x1c ; 28 1e88e: 48 5f subi r20, 0xF8 ; 248 1e890: 5f 4f sbci r21, 0xFF ; 255 1e892: 6c 96 adiw r28, 0x1c ; 28 1e894: 5f af std Y+63, r21 ; 0x3f 1e896: 4e af std Y+62, r20 ; 0x3e 1e898: 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) { 1e89a: a8 96 adiw r28, 0x28 ; 40 1e89c: 8e ad ldd r24, Y+62 ; 0x3e 1e89e: 9f ad ldd r25, Y+63 ; 0x3f 1e8a0: a8 97 sbiw r28, 0x28 ; 40 1e8a2: 82 15 cp r24, r2 1e8a4: 93 05 cpc r25, r3 1e8a6: 09 f0 breq .+2 ; 0x1e8aa 1e8a8: 50 cf rjmp .-352 ; 0x1e74a MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 1e8aa: 11 11 cpse r17, r1 1e8ac: 62 c1 rjmp .+708 ; 0x1eb72 #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); 1e8ae: a2 96 adiw r28, 0x22 ; 34 1e8b0: 2c ad ldd r18, Y+60 ; 0x3c 1e8b2: 3d ad ldd r19, Y+61 ; 0x3d 1e8b4: 4e ad ldd r20, Y+62 ; 0x3e 1e8b6: 5f ad ldd r21, Y+63 ; 0x3f 1e8b8: a2 97 sbiw r28, 0x22 ; 34 1e8ba: a6 96 adiw r28, 0x26 ; 38 1e8bc: 6c ad ldd r22, Y+60 ; 0x3c 1e8be: 7d ad ldd r23, Y+61 ; 0x3d 1e8c0: 8e ad ldd r24, Y+62 ; 0x3e 1e8c2: 9f ad ldd r25, Y+63 ; 0x3f 1e8c4: a6 97 sbiw r28, 0x26 ; 38 1e8c6: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1e8ca: 20 e0 ldi r18, 0x00 ; 0 1e8cc: 30 e0 ldi r19, 0x00 ; 0 1e8ce: 40 e0 ldi r20, 0x00 ; 0 1e8d0: 5f e3 ldi r21, 0x3F ; 63 1e8d2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e8d6: 6b 01 movw r12, r22 1e8d8: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1e8da: 0f 94 7d df call 0x3befa ; 0x3befa 1e8de: a2 96 adiw r28, 0x22 ; 34 1e8e0: 6c af std Y+60, r22 ; 0x3c 1e8e2: 7d af std Y+61, r23 ; 0x3d 1e8e4: 8e af std Y+62, r24 ; 0x3e 1e8e6: 9f af std Y+63, r25 ; 0x3f 1e8e8: a2 97 sbiw r28, 0x22 ; 34 1e8ea: 60 93 c1 13 sts 0x13C1, r22 ; 0x8013c1 1e8ee: 70 93 c2 13 sts 0x13C2, r23 ; 0x8013c2 1e8f2: 80 93 c3 13 sts 0x13C3, r24 ; 0x8013c3 1e8f6: 90 93 c4 13 sts 0x13C4, r25 ; 0x8013c4 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1e8fa: c7 01 movw r24, r14 1e8fc: b6 01 movw r22, r12 1e8fe: 0f 94 43 e2 call 0x3c486 ; 0x3c486 1e902: a6 96 adiw r28, 0x26 ; 38 1e904: 6c af std Y+60, r22 ; 0x3c 1e906: 7d af std Y+61, r23 ; 0x3d 1e908: 8e af std Y+62, r24 ; 0x3e 1e90a: 9f af std Y+63, r25 ; 0x3f 1e90c: a6 97 sbiw r28, 0x26 ; 38 1e90e: 60 93 c5 13 sts 0x13C5, r22 ; 0x8013c5 1e912: 70 93 c6 13 sts 0x13C6, r23 ; 0x8013c6 1e916: 80 93 c7 13 sts 0x13C7, r24 ; 0x8013c7 1e91a: 90 93 c8 13 sts 0x13C8, r25 ; 0x8013c8 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 1e91e: 9b 01 movw r18, r22 1e920: ac 01 movw r20, r24 1e922: 50 58 subi r21, 0x80 ; 128 1e924: aa 96 adiw r28, 0x2a ; 42 1e926: 2c af std Y+60, r18 ; 0x3c 1e928: 3d af std Y+61, r19 ; 0x3d 1e92a: 4e af std Y+62, r20 ; 0x3e 1e92c: 5f af std Y+63, r21 ; 0x3f 1e92e: aa 97 sbiw r28, 0x2a ; 42 1e930: 20 93 c9 13 sts 0x13C9, r18 ; 0x8013c9 1e934: 30 93 ca 13 sts 0x13CA, r19 ; 0x8013ca 1e938: 40 93 cb 13 sts 0x13CB, r20 ; 0x8013cb 1e93c: 50 93 cc 13 sts 0x13CC, r21 ; 0x8013cc vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 1e940: a2 96 adiw r28, 0x22 ; 34 1e942: 8c ad ldd r24, Y+60 ; 0x3c 1e944: 9d ad ldd r25, Y+61 ; 0x3d 1e946: ae ad ldd r26, Y+62 ; 0x3e 1e948: bf ad ldd r27, Y+63 ; 0x3f 1e94a: a2 97 sbiw r28, 0x22 ; 34 1e94c: 80 93 cd 13 sts 0x13CD, r24 ; 0x8013cd 1e950: 90 93 ce 13 sts 0x13CE, r25 ; 0x8013ce 1e954: a0 93 cf 13 sts 0x13CF, r26 ; 0x8013cf 1e958: b0 93 d0 13 sts 0x13D0, r27 ; 0x8013d0 // Refresh the offset. cntr[0] = 0.f; 1e95c: 10 92 d1 13 sts 0x13D1, r1 ; 0x8013d1 1e960: 10 92 d2 13 sts 0x13D2, r1 ; 0x8013d2 1e964: 10 92 d3 13 sts 0x13D3, r1 ; 0x8013d3 1e968: 10 92 d4 13 sts 0x13D4, r1 ; 0x8013d4 cntr[1] = 0.f; 1e96c: 10 92 d5 13 sts 0x13D5, r1 ; 0x8013d5 1e970: 10 92 d6 13 sts 0x13D6, r1 ; 0x8013d6 1e974: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 1e978: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 float wx = 0.f; 1e97c: 41 2c mov r4, r1 1e97e: 51 2c mov r5, r1 1e980: 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]; 1e982: cf 56 subi r28, 0x6F ; 111 1e984: df 4f sbci r29, 0xFF ; 255 1e986: a8 81 ld r26, Y 1e988: b9 81 ldd r27, Y+1 ; 0x01 1e98a: c1 59 subi r28, 0x91 ; 145 1e98c: d0 40 sbci r29, 0x00 ; 0 1e98e: 11 96 adiw r26, 0x01 ; 1 1e990: 8d 90 ld r8, X+ 1e992: 9d 90 ld r9, X+ 1e994: ad 90 ld r10, X+ 1e996: bc 90 ld r11, X 1e998: 14 97 sbiw r26, 0x04 ; 4 1e99a: 15 96 adiw r26, 0x05 ; 5 1e99c: 2d 91 ld r18, X+ 1e99e: 3d 91 ld r19, X+ 1e9a0: 4d 91 ld r20, X+ 1e9a2: 5c 91 ld r21, X 1e9a4: 18 97 sbiw r26, 0x08 ; 8 1e9a6: 6e 96 adiw r28, 0x1e ; 30 1e9a8: 2c af std Y+60, r18 ; 0x3c 1e9aa: 3d af std Y+61, r19 ; 0x3d 1e9ac: 4e af std Y+62, r20 ; 0x3e 1e9ae: 5f af std Y+63, r21 ; 0x3f 1e9b0: 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); 1e9b2: cd 56 subi r28, 0x6D ; 109 1e9b4: df 4f sbci r29, 0xFF ; 255 1e9b6: e8 81 ld r30, Y 1e9b8: f9 81 ldd r31, Y+1 ; 0x01 1e9ba: c3 59 subi r28, 0x93 ; 147 1e9bc: d0 40 sbci r29, 0x00 ; 0 1e9be: c5 90 lpm r12, Z+ 1e9c0: d5 90 lpm r13, Z+ 1e9c2: e5 90 lpm r14, Z+ 1e9c4: 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]; 1e9c6: a5 01 movw r20, r10 1e9c8: 94 01 movw r18, r8 1e9ca: a2 96 adiw r28, 0x22 ; 34 1e9cc: 6c ad ldd r22, Y+60 ; 0x3c 1e9ce: 7d ad ldd r23, Y+61 ; 0x3d 1e9d0: 8e ad ldd r24, Y+62 ; 0x3e 1e9d2: 9f ad ldd r25, Y+63 ; 0x3f 1e9d4: a2 97 sbiw r28, 0x22 ; 34 1e9d6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1e9da: ae 96 adiw r28, 0x2e ; 46 1e9dc: 6c af std Y+60, r22 ; 0x3c 1e9de: 7d af std Y+61, r23 ; 0x3d 1e9e0: 8e af std Y+62, r24 ; 0x3e 1e9e2: 9f af std Y+63, r25 ; 0x3f 1e9e4: ae 97 sbiw r28, 0x2e ; 46 1e9e6: 6e 96 adiw r28, 0x1e ; 30 1e9e8: 2c ad ldd r18, Y+60 ; 0x3c 1e9ea: 3d ad ldd r19, Y+61 ; 0x3d 1e9ec: 4e ad ldd r20, Y+62 ; 0x3e 1e9ee: 5f ad ldd r21, Y+63 ; 0x3f 1e9f0: 6e 97 sbiw r28, 0x1e ; 30 1e9f2: aa 96 adiw r28, 0x2a ; 42 1e9f4: 6c ad ldd r22, Y+60 ; 0x3c 1e9f6: 7d ad ldd r23, Y+61 ; 0x3d 1e9f8: 8e ad ldd r24, Y+62 ; 0x3e 1e9fa: 9f ad ldd r25, Y+63 ; 0x3f 1e9fc: aa 97 sbiw r28, 0x2a ; 42 1e9fe: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1ea02: 9b 01 movw r18, r22 1ea04: ac 01 movw r20, r24 1ea06: ae 96 adiw r28, 0x2e ; 46 1ea08: 6c ad ldd r22, Y+60 ; 0x3c 1ea0a: 7d ad ldd r23, Y+61 ; 0x3d 1ea0c: 8e ad ldd r24, Y+62 ; 0x3e 1ea0e: 9f ad ldd r25, Y+63 ; 0x3f 1ea10: ae 97 sbiw r28, 0x2e ; 46 1ea12: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1ea16: 9b 01 movw r18, r22 1ea18: 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); 1ea1a: c7 01 movw r24, r14 1ea1c: b6 01 movw r22, r12 1ea1e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1ea22: 20 91 d1 13 lds r18, 0x13D1 ; 0x8013d1 1ea26: 30 91 d2 13 lds r19, 0x13D2 ; 0x8013d2 1ea2a: 40 91 d3 13 lds r20, 0x13D3 ; 0x8013d3 1ea2e: 50 91 d4 13 lds r21, 0x13D4 ; 0x8013d4 1ea32: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1ea36: 6b 01 movw r12, r22 1ea38: 7c 01 movw r14, r24 1ea3a: c0 92 d1 13 sts 0x13D1, r12 ; 0x8013d1 1ea3e: d0 92 d2 13 sts 0x13D2, r13 ; 0x8013d2 1ea42: e0 92 d3 13 sts 0x13D3, r14 ; 0x8013d3 1ea46: f0 92 d4 13 sts 0x13D4, r15 ; 0x8013d4 wx += w; 1ea4a: 20 e0 ldi r18, 0x00 ; 0 1ea4c: 30 e0 ldi r19, 0x00 ; 0 1ea4e: 40 e8 ldi r20, 0x80 ; 128 1ea50: 5f e3 ldi r21, 0x3F ; 63 1ea52: c3 01 movw r24, r6 1ea54: b2 01 movw r22, r4 1ea56: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1ea5a: 2b 01 movw r4, r22 1ea5c: 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); 1ea5e: cd 56 subi r28, 0x6D ; 109 1ea60: df 4f sbci r29, 0xFF ; 255 1ea62: e8 81 ld r30, Y 1ea64: f9 81 ldd r31, Y+1 ; 0x01 1ea66: c3 59 subi r28, 0x93 ; 147 1ea68: d0 40 sbci r29, 0x00 ; 0 1ea6a: 34 96 adiw r30, 0x04 ; 4 1ea6c: 25 91 lpm r18, Z+ 1ea6e: 35 91 lpm r19, Z+ 1ea70: 45 91 lpm r20, Z+ 1ea72: 54 91 lpm r21, Z 1ea74: ae 96 adiw r28, 0x2e ; 46 1ea76: 2c af std Y+60, r18 ; 0x3c 1ea78: 3d af std Y+61, r19 ; 0x3d 1ea7a: 4e af std Y+62, r20 ; 0x3e 1ea7c: 5f af std Y+63, r21 ; 0x3f 1ea7e: 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]; 1ea80: a5 01 movw r20, r10 1ea82: 94 01 movw r18, r8 1ea84: a6 96 adiw r28, 0x26 ; 38 1ea86: 6c ad ldd r22, Y+60 ; 0x3c 1ea88: 7d ad ldd r23, Y+61 ; 0x3d 1ea8a: 8e ad ldd r24, Y+62 ; 0x3e 1ea8c: 9f ad ldd r25, Y+63 ; 0x3f 1ea8e: a6 97 sbiw r28, 0x26 ; 38 1ea90: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1ea94: 4b 01 movw r8, r22 1ea96: 5c 01 movw r10, r24 1ea98: 6e 96 adiw r28, 0x1e ; 30 1ea9a: 2c ad ldd r18, Y+60 ; 0x3c 1ea9c: 3d ad ldd r19, Y+61 ; 0x3d 1ea9e: 4e ad ldd r20, Y+62 ; 0x3e 1eaa0: 5f ad ldd r21, Y+63 ; 0x3f 1eaa2: 6e 97 sbiw r28, 0x1e ; 30 1eaa4: a2 96 adiw r28, 0x22 ; 34 1eaa6: 6c ad ldd r22, Y+60 ; 0x3c 1eaa8: 7d ad ldd r23, Y+61 ; 0x3d 1eaaa: 8e ad ldd r24, Y+62 ; 0x3e 1eaac: 9f ad ldd r25, Y+63 ; 0x3f 1eaae: a2 97 sbiw r28, 0x22 ; 34 1eab0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1eab4: 9b 01 movw r18, r22 1eab6: ac 01 movw r20, r24 1eab8: c5 01 movw r24, r10 1eaba: b4 01 movw r22, r8 1eabc: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1eac0: 9b 01 movw r18, r22 1eac2: 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); 1eac4: ae 96 adiw r28, 0x2e ; 46 1eac6: 6c ad ldd r22, Y+60 ; 0x3c 1eac8: 7d ad ldd r23, Y+61 ; 0x3d 1eaca: 8e ad ldd r24, Y+62 ; 0x3e 1eacc: 9f ad ldd r25, Y+63 ; 0x3f 1eace: ae 97 sbiw r28, 0x2e ; 46 1ead0: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1ead4: 20 91 d5 13 lds r18, 0x13D5 ; 0x8013d5 1ead8: 30 91 d6 13 lds r19, 0x13D6 ; 0x8013d6 1eadc: 40 91 d7 13 lds r20, 0x13D7 ; 0x8013d7 1eae0: 50 91 d8 13 lds r21, 0x13D8 ; 0x8013d8 1eae4: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1eae8: 4b 01 movw r8, r22 1eaea: 5c 01 movw r10, r24 1eaec: 80 92 d5 13 sts 0x13D5, r8 ; 0x8013d5 1eaf0: 90 92 d6 13 sts 0x13D6, r9 ; 0x8013d6 1eaf4: a0 92 d7 13 sts 0x13D7, r10 ; 0x8013d7 1eaf8: b0 92 d8 13 sts 0x13D8, r11 ; 0x8013d8 1eafc: cf 56 subi r28, 0x6F ; 111 1eafe: df 4f sbci r29, 0xFF ; 255 1eb00: 48 81 ld r20, Y 1eb02: 59 81 ldd r21, Y+1 ; 0x01 1eb04: c1 59 subi r28, 0x91 ; 145 1eb06: d0 40 sbci r29, 0x00 ; 0 1eb08: 48 5f subi r20, 0xF8 ; 248 1eb0a: 5f 4f sbci r21, 0xFF ; 255 1eb0c: cf 56 subi r28, 0x6F ; 111 1eb0e: df 4f sbci r29, 0xFF ; 255 1eb10: 59 83 std Y+1, r21 ; 0x01 1eb12: 48 83 st Y, r20 1eb14: c1 59 subi r28, 0x91 ; 145 1eb16: d0 40 sbci r29, 0x00 ; 0 1eb18: cd 56 subi r28, 0x6D ; 109 1eb1a: df 4f sbci r29, 0xFF ; 255 1eb1c: 88 81 ld r24, Y 1eb1e: 99 81 ldd r25, Y+1 ; 0x01 1eb20: c3 59 subi r28, 0x93 ; 147 1eb22: d0 40 sbci r29, 0x00 ; 0 1eb24: 08 96 adiw r24, 0x08 ; 8 1eb26: cd 56 subi r28, 0x6D ; 109 1eb28: df 4f sbci r29, 0xFF ; 255 1eb2a: 99 83 std Y+1, r25 ; 0x01 1eb2c: 88 83 st Y, r24 1eb2e: c3 59 subi r28, 0x93 ; 147 1eb30: 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) { 1eb32: 24 16 cp r2, r20 1eb34: 35 06 cpc r3, r21 1eb36: 09 f0 breq .+2 ; 0x1eb3a 1eb38: 24 cf rjmp .-440 ; 0x1e982 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 1eb3a: a3 01 movw r20, r6 1eb3c: 92 01 movw r18, r4 1eb3e: c7 01 movw r24, r14 1eb40: b6 01 movw r22, r12 1eb42: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1eb46: 60 93 d1 13 sts 0x13D1, r22 ; 0x8013d1 1eb4a: 70 93 d2 13 sts 0x13D2, r23 ; 0x8013d2 1eb4e: 80 93 d3 13 sts 0x13D3, r24 ; 0x8013d3 1eb52: 90 93 d4 13 sts 0x13D4, r25 ; 0x8013d4 cntr[1] /= wy; 1eb56: a3 01 movw r20, r6 1eb58: 92 01 movw r18, r4 1eb5a: c5 01 movw r24, r10 1eb5c: b4 01 movw r22, r8 1eb5e: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1eb62: 60 93 d5 13 sts 0x13D5, r22 ; 0x8013d5 1eb66: 70 93 d6 13 sts 0x13D6, r23 ; 0x8013d6 1eb6a: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 1eb6e: 90 93 d8 13 sts 0x13D8, r25 ; 0x8013d8 #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]; 1eb72: 40 90 c1 13 lds r4, 0x13C1 ; 0x8013c1 1eb76: 50 90 c2 13 lds r5, 0x13C2 ; 0x8013c2 1eb7a: 60 90 c3 13 lds r6, 0x13C3 ; 0x8013c3 1eb7e: 70 90 c4 13 lds r7, 0x13C4 ; 0x8013c4 1eb82: c0 90 cd 13 lds r12, 0x13CD ; 0x8013cd 1eb86: d0 90 ce 13 lds r13, 0x13CE ; 0x8013ce 1eb8a: e0 90 cf 13 lds r14, 0x13CF ; 0x8013cf 1eb8e: f0 90 d0 13 lds r15, 0x13D0 ; 0x8013d0 1eb92: 20 91 c5 13 lds r18, 0x13C5 ; 0x8013c5 1eb96: 30 91 c6 13 lds r19, 0x13C6 ; 0x8013c6 1eb9a: 40 91 c7 13 lds r20, 0x13C7 ; 0x8013c7 1eb9e: 50 91 c8 13 lds r21, 0x13C8 ; 0x8013c8 1eba2: a2 96 adiw r28, 0x22 ; 34 1eba4: 2c af std Y+60, r18 ; 0x3c 1eba6: 3d af std Y+61, r19 ; 0x3d 1eba8: 4e af std Y+62, r20 ; 0x3e 1ebaa: 5f af std Y+63, r21 ; 0x3f 1ebac: a2 97 sbiw r28, 0x22 ; 34 1ebae: 80 91 c9 13 lds r24, 0x13C9 ; 0x8013c9 1ebb2: 90 91 ca 13 lds r25, 0x13CA ; 0x8013ca 1ebb6: a0 91 cb 13 lds r26, 0x13CB ; 0x8013cb 1ebba: b0 91 cc 13 lds r27, 0x13CC ; 0x8013cc 1ebbe: a6 96 adiw r28, 0x26 ; 38 1ebc0: 8c af std Y+60, r24 ; 0x3c 1ebc2: 9d af std Y+61, r25 ; 0x3d 1ebc4: ae af std Y+62, r26 ; 0x3e 1ebc6: bf af std Y+63, r27 ; 0x3f 1ebc8: a6 97 sbiw r28, 0x26 ; 38 1ebca: a7 01 movw r20, r14 1ebcc: 96 01 movw r18, r12 1ebce: c3 01 movw r24, r6 1ebd0: b2 01 movw r22, r4 1ebd2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1ebd6: 4b 01 movw r8, r22 1ebd8: 5c 01 movw r10, r24 1ebda: a6 96 adiw r28, 0x26 ; 38 1ebdc: 2c ad ldd r18, Y+60 ; 0x3c 1ebde: 3d ad ldd r19, Y+61 ; 0x3d 1ebe0: 4e ad ldd r20, Y+62 ; 0x3e 1ebe2: 5f ad ldd r21, Y+63 ; 0x3f 1ebe4: a6 97 sbiw r28, 0x26 ; 38 1ebe6: a2 96 adiw r28, 0x22 ; 34 1ebe8: 6c ad ldd r22, Y+60 ; 0x3c 1ebea: 7d ad ldd r23, Y+61 ; 0x3d 1ebec: 8e ad ldd r24, Y+62 ; 0x3e 1ebee: 9f ad ldd r25, Y+63 ; 0x3f 1ebf0: a2 97 sbiw r28, 0x22 ; 34 1ebf2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1ebf6: 9b 01 movw r18, r22 1ebf8: ac 01 movw r20, r24 1ebfa: c5 01 movw r24, r10 1ebfc: b4 01 movw r22, r8 1ebfe: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 1ec02: 4b 01 movw r8, r22 1ec04: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 1ec06: ac 01 movw r20, r24 1ec08: 9b 01 movw r18, r22 1ec0a: c7 01 movw r24, r14 1ec0c: b6 01 movw r22, r12 1ec0e: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1ec12: 6b 01 movw r12, r22 1ec14: 7c 01 movw r14, r24 1ec16: a6 96 adiw r28, 0x26 ; 38 1ec18: 6c ad ldd r22, Y+60 ; 0x3c 1ec1a: 7d ad ldd r23, Y+61 ; 0x3d 1ec1c: 8e ad ldd r24, Y+62 ; 0x3e 1ec1e: 9f ad ldd r25, Y+63 ; 0x3f 1ec20: a6 97 sbiw r28, 0x26 ; 38 1ec22: 90 58 subi r25, 0x80 ; 128 1ec24: a5 01 movw r20, r10 1ec26: 94 01 movw r18, r8 1ec28: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1ec2c: a6 96 adiw r28, 0x26 ; 38 1ec2e: 6c af std Y+60, r22 ; 0x3c 1ec30: 7d af std Y+61, r23 ; 0x3d 1ec32: 8e af std Y+62, r24 ; 0x3e 1ec34: 9f af std Y+63, r25 ; 0x3f 1ec36: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 1ec38: a2 96 adiw r28, 0x22 ; 34 1ec3a: 6c ad ldd r22, Y+60 ; 0x3c 1ec3c: 7d ad ldd r23, Y+61 ; 0x3d 1ec3e: 8e ad ldd r24, Y+62 ; 0x3e 1ec40: 9f ad ldd r25, Y+63 ; 0x3f 1ec42: a2 97 sbiw r28, 0x22 ; 34 1ec44: 90 58 subi r25, 0x80 ; 128 1ec46: a5 01 movw r20, r10 1ec48: 94 01 movw r18, r8 1ec4a: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1ec4e: aa 96 adiw r28, 0x2a ; 42 1ec50: 6c af std Y+60, r22 ; 0x3c 1ec52: 7d af std Y+61, r23 ; 0x3d 1ec54: 8e af std Y+62, r24 ; 0x3e 1ec56: 9f af std Y+63, r25 ; 0x3f 1ec58: aa 97 sbiw r28, 0x2a ; 42 1ec5a: a5 01 movw r20, r10 1ec5c: 94 01 movw r18, r8 1ec5e: c3 01 movw r24, r6 1ec60: b2 01 movw r22, r4 1ec62: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 1ec66: 4b 01 movw r8, r22 1ec68: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 1ec6a: 40 90 d1 13 lds r4, 0x13D1 ; 0x8013d1 1ec6e: 50 90 d2 13 lds r5, 0x13D2 ; 0x8013d2 1ec72: 60 90 d3 13 lds r6, 0x13D3 ; 0x8013d3 1ec76: 70 90 d4 13 lds r7, 0x13D4 ; 0x8013d4 1ec7a: 20 91 d5 13 lds r18, 0x13D5 ; 0x8013d5 1ec7e: 30 91 d6 13 lds r19, 0x13D6 ; 0x8013d6 1ec82: 40 91 d7 13 lds r20, 0x13D7 ; 0x8013d7 1ec86: 50 91 d8 13 lds r21, 0x13D8 ; 0x8013d8 1ec8a: a2 96 adiw r28, 0x22 ; 34 1ec8c: 2c af std Y+60, r18 ; 0x3c 1ec8e: 3d af std Y+61, r19 ; 0x3d 1ec90: 4e af std Y+62, r20 ; 0x3e 1ec92: 5f af std Y+63, r21 ; 0x3f 1ec94: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 1ec96: c0 92 c1 13 sts 0x13C1, r12 ; 0x8013c1 1ec9a: d0 92 c2 13 sts 0x13C2, r13 ; 0x8013c2 1ec9e: e0 92 c3 13 sts 0x13C3, r14 ; 0x8013c3 1eca2: f0 92 c4 13 sts 0x13C4, r15 ; 0x8013c4 vec_x[1] = Ainv[1][0]; 1eca6: aa 96 adiw r28, 0x2a ; 42 1eca8: 8c ad ldd r24, Y+60 ; 0x3c 1ecaa: 9d ad ldd r25, Y+61 ; 0x3d 1ecac: ae ad ldd r26, Y+62 ; 0x3e 1ecae: bf ad ldd r27, Y+63 ; 0x3f 1ecb0: aa 97 sbiw r28, 0x2a ; 42 1ecb2: 80 93 c5 13 sts 0x13C5, r24 ; 0x8013c5 1ecb6: 90 93 c6 13 sts 0x13C6, r25 ; 0x8013c6 1ecba: a0 93 c7 13 sts 0x13C7, r26 ; 0x8013c7 1ecbe: b0 93 c8 13 sts 0x13C8, r27 ; 0x8013c8 vec_y[0] = Ainv[0][1]; 1ecc2: a6 96 adiw r28, 0x26 ; 38 1ecc4: 2c ad ldd r18, Y+60 ; 0x3c 1ecc6: 3d ad ldd r19, Y+61 ; 0x3d 1ecc8: 4e ad ldd r20, Y+62 ; 0x3e 1ecca: 5f ad ldd r21, Y+63 ; 0x3f 1eccc: a6 97 sbiw r28, 0x26 ; 38 1ecce: 20 93 c9 13 sts 0x13C9, r18 ; 0x8013c9 1ecd2: 30 93 ca 13 sts 0x13CA, r19 ; 0x8013ca 1ecd6: 40 93 cb 13 sts 0x13CB, r20 ; 0x8013cb 1ecda: 50 93 cc 13 sts 0x13CC, r21 ; 0x8013cc vec_y[1] = Ainv[1][1]; 1ecde: 80 92 cd 13 sts 0x13CD, r8 ; 0x8013cd 1ece2: 90 92 ce 13 sts 0x13CE, r9 ; 0x8013ce 1ece6: a0 92 cf 13 sts 0x13CF, r10 ; 0x8013cf 1ecea: b0 92 d0 13 sts 0x13D0, r11 ; 0x8013d0 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], 1ecee: c7 01 movw r24, r14 1ecf0: b6 01 movw r22, r12 1ecf2: 90 58 subi r25, 0x80 ; 128 1ecf4: a3 01 movw r20, r6 1ecf6: 92 01 movw r18, r4 1ecf8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1ecfc: 6b 01 movw r12, r22 1ecfe: 7c 01 movw r14, r24 1ed00: a2 96 adiw r28, 0x22 ; 34 1ed02: 2c ad ldd r18, Y+60 ; 0x3c 1ed04: 3d ad ldd r19, Y+61 ; 0x3d 1ed06: 4e ad ldd r20, Y+62 ; 0x3e 1ed08: 5f ad ldd r21, Y+63 ; 0x3f 1ed0a: a2 97 sbiw r28, 0x22 ; 34 1ed0c: a6 96 adiw r28, 0x26 ; 38 1ed0e: 6c ad ldd r22, Y+60 ; 0x3c 1ed10: 7d ad ldd r23, Y+61 ; 0x3d 1ed12: 8e ad ldd r24, Y+62 ; 0x3e 1ed14: 9f ad ldd r25, Y+63 ; 0x3f 1ed16: a6 97 sbiw r28, 0x26 ; 38 1ed18: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1ed1c: 9b 01 movw r18, r22 1ed1e: ac 01 movw r20, r24 1ed20: c7 01 movw r24, r14 1ed22: b6 01 movw r22, r12 1ed24: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__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]; 1ed28: 60 93 d1 13 sts 0x13D1, r22 ; 0x8013d1 1ed2c: 70 93 d2 13 sts 0x13D2, r23 ; 0x8013d2 1ed30: 80 93 d3 13 sts 0x13D3, r24 ; 0x8013d3 1ed34: 90 93 d4 13 sts 0x13D4, r25 ; 0x8013d4 { 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] 1ed38: aa 96 adiw r28, 0x2a ; 42 1ed3a: 6c ad ldd r22, Y+60 ; 0x3c 1ed3c: 7d ad ldd r23, Y+61 ; 0x3d 1ed3e: 8e ad ldd r24, Y+62 ; 0x3e 1ed40: 9f ad ldd r25, Y+63 ; 0x3f 1ed42: aa 97 sbiw r28, 0x2a ; 42 1ed44: 90 58 subi r25, 0x80 ; 128 1ed46: a3 01 movw r20, r6 1ed48: 92 01 movw r18, r4 1ed4a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1ed4e: 6b 01 movw r12, r22 1ed50: 7c 01 movw r14, r24 1ed52: a2 96 adiw r28, 0x22 ; 34 1ed54: 2c ad ldd r18, Y+60 ; 0x3c 1ed56: 3d ad ldd r19, Y+61 ; 0x3d 1ed58: 4e ad ldd r20, Y+62 ; 0x3e 1ed5a: 5f ad ldd r21, Y+63 ; 0x3f 1ed5c: a2 97 sbiw r28, 0x22 ; 34 1ed5e: c5 01 movw r24, r10 1ed60: b4 01 movw r22, r8 1ed62: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1ed66: 9b 01 movw r18, r22 1ed68: ac 01 movw r20, r24 1ed6a: c7 01 movw r24, r14 1ed6c: b6 01 movw r22, r12 1ed6e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__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]; 1ed72: 60 93 d5 13 sts 0x13D5, r22 ; 0x8013d5 1ed76: 70 93 d6 13 sts 0x13D6, r23 ; 0x8013d6 1ed7a: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 1ed7e: 90 93 d8 13 sts 0x13D8, r25 ; 0x8013d8 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 1ed82: 90 e0 ldi r25, 0x00 ; 0 1ed84: 80 e0 ldi r24, 0x00 ; 0 1ed86: 0e 94 ff 8e call 0x11dfe ; 0x11dfe if (result >= 0) { 1ed8a: 17 fd sbrc r17, 7 1ed8c: d5 c0 rjmp .+426 ; 0x1ef38 DBG(_n("Calibration success.\n")); 1ed8e: 88 ef ldi r24, 0xF8 ; 248 1ed90: 9e e6 ldi r25, 0x6E ; 110 1ed92: 9f 93 push r25 1ed94: 8f 93 push r24 1ed96: 0f 94 1d dc call 0x3b83a ; 0x3b83a world2machine_update(vec_x, vec_y, cntr); 1ed9a: 41 ed ldi r20, 0xD1 ; 209 1ed9c: 53 e1 ldi r21, 0x13 ; 19 1ed9e: 69 ec ldi r22, 0xC9 ; 201 1eda0: 73 e1 ldi r23, 0x13 ; 19 1eda2: 81 ec ldi r24, 0xC1 ; 193 1eda4: 93 e1 ldi r25, 0x13 ; 19 1eda6: 0f 94 f8 c9 call 0x393f0 ; 0x393f0 #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); 1edaa: 48 e0 ldi r20, 0x08 ; 8 1edac: 50 e0 ldi r21, 0x00 ; 0 1edae: 65 ee ldi r22, 0xE5 ; 229 1edb0: 7f e0 ldi r23, 0x0F ; 15 1edb2: 81 ed ldi r24, 0xD1 ; 209 1edb4: 93 e1 ldi r25, 0x13 ; 19 1edb6: 0f 94 6f dd call 0x3bade ; 0x3bade 1edba: 48 e0 ldi r20, 0x08 ; 8 1edbc: 50 e0 ldi r21, 0x00 ; 0 1edbe: 6d ed ldi r22, 0xDD ; 221 1edc0: 7f e0 ldi r23, 0x0F ; 15 1edc2: 81 ec ldi r24, 0xC1 ; 193 1edc4: 93 e1 ldi r25, 0x13 ; 19 1edc6: 0f 94 6f dd call 0x3bade ; 0x3bade 1edca: 48 e0 ldi r20, 0x08 ; 8 1edcc: 50 e0 ldi r21, 0x00 ; 0 1edce: 65 ed ldi r22, 0xD5 ; 213 1edd0: 7f e0 ldi r23, 0x0F ; 15 1edd2: 89 ec ldi r24, 0xC9 ; 201 1edd4: 93 e1 ldi r25, 0x13 ; 19 1edd6: 0f 94 6f dd call 0x3bade ; 0x3bade 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(); 1edda: 0f 94 7d c9 call 0x392fa ; 0x392fa } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 1edde: 0f 90 pop r0 1ede0: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 1ede2: c7 55 subi r28, 0x57 ; 87 1ede4: df 4f sbci r29, 0xFF ; 255 1ede6: 88 81 ld r24, Y 1ede8: 99 81 ldd r25, Y+1 ; 0x01 1edea: c9 5a subi r28, 0xA9 ; 169 1edec: d0 40 sbci r29, 0x00 ; 0 1edee: 0e 94 03 68 call 0xd006 ; 0xd006 // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1edf2: 80 e0 ldi r24, 0x00 ; 0 1edf4: 90 e0 ldi r25, 0x00 ; 0 1edf6: a0 ea ldi r26, 0xA0 ; 160 1edf8: b0 e4 ldi r27, 0x40 ; 64 1edfa: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 1edfe: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 1ee02: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 1ee06: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1ee0a: 60 e0 ldi r22, 0x00 ; 0 1ee0c: 70 e0 ldi r23, 0x00 ; 0 1ee0e: 80 ea ldi r24, 0xA0 ; 160 1ee10: 91 e4 ldi r25, 0x41 ; 65 1ee12: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 1ee16: 0f 94 27 58 call 0x2b04e ; 0x2b04e //#ifndef NEW_XYZCAL if (result >= 0) 1ee1a: 17 fd sbrc r17, 7 1ee1c: 22 c0 rjmp .+68 ; 0x1ee62 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; 1ee1e: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b 1ee22: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c 1ee26: 10 92 4d 07 sts 0x074D, r1 ; 0x80074d 1ee2a: 10 92 4e 07 sts 0x074E, r1 ; 0x80074e destination[Z_AXIS] = 150.F; 1ee2e: 80 e0 ldi r24, 0x00 ; 0 1ee30: 90 e0 ldi r25, 0x00 ; 0 1ee32: a6 e1 ldi r26, 0x16 ; 22 1ee34: b3 e4 ldi r27, 0x43 ; 67 1ee36: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 1ee3a: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 1ee3e: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e 1ee42: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 1ee46: 65 e5 ldi r22, 0x55 ; 85 1ee48: 75 e5 ldi r23, 0x55 ; 85 1ee4a: 85 e5 ldi r24, 0x55 ; 85 1ee4c: 91 e4 ldi r25, 0x41 ; 65 1ee4e: 0f 94 2a ba call 0x37454 ; 0x37454 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 1ee52: 8c e1 ldi r24, 0x1C ; 28 1ee54: 98 e4 ldi r25, 0x48 ; 72 1ee56: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1ee5a: 0f 94 07 35 call 0x26a0e ; 0x26a0e // 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()) 1ee5e: 0f 94 8c c7 call 0x38f18 ; 0x38f18 st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 1ee62: 81 e0 ldi r24, 0x01 ; 1 1ee64: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_update(2); 1ee68: 82 e0 ldi r24, 0x02 ; 2 1ee6a: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 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)); 1ee6e: 8d ed ldi r24, 0xDD ; 221 1ee70: 97 e4 ldi r25, 0x47 ; 71 } 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) { 1ee72: 1f 3f cpi r17, 0xFF ; 255 1ee74: 99 f0 breq .+38 ; 0x1ee9c 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) { 1ee76: 1e 3f cpi r17, 0xFE ; 254 1ee78: 09 f0 breq .+2 ; 0x1ee7c 1ee7a: 73 c0 rjmp .+230 ; 0x1ef62 if (point_too_far_mask == 0) 1ee7c: af 96 adiw r28, 0x2f ; 47 1ee7e: 4f ad ldd r20, Y+63 ; 0x3f 1ee80: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1ee82: 88 ea ldi r24, 0xA8 ; 168 1ee84: 97 e4 ldi r25, 0x47 ; 71 { 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) 1ee86: 44 23 and r20, r20 1ee88: 49 f0 breq .+18 ; 0x1ee9c msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 1ee8a: af 96 adiw r28, 0x2f ; 47 1ee8c: 5f ad ldd r21, Y+63 ; 0x3f 1ee8e: 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); 1ee90: 86 e6 ldi r24, 0x66 ; 102 1ee92: 97 e4 ldi r25, 0x47 ; 71 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) 1ee94: 52 30 cpi r21, 0x02 ; 2 1ee96: 11 f0 breq .+4 ; 0x1ee9c // 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); 1ee98: 8f e1 ldi r24, 0x1F ; 31 1ee9a: 97 e4 ldi r25, 0x47 ; 71 1ee9c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1eea0: 0c 94 2a ea jmp 0x1d454 ; 0x1d454 (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]) : 1eea4: f2 01 movw r30, r4 1eea6: 25 81 ldd r18, Z+5 ; 0x05 1eea8: 36 81 ldd r19, Z+6 ; 0x06 1eeaa: 47 81 ldd r20, Z+7 ; 0x07 1eeac: 50 85 ldd r21, Z+8 ; 0x08 1eeae: c3 58 subi r28, 0x83 ; 131 1eeb0: df 4f sbci r29, 0xFF ; 255 1eeb2: 68 81 ld r22, Y 1eeb4: 79 81 ldd r23, Y+1 ; 0x01 1eeb6: 8a 81 ldd r24, Y+2 ; 0x02 1eeb8: 9b 81 ldd r25, Y+3 ; 0x03 1eeba: cd 57 subi r28, 0x7D ; 125 1eebc: d0 40 sbci r29, 0x00 ; 0 1eebe: 0c 94 8c ee jmp 0x1dd18 ; 0x1dd18 // 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]) : 1eec2: f2 01 movw r30, r4 1eec4: 25 81 ldd r18, Z+5 ; 0x05 1eec6: 36 81 ldd r19, Z+6 ; 0x06 1eec8: 47 81 ldd r20, Z+7 ; 0x07 1eeca: 50 85 ldd r21, Z+8 ; 0x08 1eecc: ed 96 adiw r28, 0x3d ; 61 1eece: 6c ad ldd r22, Y+60 ; 0x3c 1eed0: 7d ad ldd r23, Y+61 ; 0x3d 1eed2: 8e ad ldd r24, Y+62 ; 0x3e 1eed4: 9f ad ldd r25, Y+63 ; 0x3f 1eed6: ed 97 sbiw r28, 0x3d ; 61 1eed8: b8 c0 rjmp .+368 ; 0x1f04a (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1eeda: f2 01 movw r30, r4 1eedc: 25 81 ldd r18, Z+5 ; 0x05 1eede: 36 81 ldd r19, Z+6 ; 0x06 1eee0: 47 81 ldd r20, Z+7 ; 0x07 1eee2: 50 85 ldd r21, Z+8 ; 0x08 1eee4: ed 96 adiw r28, 0x3d ; 61 1eee6: 6c ad ldd r22, Y+60 ; 0x3c 1eee8: 7d ad ldd r23, Y+61 ; 0x3d 1eeea: 8e ad ldd r24, Y+62 ; 0x3e 1eeec: 9f ad ldd r25, Y+63 ; 0x3f 1eeee: ed 97 sbiw r28, 0x3d ; 61 1eef0: c6 c0 rjmp .+396 ; 0x1f07e 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]) : 1eef2: a3 01 movw r20, r6 1eef4: 92 01 movw r18, r4 1eef6: c3 58 subi r28, 0x83 ; 131 1eef8: df 4f sbci r29, 0xFF ; 255 1eefa: 68 81 ld r22, Y 1eefc: 79 81 ldd r23, Y+1 ; 0x01 1eefe: 8a 81 ldd r24, Y+2 ; 0x02 1ef00: 9b 81 ldd r25, Y+3 ; 0x03 1ef02: cd 57 subi r28, 0x7D ; 125 1ef04: d0 40 sbci r29, 0x00 ; 0 1ef06: 0c 94 f4 ee jmp 0x1dde8 ; 0x1dde8 // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1ef0a: 81 2c mov r8, r1 1ef0c: 91 2c mov r9, r1 1ef0e: 20 e8 ldi r18, 0x80 ; 128 1ef10: a2 2e mov r10, r18 1ef12: 2f e3 ldi r18, 0x3F ; 63 1ef14: b2 2e mov r11, r18 1ef16: 0c 94 f8 ee jmp 0x1ddf0 ; 0x1ddf0 float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 1ef1a: c1 2c mov r12, r1 1ef1c: d1 2c mov r13, r1 1ef1e: 76 01 movw r14, r12 1ef20: 0c 94 6f ef jmp 0x1dede ; 0x1dede ((r == 1) ? 1.f : 1ef24: c1 2c mov r12, r1 1ef26: d1 2c mov r13, r1 1ef28: 90 e8 ldi r25, 0x80 ; 128 1ef2a: e9 2e mov r14, r25 1ef2c: 9f e3 ldi r25, 0x3F ; 63 1ef2e: f9 2e mov r15, r25 1ef30: 0c 94 6f ef jmp 0x1dede ; 0x1dede 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; 1ef34: 12 e0 ldi r17, 0x02 ; 2 1ef36: a7 cb rjmp .-2226 ; 0x1e686 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1ef38: 1e 3f cpi r17, 0xFE ; 254 1ef3a: 89 f4 brne .+34 ; 0x1ef5e 1ef3c: af 96 adiw r28, 0x2f ; 47 1ef3e: 3f ad ldd r19, Y+63 ; 0x3f 1ef40: af 97 sbiw r28, 0x2f ; 47 1ef42: 32 30 cpi r19, 0x02 ; 2 1ef44: 09 f0 breq .+2 ; 0x1ef48 1ef46: 4d cf rjmp .-358 ; 0x1ede2 DBG(_n("Fitting failed => calibration failed.\n")); 1ef48: 81 ed ldi r24, 0xD1 ; 209 1ef4a: 9e e6 ldi r25, 0x6E ; 110 1ef4c: 9f 93 push r25 1ef4e: 8f 93 push r24 1ef50: 0f 94 1d dc call 0x3b83a ; 0x3b83a 1ef54: 44 cf rjmp .-376 ; 0x1edde // 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; 1ef56: af 96 adiw r28, 0x2f ; 47 1ef58: 1f ae std Y+63, r1 ; 0x3f 1ef5a: af 97 sbiw r28, 0x2f ; 47 1ef5c: 42 cf rjmp .-380 ; 0x1ede2 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1ef5e: 1f ef ldi r17, 0xFF ; 255 1ef60: 40 cf rjmp .-384 ; 0x1ede2 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) { 1ef62: af 96 adiw r28, 0x2f ; 47 1ef64: 6f ad ldd r22, Y+63 ; 0x3f 1ef66: af 97 sbiw r28, 0x2f ; 47 1ef68: 61 11 cpse r22, r1 1ef6a: 13 c0 rjmp .+38 ; 0x1ef92 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); 1ef6c: 84 e0 ldi r24, 0x04 ; 4 1ef6e: 96 e4 ldi r25, 0x46 ; 70 // The left and maybe the center point out of reach. //@todo Why isn't it found in the firmware.map msg = _n("XYZ calibration compromised. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR c=20 r=8 lcd_show_fullscreen_message_and_wait_P(msg); } if (point_too_far_mask == 0 || result > 0) { switch (result) { 1ef70: 11 30 cpi r17, 0x01 ; 1 1ef72: 51 f0 breq .+20 ; 0x1ef88 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); 1ef74: 81 ec ldi r24, 0xC1 ; 193 1ef76: 95 e4 ldi r25, 0x45 ; 69 // 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) { 1ef78: 12 30 cpi r17, 0x02 ; 2 1ef7a: 31 f0 breq .+12 ; 0x1ef88 default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1ef7c: 88 ea ldi r24, 0xA8 ; 168 1ef7e: 97 e4 ldi r25, 0x47 ; 71 // 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) { 1ef80: 11 11 cpse r17, r1 1ef82: 02 c0 rjmp .+4 ; 0x1ef88 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); 1ef84: 89 e4 ldi r24, 0x49 ; 73 1ef86: 96 e4 ldi r25, 0x46 ; 70 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); 1ef88: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 break; } lcd_show_fullscreen_message_and_wait_P(msg); 1ef8c: 0f 94 07 35 call 0x26a0e ; 0x26a0e 1ef90: 0d c0 rjmp .+26 ; 0x1efac // 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) 1ef92: af 96 adiw r28, 0x2f ; 47 1ef94: 8f ad ldd r24, Y+63 ; 0x3f 1ef96: af 97 sbiw r28, 0x2f ; 47 1ef98: 82 30 cpi r24, 0x02 ; 2 1ef9a: f1 f4 brne .+60 ; 0x1efd8 // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 1ef9c: 88 ed ldi r24, 0xD8 ; 216 1ef9e: 96 e4 ldi r25, 0x46 ; 70 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); 1efa0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 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); 1efa4: 0f 94 07 35 call 0x26a0e ; 0x26a0e } if (point_too_far_mask == 0 || result > 0) { 1efa8: 11 16 cp r1, r17 1efaa: 04 f3 brlt .-64 ; 0x1ef6c //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 1efac: 1f 3f cpi r17, 0xFF ; 255 1efae: 11 f4 brne .+4 ; 0x1efb4 1efb0: 0c 94 33 e7 jmp 0x1ce66 ; 0x1ce66 { // 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); 1efb4: 86 e0 ldi r24, 0x06 ; 6 1efb6: 0e 94 88 e6 call 0x1cd10 ; 0x1cd10 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1efba: 8f e5 ldi r24, 0x5F ; 95 1efbc: 9f e0 ldi r25, 0x0F ; 15 1efbe: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1efc2: 81 11 cpse r24, r1 1efc4: 0c 94 44 ea jmp 0x1d488 ; 0x1d488 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1efc8: 83 e4 ldi r24, 0x43 ; 67 1efca: 98 e4 ldi r25, 0x48 ; 72 1efcc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1efd0: 0f 94 07 35 call 0x26a0e ; 0x26a0e 1efd4: 0c 94 44 ea jmp 0x1d488 ; 0x1d488 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); 1efd8: 8c e8 ldi r24, 0x8C ; 140 1efda: 96 e4 ldi r25, 0x46 ; 70 1efdc: e1 cf rjmp .-62 ; 0x1efa0 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)) 1efde: 89 81 ldd r24, Y+1 ; 0x01 1efe0: 9a 81 ldd r25, Y+2 ; 0x02 1efe2: 80 37 cpi r24, 0x70 ; 112 1efe4: 98 40 sbci r25, 0x08 ; 8 1efe6: 10 f0 brcs .+4 ; 0x1efec 1efe8: 0c 94 83 ea jmp 0x1d506 ; 0x1d506 if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 1efec: ae 01 movw r20, r28 1efee: 4f 5f subi r20, 0xFF ; 255 1eff0: 5f 4f sbci r21, 0xFF ; 255 1eff2: 7a 01 movw r14, r20 1eff4: 04 eb ldi r16, 0xB4 ; 180 1eff6: 10 e0 ldi r17, 0x00 ; 0 1eff8: 24 e8 ldi r18, 0x84 ; 132 1effa: 33 e0 ldi r19, 0x03 ; 3 1effc: a6 01 movw r20, r12 1effe: 48 5c subi r20, 0xC8 ; 200 1f000: 51 09 sbc r21, r1 1f002: 69 2d mov r22, r9 1f004: 78 2d mov r23, r8 1f006: 8b 2d mov r24, r11 1f008: 9a 2d mov r25, r10 1f00a: 0f 94 e1 94 call 0x329c2 ; 0x329c2 1f00e: 88 23 and r24, r24 1f010: 11 f4 brne .+4 ; 0x1f016 1f012: 0c 94 83 ea jmp 0x1d506 ; 0x1d506 ad += 1440; 1f016: 89 81 ldd r24, Y+1 ; 0x01 1f018: 9a 81 ldd r25, Y+2 ; 0x02 1f01a: 80 56 subi r24, 0x60 ; 96 1f01c: 9a 4f sbci r25, 0xFA ; 250 1f01e: 0c 94 0d e9 jmp 0x1d21a ; 0x1d21a 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) { 1f022: 00 23 and r16, r16 1f024: 11 f4 brne .+4 ; 0x1f02a 1f026: 0c 94 9f ee jmp 0x1dd3e ; 0x1dd3e float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1f02a: 02 30 cpi r16, 0x02 ; 2 1f02c: 09 f0 breq .+2 ; 0x1f030 1f02e: 49 cf rjmp .-366 ; 0x1eec2 1f030: d2 01 movw r26, r4 1f032: 11 96 adiw r26, 0x01 ; 1 1f034: 2d 91 ld r18, X+ 1f036: 3d 91 ld r19, X+ 1f038: 4d 91 ld r20, X+ 1f03a: 5c 91 ld r21, X 1f03c: 14 97 sbiw r26, 0x04 ; 4 1f03e: 6e 96 adiw r28, 0x1e ; 30 1f040: 6c ad ldd r22, Y+60 ; 0x3c 1f042: 7d ad ldd r23, Y+61 ; 0x3d 1f044: 8e ad ldd r24, Y+62 ; 0x3e 1f046: 9f ad ldd r25, Y+63 ; 0x3f 1f048: 6e 97 sbiw r28, 0x1e ; 30 1f04a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1f04e: 4b 01 movw r8, r22 1f050: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 1f052: 60 e0 ldi r22, 0x00 ; 0 1f054: 70 e0 ldi r23, 0x00 ; 0 1f056: 80 e8 ldi r24, 0x80 ; 128 1f058: 9f e3 ldi r25, 0x3F ; 63 1f05a: 11 30 cpi r17, 0x01 ; 1 1f05c: 91 f0 breq .+36 ; 0x1f082 ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1f05e: 12 30 cpi r17, 0x02 ; 2 1f060: 09 f0 breq .+2 ; 0x1f064 1f062: 3b cf rjmp .-394 ; 0x1eeda 1f064: d2 01 movw r26, r4 1f066: 11 96 adiw r26, 0x01 ; 1 1f068: 2d 91 ld r18, X+ 1f06a: 3d 91 ld r19, X+ 1f06c: 4d 91 ld r20, X+ 1f06e: 5c 91 ld r21, X 1f070: 14 97 sbiw r26, 0x04 ; 4 1f072: 6e 96 adiw r28, 0x1e ; 30 1f074: 6c ad ldd r22, Y+60 ; 0x3c 1f076: 7d ad ldd r23, Y+61 ; 0x3d 1f078: 8e ad ldd r24, Y+62 ; 0x3e 1f07a: 9f ad ldd r25, Y+63 ; 0x3f 1f07c: 6e 97 sbiw r28, 0x1e ; 30 1f07e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 1f082: 9b 01 movw r18, r22 1f084: ac 01 movw r20, r24 1f086: c5 01 movw r24, r10 1f088: b4 01 movw r22, r8 1f08a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 1f08e: 9b 01 movw r18, r22 1f090: ac 01 movw r20, r24 1f092: c7 01 movw r24, r14 1f094: b6 01 movw r22, r12 1f096: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 1f09a: 6b 01 movw r12, r22 1f09c: 7c 01 movw r14, r24 1f09e: 0c 94 9f ee jmp 0x1dd3e ; 0x1dd3e // 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 : 1f0a2: 81 2c mov r8, r1 1f0a4: 91 2c mov r9, r1 1f0a6: 50 e8 ldi r21, 0x80 ; 128 1f0a8: a5 2e mov r10, r21 1f0aa: 5f e3 ldi r21, 0x3F ; 63 1f0ac: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1f0ae: 11 11 cpse r17, r1 1f0b0: 0c 94 79 ee jmp 0x1dcf2 ; 0x1dcf2 ((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; 1f0b4: 20 e0 ldi r18, 0x00 ; 0 1f0b6: 30 e0 ldi r19, 0x00 ; 0 1f0b8: 40 e8 ldi r20, 0x80 ; 128 1f0ba: 5f e3 ldi r21, 0x3F ; 63 1f0bc: ea cf rjmp .-44 ; 0x1f092 } // 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) { 1f0be: 11 11 cpse r17, r1 1f0c0: b4 cf rjmp .-152 ; 0x1f02a 1f0c2: 0c 94 9f ee jmp 0x1dd3e ; 0x1dd3e float a = (r == 1) ? 1.f : 1f0c6: 81 2c mov r8, r1 1f0c8: 91 2c mov r9, r1 1f0ca: 40 e8 ldi r20, 0x80 ; 128 1f0cc: a4 2e mov r10, r20 1f0ce: 4f e3 ldi r20, 0x3F ; 63 1f0d0: 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) { 1f0d2: 11 11 cpse r17, r1 1f0d4: be cf rjmp .-132 ; 0x1f052 1f0d6: 0c 94 9f ee jmp 0x1dd3e ; 0x1dd3e 0001f0da : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1f0da: cf 93 push r28 1f0dc: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1f0de: 86 ea ldi r24, 0xA6 ; 166 1f0e0: 9c e0 ldi r25, 0x0C ; 12 1f0e2: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 return ((status & components) == components); 1f0e6: 98 2f mov r25, r24 1f0e8: 9c 23 and r25, r28 1f0ea: 81 e0 ldi r24, 0x01 ; 1 1f0ec: 9c 13 cpse r25, r28 1f0ee: 80 e0 ldi r24, 0x00 ; 0 } 1f0f0: cf 91 pop r28 1f0f2: 08 95 ret 0001f0f4 : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1f0f4: 0f 93 push r16 1f0f6: 1f 93 push r17 1f0f8: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1f0fa: 0e 94 85 cf call 0x19f0a ; 0x19f0a if (*str != '.') 1f0fe: fc 01 movw r30, r24 1f100: 20 81 ld r18, Z 1f102: 2e 32 cpi r18, 0x2E ; 46 1f104: 11 f0 breq .+4 ; 0x1f10a 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 1f106: 80 e0 ldi r24, 0x00 ; 0 1f108: 34 c0 rjmp .+104 ; 0x1f172 // 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); 1f10a: b8 01 movw r22, r16 1f10c: 6e 5f subi r22, 0xFE ; 254 1f10e: 7f 4f sbci r23, 0xFF ; 255 1f110: 01 96 adiw r24, 0x01 ; 1 1f112: 0e 94 85 cf call 0x19f0a ; 0x19f0a if (*str != '.') 1f116: fc 01 movw r30, r24 1f118: 20 81 ld r18, Z 1f11a: 2e 32 cpi r18, 0x2E ; 46 1f11c: a1 f7 brne .-24 ; 0x1f106 return false; ++str; } str = Number(str, version + 2); 1f11e: b8 01 movw r22, r16 1f120: 6c 5f subi r22, 0xFC ; 252 1f122: 7f 4f sbci r23, 0xFF ; 255 1f124: 01 96 adiw r24, 0x01 ; 1 1f126: 0e 94 85 cf call 0x19f0a ; 0x19f0a version[3] = FIRMWARE_REVISION_RELEASED; 1f12a: 20 e4 ldi r18, 0x40 ; 64 1f12c: 30 e0 ldi r19, 0x00 ; 0 1f12e: f8 01 movw r30, r16 1f130: 37 83 std Z+7, r19 ; 0x07 1f132: 26 83 std Z+6, r18 ; 0x06 1f134: fc 01 movw r30, r24 1f136: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1f138: 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'; 1f13a: 89 2f mov r24, r25 1f13c: 8f 7d andi r24, 0xDF ; 223 1f13e: c1 f1 breq .+112 ; 0x1f1b0 1f140: 87 ef ldi r24, 0xF7 ; 247 1f142: 89 0f add r24, r25 1f144: 82 30 cpi r24, 0x02 ; 2 1f146: a0 f1 brcs .+104 ; 0x1f1b0 1f148: 9d 30 cpi r25, 0x0D ; 13 1f14a: 91 f1 breq .+100 ; 0x1f1b0 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 == '-'){ 1f14c: 9d 32 cpi r25, 0x2D ; 45 1f14e: 99 f7 brne .-26 ; 0x1f136 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1f150: 11 96 adiw r26, 0x01 ; 1 1f152: 9c 91 ld r25, X 1f154: 92 34 cpi r25, 0x42 ; 66 1f156: e1 f0 breq .+56 ; 0x1f190 1f158: 7c f4 brge .+30 ; 0x1f178 1f15a: 91 34 cpi r25, 0x41 ; 65 1f15c: a1 f6 brne .-88 ; 0x1f106 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); 1f15e: 0a 5f subi r16, 0xFA ; 250 1f160: 1f 4f sbci r17, 0xFF ; 255 1f162: 28 e0 ldi r18, 0x08 ; 8 1f164: 30 e0 ldi r19, 0x00 ; 0 1f166: 45 e0 ldi r20, 0x05 ; 5 1f168: 6e e4 ldi r22, 0x4E ; 78 1f16a: 7e e8 ldi r23, 0x8E ; 142 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); 1f16c: cf 01 movw r24, r30 1f16e: 0e 94 5a d1 call 0x1a2b4 ; 0x1a2b4 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1f172: 1f 91 pop r17 1f174: 0f 91 pop r16 1f176: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1f178: 94 34 cpi r25, 0x44 ; 68 1f17a: 91 f0 breq .+36 ; 0x1f1a0 1f17c: 92 35 cpi r25, 0x52 ; 82 1f17e: 19 f6 brne .-122 ; 0x1f106 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); 1f180: 0a 5f subi r16, 0xFA ; 250 1f182: 1f 4f sbci r17, 0xFF ; 255 1f184: 20 e2 ldi r18, 0x20 ; 32 1f186: 30 e0 ldi r19, 0x00 ; 0 1f188: 42 e0 ldi r20, 0x02 ; 2 1f18a: 62 e4 ldi r22, 0x42 ; 66 1f18c: 7e e8 ldi r23, 0x8E ; 142 1f18e: ee cf rjmp .-36 ; 0x1f16c 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); 1f190: 0a 5f subi r16, 0xFA ; 250 1f192: 1f 4f sbci r17, 0xFF ; 255 1f194: 20 e1 ldi r18, 0x10 ; 16 1f196: 30 e0 ldi r19, 0x00 ; 0 1f198: 44 e0 ldi r20, 0x04 ; 4 1f19a: 69 e4 ldi r22, 0x49 ; 73 1f19c: 7e e8 ldi r23, 0x8E ; 142 1f19e: e6 cf rjmp .-52 ; 0x1f16c 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); 1f1a0: 0a 5f subi r16, 0xFA ; 250 1f1a2: 1f 4f sbci r17, 0xFF ; 255 1f1a4: 30 e0 ldi r19, 0x00 ; 0 1f1a6: 20 e0 ldi r18, 0x00 ; 0 1f1a8: 43 e0 ldi r20, 0x03 ; 3 1f1aa: 65 e4 ldi r22, 0x45 ; 69 1f1ac: 7e e8 ldi r23, 0x8E ; 142 1f1ae: de cf rjmp .-68 ; 0x1f16c // 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; 1f1b0: 81 e0 ldi r24, 0x01 ; 1 1f1b2: df cf rjmp .-66 ; 0x1f172 0001f1b4 : 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)) { 1f1b4: 0f 93 push r16 1f1b6: 1f 93 push r17 1f1b8: cf 93 push r28 1f1ba: df 93 push r29 1f1bc: eb 01 movw r28, r22 1f1be: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1f1c0: 81 30 cpi r24, 0x01 ; 1 1f1c2: 81 f0 breq .+32 ; 0x1f1e4 1f1c4: 82 30 cpi r24, 0x02 ; 2 1f1c6: 89 f0 breq .+34 ; 0x1f1ea case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1f1c8: 82 e9 ldi r24, 0x92 ; 146 1f1ca: 90 e4 ldi r25, 0x40 ; 64 break; case ClCheckMode::_Warn: MENU_ITEM_TOGGLE_P(msg, _T(MSG_WARN), func); break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1f1cc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 1f1d0: 22 e0 ldi r18, 0x02 ; 2 1f1d2: a8 01 movw r20, r16 1f1d4: bc 01 movw r22, r24 1f1d6: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1f1d8: df 91 pop r29 1f1da: cf 91 pop r28 1f1dc: 1f 91 pop r17 1f1de: 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); 1f1e0: 0d 94 69 d0 jmp 0x3a0d2 ; 0x3a0d2 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); 1f1e4: 8b e8 ldi r24, 0x8B ; 139 1f1e6: 90 e4 ldi r25, 0x40 ; 64 1f1e8: f1 cf rjmp .-30 ; 0x1f1cc break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1f1ea: 82 e8 ldi r24, 0x82 ; 130 1f1ec: 90 e4 ldi r25, 0x40 ; 64 1f1ee: ee cf rjmp .-36 ; 0x1f1cc 0001f1f0 : /// (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 ) 1f1f0: 84 e0 ldi r24, 0x04 ; 4 1f1f2: 9d e0 ldi r25, 0x0D ; 13 1f1f4: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); 1f1f8: 8a 32 cpi r24, 0x2A ; 42 1f1fa: 39 f4 brne .+14 ; 0x1f20a 1f1fc: 8a e2 ldi r24, 0x2A ; 42 1f1fe: 9d e0 ldi r25, 0x0D ; 13 1f200: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1f204: 91 e0 ldi r25, 0x01 ; 1 1f206: 81 30 cpi r24, 0x01 ; 1 1f208: 09 f0 breq .+2 ; 0x1f20c 1f20a: 90 e0 ldi r25, 0x00 ; 0 } 1f20c: 89 2f mov r24, r25 1f20e: 08 95 ret 0001f210
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1f210: cf 93 push r28 1f212: df 93 push r29 1f214: cd b7 in r28, 0x3d ; 61 1f216: de b7 in r29, 0x3e ; 62 1f218: 67 97 sbiw r28, 0x17 ; 23 1f21a: 0f b6 in r0, 0x3f ; 63 1f21c: f8 94 cli 1f21e: de bf out 0x3e, r29 ; 62 1f220: 0f be out 0x3f, r0 ; 63 1f222: cd bf out 0x3d, r28 ; 61 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1f224: 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); 1f226: 84 b5 in r24, 0x24 ; 36 1f228: 82 60 ori r24, 0x02 ; 2 1f22a: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1f22c: 84 b5 in r24, 0x24 ; 36 1f22e: 81 60 ori r24, 0x01 ; 1 1f230: 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); 1f232: 85 b5 in r24, 0x25 ; 37 1f234: 82 60 ori r24, 0x02 ; 2 1f236: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1f238: 85 b5 in r24, 0x25 ; 37 1f23a: 81 60 ori r24, 0x01 ; 1 1f23c: 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); 1f23e: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1f242: 81 60 ori r24, 0x01 ; 1 1f244: 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; 1f248: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1f24c: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f250: 82 60 ori r24, 0x02 ; 2 1f252: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1f256: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f25a: 81 60 ori r24, 0x01 ; 1 1f25c: 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); 1f260: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1f264: 81 60 ori r24, 0x01 ; 1 1f266: 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); 1f26a: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1f26e: 84 60 ori r24, 0x04 ; 4 1f270: 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); 1f274: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1f278: 81 60 ori r24, 0x01 ; 1 1f27a: 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 1f27e: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f282: 82 60 ori r24, 0x02 ; 2 1f284: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1f288: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f28c: 81 60 ori r24, 0x01 ; 1 1f28e: 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 1f292: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1f296: 81 60 ori r24, 0x01 ; 1 1f298: 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 1f29c: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f2a0: 82 60 ori r24, 0x02 ; 2 1f2a2: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1f2a6: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f2aa: 81 60 ori r24, 0x01 ; 1 1f2ac: 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 1f2b0: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1f2b4: 81 60 ori r24, 0x01 ; 1 1f2b6: 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 1f2ba: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f2be: 82 60 ori r24, 0x02 ; 2 1f2c0: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1f2c4: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f2c8: 81 60 ori r24, 0x01 ; 1 1f2ca: 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 1f2ce: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1f2d2: 81 60 ori r24, 0x01 ; 1 1f2d4: 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); 1f2d8: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f2dc: 84 60 ori r24, 0x04 ; 4 1f2de: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1f2e2: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f2e6: 82 60 ori r24, 0x02 ; 2 1f2e8: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1f2ec: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f2f0: 81 60 ori r24, 0x01 ; 1 1f2f2: 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); 1f2f6: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f2fa: 80 68 ori r24, 0x80 ; 128 1f2fc: 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; 1f300: 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) { 1f304: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f306: f8 94 cli wdt_reset(); 1f308: a8 95 wdr MCUSR &= ~_BV(WDRF); 1f30a: 84 b7 in r24, 0x34 ; 52 1f30c: 87 7f andi r24, 0xF7 ; 247 1f30e: 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" ); 1f310: 0f b6 in r0, 0x3f ; 63 1f312: f8 94 cli 1f314: a8 95 wdr 1f316: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f31a: 88 61 ori r24, 0x18 ; 24 1f31c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f320: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f324: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f326: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1f328: 9f b7 in r25, 0x3f ; 63 1f32a: 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 1f32c: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1f330: 84 e0 ldi r24, 0x04 ; 4 1f332: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1f33a: 81 60 ori r24, 0x01 ; 1 1f33c: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f344: 8d 7f andi r24, 0xFD ; 253 1f346: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f34e: 8b 7f andi r24, 0xFB ; 251 1f350: 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; 1f354: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1f358: 9f bf out 0x3f, r25 ; 63 } void backlight_init() { //check for backlight support on lcd SET_INPUT(LCD_BL_PIN); 1f35a: 6b 98 cbi 0x0d, 3 ; 13 WRITE(LCD_BL_PIN,HIGH); 1f35c: 73 9a sbi 0x0e, 3 ; 14 _delay(10); 1f35e: 6a e0 ldi r22, 0x0A ; 10 1f360: 70 e0 ldi r23, 0x00 ; 0 1f362: 80 e0 ldi r24, 0x00 ; 0 1f364: 90 e0 ldi r25, 0x00 ; 0 1f366: 0f 94 8d 3c call 0x2791a ; 0x2791a backlightSupport = !READ(LCD_BL_PIN); 1f36a: 9c b1 in r25, 0x0c ; 12 1f36c: 81 e0 ldi r24, 0x01 ; 1 1f36e: 29 2f mov r18, r25 1f370: 28 70 andi r18, 0x08 ; 8 1f372: 93 fd sbrc r25, 3 1f374: 80 e0 ldi r24, 0x00 ; 0 1f376: 80 93 fe 03 sts 0x03FE, r24 ; 0x8003fe if (!backlightSupport) return; 1f37a: 21 11 cpse r18, r1 1f37c: 22 c0 rjmp .+68 ; 0x1f3c2 //initialize backlight backlightMode = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_MODE, BACKLIGHT_MODE_AUTO); 1f37e: 62 e0 ldi r22, 0x02 ; 2 1f380: 82 e3 ldi r24, 0x32 ; 50 1f382: 9d e0 ldi r25, 0x0D ; 13 1f384: 0e 94 14 78 call 0xf028 ; 0xf028 1f388: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, 130); 1f38c: 62 e8 ldi r22, 0x82 ; 130 1f38e: 84 e3 ldi r24, 0x34 ; 52 1f390: 9d e0 ldi r25, 0x0D ; 13 1f392: 0e 94 14 78 call 0xf028 ; 0xf028 1f396: 80 93 fd 03 sts 0x03FD, r24 ; 0x8003fd backlightLevel_LOW = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, 50); 1f39a: 62 e3 ldi r22, 0x32 ; 50 1f39c: 83 e3 ldi r24, 0x33 ; 51 1f39e: 9d e0 ldi r25, 0x0D ; 13 1f3a0: 0e 94 14 78 call 0xf028 ; 0xf028 1f3a4: 80 93 fc 03 sts 0x03FC, r24 ; 0x8003fc backlightTimer_period = eeprom_init_default_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, 10); // in seconds 1f3a8: 6a e0 ldi r22, 0x0A ; 10 1f3aa: 70 e0 ldi r23, 0x00 ; 0 1f3ac: 80 e3 ldi r24, 0x30 ; 48 1f3ae: 9d e0 ldi r25, 0x0D ; 13 1f3b0: 0e 94 fc 77 call 0xeff8 ; 0xeff8 1f3b4: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 1f3b8: 80 93 4d 02 sts 0x024D, r24 ; 0x80024d SET_OUTPUT(LCD_BL_PIN); 1f3bc: 6b 9a sbi 0x0d, 3 ; 13 backlightTimer_reset(); 1f3be: 0e 94 0d 8c call 0x1181a ; 0x1181a return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1f3c2: 8f 98 cbi 0x11, 7 ; 17 SET_OUTPUT(LCD_PINS_RS); 1f3c4: 55 9a sbi 0x0a, 5 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1f3c6: 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); 1f3c8: 85 9a sbi 0x10, 5 ; 16 SET_OUTPUT(LCD_PINS_D5); 1f3ca: 9c 9a sbi 0x13, 4 ; 19 SET_OUTPUT(LCD_PINS_D6); 1f3cc: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f3d0: 80 68 ori r24, 0x80 ; 128 1f3d2: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> SET_OUTPUT(LCD_PINS_D7); 1f3d6: 9b 9a sbi 0x13, 3 ; 19 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1f3d8: 80 91 0d 04 lds r24, 0x040D ; 0x80040d <_ZL19lcd_displayfunction.lto_priv.568> 1f3dc: 88 60 ori r24, 0x08 ; 8 1f3de: 80 93 0d 04 sts 0x040D, r24 ; 0x80040d <_ZL19lcd_displayfunction.lto_priv.568> 1f3e2: 2f ef ldi r18, 0xFF ; 255 1f3e4: 30 e7 ldi r19, 0x70 ; 112 1f3e6: 82 e0 ldi r24, 0x02 ; 2 1f3e8: 21 50 subi r18, 0x01 ; 1 1f3ea: 30 40 sbci r19, 0x00 ; 0 1f3ec: 80 40 sbci r24, 0x00 ; 0 1f3ee: e1 f7 brne .-8 ; 0x1f3e8 1f3f0: 00 c0 rjmp .+0 ; 0x1f3f2 1f3f2: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1f3f4: 81 e0 ldi r24, 0x01 ; 1 1f3f6: 0e 94 80 70 call 0xe100 ; 0xe100 fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1f3fa: 88 e2 ldi r24, 0x28 ; 40 1f3fc: 92 e7 ldi r25, 0x72 ; 114 1f3fe: 90 93 08 04 sts 0x0408, r25 ; 0x800408 <_lcdout+0x9> 1f402: 80 93 07 04 sts 0x0407, r24 ; 0x800407 <_lcdout+0x8> 1f406: 10 92 0a 04 sts 0x040A, r1 ; 0x80040a <_lcdout+0xb> 1f40a: 10 92 09 04 sts 0x0409, r1 ; 0x800409 <_lcdout+0xa> 1f40e: 12 e0 ldi r17, 0x02 ; 2 1f410: 10 93 02 04 sts 0x0402, r17 ; 0x800402 <_lcdout+0x3> 1f414: 10 92 0c 04 sts 0x040C, r1 ; 0x80040c <_lcdout+0xd> 1f418: 10 92 0b 04 sts 0x040B, r1 ; 0x80040b <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1f41c: 0e 94 c1 70 call 0xe182 ; 0xe182 lcd_longpress_func = menu_lcd_longpress_func; 1f420: 8d e5 ldi r24, 0x5D ; 93 1f422: 92 ed ldi r25, 0xD2 ; 210 1f424: 90 93 12 04 sts 0x0412, r25 ; 0x800412 1f428: 80 93 11 04 sts 0x0411, r24 ; 0x800411 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1f42c: 86 ec ldi r24, 0xC6 ; 198 1f42e: 99 e3 ldi r25, 0x39 ; 57 1f430: 90 93 10 04 sts 0x0410, r25 ; 0x800410 1f434: 80 93 0f 04 sts 0x040F, r24 ; 0x80040f menu_menu = lcd_status_screen; 1f438: 84 e6 ldi r24, 0x64 ; 100 1f43a: 9a e3 ldi r25, 0x3A ; 58 1f43c: 90 93 6a 0e sts 0x0E6A, r25 ; 0x800e6a 1f440: 80 93 69 0e sts 0x0E69, r24 ; 0x800e69 SET_INPUT(BTN_EN1); 1f444: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f448: 8b 7f andi r24, 0xFB ; 251 1f44a: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(BTN_EN2); 1f44e: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f452: 8d 7f andi r24, 0xFD ; 253 1f454: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1f458: 9f b7 in r25, 0x3f ; 63 1f45a: f8 94 cli 1f45c: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f460: 84 60 ori r24, 0x04 ; 4 1f462: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f466: 9f bf out 0x3f, r25 ; 63 WRITE(BTN_EN2, HIGH); 1f468: 9f b7 in r25, 0x3f ; 63 1f46a: f8 94 cli 1f46c: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f470: 82 60 ori r24, 0x02 ; 2 1f472: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f476: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1f478: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f47c: 8f 7b andi r24, 0xBF ; 191 1f47e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BTN_ENC, HIGH); 1f482: 9f b7 in r25, 0x3f ; 63 1f484: f8 94 cli 1f486: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f48a: 80 64 ori r24, 0x40 ; 64 1f48c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f490: 9f bf out 0x3f, r25 ; 63 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1f492: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f496: 8e 7f andi r24, 0xFE ; 254 1f498: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1f49c: 9f b7 in r25, 0x3f ; 63 1f49e: f8 94 cli 1f4a0: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f4a4: 81 60 ori r24, 0x01 ; 1 1f4a6: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f4aa: 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); 1f4ac: af e9 ldi r26, 0x9F ; 159 1f4ae: bf e0 ldi r27, 0x0F ; 15 1f4b0: 11 97 sbiw r26, 0x01 ; 1 1f4b2: f1 f7 brne .-4 ; 0x1f4b0 1f4b4: 00 c0 rjmp .+0 ; 0x1f4b6 1f4b6: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1f4b8: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f4bc: 80 95 com r24 1f4be: 81 70 andi r24, 0x01 ; 1 1f4c0: 80 93 0e 04 sts 0x040E, r24 ; 0x80040e #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1f4c4: 44 e1 ldi r20, 0x14 ; 20 1f4c6: 50 e0 ldi r21, 0x00 ; 0 1f4c8: 6e e0 ldi r22, 0x0E ; 14 1f4ca: 71 e7 ldi r23, 0x71 ; 113 1f4cc: 8a e3 ldi r24, 0x3A ; 58 1f4ce: 95 e0 ldi r25, 0x05 ; 5 1f4d0: 0f 94 48 db call 0x3b690 ; 0x3b690 timer2_init(); // enables functional millis ultralcd_init(); spi_init(); 1f4d4: 0f 94 1a c0 call 0x38034 ; 0x38034 } void lcd_splash() { lcd_clear(); // clears display and homes screen 1f4d8: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1f4dc: 84 ea ldi r24, 0xA4 ; 164 1f4de: 9f e8 ldi r25, 0x8F ; 143 1f4e0: 9f 93 push r25 1f4e2: 8f 93 push r24 1f4e4: 8b ea ldi r24, 0xAB ; 171 1f4e6: 9f e8 ldi r25, 0x8F ; 143 1f4e8: 9f 93 push r25 1f4ea: 8f 93 push r24 1f4ec: 0e 94 ee 6f call 0xdfdc ; 0xdfdc static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1f4f0: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f4f4: 84 60 ori r24, 0x04 ; 4 1f4f6: 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)); 1f4fa: 60 e0 ldi r22, 0x00 ; 0 1f4fc: 87 ed ldi r24, 0xD7 ; 215 1f4fe: 9e e0 ldi r25, 0x0E ; 14 1f500: 0e 94 14 78 call 0xf028 ; 0xf028 1f504: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 spi_init(); lcd_splash(); Sound_Init(); // also guarantee "SET_OUTPUT(BEEPER)" selectedSerialPort = eeprom_init_default_byte((uint8_t *)EEPROM_SECOND_SERIAL_ACTIVE, 0); 1f508: 60 e0 ldi r22, 0x00 ; 0 1f50a: 88 e0 ldi r24, 0x08 ; 8 1f50c: 9f e0 ldi r25, 0x0F ; 15 1f50e: 0e 94 14 78 call 0xf028 ; 0xf028 1f512: 80 93 21 05 sts 0x0521, r24 ; 0x800521 MYSERIAL.begin(BAUDRATE); 1f516: 0e 94 a4 da call 0x1b548 ; 0x1b548 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1f51a: 86 e5 ldi r24, 0x56 ; 86 1f51c: 99 e7 ldi r25, 0x79 ; 121 1f51e: 90 93 09 05 sts 0x0509, r25 ; 0x800509 <_uartout+0x9> 1f522: 80 93 08 05 sts 0x0508, r24 ; 0x800508 <_uartout+0x8> 1f526: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_uartout+0xb> 1f52a: 10 92 0a 05 sts 0x050A, r1 ; 0x80050a <_uartout+0xa> 1f52e: 10 93 03 05 sts 0x0503, r17 ; 0x800503 <_uartout+0x3> 1f532: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d <_uartout+0xd> 1f536: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_uartout+0xc> stdout = uartout; 1f53a: 80 e0 ldi r24, 0x00 ; 0 1f53c: 95 e0 ldi r25, 0x05 ; 5 1f53e: 90 93 16 18 sts 0x1816, r25 ; 0x801816 <__iob+0x3> 1f542: 80 93 15 18 sts 0x1815, r24 ; 0x801815 <__iob+0x2> #ifdef XFLASH bool xflash_success = xflash_init(); 1f546: 0e 94 b9 e3 call 0x1c772 ; 0x1c772 1f54a: b8 2e mov r11, r24 uint8_t optiboot_status = 1; if (xflash_success) 1f54c: 0f 90 pop r0 1f54e: 0f 90 pop r0 1f550: 0f 90 pop r0 1f552: 0f 90 pop r0 1f554: 8e 01 movw r16, r28 1f556: 0f 5f subi r16, 0xFF ; 255 1f558: 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; 1f55a: aa 24 eor r10, r10 1f55c: a3 94 inc r10 if (xflash_success) 1f55e: 88 23 and r24, r24 1f560: 09 f4 brne .+2 ; 0x1f564 1f562: d8 c0 rjmp .+432 ; 0x1f714 { optiboot_status = optiboot_xflash_enter(); 1f564: 0f 94 28 c0 call 0x38050 ; 0x38050 1f568: 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)) 1f56a: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7e3> 1f56e: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7e4> 1f572: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7e5> 1f576: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7e6> 1f57a: 8a 3a cpi r24, 0xAA ; 170 1f57c: 95 45 sbci r25, 0x55 ; 85 1f57e: aa 4a sbci r26, 0xAA ; 170 1f580: b5 45 sbci r27, 0x55 ; 85 1f582: 09 f0 breq .+2 ; 0x1f586 1f584: bf c0 rjmp .+382 ; 0x1f704 1f586: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e2> 1f58a: 87 ff sbrs r24, 7 1f58c: bb c0 rjmp .+374 ; 0x1f704 { uint8_t lang = boot_reserved >> 3; 1f58e: 80 90 fa 1f lds r8, 0x1FFA ; 0x801ffa <__bss_end+0x7e1> 1f592: 98 2c mov r9, r8 1f594: 96 94 lsr r9 1f596: 96 94 lsr r9 1f598: 96 94 lsr r9 uint8_t state = boot_reserved & 0x07; 1f59a: f8 2d mov r31, r8 1f59c: f7 70 andi r31, 0x07 ; 7 1f59e: 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 1f5a0: 99 20 and r9, r9 1f5a2: 09 f4 brne .+2 ; 0x1f5a6 1f5a4: af c0 rjmp .+350 ; 0x1f704 #ifdef XFLASH if (lang == LANG_ID_SEC) 1f5a6: 21 e0 ldi r18, 0x01 ; 1 1f5a8: 92 12 cpse r9, r18 1f5aa: 24 c0 rjmp .+72 ; 0x1f5f4 { 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 1f5ac: 40 e1 ldi r20, 0x10 ; 16 1f5ae: 50 e0 ldi r21, 0x00 ; 0 1f5b0: 60 e0 ldi r22, 0x00 ; 0 1f5b2: 71 e0 ldi r23, 0x01 ; 1 1f5b4: c8 01 movw r24, r16 1f5b6: 0f 94 f5 da call 0x3b5ea ; 0x3b5ea if (offset) *offset = ui; 1f5ba: 60 e0 ldi r22, 0x00 ; 0 1f5bc: 71 e0 ldi r23, 0x01 ; 1 1f5be: 6b 01 movw r12, r22 1f5c0: f1 2c mov r15, r1 1f5c2: e1 2c mov r14, r1 lang_table_header_t header; uint32_t src_addr; if (lang_get_header(lang, &header, &src_addr)) 1f5c4: 89 81 ldd r24, Y+1 ; 0x01 1f5c6: 9a 81 ldd r25, Y+2 ; 0x02 1f5c8: ab 81 ldd r26, Y+3 ; 0x03 1f5ca: bc 81 ldd r27, Y+4 ; 0x04 1f5cc: 85 3a cpi r24, 0xA5 ; 165 1f5ce: 9a 45 sbci r25, 0x5A ; 90 1f5d0: a4 4b sbci r26, 0xB4 ; 180 1f5d2: bb 44 sbci r27, 0x4B ; 75 1f5d4: 09 f0 breq .+2 ; 0x1f5d8 1f5d6: 96 c0 rjmp .+300 ; 0x1f704 { lcd_puts_at_P(1,0,PSTR("Language update")); 1f5d8: 49 ed ldi r20, 0xD9 ; 217 1f5da: 5f e8 ldi r21, 0x8F ; 143 1f5dc: 60 e0 ldi r22, 0x00 ; 0 1f5de: 81 e0 ldi r24, 0x01 ; 1 1f5e0: 0e 94 29 70 call 0xe052 ; 0xe052 for (uint8_t i = 0; i < state; i++) 1f5e4: 91 2c mov r9, r1 1f5e6: 89 14 cp r8, r9 1f5e8: 39 f1 breq .+78 ; 0x1f638 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1f5ea: 8e e2 ldi r24, 0x2E ; 46 1f5ec: 0e 94 c4 70 call 0xe188 ; 0xe188 1f5f0: 93 94 inc r9 1f5f2: f9 cf rjmp .-14 ; 0x1f5e6 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1f5f4: 8c e5 ldi r24, 0x5C ; 92 1f5f6: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1f5f8: 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; 1f5fa: c1 2c mov r12, r1 1f5fc: d1 2c mov r13, r1 1f5fe: 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 1f600: 20 e1 ldi r18, 0x10 ; 16 1f602: 30 e0 ldi r19, 0x00 ; 0 1f604: a8 01 movw r20, r16 1f606: c7 01 movw r24, r14 1f608: b6 01 movw r22, r12 1f60a: 0e 94 89 e2 call 0x1c512 ; 0x1c512 if (header->magic != LANG_MAGIC) break; //break if not valid 1f60e: 89 81 ldd r24, Y+1 ; 0x01 1f610: 9a 81 ldd r25, Y+2 ; 0x02 1f612: ab 81 ldd r26, Y+3 ; 0x03 1f614: bc 81 ldd r27, Y+4 ; 0x04 1f616: 85 3a cpi r24, 0xA5 ; 165 1f618: 9a 45 sbci r25, 0x5A ; 90 1f61a: a4 4b sbci r26, 0xB4 ; 180 1f61c: bb 44 sbci r27, 0x4B ; 75 1f61e: 09 f0 breq .+2 ; 0x1f622 1f620: 71 c0 rjmp .+226 ; 0x1f704 if (offset) *offset = addr; if (--lang == 0) return 1; 1f622: f2 e0 ldi r31, 0x02 ; 2 1f624: 9f 16 cp r9, r31 1f626: c1 f2 breq .-80 ; 0x1f5d8 addr += header->size; //calc address of next table 1f628: 8d 81 ldd r24, Y+5 ; 0x05 1f62a: 9e 81 ldd r25, Y+6 ; 0x06 1f62c: c8 0e add r12, r24 1f62e: d9 1e adc r13, r25 1f630: e1 1c adc r14, r1 1f632: f1 1c adc r15, r1 1f634: 9a 94 dec r9 1f636: e4 cf rjmp .-56 ; 0x1f600 lcd_print('.'); _delay(100); 1f638: 64 e6 ldi r22, 0x64 ; 100 1f63a: 70 e0 ldi r23, 0x00 ; 0 1f63c: 80 e0 ldi r24, 0x00 ; 0 1f63e: 90 e0 ldi r25, 0x00 ; 0 1f640: 0f 94 8d 3c call 0x2791a ; 0x2791a boot_reserved = (boot_reserved & 0xF8) | ((state + 1) & 0x07); 1f644: 80 91 fa 1f lds r24, 0x1FFA ; 0x801ffa <__bss_end+0x7e1> 1f648: 88 7f andi r24, 0xF8 ; 248 1f64a: 91 e0 ldi r25, 0x01 ; 1 1f64c: 98 0d add r25, r8 1f64e: 97 70 andi r25, 0x07 ; 7 1f650: 89 2b or r24, r25 1f652: 80 93 fa 1f sts 0x1FFA, r24 ; 0x801ffa <__bss_end+0x7e1> if ((state * LANGBOOT_BLOCKSIZE) < header.size) 1f656: 91 2c mov r9, r1 1f658: 98 2c mov r9, r8 1f65a: 88 24 eor r8, r8 1f65c: 92 94 swap r9 1f65e: 80 ef ldi r24, 0xF0 ; 240 1f660: 98 22 and r9, r24 1f662: 8d 81 ldd r24, Y+5 ; 0x05 1f664: 9e 81 ldd r25, Y+6 ; 0x06 1f666: 88 16 cp r8, r24 1f668: 99 06 cpc r9, r25 1f66a: 08 f0 brcs .+2 ; 0x1f66e 1f66c: 46 c0 rjmp .+140 ; 0x1f6fa { cli(); 1f66e: f8 94 cli uint16_t size = header.size - state * LANGBOOT_BLOCKSIZE; 1f670: 0d 81 ldd r16, Y+5 ; 0x05 1f672: 1e 81 ldd r17, Y+6 ; 0x06 1f674: 08 19 sub r16, r8 1f676: 19 09 sbc r17, r9 if (size > LANGBOOT_BLOCKSIZE) size = LANGBOOT_BLOCKSIZE; 1f678: 01 30 cpi r16, 0x01 ; 1 1f67a: 20 e1 ldi r18, 0x10 ; 16 1f67c: 12 07 cpc r17, r18 1f67e: 10 f0 brcs .+4 ; 0x1f684 1f680: 00 e0 ldi r16, 0x00 ; 0 1f682: 10 e1 ldi r17, 0x10 ; 16 xflash_rd_data(src_addr + state * LANGBOOT_BLOCKSIZE, (uint8_t*)LANGBOOT_RAMBUFFER, size); 1f684: c7 01 movw r24, r14 1f686: b6 01 movw r22, r12 1f688: 68 0d add r22, r8 1f68a: 79 1d adc r23, r9 1f68c: 81 1d adc r24, r1 1f68e: 91 1d adc r25, r1 1f690: 98 01 movw r18, r16 1f692: 40 e0 ldi r20, 0x00 ; 0 1f694: 58 e0 ldi r21, 0x08 ; 8 1f696: 0e 94 89 e2 call 0x1c512 ; 0x1c512 } void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size) { cli(); 1f69a: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1f69c: 8a ea ldi r24, 0xAA ; 170 1f69e: 95 e5 ldi r25, 0x55 ; 85 1f6a0: dc 01 movw r26, r24 1f6a2: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7e3> 1f6a6: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7e4> 1f6aa: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7e5> 1f6ae: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7e6> boot_app_flags |= BOOT_APP_FLG_COPY | BOOT_APP_FLG_ERASE; 1f6b2: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e2> 1f6b6: 83 60 ori r24, 0x03 ; 3 1f6b8: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7e2> boot_copy_size = (uint16_t)size; 1f6bc: 10 93 f9 1f sts 0x1FF9, r17 ; 0x801ff9 <__bss_end+0x7e0> 1f6c0: 00 93 f8 1f sts 0x1FF8, r16 ; 0x801ff8 <__bss_end+0x7df> boot_src_addr = (uint32_t)rptr; 1f6c4: 80 e0 ldi r24, 0x00 ; 0 1f6c6: 98 e0 ldi r25, 0x08 ; 8 1f6c8: a0 e0 ldi r26, 0x00 ; 0 1f6ca: b0 e0 ldi r27, 0x00 ; 0 1f6cc: 80 93 f0 1f sts 0x1FF0, r24 ; 0x801ff0 <__bss_end+0x7d7> 1f6d0: 90 93 f1 1f sts 0x1FF1, r25 ; 0x801ff1 <__bss_end+0x7d8> 1f6d4: a0 93 f2 1f sts 0x1FF2, r26 ; 0x801ff2 <__bss_end+0x7d9> 1f6d8: b0 93 f3 1f sts 0x1FF3, r27 ; 0x801ff3 <__bss_end+0x7da> if (state == 0) { //TODO - check header integrity } bootapp_ram2flash(LANGBOOT_RAMBUFFER, _SEC_LANG_TABLE + state * LANGBOOT_BLOCKSIZE, size); 1f6dc: c4 01 movw r24, r8 1f6de: 80 50 subi r24, 0x00 ; 0 1f6e0: 9f 4f sbci r25, 0xFF ; 255 boot_dst_addr = (uint32_t)fptr; 1f6e2: b0 e0 ldi r27, 0x00 ; 0 1f6e4: a0 e0 ldi r26, 0x00 ; 0 1f6e6: 80 93 f4 1f sts 0x1FF4, r24 ; 0x801ff4 <__bss_end+0x7db> 1f6ea: 90 93 f5 1f sts 0x1FF5, r25 ; 0x801ff5 <__bss_end+0x7dc> 1f6ee: a0 93 f6 1f sts 0x1FF6, r26 ; 0x801ff6 <__bss_end+0x7dd> 1f6f2: b0 93 f7 1f sts 0x1FF7, r27 ; 0x801ff7 <__bss_end+0x7de> 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(); 1f6f6: 0e 94 81 68 call 0xd102 ; 0xd102 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1f6fa: 61 e0 ldi r22, 0x01 ; 1 1f6fc: 8e ef ldi r24, 0xFE ; 254 1f6fe: 9f e0 ldi r25, 0x0F ; 15 1f700: 0f 94 7f dd call 0x3bafe ; 0x3bafe //TODO - check sec lang data integrity eeprom_update_byte_notify((unsigned char *)EEPROM_LANG, LANG_ID_SEC); } } } boot_app_magic = 0; 1f704: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e3> 1f708: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e4> 1f70c: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e5> 1f710: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e6> 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(); 1f714: 0e 94 f8 f8 call 0x1f1f0 ; 0x1f1f0 setup_powerhold(); farm_mode_init(); #ifdef TMC2130 if(FarmOrUserECool()) { 1f718: 88 23 and r24, r24 1f71a: 51 f0 breq .+20 ; 0x1f730 //increased extruder current (PFW363) currents[E_AXIS].setiRun(TMC2130_CURRENTS_FARM); 1f71c: 64 e2 ldi r22, 0x24 ; 36 1f71e: 86 e6 ldi r24, 0x66 ; 102 1f720: 92 e0 ldi r25, 0x02 ; 2 1f722: 0e 94 3b 69 call 0xd276 ; 0xd276 currents[E_AXIS].setiHold(TMC2130_CURRENTS_FARM); 1f726: 64 e2 ldi r22, 0x24 ; 36 1f728: 86 e6 ldi r24, 0x66 ; 102 1f72a: 92 e0 ldi r25, 0x02 ; 2 1f72c: 0e 94 33 69 call 0xd266 ; 0xd266 #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); 1f730: 44 e1 ldi r20, 0x14 ; 20 1f732: 50 e0 ldi r21, 0x00 ; 0 1f734: 65 e1 ldi r22, 0x15 ; 21 1f736: 7d e0 ldi r23, 0x0D ; 13 1f738: c8 01 movw r24, r16 1f73a: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 if (SN[19] || strncmp_P(SN, PSTR("CZPX"), 4)) 1f73e: 8c 89 ldd r24, Y+20 ; 0x14 1f740: 81 11 cpse r24, r1 1f742: 0a c0 rjmp .+20 ; 0x1f758 1f744: 44 e0 ldi r20, 0x04 ; 4 1f746: 50 e0 ldi r21, 0x00 ; 0 1f748: 69 ee ldi r22, 0xE9 ; 233 1f74a: 70 e9 ldi r23, 0x90 ; 144 1f74c: c8 01 movw r24, r16 1f74e: 0f 94 3a db call 0x3b674 ; 0x3b674 1f752: 89 2b or r24, r25 1f754: 09 f4 brne .+2 ; 0x1f758 1f756: 51 c0 rjmp .+162 ; 0x1f7fa * @return 1 on general failure */ #ifdef PRUSA_SN_SUPPORT static uint8_t get_PRUSA_SN(char* SN) { uint8_t selectedSerialPort_bak = selectedSerialPort; 1f758: e0 90 21 05 lds r14, 0x0521 ; 0x800521 uint8_t rxIndex; bool SN_valid = false; ShortTimer timeout; 1f75c: 1d 8a std Y+21, r1 ; 0x15 1f75e: 1f 8a std Y+23, r1 ; 0x17 1f760: 1e 8a std Y+22, r1 ; 0x16 selectedSerialPort = 0; 1f762: 10 92 21 05 sts 0x0521, r1 ; 0x800521 timeout.start(); 1f766: ce 01 movw r24, r28 1f768: 45 96 adiw r24, 0x15 ; 21 1f76a: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> while (!SN_valid) { rxIndex = 0; _delay(50); 1f76e: 62 e3 ldi r22, 0x32 ; 50 1f770: 70 e0 ldi r23, 0x00 ; 0 1f772: 80 e0 ldi r24, 0x00 ; 0 1f774: 90 e0 ldi r25, 0x00 ; 0 1f776: 0f 94 8d 3c call 0x2791a ; 0x2791a // 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; 1f77a: 80 91 95 04 lds r24, 0x0495 ; 0x800495 1f77e: 90 91 96 04 lds r25, 0x0496 ; 0x800496 1f782: 90 93 94 04 sts 0x0494, r25 ; 0x800494 1f786: 80 93 93 04 sts 0x0493, r24 ; 0x800493 MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); 1f78a: 8e ee ldi r24, 0xEE ; 238 1f78c: 9f e8 ldi r25, 0x8F ; 143 1f78e: 0e 94 86 7b call 0xf70c ; 0xf70c 1f792: 68 01 movw r12, r16 selectedSerialPort = 0; timeout.start(); while (!SN_valid) { rxIndex = 0; 1f794: f1 2c mov r15, r1 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) 1f796: 33 e1 ldi r19, 0x13 ; 19 1f798: f3 16 cp r15, r19 1f79a: a1 f0 breq .+40 ; 0x1f7c4 { if (timeout.expired(250u)) 1f79c: 6a ef ldi r22, 0xFA ; 250 1f79e: 70 e0 ldi r23, 0x00 ; 0 1f7a0: ce 01 movw r24, r28 1f7a2: 45 96 adiw r24, 0x15 ; 21 1f7a4: 0f 94 b8 3e call 0x27d70 ; 0x27d70 ::expired(unsigned short)> 1f7a8: 81 11 cpse r24, r1 1f7aa: c1 c0 rjmp .+386 ; 0x1f92e goto exit; if (MYSERIAL.available() > 0) 1f7ac: 0e 94 14 79 call 0xf228 ; 0xf228 1f7b0: 18 16 cp r1, r24 1f7b2: 19 06 cpc r1, r25 1f7b4: 84 f7 brge .-32 ; 0x1f796 { SN[rxIndex] = MYSERIAL.read(); 1f7b6: 0f 94 64 d6 call 0x3acc8 ; 0x3acc8 1f7ba: d6 01 movw r26, r12 1f7bc: 8d 93 st X+, r24 1f7be: 6d 01 movw r12, r26 rxIndex++; 1f7c0: f3 94 inc r15 1f7c2: e9 cf rjmp .-46 ; 0x1f796 } } SN[rxIndex] = 0; 1f7c4: 1c 8a std Y+20, r1 ; 0x14 // printf_P(PSTR("SN:%s\n"), SN); SN_valid = (strncmp_P(SN, PSTR("CZPX"), 4) == 0); 1f7c6: 44 e0 ldi r20, 0x04 ; 4 1f7c8: 50 e0 ldi r21, 0x00 ; 0 1f7ca: 69 ee ldi r22, 0xE9 ; 233 1f7cc: 7f e8 ldi r23, 0x8F ; 143 1f7ce: c8 01 movw r24, r16 1f7d0: 0f 94 3a db call 0x3b674 ; 0x3b674 ShortTimer timeout; selectedSerialPort = 0; timeout.start(); while (!SN_valid) 1f7d4: 89 2b or r24, r25 1f7d6: 59 f6 brne .-106 ; 0x1f76e 1f7d8: 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; 1f7da: e0 92 21 05 sts 0x0521, r14 ; 0x800521 { 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)) 1f7de: 88 23 and r24, r24 1f7e0: 09 f4 brne .+2 ; 0x1f7e4 1f7e2: a7 c0 rjmp .+334 ; 0x1f932 #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); 1f7e4: 44 e1 ldi r20, 0x14 ; 20 1f7e6: 50 e0 ldi r21, 0x00 ; 0 1f7e8: 65 e1 ldi r22, 0x15 ; 21 1f7ea: 7d e0 ldi r23, 0x0D ; 13 1f7ec: c8 01 movw r24, r16 1f7ee: 0f 94 6f dd call 0x3bade ; 0x3bade { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); 1f7f2: 8e ed ldi r24, 0xDE ; 222 1f7f4: 90 e9 ldi r25, 0x90 ; 144 } else puts_P(PSTR("SN update failed")); 1f7f6: 0f 94 44 dc call 0x3b888 ; 0x3b888 #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) 1f7fa: a1 10 cpse r10, r1 1f7fc: 04 c0 rjmp .+8 ; 0x1f806 1f7fe: 80 91 21 05 lds r24, 0x0521 ; 0x800521 1f802: 88 23 and r24, r24 1f804: 21 f0 breq .+8 ; 0x1f80e SERIAL_PROTOCOLLNPGM("start"); 1f806: 87 ec ldi r24, 0xC7 ; 199 1f808: 90 e9 ldi r25, 0x90 ; 144 1f80a: 0e 94 86 7b call 0xf70c ; 0xf70c #endif SERIAL_ECHO_START; 1f80e: 82 ef ldi r24, 0xF2 ; 242 1f810: 9a ea ldi r25, 0xAA ; 170 1f812: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1f816: 80 eb ldi r24, 0xB0 ; 176 1f818: 90 e9 ldi r25, 0x90 ; 144 1f81a: 0f 94 44 dc call 0x3b888 ; 0x3b888 // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1f81e: 60 e0 ldi r22, 0x00 ; 0 1f820: 8c ea ldi r24, 0xAC ; 172 1f822: 9c e0 ldi r25, 0x0C ; 12 1f824: 0e 94 14 78 call 0xf028 ; 0xf028 1f828: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1f82a: 0e 94 46 da call 0x1b48c ; 0x1b48c } MMU2::mmu2.Status(); 1f82e: 0f 94 ce 75 call 0x2eb9c ; 0x2eb9c } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1f832: 81 ef ldi r24, 0xF1 ; 241 1f834: 9f e8 ldi r25, 0x8F ; 143 1f836: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1f83a: 62 e0 ldi r22, 0x02 ; 2 1f83c: 86 ed ldi r24, 0xD6 ; 214 1f83e: 9e e0 ldi r25, 0x0E ; 14 1f840: 0e 94 14 78 call 0xf028 ; 0xf028 if (status == (uint8_t)EEPROM::Enabled) 1f844: 81 30 cpi r24, 0x01 ; 1 1f846: 09 f0 breq .+2 ; 0x1f84a 1f848: 77 c0 rjmp .+238 ; 0x1f938 { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1f84a: 8c e0 ldi r24, 0x0C ; 12 1f84c: 9e e5 ldi r25, 0x5E ; 94 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1f84e: 0e 94 86 7b call 0xf70c ; 0xf70c #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1f852: 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); 1f854: f0 fe sbrs r15, 0 1f856: 04 c0 rjmp .+8 ; 0x1f860 1f858: 8e e7 ldi r24, 0x7E ; 126 1f85a: 9e e6 ldi r25, 0x6E ; 110 1f85c: 0f 94 44 dc call 0x3b888 ; 0x3b888 if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1f860: f1 fe sbrs r15, 1 1f862: 04 c0 rjmp .+8 ; 0x1f86c 1f864: 8e e6 ldi r24, 0x6E ; 110 1f866: 9e e6 ldi r25, 0x6E ; 110 1f868: 0f 94 44 dc call 0x3b888 ; 0x3b888 if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1f86c: f2 fe sbrs r15, 2 1f86e: 04 c0 rjmp .+8 ; 0x1f878 1f870: 8d e5 ldi r24, 0x5D ; 93 1f872: 9e e6 ldi r25, 0x6E ; 110 1f874: 0f 94 44 dc call 0x3b888 ; 0x3b888 if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1f878: f3 fe sbrs r15, 3 1f87a: 04 c0 rjmp .+8 ; 0x1f884 1f87c: 8d e4 ldi r24, 0x4D ; 77 1f87e: 9e e6 ldi r25, 0x6E ; 110 1f880: 0f 94 44 dc call 0x3b888 ; 0x3b888 if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1f884: f5 fe sbrs r15, 5 1f886: 04 c0 rjmp .+8 ; 0x1f890 1f888: 8d e3 ldi r24, 0x3D ; 61 1f88a: 9e e6 ldi r25, 0x6E ; 110 1f88c: 0f 94 44 dc call 0x3b888 ; 0x3b888 MCUSR = 0; 1f890: 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; 1f892: 82 ef ldi r24, 0xF2 ; 242 1f894: 9a ea ldi r25, 0xAA ; 170 1f896: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1f89a: 8d e2 ldi r24, 0x2D ; 45 1f89c: 9e e6 ldi r25, 0x6E ; 110 1f89e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1f8a2: 8c e9 ldi r24, 0x9C ; 156 1f8a4: 90 e9 ldi r25, 0x90 ; 144 1f8a6: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1f8aa: 81 e2 ldi r24, 0x21 ; 33 1f8ac: 9e e6 ldi r25, 0x6E ; 110 1f8ae: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1f8b2: 84 e9 ldi r24, 0x94 ; 148 1f8b4: 90 e9 ldi r25, 0x90 ; 144 1f8b6: 0e 94 86 7b call 0xf70c ; 0xf70c #endif #endif SERIAL_ECHO_START; 1f8ba: 82 ef ldi r24, 0xF2 ; 242 1f8bc: 9a ea ldi r25, 0xAA ; 170 1f8be: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1f8c2: 82 e1 ldi r24, 0x12 ; 18 1f8c4: 9e e6 ldi r25, 0x6E ; 110 1f8c6: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1f8ca: 80 91 0f 18 lds r24, 0x180F ; 0x80180f <__brkval> 1f8ce: 90 91 10 18 lds r25, 0x1810 ; 0x801810 <__brkval+0x1> 1f8d2: 00 97 sbiw r24, 0x00 ; 0 1f8d4: a1 f1 breq .+104 ; 0x1f93e 1f8d6: 08 1b sub r16, r24 1f8d8: 19 0b sbc r17, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1f8da: b8 01 movw r22, r16 1f8dc: 11 0f add r17, r17 1f8de: 88 0b sbc r24, r24 1f8e0: 99 0b sbc r25, r25 1f8e2: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1f8e6: 8b ef ldi r24, 0xFB ; 251 1f8e8: 9d e6 ldi r25, 0x6D ; 109 1f8ea: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1f8ee: 80 ee ldi r24, 0xE0 ; 224 1f8f0: 96 e0 ldi r25, 0x06 ; 6 1f8f2: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 #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); 1f8f6: 6e e2 ldi r22, 0x2E ; 46 1f8f8: 71 e0 ldi r23, 0x01 ; 1 1f8fa: 8e ee ldi r24, 0xEE ; 238 1f8fc: 9e e0 ldi r25, 0x0E ; 14 1f8fe: 0e 94 fc 77 call 0xeff8 ; 0xeff8 1f902: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1f904: 66 e3 ldi r22, 0x36 ; 54 1f906: 71 e0 ldi r23, 0x01 ; 1 1f908: 8c ee ldi r24, 0xEC ; 236 1f90a: 9e e0 ldi r25, 0x0E ; 14 1f90c: 0e 94 fc 77 call 0xeff8 ; 0xeff8 if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1f910: 0e 32 cpi r16, 0x2E ; 46 1f912: 11 40 sbci r17, 0x01 ; 1 1f914: 11 f0 breq .+4 ; 0x1f91a 1f916: 0d 94 db 04 jmp 0x209b6 ; 0x209b6 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1f91a: 01 e0 ldi r16, 0x01 ; 1 1f91c: 86 33 cpi r24, 0x36 ; 54 1f91e: 91 40 sbci r25, 0x01 ; 1 1f920: 09 f4 brne .+2 ; 0x1f924 1f922: 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(); 1f924: 0e 94 d1 95 call 0x12ba2 ; 0x12ba2 1f928: f8 2e mov r15, r24 1f92a: 0d 94 e3 04 jmp 0x209c6 ; 0x209c6 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) { if (timeout.expired(250u)) 1f92e: 80 e0 ldi r24, 0x00 ; 0 1f930: 54 cf rjmp .-344 ; 0x1f7da { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); } else puts_P(PSTR("SN update failed")); 1f932: 8d ec ldi r24, 0xCD ; 205 1f934: 90 e9 ldi r25, 0x90 ; 144 1f936: 5f cf rjmp .-322 ; 0x1f7f6 1f938: 86 e0 ldi r24, 0x06 ; 6 1f93a: 9e e5 ldi r25, 0x5E ; 94 1f93c: 88 cf rjmp .-240 ; 0x1f84e 1f93e: 09 51 subi r16, 0x19 ; 25 1f940: 18 41 sbci r17, 0x18 ; 24 1f942: cb cf rjmp .-106 ; 0x1f8da minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1f944: 81 e3 ldi r24, 0x31 ; 49 1f946: 91 e0 ldi r25, 0x01 ; 1 1f948: 90 93 57 02 sts 0x0257, r25 ; 0x800257 <_ZL8maxttemp.lto_priv.483+0x1> 1f94c: 80 93 56 02 sts 0x0256, r24 ; 0x800256 <_ZL8maxttemp.lto_priv.483> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1f950: c0 90 9b 04 lds r12, 0x049B ; 0x80049b <_ZL12maxttemp_raw.lto_priv.476> 1f954: d0 90 9c 04 lds r13, 0x049C ; 0x80049c <_ZL12maxttemp_raw.lto_priv.476+0x1> 1f958: c6 01 movw r24, r12 1f95a: 0e 94 b1 d9 call 0x1b362 ; 0x1b362 1f95e: 20 e0 ldi r18, 0x00 ; 0 1f960: 30 e8 ldi r19, 0x80 ; 128 1f962: 48 e9 ldi r20, 0x98 ; 152 1f964: 53 e4 ldi r21, 0x43 ; 67 1f966: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1f96a: 18 16 cp r1, r24 1f96c: 44 f4 brge .+16 ; 0x1f97e #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1f96e: f0 e1 ldi r31, 0x10 ; 16 1f970: cf 0e add r12, r31 1f972: d1 1c adc r13, r1 1f974: d0 92 9c 04 sts 0x049C, r13 ; 0x80049c <_ZL12maxttemp_raw.lto_priv.476+0x1> 1f978: c0 92 9b 04 sts 0x049B, r12 ; 0x80049b <_ZL12maxttemp_raw.lto_priv.476> 1f97c: e9 cf rjmp .-46 ; 0x1f950 #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1f97e: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.484> 1f982: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.484+0x1> 1f986: 0f 94 f5 49 call 0x293ea ; 0x293ea 1f98a: 20 e0 ldi r18, 0x00 ; 0 1f98c: 30 e0 ldi r19, 0x00 ; 0 1f98e: 40 e2 ldi r20, 0x20 ; 32 1f990: 51 e4 ldi r21, 0x41 ; 65 1f992: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1f996: 87 ff sbrs r24, 7 1f998: 0a c0 rjmp .+20 ; 0x1f9ae #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1f99a: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.484> 1f99e: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.484+0x1> 1f9a2: 40 97 sbiw r24, 0x10 ; 16 1f9a4: 90 93 53 02 sts 0x0253, r25 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.484+0x1> 1f9a8: 80 93 52 02 sts 0x0252, r24 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.484> 1f9ac: e8 cf rjmp .-48 ; 0x1f97e #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1f9ae: 80 91 99 04 lds r24, 0x0499 ; 0x800499 <_ZL16bed_maxttemp_raw.lto_priv.477> 1f9b2: 90 91 9a 04 lds r25, 0x049A ; 0x80049a <_ZL16bed_maxttemp_raw.lto_priv.477+0x1> 1f9b6: 0f 94 f5 49 call 0x293ea ; 0x293ea 1f9ba: 20 e0 ldi r18, 0x00 ; 0 1f9bc: 30 e0 ldi r19, 0x00 ; 0 1f9be: 4a ef ldi r20, 0xFA ; 250 1f9c0: 52 e4 ldi r21, 0x42 ; 66 1f9c2: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1f9c6: 18 16 cp r1, r24 1f9c8: 54 f4 brge .+20 ; 0x1f9de #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1f9ca: 80 91 99 04 lds r24, 0x0499 ; 0x800499 <_ZL16bed_maxttemp_raw.lto_priv.477> 1f9ce: 90 91 9a 04 lds r25, 0x049A ; 0x80049a <_ZL16bed_maxttemp_raw.lto_priv.477+0x1> 1f9d2: 40 96 adiw r24, 0x10 ; 16 1f9d4: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a <_ZL16bed_maxttemp_raw.lto_priv.477+0x1> 1f9d8: 80 93 99 04 sts 0x0499, r24 ; 0x800499 <_ZL16bed_maxttemp_raw.lto_priv.477> 1f9dc: e8 cf rjmp .-48 ; 0x1f9ae #endif } #endif //BED_MAXTEMP #ifdef AMBIENT_MINTEMP while(analog2tempAmbient(ambient_minttemp_raw) < AMBIENT_MINTEMP) { 1f9de: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.475> 1f9e2: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.475+0x1> 1f9e6: 0f 94 60 49 call 0x292c0 ; 0x292c0 1f9ea: 20 e0 ldi r18, 0x00 ; 0 1f9ec: 30 e0 ldi r19, 0x00 ; 0 1f9ee: 40 ef ldi r20, 0xF0 ; 240 1f9f0: 51 ec ldi r21, 0xC1 ; 193 1f9f2: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 1f9f6: 87 ff sbrs r24, 7 1f9f8: 0a c0 rjmp .+20 ; 0x1fa0e #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_minttemp_raw += OVERSAMPLENR; #else ambient_minttemp_raw -= OVERSAMPLENR; 1f9fa: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.475> 1f9fe: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.475+0x1> 1fa02: 40 97 sbiw r24, 0x10 ; 16 1fa04: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.475+0x1> 1fa08: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.475> 1fa0c: e8 cf rjmp .-48 ; 0x1f9de #endif } #endif //AMBIENT_MINTEMP #ifdef AMBIENT_MAXTEMP while(analog2tempAmbient(ambient_maxttemp_raw) > AMBIENT_MAXTEMP) { 1fa0e: 80 91 97 04 lds r24, 0x0497 ; 0x800497 <_ZL20ambient_maxttemp_raw.lto_priv.478> 1fa12: 90 91 98 04 lds r25, 0x0498 ; 0x800498 <_ZL20ambient_maxttemp_raw.lto_priv.478+0x1> 1fa16: 0f 94 60 49 call 0x292c0 ; 0x292c0 1fa1a: 20 e0 ldi r18, 0x00 ; 0 1fa1c: 30 e0 ldi r19, 0x00 ; 0 1fa1e: 40 ea ldi r20, 0xA0 ; 160 1fa20: 52 e4 ldi r21, 0x42 ; 66 1fa22: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 1fa26: 18 16 cp r1, r24 1fa28: 54 f4 brge .+20 ; 0x1fa3e #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_maxttemp_raw -= OVERSAMPLENR; #else ambient_maxttemp_raw += OVERSAMPLENR; 1fa2a: 80 91 97 04 lds r24, 0x0497 ; 0x800497 <_ZL20ambient_maxttemp_raw.lto_priv.478> 1fa2e: 90 91 98 04 lds r25, 0x0498 ; 0x800498 <_ZL20ambient_maxttemp_raw.lto_priv.478+0x1> 1fa32: 40 96 adiw r24, 0x10 ; 16 1fa34: 90 93 98 04 sts 0x0498, r25 ; 0x800498 <_ZL20ambient_maxttemp_raw.lto_priv.478+0x1> 1fa38: 80 93 97 04 sts 0x0497, r24 ; 0x800497 <_ZL20ambient_maxttemp_raw.lto_priv.478> 1fa3c: e8 cf rjmp .-48 ; 0x1fa0e #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1fa3e: 9f b7 in r25, 0x3f ; 63 1fa40: f8 94 cli TCNT0 = 0; 1fa42: 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; 1fa44: 8f ef ldi r24, 0xFF ; 255 1fa46: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1fa48: 83 e3 ldi r24, 0x33 ; 51 1fa4a: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1fa4c: 12 e0 ldi r17, 0x02 ; 2 1fa4e: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1fa50: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1fa54: 81 60 ori r24, 0x01 ; 1 1fa56: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1fa5a: 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; 1fa5c: 80 e8 ldi r24, 0x80 ; 128 1fa5e: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1fa62: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1fa66: 84 60 ori r24, 0x04 ; 4 1fa68: 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; 1fa6c: 2f b7 in r18, 0x3f ; 63 1fa6e: f8 94 cli SET_OUTPUT(BEEPER); 1fa70: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fa74: 84 60 ori r24, 0x04 ; 4 1fa76: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BEEPER, LOW); 1fa7a: 9f b7 in r25, 0x3f ; 63 1fa7c: f8 94 cli 1fa7e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fa82: 8b 7f andi r24, 0xFB ; 251 1fa84: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fa88: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1fa8a: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fa8e: 80 62 ori r24, 0x20 ; 32 1fa90: 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); 1fa94: 81 e0 ldi r24, 0x01 ; 1 1fa96: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1fa9a: 85 e1 ldi r24, 0x15 ; 21 1fa9c: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1faa0: 8f ef ldi r24, 0xFF ; 255 1faa2: 90 e0 ldi r25, 0x00 ; 0 1faa4: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1faa8: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1faac: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1fab0: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1fab4: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1fab8: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1fabc: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1fac0: 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")); 1fac2: 8f ef ldi r24, 0xFF ; 255 1fac4: 9f e8 ldi r25, 0x8F ; 143 1fac6: 0f 94 44 dc call 0x3b888 ; 0x3b888 DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1faca: 8f e5 ldi r24, 0x5F ; 95 1facc: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1fad0: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1fad4: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1fad8: 80 64 ori r24, 0x40 ; 64 1fada: 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); 1fade: 8f e9 ldi r24, 0x9F ; 159 1fae0: 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(); 1fae4: 0e 94 fc 8f call 0x11ff8 ; 0x11ff8 // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1fae8: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1faea: f8 94 cli // CTC TCCRxB &= ~(1< 1faf0: 8f 7e andi r24, 0xEF ; 239 1faf2: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB |= (1< 1fafa: 88 60 ori r24, 0x08 ; 8 1fafc: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxA &= ~(1< 1fb04: 8d 7f andi r24, 0xFD ; 253 1fb06: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(1< 1fb0e: 8e 7f andi r24, 0xFE ; 254 1fb10: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1fb18: 8f 73 andi r24, 0x3F ; 63 1fb1a: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(3< 1fb22: 8f 7c andi r24, 0xCF ; 207 1fb24: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // x/256 prescaler TCCRxB |= (1< 1fb2c: 84 60 ori r24, 0x04 ; 4 1fb2e: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fb36: 8d 7f andi r24, 0xFD ; 253 1fb38: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fb40: 8e 7f andi r24, 0xFE ; 254 1fb42: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> // reset counter TCNTx = 0; 1fb46: 10 92 25 01 sts 0x0125, r1 ; 0x800125 <__TEXT_REGION_LENGTH__+0x7c2125> 1fb4a: 10 92 24 01 sts 0x0124, r1 ; 0x800124 <__TEXT_REGION_LENGTH__+0x7c2124> OCRxA = TEMP_TIM_OCRA_OVF; 1fb4e: 2b ee ldi r18, 0xEB ; 235 1fb50: 31 e4 ldi r19, 0x41 ; 65 1fb52: 30 93 29 01 sts 0x0129, r19 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1fb56: 20 93 28 01 sts 0x0128, r18 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1fb5a: d1 9a sbi 0x1a, 1 ; 26 ENABLE_TEMP_MGR_INTERRUPT(); 1fb5c: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 1fb60: 82 60 ori r24, 0x02 ; 2 1fb62: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1fb66: 9f bf out 0x3f, r25 ; 63 // Initialize pwm/temperature loops soft_pwm_init(); temp_mgr_init(); #ifdef EXTRUDER_ALTFAN_DETECT SERIAL_ECHORPGM(_n("Hotend fan type: ")); 1fb68: 89 ee ldi r24, 0xE9 ; 233 1fb6a: 9d e6 ldi r25, 0x6D ; 109 1fb6c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 } bool extruder_altfan_detect() { // override isAltFan setting for detection altfanStatus.isAltfan = 0; 1fb70: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> 1fb74: 8e 7f andi r24, 0xFE ; 254 1fb76: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> // During initialisation, use the EEPROM value altfanStatus.altfanOverride = eeprom_init_default_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE, 0); 1fb7a: 60 e0 ldi r22, 0x00 ; 0 1fb7c: 8b e2 ldi r24, 0x2B ; 43 1fb7e: 9d e0 ldi r25, 0x0D ; 13 1fb80: 0e 94 14 78 call 0xf028 ; 0xf028 1fb84: 90 91 b9 04 lds r25, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> 1fb88: 80 fb bst r24, 0 1fb8a: 91 f9 bld r25, 1 1fb8c: 90 93 b9 04 sts 0x04B9, r25 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> setExtruderAutoFanState(3); 1fb90: 83 e0 ldi r24, 0x03 ; 3 1fb92: 0e 94 51 77 call 0xeea2 ; 0xeea2 SET_INPUT(TACH_0); 1fb96: 6e 98 cbi 0x0d, 6 ; 13 CRITICAL_SECTION_START; 1fb98: 9f b7 in r25, 0x3f ; 63 1fb9a: f8 94 cli EICRB &= ~(1 << ISC61); 1fb9c: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 1fba0: 8f 7d andi r24, 0xDF ; 223 1fba2: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << ISC60); 1fba6: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 1fbaa: 80 61 ori r24, 0x10 ; 16 1fbac: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EIMSK |= (1 << INT6); 1fbb0: ee 9a sbi 0x1d, 6 ; 29 fan_edge_counter[0] = 0; 1fbb2: 10 92 b6 04 sts 0x04B6, r1 ; 0x8004b6 1fbb6: 10 92 b5 04 sts 0x04B5, r1 ; 0x8004b5 CRITICAL_SECTION_END; 1fbba: 9f bf out 0x3f, r25 ; 63 extruder_autofan_last_check = _millis(); 1fbbc: 0f 94 86 3e call 0x27d0c ; 0x27d0c 1fbc0: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c 1fbc4: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d 1fbc8: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e 1fbcc: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f _delay(1000); 1fbd0: 68 ee ldi r22, 0xE8 ; 232 1fbd2: 73 e0 ldi r23, 0x03 ; 3 1fbd4: 80 e0 ldi r24, 0x00 ; 0 1fbd6: 90 e0 ldi r25, 0x00 ; 0 1fbd8: 0f 94 8d 3c call 0x2791a ; 0x2791a EIMSK &= ~(1 << INT6); 1fbdc: ee 98 cbi 0x1d, 6 ; 29 countFanSpeed(); 1fbde: 0e 94 da 76 call 0xedb4 ; 0xedb4 // restore fan state altfanStatus.isAltfan = fan_speed[0] > 100; 1fbe2: 91 e0 ldi r25, 0x01 ; 1 1fbe4: 20 91 b1 04 lds r18, 0x04B1 ; 0x8004b1 1fbe8: 30 91 b2 04 lds r19, 0x04B2 ; 0x8004b2 1fbec: 25 36 cpi r18, 0x65 ; 101 1fbee: 31 05 cpc r19, r1 1fbf0: 0c f4 brge .+2 ; 0x1fbf4 1fbf2: 90 e0 ldi r25, 0x00 ; 0 1fbf4: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> 1fbf8: 90 fb bst r25, 0 1fbfa: 80 f9 bld r24, 0 1fbfc: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> setExtruderAutoFanState(1); 1fc00: 81 e0 ldi r24, 0x01 ; 1 1fc02: 0e 94 51 77 call 0xeea2 ; 0xeea2 return altfanStatus.isAltfan; 1fc06: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> if (extruder_altfan_detect()) 1fc0a: 80 ff sbrs r24, 0 1fc0c: c4 c0 rjmp .+392 ; 0x1fd96 SERIAL_ECHOLNRPGM(PSTR("ALTFAN")); 1fc0e: 8d e8 ldi r24, 0x8D ; 141 1fc10: 90 e9 ldi r25, 0x90 ; 144 else SERIAL_ECHOLNRPGM(PSTR("NOCTUA")); 1fc12: 0e 94 86 7b call 0xf70c ; 0xf70c // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1fc16: 10 92 56 0e sts 0x0E56, r1 ; 0x800e56 block_buffer_tail = 0; 1fc1a: 10 92 57 0e sts 0x0E57, r1 ; 0x800e57 memset(position, 0, sizeof(position)); // clear position 1fc1e: 80 e1 ldi r24, 0x10 ; 16 1fc20: e4 e5 ldi r30, 0x54 ; 84 1fc22: f7 e0 ldi r31, 0x07 ; 7 1fc24: df 01 movw r26, r30 1fc26: 28 2f mov r18, r24 1fc28: 1d 92 st X+, r1 1fc2a: 2a 95 dec r18 1fc2c: e9 f7 brne .-6 ; 0x1fc28 #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1fc2e: e0 ed ldi r30, 0xD0 ; 208 1fc30: f4 e0 ldi r31, 0x04 ; 4 1fc32: df 01 movw r26, r30 1fc34: 28 2f mov r18, r24 1fc36: 1d 92 st X+, r1 1fc38: 2a 95 dec r18 1fc3a: e9 f7 brne .-6 ; 0x1fc36 #endif memset(previous_speed, 0, sizeof(previous_speed)); 1fc3c: e0 ec ldi r30, 0xC0 ; 192 1fc3e: f4 e0 ldi r31, 0x04 ; 4 1fc40: df 01 movw r26, r30 1fc42: 1d 92 st X+, r1 1fc44: 8a 95 dec r24 1fc46: e9 f7 brne .-6 ; 0x1fc42 previous_nominal_speed = 0.0; 1fc48: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.505> 1fc4c: 10 92 bd 04 sts 0x04BD, r1 ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.505+0x1> 1fc50: 10 92 be 04 sts 0x04BE, r1 ; 0x8004be <_ZL22previous_nominal_speed.lto_priv.505+0x2> 1fc54: 10 92 bf 04 sts 0x04BF, r1 ; 0x8004bf <_ZL22previous_nominal_speed.lto_priv.505+0x3> plan_reset_next_e_queue = false; 1fc58: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL23plan_reset_next_e_queue.lto_priv.503> plan_reset_next_e_sched = false; 1fc5c: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL23plan_reset_next_e_sched.lto_priv.504> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1fc60: 84 e0 ldi r24, 0x04 ; 4 1fc62: 80 93 96 02 sts 0x0296, r24 ; 0x800296 if (!READ(BTN_ENC)) 1fc66: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fc6a: 86 fd sbrc r24, 6 1fc6c: cd c0 rjmp .+410 ; 0x1fe08 1fc6e: bf ef ldi r27, 0xFF ; 255 1fc70: e3 ed ldi r30, 0xD3 ; 211 1fc72: f0 e3 ldi r31, 0x30 ; 48 1fc74: b1 50 subi r27, 0x01 ; 1 1fc76: e0 40 sbci r30, 0x00 ; 0 1fc78: f0 40 sbci r31, 0x00 ; 0 1fc7a: e1 f7 brne .-8 ; 0x1fc74 1fc7c: 00 c0 rjmp .+0 ; 0x1fc7e 1fc7e: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1fc80: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fc84: 86 fd sbrc r24, 6 1fc86: c0 c0 rjmp .+384 ; 0x1fe08 { lcd_clear(); 1fc88: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_P(PSTR("Factory RESET")); 1fc8c: 89 e5 ldi r24, 0x59 ; 89 1fc8e: 90 e9 ldi r25, 0x90 ; 144 1fc90: 0e 94 00 70 call 0xe000 ; 0xe000 SET_OUTPUT(BEEPER); 1fc94: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fc98: 84 60 ori r24, 0x04 ; 4 1fc9a: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> if(eSoundMode!=e_SOUND_MODE_SILENT) 1fc9e: 80 91 e1 04 lds r24, 0x04E1 ; 0x8004e1 1fca2: 82 30 cpi r24, 0x02 ; 2 1fca4: 41 f0 breq .+16 ; 0x1fcb6 WRITE(BEEPER, HIGH); 1fca6: 9f b7 in r25, 0x3f ; 63 1fca8: f8 94 cli 1fcaa: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fcae: 84 60 ori r24, 0x04 ; 4 1fcb0: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fcb4: 9f bf out 0x3f, r25 ; 63 while (!READ(BTN_ENC)); 1fcb6: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fcba: 86 ff sbrs r24, 6 1fcbc: fc cf rjmp .-8 ; 0x1fcb6 WRITE(BEEPER, LOW); 1fcbe: 9f b7 in r25, 0x3f ; 63 1fcc0: f8 94 cli 1fcc2: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fcc6: 8b 7f andi r24, 0xFB ; 251 1fcc8: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fccc: 9f bf out 0x3f, r25 ; 63 1fcce: 2f ef ldi r18, 0xFF ; 255 1fcd0: 37 ea ldi r19, 0xA7 ; 167 1fcd2: 81 e6 ldi r24, 0x61 ; 97 1fcd4: 21 50 subi r18, 0x01 ; 1 1fcd6: 30 40 sbci r19, 0x00 ; 0 1fcd8: 80 40 sbci r24, 0x00 ; 0 1fcda: e1 f7 brne .-8 ; 0x1fcd4 1fcdc: 00 c0 rjmp .+0 ; 0x1fcde 1fcde: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1fce0: 8f e3 ldi r24, 0x3F ; 63 1fce2: 90 e9 ldi r25, 0x90 ; 144 1fce4: 9a 83 std Y+2, r25 ; 0x02 1fce6: 89 83 std Y+1, r24 ; 0x01 1fce8: 84 e3 ldi r24, 0x34 ; 52 1fcea: 90 e9 ldi r25, 0x90 ; 144 1fcec: 9c 83 std Y+4, r25 ; 0x04 1fcee: 8b 83 std Y+3, r24 ; 0x03 1fcf0: 86 e2 ldi r24, 0x26 ; 38 1fcf2: 90 e9 ldi r25, 0x90 ; 144 1fcf4: 9e 83 std Y+6, r25 ; 0x06 1fcf6: 8d 83 std Y+5, r24 ; 0x05 1fcf8: 89 e1 ldi r24, 0x19 ; 25 1fcfa: 90 e9 ldi r25, 0x90 ; 144 1fcfc: 98 87 std Y+8, r25 ; 0x08 1fcfe: 8f 83 std Y+7, r24 ; 0x07 1fd00: 80 e1 ldi r24, 0x10 ; 16 1fd02: 90 e9 ldi r25, 0x90 ; 144 1fd04: 9a 87 std Y+10, r25 ; 0x0a 1fd06: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1fd08: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_putc_at(0, 0, '>'); 1fd0c: 4e e3 ldi r20, 0x3E ; 62 1fd0e: 60 e0 ldi r22, 0x00 ; 0 1fd10: 80 e0 ldi r24, 0x00 ; 0 1fd12: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_consume_click(); 1fd16: 0e 94 2d 72 call 0xe45a ; 0xe45a } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1fd1a: 10 e0 ldi r17, 0x00 ; 0 1fd1c: d1 2c mov r13, r1 1fd1e: 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]); 1fd20: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 1fd24: f6 01 movw r30, r12 1fd26: e8 0f add r30, r24 1fd28: f1 1d adc r31, r1 1fd2a: 87 fd sbrc r24, 7 1fd2c: fa 95 dec r31 1fd2e: ee 0f add r30, r30 1fd30: ff 1f adc r31, r31 1fd32: a1 e0 ldi r26, 0x01 ; 1 1fd34: b0 e0 ldi r27, 0x00 ; 0 1fd36: ac 0f add r26, r28 1fd38: bd 1f adc r27, r29 1fd3a: ea 0f add r30, r26 1fd3c: fb 1f adc r31, r27 1fd3e: 40 81 ld r20, Z 1fd40: 51 81 ldd r21, Z+1 ; 0x01 1fd42: 6c 2d mov r22, r12 1fd44: 81 e0 ldi r24, 0x01 ; 1 1fd46: 0e 94 29 70 call 0xe052 ; 0xe052 1fd4a: bf ef ldi r27, 0xFF ; 255 1fd4c: cb 1a sub r12, r27 1fd4e: 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++) { 1fd50: e4 e0 ldi r30, 0x04 ; 4 1fd52: ce 16 cp r12, r30 1fd54: d1 04 cpc r13, r1 1fd56: 21 f7 brne .-56 ; 0x1fd20 lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1fd58: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(true); 1fd5c: 81 e0 ldi r24, 0x01 ; 1 1fd5e: 0e 94 5a 8c call 0x118b4 ; 0x118b4 if (lcd_encoder) { 1fd62: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1fd66: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1fd6a: 00 97 sbiw r24, 0x00 ; 0 1fd6c: 89 f1 breq .+98 ; 0x1fdd0 if (lcd_encoder < 0) { 1fd6e: 97 ff sbrs r25, 7 1fd70: 15 c0 rjmp .+42 ; 0x1fd9c cursor_pos--; 1fd72: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1fd74: 14 30 cpi r17, 0x04 ; 4 1fd76: 0c f4 brge .+2 ; 0x1fd7a 1fd78: a9 c0 rjmp .+338 ; 0x1fecc cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1fd7a: 87 e0 ldi r24, 0x07 ; 7 1fd7c: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1fd80: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 1fd84: 18 16 cp r1, r24 1fd86: 2c f0 brlt .+10 ; 0x1fd92 first++; 1fd88: 8f 5f subi r24, 0xFF ; 255 1fd8a: 80 93 e0 04 sts 0x04E0, r24 ; 0x8004e0 lcd_clear(); 1fd8e: 0e 94 48 70 call 0xe090 ; 0xe090 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1fd92: 13 e0 ldi r17, 0x03 ; 3 1fd94: 06 c0 rjmp .+12 ; 0x1fda2 #ifdef EXTRUDER_ALTFAN_DETECT SERIAL_ECHORPGM(_n("Hotend fan type: ")); if (extruder_altfan_detect()) SERIAL_ECHOLNRPGM(PSTR("ALTFAN")); else SERIAL_ECHOLNRPGM(PSTR("NOCTUA")); 1fd96: 86 e8 ldi r24, 0x86 ; 134 1fd98: 90 e9 ldi r25, 0x90 ; 144 1fd9a: 3b cf rjmp .-394 ; 0x1fc12 if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1fd9c: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1fd9e: 14 30 cpi r17, 0x04 ; 4 1fda0: 60 f7 brcc .-40 ; 0x1fd7a if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1fda2: 48 e0 ldi r20, 0x08 ; 8 1fda4: 50 e9 ldi r21, 0x90 ; 144 1fda6: 60 e0 ldi r22, 0x00 ; 0 1fda8: 80 e0 ldi r24, 0x00 ; 0 1fdaa: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(0, cursor_pos); 1fdae: 61 2f mov r22, r17 1fdb0: 80 e0 ldi r24, 0x00 ; 0 1fdb2: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_putc('>'); 1fdb6: 8e e3 ldi r24, 0x3E ; 62 1fdb8: 0e 94 04 70 call 0xe008 ; 0xe008 lcd_encoder = 0; 1fdbc: 10 92 38 05 sts 0x0538, r1 ; 0x800538 1fdc0: 10 92 37 05 sts 0x0537, r1 ; 0x800537 _delay(100); 1fdc4: 64 e6 ldi r22, 0x64 ; 100 1fdc6: 70 e0 ldi r23, 0x00 ; 0 1fdc8: 80 e0 ldi r24, 0x00 ; 0 1fdca: 90 e0 ldi r25, 0x00 ; 0 1fdcc: 0f 94 8d 3c call 0x2791a ; 0x2791a } if (lcd_clicked()) { 1fdd0: 0e 94 32 72 call 0xe464 ; 0xe464 1fdd4: 88 23 and r24, r24 1fdd6: 09 f4 brne .+2 ; 0x1fdda 1fdd8: a1 cf rjmp .-190 ; 0x1fd1c return(cursor_pos + first); 1fdda: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 1fdde: 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(); 1fde0: 0e 94 48 70 call 0xe090 ; 0xe090 Sound_MakeCustom(100,0,false); 1fde4: 40 e0 ldi r20, 0x00 ; 0 1fde6: 70 e0 ldi r23, 0x00 ; 0 1fde8: 60 e0 ldi r22, 0x00 ; 0 1fdea: 84 e6 ldi r24, 0x64 ; 100 1fdec: 90 e0 ldi r25, 0x00 ; 0 1fdee: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc switch (level) { 1fdf2: 12 30 cpi r17, 0x02 ; 2 1fdf4: 09 f4 brne .+2 ; 0x1fdf8 1fdf6: a0 c0 rjmp .+320 ; 0x1ff38 1fdf8: 08 f0 brcs .+2 ; 0x1fdfc 1fdfa: 79 c0 rjmp .+242 ; 0x1feee 1fdfc: 11 23 and r17, r17 1fdfe: 09 f4 brne .+2 ; 0x1fe02 1fe00: 93 c0 rjmp .+294 ; 0x1ff28 1fe02: 11 30 cpi r17, 0x01 ; 1 1fe04: 09 f4 brne .+2 ; 0x1fe08 1fe06: 93 c0 rjmp .+294 ; 0x1ff2e case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 1fe08: 82 e0 ldi r24, 0x02 ; 2 1fe0a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 plan_init(); // Initialize planner; factory_reset(); eeprom_init_default_byte((uint8_t*)EEPROM_SILENT, SILENT_MODE_OFF); 1fe0e: 60 e0 ldi r22, 0x00 ; 0 1fe10: 8f ef ldi r24, 0xFF ; 255 1fe12: 9f e0 ldi r25, 0x0F ; 15 1fe14: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 1fe18: 61 e0 ldi r22, 0x01 ; 1 1fe1a: 8f e5 ldi r24, 0x5F ; 95 1fe1c: 9f e0 ldi r25, 0x0F ; 15 1fe1e: 0e 94 14 78 call 0xf028 ; 0xf028 #ifdef TMC2130 uint8_t silentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 1fe22: 8f ef ldi r24, 0xFF ; 255 1fe24: 9f e0 ldi r25, 0x0F ; 15 1fe26: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1fe2a: 18 2f mov r17, r24 if (silentMode == 0xff) silentMode = 0; 1fe2c: 8f 3f cpi r24, 0xFF ; 255 1fe2e: 09 f4 brne .+2 ; 0x1fe32 1fe30: 10 e0 ldi r17, 0x00 ; 0 tmc2130_mode = TMC2130_MODE_NORMAL; 1fe32: 10 92 6c 06 sts 0x066C, r1 ; 0x80066c tmc2130_sg_stop_on_crash = eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_DET, farm_mode ? false : true); 1fe36: 61 e0 ldi r22, 0x01 ; 1 1fe38: 89 e6 ldi r24, 0x69 ; 105 1fe3a: 9f e0 ldi r25, 0x0F ; 15 1fe3c: 0e 94 14 78 call 0xf028 ; 0xf028 1fe40: 91 e0 ldi r25, 0x01 ; 1 1fe42: 81 11 cpse r24, r1 1fe44: 01 c0 rjmp .+2 ; 0x1fe48 1fe46: 90 e0 ldi r25, 0x00 ; 0 1fe48: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c if (tmc2130_sg_stop_on_crash) { 1fe4c: 88 23 and r24, r24 1fe4e: 09 f4 brne .+2 ; 0x1fe52 1fe50: 92 c0 rjmp .+292 ; 0x1ff76 puts_P(_N("CrashDetect ENABLED!")); 1fe52: 84 ed ldi r24, 0xD4 ; 212 1fe54: 9d e6 ldi r25, 0x6D ; 109 } else { puts_P(_N("CrashDetect DISABLED")); 1fe56: 0f 94 44 dc call 0x3b888 ; 0x3b888 } #ifdef TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[X_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_X_FAC); 1fe5a: 87 ef ldi r24, 0xF7 ; 247 1fe5c: 9e e0 ldi r25, 0x0E ; 14 1fe5e: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1fe62: c8 2e mov r12, r24 1fe64: 80 93 fc 04 sts 0x04FC, r24 ; 0x8004fc tmc2130_wave_fac[Y_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Y_FAC); 1fe68: 86 ef ldi r24, 0xF6 ; 246 1fe6a: 9e e0 ldi r25, 0x0E ; 14 1fe6c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1fe70: d8 2e mov r13, r24 1fe72: 80 93 fd 04 sts 0x04FD, r24 ; 0x8004fd tmc2130_wave_fac[Z_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Z_FAC); 1fe76: 85 ef ldi r24, 0xF5 ; 245 1fe78: 9e e0 ldi r25, 0x0E ; 14 1fe7a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1fe7e: e8 2e mov r14, r24 1fe80: 80 93 fe 04 sts 0x04FE, r24 ; 0x8004fe #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[E_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_E_FAC); 1fe84: 84 ef ldi r24, 0xF4 ; 244 1fe86: 9e e0 ldi r25, 0x0E ; 14 1fe88: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 1fe8c: 80 93 ff 04 sts 0x04FF, r24 ; 0x8004ff if (tmc2130_wave_fac[X_AXIS] == 0xff) tmc2130_wave_fac[X_AXIS] = 0; 1fe90: 2f ef ldi r18, 0xFF ; 255 1fe92: c2 12 cpse r12, r18 1fe94: 02 c0 rjmp .+4 ; 0x1fe9a 1fe96: 10 92 fc 04 sts 0x04FC, r1 ; 0x8004fc if (tmc2130_wave_fac[Y_AXIS] == 0xff) tmc2130_wave_fac[Y_AXIS] = 0; 1fe9a: 3f ef ldi r19, 0xFF ; 255 1fe9c: d3 12 cpse r13, r19 1fe9e: 02 c0 rjmp .+4 ; 0x1fea4 1fea0: 10 92 fd 04 sts 0x04FD, r1 ; 0x8004fd if (tmc2130_wave_fac[Z_AXIS] == 0xff) tmc2130_wave_fac[Z_AXIS] = 0; 1fea4: 9f ef ldi r25, 0xFF ; 255 1fea6: e9 12 cpse r14, r25 1fea8: 02 c0 rjmp .+4 ; 0x1feae 1feaa: 10 92 fe 04 sts 0x04FE, r1 ; 0x8004fe if (tmc2130_wave_fac[E_AXIS] == 0xff) tmc2130_wave_fac[E_AXIS] = 0; 1feae: 8f 3f cpi r24, 0xFF ; 255 1feb0: 11 f4 brne .+4 ; 0x1feb6 1feb2: 10 92 ff 04 sts 0x04FF, r1 ; 0x8004ff #endif //TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_VARIABLE_RESOLUTION tmc2130_mres[X_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[X_AXIS]); 1feb6: 80 91 2a 07 lds r24, 0x072A ; 0x80072a 1feba: 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--; 1febc: 28 e0 ldi r18, 0x08 ; 8 1febe: 96 95 lsr r25 1fec0: 87 95 ror r24 1fec2: 00 97 sbiw r24, 0x00 ; 0 1fec4: 09 f4 brne .+2 ; 0x1fec8 1fec6: 5a c0 rjmp .+180 ; 0x1ff7c 1fec8: 21 50 subi r18, 0x01 ; 1 1feca: f9 cf rjmp .-14 ; 0x1febe first++; lcd_clear(); } } if (cursor_pos < 0) { 1fecc: 1f 3f cpi r17, 0xFF ; 255 1fece: 09 f0 breq .+2 ; 0x1fed2 1fed0: 68 cf rjmp .-304 ; 0x1fda2 cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1fed2: 87 e0 ldi r24, 0x07 ; 7 1fed4: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 if (first > 0) { 1fed8: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 1fedc: 18 16 cp r1, r24 1fede: 2c f4 brge .+10 ; 0x1feea first--; 1fee0: 81 50 subi r24, 0x01 ; 1 1fee2: 80 93 e0 04 sts 0x04E0, r24 ; 0x8004e0 lcd_clear(); 1fee6: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 1feea: 10 e0 ldi r17, 0x00 ; 0 1feec: 5a cf rjmp .-332 ; 0x1fda2 // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 1feee: 13 30 cpi r17, 0x03 ; 3 1fef0: 29 f1 breq .+74 ; 0x1ff3c 1fef2: 14 30 cpi r17, 0x04 ; 4 1fef4: 09 f0 breq .+2 ; 0x1fef8 1fef6: 88 cf rjmp .-240 ; 0x1fe08 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 1fef8: 68 e4 ldi r22, 0x48 ; 72 1fefa: 70 e9 ldi r23, 0x90 ; 144 1fefc: 80 e0 ldi r24, 0x00 ; 0 1fefe: 90 e1 ldi r25, 0x10 ; 16 1ff00: 0f 94 3c cd call 0x39a78 ; 0x39a78 // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1ff04: 10 e0 ldi r17, 0x00 ; 0 1ff06: 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); 1ff08: 6f ef ldi r22, 0xFF ; 255 1ff0a: c8 01 movw r24, r16 1ff0c: 0f 94 7f dd call 0x3bafe ; 0x3bafe eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 1ff10: c8 01 movw r24, r16 1ff12: 0f 94 0d cd call 0x39a1a ; 0x39a1a break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1ff16: 0f 5f subi r16, 0xFF ; 255 1ff18: 1f 4f sbci r17, 0xFF ; 255 1ff1a: 01 15 cp r16, r1 1ff1c: f0 e1 ldi r31, 0x10 ; 16 1ff1e: 1f 07 cpc r17, r31 1ff20: 99 f7 brne .-26 ; 0x1ff08 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 1ff22: 0f 94 2e cd call 0x39a5c ; 0x39a5c 1ff26: e7 cb rjmp .-2098 ; 0x1f6f6 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 1ff28: 0e 94 61 72 call 0xe4c2 ; 0xe4c2 1ff2c: 6d cf rjmp .-294 ; 0x1fe08 break; case 1: //Level 1: Reset statistics factory_reset_stats(); 1ff2e: 0e 94 46 68 call 0xd08c ; 0xd08c lcd_menu_statistics(); 1ff32: 0f 94 14 54 call 0x2a828 ; 0x2a828 1ff36: 68 cf rjmp .-304 ; 0x1fe08 break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 1ff38: 0e 94 46 68 call 0xd08c ; 0xd08c // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 1ff3c: 0e 94 61 72 call 0xe4c2 ; 0xe4c2 // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 1ff40: 84 e0 ldi r24, 0x04 ; 4 1ff42: 0e 94 33 e6 call 0x1cc66 ; 0x1cc66 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); 1ff46: 62 e0 ldi r22, 0x02 ; 2 1ff48: 8f e5 ldi r24, 0x5F ; 95 1ff4a: 9f e0 ldi r25, 0x0F ; 15 1ff4c: 0f 94 a3 dd call 0x3bb46 ; 0x3bb46 eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 1ff50: 81 e0 ldi r24, 0x01 ; 1 1ff52: 0e 94 34 76 call 0xec68 ; 0xec68 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1ff56: 11 e0 ldi r17, 0x01 ; 1 1ff58: 10 93 89 17 sts 0x1789, r17 ; 0x801789 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1ff5c: 61 e0 ldi r22, 0x01 ; 1 1ff5e: 87 e0 ldi r24, 0x07 ; 7 1ff60: 9f e0 ldi r25, 0x0F ; 15 1ff62: 0f 94 7f dd call 0x3bafe ; 0x3bafe eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1ff66: 10 93 8a 17 sts 0x178A, r17 ; 0x80178a 1ff6a: 61 e0 ldi r22, 0x01 ; 1 1ff6c: 85 ed ldi r24, 0xD5 ; 213 1ff6e: 9e e0 ldi r25, 0x0E ; 14 1ff70: 0f 94 7f dd call 0x3bafe ; 0x3bafe 1ff74: 49 cf rjmp .-366 ; 0x1fe08 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")); 1ff76: 8f eb ldi r24, 0xBF ; 191 1ff78: 9d e6 ldi r25, 0x6D ; 109 1ff7a: 6d cf rjmp .-294 ; 0x1fe56 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]); 1ff7c: 20 93 f8 04 sts 0x04F8, r18 ; 0x8004f8 tmc2130_mres[Y_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Y_AXIS]); 1ff80: 80 91 2b 07 lds r24, 0x072B ; 0x80072b 1ff84: 90 e0 ldi r25, 0x00 ; 0 1ff86: 28 e0 ldi r18, 0x08 ; 8 1ff88: 96 95 lsr r25 1ff8a: 87 95 ror r24 1ff8c: 00 97 sbiw r24, 0x00 ; 0 1ff8e: 11 f0 breq .+4 ; 0x1ff94 1ff90: 21 50 subi r18, 0x01 ; 1 1ff92: fa cf rjmp .-12 ; 0x1ff88 1ff94: 20 93 f9 04 sts 0x04F9, r18 ; 0x8004f9 tmc2130_mres[Z_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Z_AXIS]); 1ff98: 80 91 2c 07 lds r24, 0x072C ; 0x80072c 1ff9c: 90 e0 ldi r25, 0x00 ; 0 1ff9e: 28 e0 ldi r18, 0x08 ; 8 1ffa0: 96 95 lsr r25 1ffa2: 87 95 ror r24 1ffa4: 00 97 sbiw r24, 0x00 ; 0 1ffa6: 11 f0 breq .+4 ; 0x1ffac 1ffa8: 21 50 subi r18, 0x01 ; 1 1ffaa: fa cf rjmp .-12 ; 0x1ffa0 1ffac: 20 93 fa 04 sts 0x04FA, r18 ; 0x8004fa tmc2130_mres[E_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[E_AXIS]); 1ffb0: 80 91 2d 07 lds r24, 0x072D ; 0x80072d 1ffb4: 90 e0 ldi r25, 0x00 ; 0 1ffb6: 28 e0 ldi r18, 0x08 ; 8 1ffb8: 96 95 lsr r25 1ffba: 87 95 ror r24 1ffbc: 00 97 sbiw r24, 0x00 ; 0 1ffbe: 11 f0 breq .+4 ; 0x1ffc4 1ffc0: 21 50 subi r18, 0x01 ; 1 1ffc2: fa cf rjmp .-12 ; 0x1ffb8 1ffc4: 20 93 fb 04 sts 0x04FB, r18 ; 0x8004fb 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(); 1ffc8: 0e 94 f8 f8 call 0x1f1f0 ; 0x1f1f0 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) { } 1ffcc: 88 0f add r24, r24 #endif // LIN_ADVANCE void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); 1ffce: 82 70 andi r24, 0x02 ; 2 1ffd0: 0f 94 1c 3b call 0x27638 ; 0x27638 microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 1ffd4: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1ffd8: 81 60 ori r24, 0x01 ; 1 1ffda: 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); 1ffde: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1ffe2: 82 60 ori r24, 0x02 ; 2 1ffe4: 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); 1ffe8: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1ffec: 84 60 ori r24, 0x04 ; 4 1ffee: 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); 1fff2: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1fff6: 80 64 ori r24, 0x40 ; 64 1fff8: 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); 1fffc: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 1fffe: 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); 20000: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 20002: 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); 20004: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 20006: 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); 20008: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 2000a: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 2000c: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 2000e: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 20010: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 20012: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 20014: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 20016: 2c 9a sbi 0x05, 4 ; 5 #endif #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SET_INPUT(X_MAX_PIN); 20018: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2001c: 8b 7f andi r24, 0xFB ; 251 2001e: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_XMAX WRITE(X_MAX_PIN,HIGH); 20022: 9f b7 in r25, 0x3f ; 63 20024: f8 94 cli 20026: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2002a: 84 60 ori r24, 0x04 ; 4 2002c: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20030: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SET_INPUT(Y_MAX_PIN); 20032: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 20036: 8f 77 andi r24, 0x7F ; 127 20038: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_YMAX WRITE(Y_MAX_PIN,HIGH); 2003c: 9f b7 in r25, 0x3f ; 63 2003e: f8 94 cli 20040: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20044: 80 68 ori r24, 0x80 ; 128 20046: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2004a: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SET_INPUT(Z_MAX_PIN); 2004c: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 2004e: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 20050: 6e 98 cbi 0x0d, 6 ; 13 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 20052: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 20054: 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(); 20056: 17 9a sbi 0x02, 7 ; 2 20058: 10 92 40 07 sts 0x0740, r1 ; 0x800740 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); 2005c: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 2005e: 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(); 20060: 16 9a sbi 0x02, 6 ; 2 20062: 10 92 41 07 sts 0x0741, r1 ; 0x800741 #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 20066: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 20068: 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); 2006a: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 2006c: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 2006e: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 20074: 8f 7e andi r24, 0xEF ; 239 20076: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 2007e: 88 60 ori r24, 0x08 ; 8 20080: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 20088: 8d 7f andi r24, 0xFD ; 253 2008a: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 20092: 8e 7f andi r24, 0xFE ; 254 20094: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 2009c: 8f 73 andi r24, 0x3F ; 63 2009e: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 200a6: 8f 7c andi r24, 0xCF ; 207 200a8: 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< 200b0: 88 7f andi r24, 0xF8 ; 248 200b2: 82 60 ori r24, 0x02 ; 2 200b4: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 200b8: 80 e0 ldi r24, 0x00 ; 0 200ba: 90 e4 ldi r25, 0x40 ; 64 200bc: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 200c0: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 200c4: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 200c8: 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; 200cc: 10 92 e9 04 sts 0x04E9, r1 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.490+0x1> 200d0: 10 92 e8 04 sts 0x04E8, r1 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.490> nextAdvanceISR = ADV_NEVER; 200d4: 8f ef ldi r24, 0xFF ; 255 200d6: 9f ef ldi r25, 0xFF ; 255 200d8: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 200dc: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> main_Rate = ADV_NEVER; 200e0: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL9main_Rate.lto_priv.492+0x1> 200e4: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL9main_Rate.lto_priv.492> current_adv_steps = 0; 200e8: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 200ec: 10 92 e2 04 sts 0x04E2, r1 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 200f0: 81 e0 ldi r24, 0x01 ; 1 200f2: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> current_adv_steps = 0; #endif enable_endstops(true); // Start with endstops active. After homing they can be disabled ENABLE_STEPPER_DRIVER_INTERRUPT(); 200f6: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 200fa: 82 60 ori r24, 0x02 ; 2 200fc: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 20100: 78 94 sei #endif //TMC2130 st_init(); // Initialize stepper, this enables interrupts! #ifdef TMC2130 tmc2130_mode = silentMode?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 20102: 81 e0 ldi r24, 0x01 ; 1 20104: 11 11 cpse r17, r1 20106: 01 c0 rjmp .+2 ; 0x2010a 20108: 80 e0 ldi r24, 0x00 ; 0 2010a: 80 93 6c 06 sts 0x066C, r24 ; 0x80066c update_mode_profile(); 2010e: 0f 94 91 aa call 0x35522 ; 0x35522 20112: 0e 94 f8 f8 call 0x1f1f0 ; 0x1f1f0 20116: 88 0f add r24, r24 tmc2130_init(TMCInitParams(false, FarmOrUserECool() )); 20118: 82 70 andi r24, 0x02 ; 2 2011a: 0f 94 1c 3b call 0x27638 ; 0x27638 setup_photpin(); // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); 2011e: 0f 94 41 cb call 0x39682 ; 0x39682 // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 20122: 83 e4 ldi r24, 0x43 ; 67 20124: 97 e0 ldi r25, 0x07 ; 7 20126: 0e 94 fe 6c call 0xd9fc ; 0xd9fc plan_set_position_curposXYZE(); 2012a: 0f 94 1d b9 call 0x3723a ; 0x3723a // Show the xflash error message now that serial, lcd and encoder are available if (!xflash_success) 2012e: b1 10 cpse r11, r1 20130: 08 c0 rjmp .+16 ; 0x20142 } static void xflash_err_msg() { puts_P(_n("XFLASH not responding.")); 20132: 8c e1 ldi r24, 0x1C ; 28 20134: 9d e6 ldi r25, 0x6D ; 109 20136: 0f 94 44 dc call 0x3b888 ; 0x3b888 lcd_show_fullscreen_message_and_wait_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable.")); 2013a: 80 ed ldi r24, 0xD0 ; 208 2013c: 9c e6 ldi r25, 0x6C ; 108 2013e: 0f 94 07 35 call 0x26a0e ; 0x26a0e } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 20142: 84 e9 ldi r24, 0x94 ; 148 20144: 9c e0 ldi r25, 0x0C ; 12 20146: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2014a: 82 34 cpi r24, 0x42 ; 66 2014c: 59 f4 brne .+22 ; 0x20164 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); 2014e: 6f ef ldi r22, 0xFF ; 255 20150: 84 e9 ldi r24, 0x94 ; 148 20152: 9c e0 ldi r25, 0x0C ; 12 20154: 0f 94 a3 dd call 0x3bb46 ; 0x3bb46 // 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); 20158: 85 e9 ldi r24, 0x95 ; 149 2015a: 9c e0 ldi r25, 0x0C ; 12 2015c: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 lcd_show_fullscreen_message_and_wait_P(kill_msg); 20160: 0f 94 07 35 call 0x26a0e ; 0x26a0e // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 20164: 0f 94 3b 86 call 0x30c76 ; 0x30c76 #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 20168: 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); 2016a: 8b eb ldi r24, 0xBB ; 187 2016c: 9f e0 ldi r25, 0x0F ; 15 2016e: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 20172: 91 e0 ldi r25, 0x01 ; 1 20174: 81 30 cpi r24, 0x01 ; 1 20176: 09 f0 breq .+2 ; 0x2017a 20178: 90 e0 ldi r25, 0x00 ; 0 bool writeStop(); // Toshiba FlashAir support uint8_t readExtMemory(uint8_t mio, uint8_t func, uint32_t addr, uint16_t count, uint8_t* dst); void setFlashAirCompatible(bool flashAirCompatible) { flash_air_compatible_ = flashAirCompatible; } 2017a: 90 93 df 16 sts 0x16DF, r25 ; 0x8016df // 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(); 2017e: 81 e0 ldi r24, 0x01 ; 1 20180: 0f 94 3f 80 call 0x3007e ; 0x3007e #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 20184: 60 e0 ldi r22, 0x00 ; 0 20186: 84 e6 ldi r24, 0x64 ; 100 20188: 9f e0 ldi r25, 0x0F ; 15 2018a: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 2018e: 60 e0 ldi r22, 0x00 ; 0 20190: 86 e6 ldi r24, 0x66 ; 102 20192: 9f e0 ldi r25, 0x0F ; 15 20194: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 20198: 60 e0 ldi r22, 0x00 ; 0 2019a: 88 e6 ldi r24, 0x68 ; 104 2019c: 9f e0 ldi r25, 0x0F ; 15 2019e: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 201a2: 60 e0 ldi r22, 0x00 ; 0 201a4: 85 e6 ldi r24, 0x65 ; 101 201a6: 9f e0 ldi r25, 0x0F ; 15 201a8: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 201ac: 70 e0 ldi r23, 0x00 ; 0 201ae: 60 e0 ldi r22, 0x00 ; 0 201b0: 8f ef ldi r24, 0xFF ; 255 201b2: 9e e0 ldi r25, 0x0E ; 14 201b4: 0e 94 fc 77 call 0xeff8 ; 0xeff8 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 201b8: 70 e0 ldi r23, 0x00 ; 0 201ba: 60 e0 ldi r22, 0x00 ; 0 201bc: 85 e0 ldi r24, 0x05 ; 5 201be: 9f e0 ldi r25, 0x0F ; 15 201c0: 0e 94 fc 77 call 0xeff8 ; 0xeff8 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 201c4: 70 e0 ldi r23, 0x00 ; 0 201c6: 60 e0 ldi r22, 0x00 ; 0 201c8: 83 e0 ldi r24, 0x03 ; 3 201ca: 9f e0 ldi r25, 0x0F ; 15 201cc: 0e 94 fc 77 call 0xeff8 ; 0xeff8 eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 201d0: 70 e0 ldi r23, 0x00 ; 0 201d2: 60 e0 ldi r22, 0x00 ; 0 201d4: 81 e0 ldi r24, 0x01 ; 1 201d6: 9f e0 ldi r25, 0x0F ; 15 201d8: 0e 94 fc 77 call 0xeff8 ; 0xeff8 eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 201dc: 70 e0 ldi r23, 0x00 ; 0 201de: 60 e0 ldi r22, 0x00 ; 0 201e0: 83 ed ldi r24, 0xD3 ; 211 201e2: 9e e0 ldi r25, 0x0E ; 14 201e4: 0e 94 fc 77 call 0xeff8 ; 0xeff8 eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 201e8: 70 e0 ldi r23, 0x00 ; 0 201ea: 60 e0 ldi r22, 0x00 ; 0 201ec: 80 ed ldi r24, 0xD0 ; 208 201ee: 9e e0 ldi r25, 0x0E ; 14 201f0: 0e 94 fc 77 call 0xeff8 ; 0xeff8 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 201f4: 60 e0 ldi r22, 0x00 ; 0 201f6: 82 ed ldi r24, 0xD2 ; 210 201f8: 9e e0 ldi r25, 0x0E ; 14 201fa: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 201fe: 60 e0 ldi r22, 0x00 ; 0 20200: 8f ec ldi r24, 0xCF ; 207 20202: 9e e0 ldi r25, 0x0E ; 14 20204: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 20208: 88 ea ldi r24, 0xA8 ; 168 2020a: 9c e0 ldi r25, 0x0C ; 12 2020c: 0f 94 48 7b call 0x2f690 ; 0x2f690 if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 20210: 81 ea ldi r24, 0xA1 ; 161 20212: 9d e0 ldi r25, 0x0D ; 13 20214: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 20218: 8f 3f cpi r24, 0xFF ; 255 2021a: 71 f4 brne .+28 ; 0x20238 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2021c: 60 e0 ldi r22, 0x00 ; 0 2021e: 81 ea ldi r24, 0xA1 ; 161 20220: 9d e0 ldi r25, 0x0D ; 13 20222: 0f 94 7f dd call 0x3bafe ; 0x3bafe 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); 20226: 88 ef ldi r24, 0xF8 ; 248 20228: 9f e0 ldi r25, 0x0F ; 15 2022a: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 2022e: bc 01 movw r22, r24 20230: 80 e5 ldi r24, 0x50 ; 80 20232: 9d e0 ldi r25, 0x0D ; 13 20234: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 20238: 39 e4 ldi r19, 0x49 ; 73 2023a: c3 2e mov r12, r19 2023c: 3d e0 ldi r19, 0x0D ; 13 2023e: d3 2e mov r13, r19 20240: 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); 20242: be 01 movw r22, r28 20244: 6f 5f subi r22, 0xFF ; 255 20246: 7f 4f sbci r23, 0xFF ; 255 20248: 81 2f mov r24, r17 2024a: 0e 94 7c 78 call 0xf0f8 ; 0xf0f8 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 2024e: ae 01 movw r20, r28 20250: 4f 5f subi r20, 0xFF ; 255 20252: 5f 4f sbci r21, 0xFF ; 255 20254: 67 e0 ldi r22, 0x07 ; 7 20256: 70 e0 ldi r23, 0x00 ; 0 20258: c6 01 movw r24, r12 2025a: 0e 94 dd 77 call 0xefba ; 0xefba 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++) { 2025e: 1f 5f subi r17, 0xFF ; 255 20260: ab e0 ldi r26, 0x0B ; 11 20262: ca 0e add r12, r26 20264: d1 1c adc r13, r1 20266: 18 30 cpi r17, 0x08 ; 8 20268: 61 f7 brne .-40 ; 0x20242 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)))) 2026a: 81 ea ldi r24, 0xA1 ; 161 2026c: 9d e0 ldi r25, 0x0D ; 13 2026e: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 20272: 0e 94 4c 78 call 0xf098 ; 0xf098 20276: 81 11 cpse r24, r1 20278: 02 c0 rjmp .+4 ; 0x2027e { eeprom_switch_to_next_sheet(); 2027a: 0e 94 6e 78 call 0xf0dc ; 0xf0dc } check_babystep(); 2027e: 0e 94 8a 7b call 0xf714 ; 0xf714 // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 20282: 80 e8 ldi r24, 0x80 ; 128 20284: 9c e0 ldi r25, 0x0C ; 12 20286: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2028a: 8f 3f cpi r24, 0xFF ; 255 2028c: 41 f4 brne .+16 ; 0x2029e #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); 2028e: 41 e1 ldi r20, 0x11 ; 17 20290: 50 e0 ldi r21, 0x00 ; 0 20292: 60 e8 ldi r22, 0x80 ; 128 20294: 7c e0 ldi r23, 0x0C ; 12 20296: 81 ee ldi r24, 0xE1 ; 225 20298: 92 e0 ldi r25, 0x02 ; 2 2029a: 0f 94 6f dd call 0x3bade ; 0x3bade #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); 2029e: 85 e0 ldi r24, 0x05 ; 5 202a0: 9d e0 ldi r25, 0x0D ; 13 202a2: 0f 94 48 7b call 0x2f690 ; 0x2f690 eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 202a6: 8d ee ldi r24, 0xED ; 237 202a8: 9f e0 ldi r25, 0x0F ; 15 202aa: 0f 94 48 7b call 0x2f690 ; 0x2f690 eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 202ae: 81 ef ldi r24, 0xF1 ; 241 202b0: 9f e0 ldi r25, 0x0F ; 15 202b2: 0f 94 48 7b call 0x2f690 ; 0x2f690 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 202b6: 60 e0 ldi r22, 0x00 ; 0 202b8: 8e ec ldi r24, 0xCE ; 206 202ba: 9e e0 ldi r25, 0x0E ; 14 202bc: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 202c0: 61 e0 ldi r22, 0x01 ; 1 202c2: 87 ea ldi r24, 0xA7 ; 167 202c4: 9c e0 ldi r25, 0x0C ; 12 202c6: 0e 94 14 78 call 0xf028 ; 0xf028 putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 202ca: 8e ef ldi r24, 0xFE ; 254 202cc: 9f e0 ldi r25, 0x0F ; 15 202ce: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 202d2: 0e 94 69 73 call 0xe6d2 ; 0xe6d2 202d6: 81 11 cpse r24, r1 202d8: 02 c0 rjmp .+4 ; 0x202de lcd_language(); 202da: 0f 94 5f 26 call 0x24cbe ; 0x24cbe lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 202de: 60 e0 ldi r22, 0x00 ; 0 202e0: 8f ea ldi r24, 0xAF ; 175 202e2: 9f e0 ldi r25, 0x0F ; 15 202e4: 0e 94 14 78 call 0xf028 ; 0xf028 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 202e8: 86 ea ldi r24, 0xA6 ; 166 202ea: 9f e0 ldi r25, 0x0F ; 15 202ec: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 202f0: 8f 3f cpi r24, 0xFF ; 255 202f2: d9 f4 brne .+54 ; 0x2032a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 202f4: 61 e0 ldi r22, 0x01 ; 1 202f6: 86 ea ldi r24, 0xA6 ; 166 202f8: 9f e0 ldi r25, 0x0F ; 15 202fa: 0f 94 7f dd call 0x3bafe ; 0x3bafe 202fe: 20 eb ldi r18, 0xB0 ; 176 20300: c2 2e mov r12, r18 20302: 2f e0 ldi r18, 0x0F ; 15 20304: 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); 20306: 70 e0 ldi r23, 0x00 ; 0 20308: 60 e0 ldi r22, 0x00 ; 0 2030a: c6 01 movw r24, r12 2030c: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 20310: b2 e0 ldi r27, 0x02 ; 2 20312: cb 0e add r12, r27 20314: 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++) { 20316: ea eb ldi r30, 0xBA ; 186 20318: ce 16 cp r12, r30 2031a: ef e0 ldi r30, 0x0F ; 15 2031c: de 06 cpc r13, r30 2031e: 99 f7 brne .-26 ; 0x20306 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20320: 60 e0 ldi r22, 0x00 ; 0 20322: 8f ea ldi r24, 0xAF ; 175 20324: 9f e0 ldi r25, 0x0F ; 15 20326: 0f 94 7f dd call 0x3bafe ; 0x3bafe 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); 2032a: 60 e0 ldi r22, 0x00 ; 0 2032c: 85 ea ldi r24, 0xA5 ; 165 2032e: 9f e0 ldi r25, 0x0F ; 15 20330: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 20334: 60 e0 ldi r22, 0x00 ; 0 20336: 8f e7 ldi r24, 0x7F ; 127 20338: 9c e0 ldi r25, 0x0C ; 12 2033a: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 2033e: 60 e0 ldi r22, 0x00 ; 0 20340: 89 e0 ldi r24, 0x09 ; 9 20342: 9f e0 ldi r25, 0x0F ; 15 20344: 0e 94 14 78 call 0xf028 ; 0xf028 } 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); 20348: 61 e0 ldi r22, 0x01 ; 1 2034a: 8c ea ldi r24, 0xAC ; 172 2034c: 9d e0 ldi r25, 0x0D ; 13 2034e: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 20352: 63 e0 ldi r22, 0x03 ; 3 20354: 8b ea ldi r24, 0xAB ; 171 20356: 9d e0 ldi r25, 0x0D ; 13 20358: 0e 94 14 78 call 0xf028 ; 0xf028 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 2035c: 63 e0 ldi r22, 0x03 ; 3 2035e: 8a ea ldi r24, 0xAA ; 170 20360: 9d e0 ldi r25, 0x0D ; 13 20362: 0e 94 14 78 call 0xf028 ; 0xf028 //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 20366: 61 e0 ldi r22, 0x01 ; 1 20368: 89 ea ldi r24, 0xA9 ; 169 2036a: 9d e0 ldi r25, 0x0D ; 13 2036c: 0e 94 14 78 call 0xf028 ; 0xf028 #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 20370: 6f 98 cbi 0x0d, 7 ; 13 PORTE &= ~(1 << 7); //no internal pull-up 20372: 77 98 cbi 0x0e, 7 ; 14 //start with sensing rising edge EICRB &= ~(1 << 6); 20374: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20378: 8f 7b andi r24, 0xBF ; 191 2037a: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << 7); 2037e: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20382: 80 68 ori r24, 0x80 ; 128 20384: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> //enable INT7 interrupt EIMSK |= (1 << 7); 20388: 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); 2038a: 84 e0 ldi r24, 0x04 ; 4 2038c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 void twi_init(void) { // activate internal pullups for SDA SET_INPUT(SDA_PIN); 20390: 51 98 cbi 0x0a, 1 ; 10 WRITE(SDA_PIN, 1); 20392: 59 9a sbi 0x0b, 1 ; 11 // start with the SDA pulled low WRITE(SCL_PIN, 0); 20394: 58 98 cbi 0x0b, 0 ; 11 SET_OUTPUT(SCL_PIN); 20396: 50 9a sbi 0x0a, 0 ; 10 20398: 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); 2039a: 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); 2039c: f5 e0 ldi r31, 0x05 ; 5 2039e: fa 95 dec r31 203a0: f1 f7 brne .-4 ; 0x2039e 203a2: 00 00 nop _delay_us((1000000 / TWI_FREQ) / 2); WRITE(SCL_PIN, 0); 203a4: 58 98 cbi 0x0b, 0 ; 11 203a6: 25 e0 ldi r18, 0x05 ; 5 203a8: 2a 95 dec r18 203aa: f1 f7 brne .-4 ; 0x203a8 203ac: 00 00 nop 203ae: 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++) { 203b0: a1 f7 brne .-24 ; 0x2039a WRITE(SCL_PIN, 0); _delay_us((1000000 / TWI_FREQ) / 2); } // activate internal pullups for SCL SET_INPUT(SCL_PIN); 203b2: 50 98 cbi 0x0a, 0 ; 10 WRITE(SCL_PIN, 1); 203b4: 58 9a sbi 0x0b, 0 ; 11 // initialize twi prescaler and bit rate TWSR &= ~(_BV(TWPS0) | _BV(TWPS1)); 203b6: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 203ba: 8c 7f andi r24, 0xFC ; 252 203bc: 80 93 b9 00 sts 0x00B9, r24 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> TWBR = ((F_CPU / TWI_FREQ) - 16) / 2; 203c0: 8c e0 ldi r24, 0x0C ; 12 203c2: 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); 203c6: 84 ea ldi r24, 0xA4 ; 164 203c8: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 203cc: 88 e0 ldi r24, 0x08 ; 8 203ce: 0f 94 f3 3e call 0x27de6 ; 0x27de6 203d2: 81 11 cpse r24, r1 203d4: 14 c0 rjmp .+40 ; 0x203fe return 1; // send address TWDR = TW_WRITE | (address << 1); 203d6: 8a ee ldi r24, 0xEA ; 234 203d8: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 203dc: 84 e8 ldi r24, 0x84 ; 132 203de: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 203e2: 88 e1 ldi r24, 0x18 ; 24 203e4: 0f 94 f3 3e call 0x27de6 ; 0x27de6 203e8: 81 11 cpse r24, r1 203ea: 09 c0 rjmp .+18 ; 0x203fe } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 203ec: 84 e9 ldi r24, 0x94 ; 148 203ee: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> #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()) { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FW_MK3_DETECTED)); 203f2: 8b ef ldi r24, 0xFB ; 251 203f4: 91 e4 ldi r25, 0x41 ; 65 203f6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 203fa: 0f 94 07 35 call 0x26a0e ; 0x26a0e #if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) check_if_fw_is_on_right_printer(); #endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) } switch (hw_changed) { 203fe: 02 30 cpi r16, 0x02 ; 2 20400: 81 f0 breq .+32 ; 0x20422 20402: 03 30 cpi r16, 0x03 ; 3 20404: 09 f4 brne .+2 ; 0x20408 20406: 37 c1 rjmp .+622 ; 0x20676 20408: 01 30 cpi r16, 0x01 ; 1 2040a: b9 f4 brne .+46 ; 0x2043a //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)); 2040c: 8d e2 ldi r24, 0x2D ; 45 2040e: 94 e4 ldi r25, 0x44 ; 68 20410: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20414: 0f 94 07 35 call 0x26a0e ; 0x26a0e 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); 20418: 66 e3 ldi r22, 0x36 ; 54 2041a: 71 e0 ldi r23, 0x01 ; 1 2041c: 8c ee ldi r24, 0xEC ; 236 2041e: 9e e0 ldi r25, 0x0E ; 14 20420: 0a c0 rjmp .+20 ; 0x20436 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; case(0b10): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_PRINTER)); 20422: 8c e0 ldi r24, 0x0C ; 12 20424: 94 e4 ldi r25, 0x44 ; 68 20426: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2042a: 0f 94 07 35 call 0x26a0e ; 0x26a0e 2042e: 6e e2 ldi r22, 0x2E ; 46 20430: 71 e0 ldi r23, 0x01 ; 1 20432: 8e ee ldi r24, 0xEE ; 238 20434: 9e e0 ldi r25, 0x0E ; 14 20436: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 2043a: f1 10 cpse r15, r1 2043c: 08 c0 rjmp .+16 ; 0x2044e 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 2043e: 85 e9 ldi r24, 0x95 ; 149 20440: 93 e4 ldi r25, 0x43 ; 67 20442: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20446: 0f 94 07 35 call 0x26a0e ; 0x26a0e Config_StoreSettings(); 2044a: 0e 94 4f 84 call 0x1089e ; 0x1089e } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 2044e: 80 e8 ldi r24, 0x80 ; 128 20450: 0e 94 6d f8 call 0x1f0da ; 0x1f0da 20454: 88 23 and r24, r24 20456: c9 f0 breq .+50 ; 0x2048a CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 20458: 87 ef ldi r24, 0xF7 ; 247 2045a: 9f e0 ldi r25, 0x0F ; 15 2045c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 20460: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 20462: 81 30 cpi r24, 0x01 ; 1 20464: 71 f4 brne .+28 ; 0x20482 // 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)) { 20466: 8e e7 ldi r24, 0x7E ; 126 20468: 90 e9 ldi r25, 0x90 ; 144 2046a: 0e 94 d1 d1 call 0x1a3a2 ; 0x1a3a2 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); 2046e: 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)) { 20470: 88 23 and r24, r24 20472: 39 f0 breq .+14 ; 0x20482 // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 20474: 83 e5 ldi r24, 0x53 ; 83 20476: 93 e4 ldi r25, 0x43 ; 67 20478: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2047c: 0f 94 07 35 call 0x26a0e ; 0x26a0e calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 20480: 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); 20482: 86 ea ldi r24, 0xA6 ; 166 20484: 9c e0 ldi r25, 0x0C ; 12 20486: 0f 94 7f dd call 0x3bafe ; 0x3bafe } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 2048a: 86 e7 ldi r24, 0x76 ; 118 2048c: 90 e9 ldi r25, 0x90 ; 144 2048e: 0e 94 d1 d1 call 0x1a3a2 ; 0x1a3a2 20492: f8 2e mov r15, r24 20494: 88 23 and r24, r24 20496: 31 f0 breq .+12 ; 0x204a4 if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 20498: 8f e1 ldi r24, 0x1F ; 31 2049a: 0e 94 6d f8 call 0x1f0da ; 0x1f0da 2049e: 91 e0 ldi r25, 0x01 ; 1 204a0: f8 2e mov r15, r24 204a2: 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; 204a4: 10 e0 ldi r17, 0x00 ; 0 204a6: 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)); 204a8: f8 01 movw r30, r16 204aa: e9 59 subi r30, 0x99 ; 153 204ac: ff 46 sbci r31, 0x6F ; 111 204ae: 64 91 lpm r22, Z 204b0: c8 01 movw r24, r16 204b2: 0f 94 7f dd call 0x3bafe ; 0x3bafe 204b6: 0f 5f subi r16, 0xFF ; 255 204b8: 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){ 204ba: 0a 30 cpi r16, 0x0A ; 10 204bc: 11 05 cpc r17, r1 204be: a1 f7 brne .-24 ; 0x204a8 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])); 204c0: e6 e7 ldi r30, 0x76 ; 118 204c2: f0 e9 ldi r31, 0x90 ; 144 204c4: 65 91 lpm r22, Z+ 204c6: 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); 204c8: 8a e0 ldi r24, 0x0A ; 10 204ca: 90 e0 ldi r25, 0x00 ; 0 204cc: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 204d0: e8 e7 ldi r30, 0x78 ; 120 204d2: f0 e9 ldi r31, 0x90 ; 144 204d4: 65 91 lpm r22, Z+ 204d6: 74 91 lpm r23, Z 204d8: 8c e0 ldi r24, 0x0C ; 12 204da: 90 e0 ldi r25, 0x00 ; 0 204dc: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 204e0: ea e7 ldi r30, 0x7A ; 122 204e2: f0 e9 ldi r31, 0x90 ; 144 204e4: 65 91 lpm r22, Z+ 204e6: 74 91 lpm r23, Z 204e8: 8e e0 ldi r24, 0x0E ; 14 204ea: 90 e0 ldi r25, 0x00 ; 0 204ec: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a // 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])); 204f0: ec e7 ldi r30, 0x7C ; 124 204f2: f0 e9 ldi r31, 0x90 ; 144 204f4: 65 91 lpm r22, Z+ 204f6: 74 91 lpm r23, Z 204f8: 80 e1 ldi r24, 0x10 ; 16 204fa: 90 e0 ldi r25, 0x00 ; 0 204fc: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 20500: 8f e5 ldi r24, 0x5F ; 95 20502: 9f e0 ldi r25, 0x0F ; 15 20504: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 20508: 88 23 and r24, r24 2050a: 09 f4 brne .+2 ; 0x2050e 2050c: c1 c0 rjmp .+386 ; 0x20690 // first time run of wizard or service prep lcd_wizard(WizState::Run); 2050e: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 20510: 0f 94 dc 64 call 0x2c9b8 ; 0x2c9b8 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 20514: 83 e0 ldi r24, 0x03 ; 3 20516: 80 93 96 02 sts 0x0296, r24 ; 0x800296 #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 2051a: 81 e0 ldi r24, 0x01 ; 1 2051c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_clear(); 20520: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_update(2); 20524: 82 e0 ldi r24, 0x02 ; 2 20526: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 #ifdef TMC2130 tmc2130_home_origin[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, 0); 2052a: 60 e0 ldi r22, 0x00 ; 0 2052c: 8e ef ldi r24, 0xFE ; 254 2052e: 9e e0 ldi r25, 0x0E ; 14 20530: 0e 94 14 78 call 0xf028 ; 0xf028 20534: 80 93 f6 04 sts 0x04F6, r24 ; 0x8004f6 tmc2130_home_bsteps[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_BSTEPS, 48); 20538: 60 e3 ldi r22, 0x30 ; 48 2053a: 8d ef ldi r24, 0xFD ; 253 2053c: 9e e0 ldi r25, 0x0E ; 14 2053e: 0e 94 14 78 call 0xf028 ; 0xf028 20542: 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); 20546: 60 e3 ldi r22, 0x30 ; 48 20548: 8c ef ldi r24, 0xFC ; 252 2054a: 9e e0 ldi r25, 0x0E ; 14 2054c: 0e 94 14 78 call 0xf028 ; 0xf028 20550: 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); 20554: 60 e0 ldi r22, 0x00 ; 0 20556: 8b ef ldi r24, 0xFB ; 251 20558: 9e e0 ldi r25, 0x0E ; 14 2055a: 0e 94 14 78 call 0xf028 ; 0xf028 2055e: 80 93 f7 04 sts 0x04F7, r24 ; 0x8004f7 tmc2130_home_bsteps[Y_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_Y_BSTEPS, 48); 20562: 60 e3 ldi r22, 0x30 ; 48 20564: 8a ef ldi r24, 0xFA ; 250 20566: 9e e0 ldi r25, 0x0E ; 14 20568: 0e 94 14 78 call 0xf028 ; 0xf028 2056c: 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); 20570: 60 e3 ldi r22, 0x30 ; 48 20572: 89 ef ldi r24, 0xF9 ; 249 20574: 9e e0 ldi r25, 0x0E ; 14 20576: 0e 94 14 78 call 0xf028 ; 0xf028 2057a: 80 93 59 02 sts 0x0259, r24 ; 0x800259 tmc2130_home_enabled = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 0); 2057e: 60 e0 ldi r22, 0x00 ; 0 20580: 88 ef ldi r24, 0xF8 ; 248 20582: 9e e0 ldi r25, 0x0E ; 14 20584: 0e 94 14 78 call 0xf028 ; 0xf028 20588: 80 93 f5 04 sts 0x04F5, r24 ; 0x8004f5 static void fw_crash_init() { #ifdef XFLASH_DUMP dump_crash_reason crash_reason; if(xfdump_check_state(&crash_reason)) 2058c: ce 01 movw r24, r28 2058e: 01 96 adiw r24, 0x01 ; 1 20590: 0e 94 aa e2 call 0x1c554 ; 0x1c554 20594: 88 23 and r24, r24 20596: 89 f0 breq .+34 ; 0x205ba { // always signal to the host that a dump is available for retrieval puts_P(_N("//action:dump_available")); 20598: 87 ea ldi r24, 0xA7 ; 167 2059a: 9d e6 ldi r25, 0x6D ; 109 2059c: 0f 94 44 dc call 0x3b888 ; 0x3b888 #ifdef EMERGENCY_DUMP if(crash_reason != dump_crash_reason::manual && 205a0: 89 81 ldd r24, Y+1 ; 0x01 205a2: 88 23 and r24, r24 205a4: 51 f0 breq .+20 ; 0x205ba eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) 205a6: 83 e0 ldi r24, 0x03 ; 3 205a8: 9d e0 ldi r25, 0x0D ; 13 205aa: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 { // 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 && 205ae: 8f 3f cpi r24, 0xFF ; 255 205b0: 21 f0 breq .+8 ; 0x205ba eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) { lcd_show_fullscreen_message_and_wait_P( 205b2: 83 e3 ldi r24, 0x33 ; 51 205b4: 9d e6 ldi r25, 0x6D ; 109 205b6: 0f 94 07 35 call 0x26a0e ; 0x26a0e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 205ba: 6f ef ldi r22, 0xFF ; 255 205bc: 83 e0 ldi r24, 0x03 ; 3 205be: 9d e0 ldi r25, 0x0D ; 13 205c0: 0f 94 7f dd call 0x3bafe ; 0x3bafe // report crash failures fw_crash_init(); #ifdef UVLO_SUPPORT if (printer_recovering()) { //previous print was terminated by UVLO 205c4: 0e 94 b0 68 call 0xd160 ; 0xd160 205c8: 88 23 and r24, r24 205ca: d9 f1 breq .+118 ; 0x20642 manage_heater(); // Update temperatures 205cc: 0f 94 9b 4d call 0x29b36 ; 0x29b36 //Restore printing type saved_printing_type = eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE); 205d0: 8c e8 ldi r24, 0x8C ; 140 205d2: 9f e0 ldi r25, 0x0F ; 15 205d4: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 205d8: 08 2f mov r16, r24 205da: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a return current_temperature_bed_raw; }; #endif FORCE_INLINE float degBed() { return current_temperature_bed; 205de: 80 90 f1 04 lds r8, 0x04F1 ; 0x8004f1 205e2: 90 90 f2 04 lds r9, 0x04F2 ; 0x8004f2 205e6: a0 90 f3 04 lds r10, 0x04F3 ; 0x8004f3 205ea: b0 90 f4 04 lds r11, 0x04F4 ; 0x8004f4 #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)); 205ee: 8b e8 ldi r24, 0x8B ; 139 205f0: 9f e0 ldi r25, 0x0F ; 15 205f2: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 205f6: 68 2f mov r22, r24 205f8: 70 e0 ldi r23, 0x00 ; 0 205fa: 90 e0 ldi r25, 0x00 ; 0 205fc: 80 e0 ldi r24, 0x00 ; 0 205fe: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 20602: 20 e0 ldi r18, 0x00 ; 0 20604: 30 e0 ldi r19, 0x00 ; 0 20606: 40 ea ldi r20, 0xA0 ; 160 20608: 50 e4 ldi r21, 0x40 ; 64 2060a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 2060e: 6b 01 movw r12, r22 20610: 7c 01 movw r14, r24 20612: 11 e0 ldi r17, 0x01 ; 1 20614: ac 01 movw r20, r24 20616: 9b 01 movw r18, r22 20618: c5 01 movw r24, r10 2061a: b4 01 movw r22, r8 2061c: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 20620: 18 16 cp r1, r24 20622: 0c f0 brlt .+2 ; 0x20626 20624: 10 e0 ldi r17, 0x00 ; 0 20626: 10 93 f0 04 sts 0x04F0, r17 ; 0x8004f0 <_ZL24uvlo_auto_recovery_ready.lto_priv.550> if (uvlo_auto_recovery_ready){ 2062a: a7 01 movw r20, r14 2062c: 96 01 movw r18, r12 2062e: c5 01 movw r24, r10 20630: b4 01 movw r22, r8 20632: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 20636: 18 16 cp r1, r24 20638: 0c f0 brlt .+2 ; 0x2063c 2063a: 58 c0 rjmp .+176 ; 0x206ec #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Automatic recovery!")); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER recover_print(1); 2063c: 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); 2063e: 0f 94 cb d2 call 0x3a596 ; 0x3a596 printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); uvlo_drain_reset(); } void setup_uvlo_interrupt() { DDRE &= ~(1 << 4); //input pin 20642: 6c 98 cbi 0x0d, 4 ; 13 PORTE &= ~(1 << 4); //no internal pull-up 20644: 74 98 cbi 0x0e, 4 ; 14 // sensing falling edge EICRB |= (1 << 0); 20646: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 2064a: 81 60 ori r24, 0x01 ; 1 2064c: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB &= ~(1 << 1); 20650: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20654: 8d 7f andi r24, 0xFD ; 253 20656: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> // enable INT4 interrupt EIMSK |= (1 << 4); 2065a: ec 9a sbi 0x1d, 4 ; 29 // check if power was lost before we armed the interrupt if(!(PINE & (1 << 4)) && printer_recovering()) 2065c: 64 99 sbic 0x0c, 4 ; 12 2065e: 57 c0 rjmp .+174 ; 0x2070e 20660: 0e 94 b0 68 call 0xd160 ; 0xd160 20664: 88 23 and r24, r24 20666: 09 f4 brne .+2 ; 0x2066a 20668: 52 c0 rjmp .+164 ; 0x2070e { SERIAL_ECHOLNRPGM(MSG_INT4); 2066a: 81 e7 ldi r24, 0x71 ; 113 2066c: 90 e9 ldi r25, 0x90 ; 144 2066e: 0e 94 86 7b call 0xf70c ; 0xf70c uvlo_drain_reset(); 20672: 0f 94 04 aa call 0x35408 ; 0x35408 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)); 20676: 81 ed ldi r24, 0xD1 ; 209 20678: 93 e4 ldi r25, 0x43 ; 67 2067a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2067e: 0f 94 07 35 call 0x26a0e ; 0x26a0e 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); 20682: 6e e2 ldi r22, 0x2E ; 46 20684: 71 e0 ldi r23, 0x01 ; 1 20686: 8e ee ldi r24, 0xEE ; 238 20688: 9e e0 ldi r25, 0x0E ; 14 2068a: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 2068e: c4 ce rjmp .-632 ; 0x20418 // 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); 20690: 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) { 20692: f1 10 cpse r15, r1 20694: 3d cf rjmp .-390 ; 0x20510 // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 20696: 0e 94 6d f8 call 0x1f0da ; 0x1f0da 2069a: 81 11 cpse r24, r1 2069c: 07 c0 rjmp .+14 ; 0x206ac // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 2069e: 83 ee ldi r24, 0xE3 ; 227 206a0: 92 e4 ldi r25, 0x42 ; 66 // 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)); 206a2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 206a6: 0f 94 07 35 call 0x26a0e ; 0x26a0e 206aa: 34 cf rjmp .-408 ; 0x20514 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)) { 206ac: 84 e0 ldi r24, 0x04 ; 4 206ae: 0e 94 6d f8 call 0x1f0da ; 0x1f0da 206b2: 81 11 cpse r24, r1 206b4: 03 c0 rjmp .+6 ; 0x206bc // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 206b6: 8b e6 ldi r24, 0x6B ; 107 206b8: 92 e4 ldi r25, 0x42 ; 66 206ba: f3 cf rjmp .-26 ; 0x206a2 } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 206bc: 80 e1 ldi r24, 0x10 ; 16 206be: 0e 94 6d f8 call 0x1f0da ; 0x1f0da 206c2: 81 11 cpse r24, r1 206c4: 06 c0 rjmp .+12 ; 0x206d2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 206c6: 83 e4 ldi r24, 0x43 ; 67 206c8: 98 e4 ldi r25, 0x48 ; 72 206ca: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 206ce: 0f 94 07 35 call 0x26a0e ; 0x26a0e #ifdef THERMAL_MODEL if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL) && thermal_model_enabled()) 206d2: 88 e0 ldi r24, 0x08 ; 8 206d4: 0e 94 6d f8 call 0x1f0da ; 0x1f0da 206d8: 81 11 cpse r24, r1 206da: 1c cf rjmp .-456 ; 0x20514 206dc: 80 91 20 05 lds r24, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> 206e0: 88 23 and r24, r24 206e2: 09 f4 brne .+2 ; 0x206e6 206e4: 17 cf rjmp .-466 ; 0x20514 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); 206e6: 87 e4 ldi r24, 0x47 ; 71 206e8: 92 e4 ldi r25, 0x42 ; 66 206ea: db cf rjmp .-74 ; 0x206a2 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) { 206ec: 01 30 cpi r16, 0x01 ; 1 206ee: 11 f4 brne .+4 ; 0x206f4 recover_print(0); 206f0: 80 e0 ldi r24, 0x00 ; 0 206f2: a5 cf rjmp .-182 ; 0x2063e } else { const uint8_t btn = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false); 206f4: 83 e2 ldi r24, 0x23 ; 35 206f6: 92 e4 ldi r25, 0x42 ; 66 206f8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 206fc: 41 e0 ldi r20, 0x01 ; 1 206fe: 60 e0 ldi r22, 0x00 ; 0 20700: 0f 94 b3 64 call 0x2c966 ; 0x2c966 if ( btn == LCD_LEFT_BUTTON_CHOICE) { 20704: 88 23 and r24, r24 20706: a1 f3 breq .-24 ; 0x206f0 recover_print(0); } else { // LCD_MIDDLE_BUTTON_CHOICE cancel_saved_printing(); 20708: 0e 94 e2 65 call 0xcbc4 ; 0xcbc4 2070c: 9a cf rjmp .-204 ; 0x20642 ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 2070e: 61 e0 ldi r22, 0x01 ; 1 20710: 88 ea ldi r24, 0xA8 ; 168 20712: 9d e0 ldi r25, 0x0D ; 13 20714: 0e 94 14 78 call 0xf028 ; 0xf028 20718: 80 93 ef 04 sts 0x04EF, r24 ; 0x8004ef 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); 2071c: 68 e2 ldi r22, 0x28 ; 40 2071e: 87 ea ldi r24, 0xA7 ; 167 20720: 9d e0 ldi r25, 0x0D ; 13 20722: 0e 94 14 78 call 0xf028 ; 0xf028 20726: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 2072a: 60 e9 ldi r22, 0x90 ; 144 2072c: 71 e0 ldi r23, 0x01 ; 1 2072e: 85 ea ldi r24, 0xA5 ; 165 20730: 9d e0 ldi r25, 0x0D ; 13 20732: 0e 94 fc 77 call 0xeff8 ; 0xeff8 oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 20736: 61 e0 ldi r22, 0x01 ; 1 20738: 84 ea ldi r24, 0xA4 ; 164 2073a: 9d e0 ldi r25, 0x0D ; 13 2073c: 0e 94 14 78 call 0xf028 ; 0xf028 20740: 80 93 ed 04 sts 0x04ED, r24 ; 0x8004ed oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 20744: 61 e0 ldi r22, 0x01 ; 1 20746: 83 ea ldi r24, 0xA3 ; 163 20748: 9d e0 ldi r25, 0x0D ; 13 2074a: 0e 94 14 78 call 0xf028 ; 0xf028 2074e: 80 93 ec 04 sts 0x04EC, r24 ; 0x8004ec oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 20752: 61 e0 ldi r22, 0x01 ; 1 20754: 82 ea ldi r24, 0xA2 ; 162 20756: 9d e0 ldi r25, 0x0D ; 13 20758: 0e 94 14 78 call 0xf028 ; 0xf028 2075c: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 20760: 61 e0 ldi r22, 0x01 ; 1 20762: 80 e2 ldi r24, 0x20 ; 32 20764: 9c e0 ldi r25, 0x0C ; 12 20766: 0e 94 14 78 call 0xf028 ; 0xf028 2076a: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea // the entire state machine initialized. setup_uvlo_interrupt(); #endif //UVLO_SUPPORT fCheckModeInit(); KEEPALIVE_STATE(NOT_BUSY); 2076e: 81 e0 ldi r24, 0x01 ; 1 20770: 80 93 96 02 sts 0x0296, r24 ; 0x800296 : "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" ); 20774: 88 e1 ldi r24, 0x18 ; 24 20776: 98 e2 ldi r25, 0x28 ; 40 20778: 0f b6 in r0, 0x3f ; 63 2077a: f8 94 cli 2077c: a8 95 wdr 2077e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 20782: 0f be out 0x3f, r0 ; 63 20784: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 20788: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2078c: 80 64 ori r24, 0x40 ; 64 2078e: 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; 20792: 85 e0 ldi r24, 0x05 ; 5 20794: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 20796: 00 e0 ldi r16, 0x00 ; 0 20798: 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); 2079a: cc 24 eor r12, r12 2079c: 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); 2079e: 94 e0 ldi r25, 0x04 ; 4 207a0: 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; 207a2: 10 92 5d 0e sts 0x0E5D, r1 ; 0x800e5d if(Stopped) { 207a6: 80 91 14 05 lds r24, 0x0514 ; 0x800514 207aa: 88 23 and r24, r24 207ac: 09 f4 brne .+2 ; 0x207b0 207ae: c4 c0 rjmp .+392 ; 0x20938 // 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); 207b0: b0 92 96 02 sts 0x0296, r11 ; 0x800296 } 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. 207b4: 0e 94 ba 68 call 0xd174 ; 0xd174 207b8: 88 23 and r24, r24 207ba: 09 f4 brne .+2 ; 0x207be 207bc: c0 c0 rjmp .+384 ; 0x2093e 207be: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 207c2: 81 30 cpi r24, 0x01 ; 1 207c4: 09 f0 breq .+2 ; 0x207c8 207c6: bb c0 rjmp .+374 ; 0x2093e usb_timer.start(); 207c8: 81 e1 ldi r24, 0x11 ; 17 207ca: 95 e0 ldi r25, 0x05 ; 5 207cc: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> } else #endif { get_command(); 207d0: 0e 94 cb 84 call 0x10996 ; 0x10996 // 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) 207d4: 80 91 69 02 lds r24, 0x0269 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.570> 207d8: 88 23 and r24, r24 207da: 89 f0 breq .+34 ; 0x207fe return; if(autostart_atmillis.expired(5000)) 207dc: 68 e8 ldi r22, 0x88 ; 136 207de: 73 e1 ldi r23, 0x13 ; 19 207e0: 8f e7 ldi r24, 0x7F ; 127 207e2: 97 e1 ldi r25, 0x17 ; 23 207e4: 0f 94 b8 3e call 0x27d70 ; 0x27d70 ::expired(unsigned short)> 207e8: 81 11 cpse r24, r1 207ea: 09 c0 rjmp .+18 ; 0x207fe return; } autostart_stilltocheck = false; 207ec: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.570> if(!mounted) 207f0: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 207f4: 88 23 and r24, r24 207f6: 09 f4 brne .+2 ; 0x207fa 207f8: ae c0 rjmp .+348 ; 0x20956 207fa: 0f 94 a2 76 call 0x2ed44 ; 0x2ed44 #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 207fe: 80 91 81 10 lds r24, 0x1081 ; 0x801081 20802: 90 91 82 10 lds r25, 0x1082 ; 0x801082 20806: 89 2b or r24, r25 20808: 09 f4 brne .+2 ; 0x2080c 2080a: 61 c0 rjmp .+194 ; 0x208ce { cmdbuffer_front_already_processed = false; 2080c: 10 92 80 10 sts 0x1080, r1 ; 0x801080 #ifdef SDSUPPORT if(card.saving) 20810: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 20814: 88 23 and r24, r24 20816: d1 f1 breq .+116 ; 0x2088c { // 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) { 20818: 80 91 70 12 lds r24, 0x1270 ; 0x801270 2081c: 90 91 71 12 lds r25, 0x1271 ; 0x801271 20820: dc 01 movw r26, r24 20822: aa 57 subi r26, 0x7A ; 122 20824: bf 4e sbci r27, 0xEF ; 239 20826: 7d 01 movw r14, r26 20828: 6f e1 ldi r22, 0x1F ; 31 2082a: 71 e9 ldi r23, 0x91 ; 145 2082c: cd 01 movw r24, r26 2082e: 0f 94 62 db call 0x3b6c4 ; 0x3b6c4 20832: 89 2b or r24, r25 20834: 09 f0 breq .+2 ; 0x20838 20836: 9c c0 rjmp .+312 ; 0x20970 else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 20838: 10 92 fe 16 sts 0x16FE, r1 ; 0x8016fe /** 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)); 2083c: f7 01 movw r30, r14 2083e: 01 90 ld r0, Z+ 20840: 00 20 and r0, r0 20842: e9 f7 brne .-6 ; 0x2083e 20844: 31 97 sbiw r30, 0x01 ; 1 20846: bf 01 movw r22, r30 20848: 6e 19 sub r22, r14 2084a: 7f 09 sbc r23, r15 2084c: c7 01 movw r24, r14 2084e: 0f 94 dd 82 call 0x305ba ; 0x305ba 20852: 62 e0 ldi r22, 0x02 ; 2 20854: 70 e0 ldi r23, 0x00 ; 0 20856: 82 ef ldi r24, 0xF2 ; 242 20858: 92 e0 ldi r25, 0x02 ; 2 2085a: 0f 94 dd 82 call 0x305ba ; 0x305ba file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 2085e: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 20862: 88 23 and r24, r24 20864: 41 f0 breq .+16 ; 0x20876 { SERIAL_ERROR_START; 20866: 8a ec ldi r24, 0xCA ; 202 20868: 9a ea ldi r25, 0xAA ; 170 2086a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 2086e: 86 e8 ldi r24, 0x86 ; 134 20870: 9e e6 ldi r25, 0x6E ; 110 20872: 0e 94 86 7b call 0xf70c ; 0xf70c card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 20876: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 2087a: 88 23 and r24, r24 2087c: 09 f4 brne .+2 ; 0x20880 2087e: 73 c0 rjmp .+230 ; 0x20966 */ void process_commands() { if (!buflen) return; //empty command 20880: 80 91 81 10 lds r24, 0x1081 ; 0x801081 20884: 90 91 82 10 lds r25, 0x1082 ; 0x801082 20888: 89 2b or r24, r25 2088a: 11 f0 breq .+4 ; 0x20890 2088c: 0e 94 a0 97 call 0x12f40 ; 0x12f40 } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 20890: 80 91 80 10 lds r24, 0x1080 ; 0x801080 20894: 81 11 cpse r24, r1 20896: 19 c0 rjmp .+50 ; 0x208ca 20898: 80 91 81 10 lds r24, 0x1081 ; 0x801081 2089c: 90 91 82 10 lds r25, 0x1082 ; 0x801082 208a0: 89 2b or r24, r25 208a2: 99 f0 breq .+38 ; 0x208ca { // 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; 208a4: e0 91 70 12 lds r30, 0x1270 ; 0x801270 208a8: f0 91 71 12 lds r31, 0x1271 ; 0x801271 208ac: ed 57 subi r30, 0x7D ; 125 208ae: ff 4e sbci r31, 0xEF ; 239 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 208b0: 80 81 ld r24, Z 208b2: 82 30 cpi r24, 0x02 ; 2 208b4: 09 f0 breq .+2 ; 0x208b8 208b6: 6b c0 rjmp .+214 ; 0x2098e { // 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(); 208b8: 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; 208ba: 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); 208bc: 81 81 ldd r24, Z+1 ; 0x01 208be: 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); 208c0: 0f 94 36 aa call 0x3546c ; 0x3546c sei(); 208c4: 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(); 208c6: 0e 94 c7 78 call 0xf18e ; 0xf18e } host_keepalive(); 208ca: 0e 94 b2 81 call 0x10364 ; 0x10364 } } //check heater every n milliseconds manage_heater(); 208ce: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(printingIsPaused()); 208d2: 0e 94 ba 68 call 0xd174 ; 0xd174 208d6: 0e 94 5a 8c call 0x118b4 ; 0x118b4 //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 208da: 80 91 0e 05 lds r24, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.494> 208de: 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; 208e0: 10 92 0e 05 sts 0x050E, r1 ; 0x80050e <_ZL11endstop_hit.lto_priv.494> checkHitEndstops(); lcd_update(0); 208e4: 80 e0 ldi r24, 0x00 ; 0 208e6: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 #ifdef TMC2130 tmc2130_check_overtemp(); 208ea: 0f 94 21 3f call 0x27e42 ; 0x27e42 if (tmc2130_sg_crash) 208ee: 80 91 10 05 lds r24, 0x0510 ; 0x800510 208f2: 88 23 and r24, r24 208f4: 79 f0 breq .+30 ; 0x20914 { uint8_t crash = tmc2130_sg_crash; tmc2130_sg_crash = 0; 208f6: 10 92 10 05 sts 0x0510, r1 ; 0x800510 // crashdet_stop_and_save_print(); switch (crash) 208fa: 82 30 cpi r24, 0x02 ; 2 208fc: 09 f4 brne .+2 ; 0x20900 208fe: 53 c0 rjmp .+166 ; 0x209a6 20900: 83 30 cpi r24, 0x03 ; 3 20902: 09 f4 brne .+2 ; 0x20906 20904: 54 c0 rjmp .+168 ; 0x209ae 20906: 81 30 cpi r24, 0x01 ; 1 20908: 29 f4 brne .+10 ; 0x20914 { case 1: enquecommand_P((PSTR("CRASH_DETECTEDX"))); break; 2090a: 61 e0 ldi r22, 0x01 ; 1 2090c: 8f e0 ldi r24, 0x0F ; 15 2090e: 91 e9 ldi r25, 0x91 ; 145 case 2: enquecommand_P((PSTR("CRASH_DETECTEDY"))); break; case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20910: 0e 94 cb 89 call 0x11396 ; 0x11396 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) { 20914: 80 91 0f 05 lds r24, 0x050F ; 0x80050f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.559> 20918: 81 11 cpse r24, r1 2091a: 07 c0 rjmp .+14 ; 0x2092a return; } avoidRecursion = true; 2091c: c0 92 0f 05 sts 0x050F, r12 ; 0x80050f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.559> mmu_loop_inner(true); 20920: 81 e0 ldi r24, 0x01 ; 1 20922: 0f 94 f8 99 call 0x333f0 ; 0x333f0 avoidRecursion = false; 20926: 10 92 0f 05 sts 0x050F, r1 ; 0x80050f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.559> 2092a: 01 15 cp r16, r1 2092c: 11 05 cpc r17, r1 2092e: 09 f4 brne .+2 ; 0x20932 20930: 38 cf rjmp .-400 ; 0x207a2 20932: 0e 94 00 00 call 0 ; 0x0 <__vectors> 20936: 35 cf rjmp .-406 ; 0x207a2 // 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); 20938: c0 92 96 02 sts 0x0296, r12 ; 0x800296 2093c: 3b cf rjmp .-394 ; 0x207b4 } 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. 2093e: 60 e1 ldi r22, 0x10 ; 16 20940: 77 e2 ldi r23, 0x27 ; 39 20942: 81 e1 ldi r24, 0x11 ; 17 20944: 95 e0 ldi r25, 0x05 ; 5 20946: 0f 94 b8 3e call 0x27d70 ; 0x27d70 ::expired(unsigned short)> 2094a: 88 23 and r24, r24 2094c: 09 f4 brne .+2 ; 0x20950 2094e: 40 cf rjmp .-384 ; 0x207d0 } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 20950: b0 92 67 0e sts 0x0E67, r11 ; 0x800e67 <_ZL13printer_state.lto_priv.395> 20954: 3d cf rjmp .-390 ; 0x207d0 return; } autostart_stilltocheck = false; if(!mounted) { mount(); 20956: 81 e0 ldi r24, 0x01 ; 1 20958: 0f 94 3f 80 call 0x3007e ; 0x3007e if(!mounted) //fail 2095c: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 20960: 81 11 cpse r24, r1 20962: 4b cf rjmp .-362 ; 0x207fa 20964: 4c cf rjmp .-360 ; 0x207fe 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); 20966: 8e ea ldi r24, 0xAE ; 174 20968: 9e e6 ldi r25, 0x6E ; 110 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 2096a: 0e 94 86 7b call 0xf70c ; 0xf70c 2096e: 90 cf rjmp .-224 ; 0x20890 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 20970: 8e ef ldi r24, 0xFE ; 254 20972: 96 e1 ldi r25, 0x16 ; 22 20974: 0f 94 41 6d call 0x2da82 ; 0x2da82 file.close(); 20978: 8e ef ldi r24, 0xFE ; 254 2097a: 96 e1 ldi r25, 0x16 ; 22 2097c: 0f 94 3e a4 call 0x3487c ; 0x3487c saving = false; 20980: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c logging = false; 20984: 10 92 6d 14 sts 0x146D, r1 ; 0x80146d 20988: 8c e9 ldi r24, 0x9C ; 156 2098a: 9e e6 ldi r25, 0x6E ; 110 2098c: ee cf rjmp .-36 ; 0x2096a // 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){ 2098e: 86 30 cpi r24, 0x06 ; 6 20990: 09 f0 breq .+2 ; 0x20994 20992: 99 cf rjmp .-206 ; 0x208c6 20994: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 20998: 81 11 cpse r24, r1 2099a: 95 cf rjmp .-214 ; 0x208c6 cli(); 2099c: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 2099e: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 209a0: 81 e0 ldi r24, 0x01 ; 1 209a2: 90 e0 ldi r25, 0x00 ; 0 209a4: 8d cf rjmp .-230 ; 0x208c0 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; 209a6: 61 e0 ldi r22, 0x01 ; 1 209a8: 8f ef ldi r24, 0xFF ; 255 209aa: 90 e9 ldi r25, 0x90 ; 144 209ac: b1 cf rjmp .-158 ; 0x20910 case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 209ae: 61 e0 ldi r22, 0x01 ; 1 209b0: 8e ee ldi r24, 0xEE ; 238 209b2: 90 e9 ldi r25, 0x90 ; 144 209b4: ad cf rjmp .-166 ; 0x20910 { 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; 209b6: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 209b8: 86 33 cpi r24, 0x36 ; 54 209ba: 91 40 sbci r25, 0x01 ; 1 209bc: 09 f0 breq .+2 ; 0x209c0 209be: 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(); 209c0: 0e 94 37 84 call 0x1086e ; 0x1086e 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; 209c4: 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; 209c6: 82 ea ldi r24, 0xA2 ; 162 209c8: 92 ea ldi r25, 0xA2 ; 162 209ca: a0 e0 ldi r26, 0x00 ; 0 209cc: b0 e0 ldi r27, 0x00 ; 0 209ce: 80 93 39 18 sts 0x1839, r24 ; 0x801839 <__bss_end+0x20> 209d2: 90 93 3a 18 sts 0x183A, r25 ; 0x80183a <__bss_end+0x21> 209d6: a0 93 3b 18 sts 0x183B, r26 ; 0x80183b <__bss_end+0x22> 209da: b0 93 3c 18 sts 0x183C, r27 ; 0x80183c <__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; 209de: 10 92 ad 04 sts 0x04AD, r1 ; 0x8004ad <_ZL14iState_sum_min.lto_priv.481> 209e2: 10 92 ae 04 sts 0x04AE, r1 ; 0x8004ae <_ZL14iState_sum_min.lto_priv.481+0x1> 209e6: 10 92 af 04 sts 0x04AF, r1 ; 0x8004af <_ZL14iState_sum_min.lto_priv.481+0x2> 209ea: 10 92 b0 04 sts 0x04B0, r1 ; 0x8004b0 <_ZL14iState_sum_min.lto_priv.481+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 209ee: 20 91 da 06 lds r18, 0x06DA ; 0x8006da 209f2: 30 91 db 06 lds r19, 0x06DB ; 0x8006db 209f6: 40 91 dc 06 lds r20, 0x06DC ; 0x8006dc 209fa: 50 91 dd 06 lds r21, 0x06DD ; 0x8006dd 209fe: 60 e0 ldi r22, 0x00 ; 0 20a00: 70 e0 ldi r23, 0x00 ; 0 20a02: 8f e7 ldi r24, 0x7F ; 127 20a04: 93 e4 ldi r25, 0x43 ; 67 20a06: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 20a0a: 60 93 a9 04 sts 0x04A9, r22 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.482> 20a0e: 70 93 aa 04 sts 0x04AA, r23 ; 0x8004aa <_ZL14iState_sum_max.lto_priv.482+0x1> 20a12: 80 93 ab 04 sts 0x04AB, r24 ; 0x8004ab <_ZL14iState_sum_max.lto_priv.482+0x2> 20a16: 90 93 ac 04 sts 0x04AC, r25 ; 0x8004ac <_ZL14iState_sum_max.lto_priv.482+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 20a1a: 10 92 a5 04 sts 0x04A5, r1 ; 0x8004a5 <_ZL19temp_iState_min_bed.lto_priv.479> 20a1e: 10 92 a6 04 sts 0x04A6, r1 ; 0x8004a6 <_ZL19temp_iState_min_bed.lto_priv.479+0x1> 20a22: 10 92 a7 04 sts 0x04A7, r1 ; 0x8004a7 <_ZL19temp_iState_min_bed.lto_priv.479+0x2> 20a26: 10 92 a8 04 sts 0x04A8, r1 ; 0x8004a8 <_ZL19temp_iState_min_bed.lto_priv.479+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 20a2a: 20 91 e6 06 lds r18, 0x06E6 ; 0x8006e6 20a2e: 30 91 e7 06 lds r19, 0x06E7 ; 0x8006e7 20a32: 40 91 e8 06 lds r20, 0x06E8 ; 0x8006e8 20a36: 50 91 e9 06 lds r21, 0x06E9 ; 0x8006e9 20a3a: 60 e0 ldi r22, 0x00 ; 0 20a3c: 70 e0 ldi r23, 0x00 ; 0 20a3e: 8f e7 ldi r24, 0x7F ; 127 20a40: 93 e4 ldi r25, 0x43 ; 67 20a42: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 20a46: 60 93 a1 04 sts 0x04A1, r22 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.480> 20a4a: 70 93 a2 04 sts 0x04A2, r23 ; 0x8004a2 <_ZL19temp_iState_max_bed.lto_priv.480+0x1> 20a4e: 80 93 a3 04 sts 0x04A3, r24 ; 0x8004a3 <_ZL19temp_iState_max_bed.lto_priv.480+0x2> 20a52: 90 93 a4 04 sts 0x04A4, r25 ; 0x8004a4 <_ZL19temp_iState_max_bed.lto_priv.480+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 20a56: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 20a58: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 20a5a: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 20a5e: 88 60 ori r24, 0x08 ; 8 20a60: 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)); 20a64: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 20a68: 90 e0 ldi r25, 0x00 ; 0 20a6a: b4 e0 ldi r27, 0x04 ; 4 20a6c: 95 95 asr r25 20a6e: 87 95 ror r24 20a70: ba 95 dec r27 20a72: e1 f7 brne .-8 ; 0x20a6c 20a74: 80 93 9f 04 sts 0x049F, r24 ; 0x80049f <_ZL12soft_pwm_fan.lto_priv.473> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 20a78: 8a e0 ldi r24, 0x0A ; 10 20a7a: 90 e0 ldi r25, 0x00 ; 0 20a7c: 90 93 9e 04 sts 0x049E, r25 ; 0x80049e <_ZL8minttemp.lto_priv.474+0x1> 20a80: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d <_ZL8minttemp.lto_priv.474> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 20a84: c0 90 54 02 lds r12, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.485> 20a88: d0 90 55 02 lds r13, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.485+0x1> 20a8c: c6 01 movw r24, r12 20a8e: 0e 94 b1 d9 call 0x1b362 ; 0x1b362 20a92: 20 e0 ldi r18, 0x00 ; 0 20a94: 30 e0 ldi r19, 0x00 ; 0 20a96: 40 e2 ldi r20, 0x20 ; 32 20a98: 51 e4 ldi r21, 0x41 ; 65 20a9a: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 20a9e: 87 fd sbrc r24, 7 20aa0: 02 c0 rjmp .+4 ; 0x20aa6 20aa2: 0c 94 a2 fc jmp 0x1f944 ; 0x1f944 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 20aa6: e0 e1 ldi r30, 0x10 ; 16 20aa8: ce 1a sub r12, r30 20aaa: d1 08 sbc r13, r1 20aac: d0 92 55 02 sts 0x0255, r13 ; 0x800255 <_ZL12minttemp_raw.lto_priv.485+0x1> 20ab0: c0 92 54 02 sts 0x0254, r12 ; 0x800254 <_ZL12minttemp_raw.lto_priv.485> 20ab4: e7 cf rjmp .-50 ; 0x20a84 00020ab6 : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 20ab6: 0f 94 da ce call 0x39db4 ; 0x39db4 20aba: 10 92 15 05 sts 0x0515, r1 ; 0x800515 20abe: 80 91 15 05 lds r24, 0x0515 ; 0x800515 20ac2: 84 30 cpi r24, 0x04 ; 4 20ac4: 08 f0 brcs .+2 ; 0x20ac8 20ac6: 41 c0 rjmp .+130 ; 0x20b4a 20ac8: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_BACK)); 20acc: 8b e7 ldi r24, 0x7B ; 123 20ace: 90 e4 ldi r25, 0x40 ; 64 20ad0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20ad4: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a eeprom_update_byte_notify((uint8_t *)EEPROM_ALTFAN_OVERRIDE, altfanStatus.altfanOverride); } bool altfanOverride_get() { return altfanStatus.altfanOverride; 20ad8: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> #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 20adc: 81 ff sbrs r24, 1 20ade: 2f c0 rjmp .+94 ; 0x20b3e 20ae0: 84 e0 ldi r24, 0x04 ; 4 20ae2: 9e e5 ldi r25, 0x5E ; 94 20ae4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20ae8: 22 e0 ldi r18, 0x02 ; 2 20aea: 48 e6 ldi r20, 0x68 ; 104 20aec: 5d e5 ldi r21, 0x5D ; 93 20aee: bc 01 movw r22, r24 20af0: 8d e9 ldi r24, 0x9D ; 157 20af2: 9c e6 ldi r25, 0x6C ; 108 20af4: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 #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 20af8: 0e 94 f8 f8 call 0x1f1f0 ; 0x1f1f0 20afc: 88 23 and r24, r24 20afe: 11 f1 breq .+68 ; 0x20b44 20b00: 8a e0 ldi r24, 0x0A ; 10 20b02: 9e e5 ldi r25, 0x5E ; 94 20b04: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20b08: 22 e0 ldi r18, 0x02 ; 2 20b0a: 44 ea ldi r20, 0xA4 ; 164 20b0c: 5b e3 ldi r21, 0x3B ; 59 20b0e: bc 01 movw r22, r24 20b10: 81 e9 ldi r24, 0x91 ; 145 20b12: 9c e6 ldi r25, 0x6C ; 108 20b14: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 #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 20b18: 60 e9 ldi r22, 0x90 ; 144 20b1a: 71 ed ldi r23, 0xD1 ; 209 20b1c: 8e e7 ldi r24, 0x7E ; 126 20b1e: 9c e6 ldi r25, 0x6C ; 108 20b20: 0f 94 57 ce call 0x39cae ; 0x39cae #endif //PRUSA_SN_SUPPORT MENU_END(); 20b24: 0f 94 ae ce call 0x39d5c ; 0x39d5c } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 20b28: 80 91 15 05 lds r24, 0x0515 ; 0x800515 20b2c: 8f 5f subi r24, 0xFF ; 255 20b2e: 80 93 15 05 sts 0x0515, r24 ; 0x800515 20b32: 80 91 17 05 lds r24, 0x0517 ; 0x800517 20b36: 8f 5f subi r24, 0xFF ; 255 20b38: 80 93 17 05 sts 0x0517, r24 ; 0x800517 20b3c: c0 cf rjmp .-128 ; 0x20abe MENU_ITEM_BACK_P(_T(MSG_BACK)); #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 20b3e: 8a e0 ldi r24, 0x0A ; 10 20b40: 9e e5 ldi r25, 0x5E ; 94 20b42: d0 cf rjmp .-96 ; 0x20ae4 #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 20b44: 84 e0 ldi r24, 0x04 ; 4 20b46: 9e e5 ldi r25, 0x5E ; 94 20b48: dd cf rjmp .-70 ; 0x20b04 #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(); } 20b4a: 08 95 ret 00020b4c : prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); } #ifdef TMC2130 void UserECool_toggle(){ 20b4c: 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(); 20b4e: 0e 94 f8 f8 call 0x1f1f0 ; 0x1f1f0 20b52: c1 e0 ldi r28, 0x01 ; 1 20b54: c8 27 eor r28, r24 eeprom_update_byte_notify((uint8_t *)EEPROM_ECOOL_ENABLE, enable ? EEPROM_ECOOL_MAGIC_NUMBER : EEPROM_EMPTY_VALUE); 20b56: 6f ef ldi r22, 0xFF ; 255 20b58: 09 f0 breq .+2 ; 0x20b5c 20b5a: 6a e2 ldi r22, 0x2A ; 42 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20b5c: 84 e0 ldi r24, 0x04 ; 4 20b5e: 9d e0 ldi r25, 0x0D ; 13 20b60: 0f 94 7f dd call 0x3bafe ; 0x3bafe 1 #else 0 #endif ) , enableECool(enableECool) { } 20b64: 8c 2f mov r24, r28 20b66: 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)); 20b68: 82 70 andi r24, 0x02 ; 2 } 20b6a: 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)); 20b6c: 0d 94 1c 3b jmp 0x27638 ; 0x27638 00020b70 : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 20b70: 44 e1 ldi r20, 0x14 ; 20 20b72: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 20b74: 66 23 and r22, r22 20b76: 89 f0 breq .+34 ; 0x20b9a strncpy_P(lcd_status_message, message, LCD_WIDTH); 20b78: bc 01 movw r22, r24 20b7a: 8a e3 ldi r24, 0x3A ; 58 20b7c: 95 e0 ldi r25, 0x05 ; 5 20b7e: 0f 94 48 db call 0x3b690 ; 0x3b690 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 20b82: 10 92 4e 05 sts 0x054E, r1 ; 0x80054e <_ZL18lcd_status_message.lto_priv.466+0x14> lcd_status_message_idx = 0; // Print message from beginning 20b86: 10 92 39 05 sts 0x0539, r1 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.462> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 20b8a: 8a e5 ldi r24, 0x5A ; 90 20b8c: 9c e6 ldi r25, 0x6C ; 108 20b8e: 0e 94 86 7b call 0xf70c ; 0xf70c // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 20b92: 81 e0 ldi r24, 0x01 ; 1 20b94: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 20b98: 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); 20b9a: bc 01 movw r22, r24 20b9c: 8a e3 ldi r24, 0x3A ; 58 20b9e: 95 e0 ldi r25, 0x05 ; 5 20ba0: 0f 94 db e3 call 0x3c7b6 ; 0x3c7b6 20ba4: ee cf rjmp .-36 ; 0x20b82 00020ba6 : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 20ba6: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.453> 20baa: 89 17 cp r24, r25 20bac: 80 f4 brcc .+32 ; 0x20bce return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 20bae: 91 30 cpi r25, 0x01 ; 1 20bb0: 61 f4 brne .+24 ; 0x20bca } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 20bb2: 80 91 4f 05 lds r24, 0x054F ; 0x80054f <_ZL26lcd_status_message_timeout.lto_priv.465> 20bb6: 88 23 and r24, r24 20bb8: 51 f0 breq .+20 ; 0x20bce 20bba: 40 e2 ldi r20, 0x20 ; 32 20bbc: 5e e4 ldi r21, 0x4E ; 78 20bbe: 60 e0 ldi r22, 0x00 ; 0 20bc0: 70 e0 ldi r23, 0x00 ; 0 20bc2: 8f e4 ldi r24, 0x4F ; 79 20bc4: 95 e0 ldi r25, 0x05 ; 5 20bc6: 0d 94 6a 3f jmp 0x27ed4 ; 0x27ed4 ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 20bca: 80 e0 ldi r24, 0x00 ; 0 20bcc: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 20bce: 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; } 20bd0: 08 95 ret 00020bd2 : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 20bd2: ef 92 push r14 20bd4: ff 92 push r15 20bd6: 1f 93 push r17 20bd8: cf 93 push r28 20bda: df 93 push r29 20bdc: ec 01 movw r28, r24 20bde: 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)) { 20be0: 86 2f mov r24, r22 20be2: 0f 94 d3 05 call 0x20ba6 ; 0x20ba6 20be6: 88 23 and r24, r24 20be8: e9 f0 breq .+58 ; 0x20c24 bool same = !(progmem? strcmp_P(lcd_status_message, message): 20bea: be 01 movw r22, r28 20bec: 8a e3 ldi r24, 0x3A ; 58 20bee: 95 e0 ldi r25, 0x05 ; 5 20bf0: 0f 94 09 db call 0x3b612 ; 0x3b612 20bf4: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 20bf6: 8f e4 ldi r24, 0x4F ; 79 20bf8: 95 e0 ldi r25, 0x05 ; 5 20bfa: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> lcd_status_message_level = severity; 20bfe: 10 93 d1 03 sts 0x03D1, r17 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.453> custom_message_type = CustomMsg::Status; 20c02: 10 92 75 07 sts 0x0775, r1 ; 0x800775 custom_message_state = 0; 20c06: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 if (!same) { 20c0a: ef 28 or r14, r15 20c0c: 59 f0 breq .+22 ; 0x20c24 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 20c0e: 61 e0 ldi r22, 0x01 ; 1 20c10: ce 01 movw r24, r28 20c12: 0f 94 b8 05 call 0x20b70 ; 0x20b70 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 20c16: df 91 pop r29 20c18: cf 91 pop r28 20c1a: 1f 91 pop r17 20c1c: ff 90 pop r15 20c1e: 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(); 20c20: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 20c24: df 91 pop r29 20c26: cf 91 pop r28 20c28: 1f 91 pop r17 20c2a: ff 90 pop r15 20c2c: ef 90 pop r14 20c2e: 08 95 ret 00020c30 : manage_heater(); manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) 20c30: 1f 93 push r17 20c32: cf 93 push r28 20c34: df 93 push r29 20c36: 18 2f mov r17, r24 20c38: eb 01 movw r28, r22 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 20c3a: 80 e0 ldi r24, 0x00 ; 0 20c3c: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 { lcd_beeper_quick_feedback(); FORCE_BL_ON_END; 20c40: 80 e0 ldi r24, 0x00 ; 0 20c42: 0e 94 f4 8b call 0x117e8 ; 0x117e8 target_temperature[0] = 0; 20c46: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 20c4a: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d target_temperature_bed = 0; 20c4e: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 20c52: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b manage_heater(); 20c56: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(); 20c5a: 80 e0 ldi r24, 0x00 ; 0 20c5c: 0e 94 5a 8c call 0x118b4 ; 0x118b4 lcd_clear(); 20c60: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 20c64: 8f ea ldi r24, 0xAF ; 175 20c66: 95 e4 ldi r25, 0x45 ; 69 20c68: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20c6c: ac 01 movw r20, r24 20c6e: 60 e0 ldi r22, 0x00 ; 0 20c70: 80 e0 ldi r24, 0x00 ; 0 20c72: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 20c76: 8f e9 ldi r24, 0x9F ; 159 20c78: 95 e4 ldi r25, 0x45 ; 69 20c7a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20c7e: ac 01 movw r20, r24 20c80: 61 e0 ldi r22, 0x01 ; 1 20c82: 80 e0 ldi r24, 0x00 ; 0 20c84: 0e 94 29 70 call 0xe052 ; 0xe052 switch (testError) 20c88: 11 50 subi r17, 0x01 ; 1 20c8a: 1c 30 cpi r17, 0x0C ; 12 20c8c: a0 f4 brcc .+40 ; 0x20cb6 20c8e: e1 2f mov r30, r17 20c90: f0 e0 ldi r31, 0x00 ; 0 20c92: 88 27 eor r24, r24 20c94: e1 5b subi r30, 0xB1 ; 177 20c96: f9 4f sbci r31, 0xF9 ; 249 20c98: 8e 4f sbci r24, 0xFE ; 254 20c9a: 0d 94 6b de jmp 0x3bcd6 ; 0x3bcd6 <__tablejump2__> 20c9e: 12 3a cpi r17, 0xA2 ; 162 20ca0: 30 3b cpi r19, 0xB0 ; 176 20ca2: 98 3a cpi r25, 0xA8 ; 168 20ca4: 8c 3a cpi r24, 0xAC ; 172 20ca6: e2 39 cpi r30, 0x92 ; 146 20ca8: b4 39 cpi r27, 0x94 ; 148 20caa: 6c 3a cpi r22, 0xAC ; 172 20cac: e6 39 cpi r30, 0x96 ; 150 20cae: 1e 3a cpi r17, 0xAE ; 174 20cb0: 7a 3b cpi r23, 0xBA ; 186 20cb2: 70 3a cpi r23, 0xA0 ; 160 20cb4: 24 3a cpi r18, 0xA4 ; 164 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 20cb6: 8b e8 ldi r24, 0x8B ; 139 20cb8: 95 e4 ldi r25, 0x45 ; 69 20cba: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20cbe: ac 01 movw r20, r24 20cc0: 62 e0 ldi r22, 0x02 ; 2 20cc2: 80 e0 ldi r24, 0x00 ; 0 20cc4: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 20cc8: 8b e7 ldi r24, 0x7B ; 123 20cca: 95 e4 ldi r25, 0x45 ; 69 lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); break; case TestError::TriggeringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); lcd_puts_at_P(0, 3, _T(MSG_FALSE_TRIGGERING)); 20ccc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20cd0: ac 01 movw r20, r24 20cd2: 63 e0 ldi r22, 0x03 ; 3 20cd4: 80 e0 ldi r24, 0x00 ; 0 20cd6: 0e 94 29 70 call 0xe052 ; 0xe052 20cda: 45 c0 rjmp .+138 ; 0x20d66 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)); 20cdc: 8e e6 ldi r24, 0x6E ; 110 20cde: 95 e4 ldi r25, 0x45 ; 69 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)); 20ce0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20ce4: ac 01 movw r20, r24 20ce6: 62 e0 ldi r22, 0x02 ; 2 20ce8: 80 e0 ldi r24, 0x00 ; 0 20cea: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 20cee: 8f e5 ldi r24, 0x5F ; 95 20cf0: 95 e4 ldi r25, 0x45 ; 69 20cf2: ec cf rjmp .-40 ; 0x20ccc 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)); 20cf4: 84 e5 ldi r24, 0x54 ; 84 20cf6: 95 e4 ldi r25, 0x45 ; 69 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)); 20cf8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20cfc: ac 01 movw r20, r24 20cfe: 62 e0 ldi r22, 0x02 ; 2 20d00: 80 e0 ldi r24, 0x00 ; 0 20d02: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 20d06: 8f e5 ldi r24, 0x5F ; 95 20d08: 95 e4 ldi r25, 0x45 ; 69 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)); 20d0a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20d0e: ac 01 movw r20, r24 20d10: 63 e0 ldi r22, 0x03 ; 3 20d12: 80 e0 ldi r24, 0x00 ; 0 20d14: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(18, 3); 20d18: 63 e0 ldi r22, 0x03 ; 3 20d1a: 82 e1 ldi r24, 0x12 ; 18 20d1c: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print(_error_1); 20d20: ce 01 movw r24, r28 20d22: 1f c0 rjmp .+62 ; 0x20d62 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)); 20d24: 8c e4 ldi r24, 0x4C ; 76 20d26: 95 e4 ldi r25, 0x45 ; 69 20d28: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20d2c: ac 01 movw r20, r24 20d2e: 62 e0 ldi r22, 0x02 ; 2 20d30: 80 e0 ldi r24, 0x00 ; 0 20d32: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(18, 2); 20d36: 62 e0 ldi r22, 0x02 ; 2 20d38: 82 e1 ldi r24, 0x12 ; 18 20d3a: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print(_error_1); 20d3e: ce 01 movw r24, r28 20d40: 0e 94 1c 72 call 0xe438 ; 0xe438 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 20d44: 82 e4 ldi r24, 0x42 ; 66 20d46: 95 e4 ldi r25, 0x45 ; 69 20d48: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20d4c: ac 01 movw r20, r24 20d4e: 63 e0 ldi r22, 0x03 ; 3 20d50: 80 e0 ldi r24, 0x00 ; 0 20d52: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(18, 3); 20d56: 63 e0 ldi r22, 0x03 ; 3 20d58: 82 e1 ldi r24, 0x12 ; 18 20d5a: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print(_error_2); 20d5e: 84 ef ldi r24, 0xF4 ; 244 20d60: 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); 20d62: 0e 94 1c 72 call 0xe438 ; 0xe438 lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 20d66: 68 ee ldi r22, 0xE8 ; 232 20d68: 73 e0 ldi r23, 0x03 ; 3 20d6a: 80 e0 ldi r24, 0x00 ; 0 20d6c: 90 e0 ldi r25, 0x00 ; 0 20d6e: 0f 94 8d 3c call 0x2791a ; 0x2791a 20d72: 80 e0 ldi r24, 0x00 ; 0 20d74: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 lcd_beeper_quick_feedback(); do { _delay(100); 20d78: 64 e6 ldi r22, 0x64 ; 100 20d7a: 70 e0 ldi r23, 0x00 ; 0 20d7c: 80 e0 ldi r24, 0x00 ; 0 20d7e: 90 e0 ldi r25, 0x00 ; 0 20d80: 0f 94 8d 3c call 0x2791a ; 0x2791a manage_heater(); 20d84: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(); 20d88: 80 e0 ldi r24, 0x00 ; 0 20d8a: 0e 94 5a 8c call 0x118b4 ; 0x118b4 } while (!lcd_clicked()); 20d8e: 0e 94 32 72 call 0xe464 ; 0xe464 20d92: 88 23 and r24, r24 20d94: 89 f3 breq .-30 ; 0x20d78 LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 20d96: 8f e7 ldi r24, 0x7F ; 127 20d98: 94 e4 ldi r25, 0x44 ; 68 20d9a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20d9e: 62 e0 ldi r22, 0x02 ; 2 20da0: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 lcd_return_to_status(); } 20da4: df 91 pop r29 20da6: cf 91 pop r28 20da8: 1f 91 pop r17 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 20daa: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 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)); 20dae: 80 e3 ldi r24, 0x30 ; 48 20db0: 95 e4 ldi r25, 0x45 ; 69 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)); 20db2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20db6: ac 01 movw r20, r24 20db8: 62 e0 ldi r22, 0x02 ; 2 20dba: 80 e0 ldi r24, 0x00 ; 0 20dbc: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 20dc0: 8c e4 ldi r24, 0x4C ; 76 20dc2: 95 e4 ldi r25, 0x45 ; 69 20dc4: a2 cf rjmp .-188 ; 0x20d0a 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)); 20dc6: 8d e1 ldi r24, 0x1D ; 29 20dc8: 95 e4 ldi r25, 0x45 ; 69 20dca: 96 cf rjmp .-212 ; 0x20cf8 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)); 20dcc: 8a e0 ldi r24, 0x0A ; 10 20dce: 95 e4 ldi r25, 0x45 ; 69 20dd0: 93 cf rjmp .-218 ; 0x20cf8 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)); 20dd2: 8b ef ldi r24, 0xFB ; 251 20dd4: 94 e4 ldi r25, 0x44 ; 68 20dd6: ed cf rjmp .-38 ; 0x20db2 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)); 20dd8: 8d ee ldi r24, 0xED ; 237 20dda: 94 e4 ldi r25, 0x44 ; 68 20ddc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20de0: ac 01 movw r20, r24 20de2: 62 e0 ldi r22, 0x02 ; 2 20de4: 80 e0 ldi r24, 0x00 ; 0 20de6: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 20dea: 86 ee ldi r24, 0xE6 ; 230 20dec: 94 e4 ldi r25, 0x44 ; 68 20dee: 8d cf rjmp .-230 ; 0x20d0a lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 20df0: 84 ed ldi r24, 0xD4 ; 212 20df2: 94 e4 ldi r25, 0x44 ; 68 20df4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20df8: ac 01 movw r20, r24 20dfa: 62 e0 ldi r22, 0x02 ; 2 20dfc: 80 e0 ldi r24, 0x00 ; 0 20dfe: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 20e02: 8a ec ldi r24, 0xCA ; 202 20e04: 94 e4 ldi r25, 0x44 ; 68 20e06: 81 cf rjmp .-254 ; 0x20d0a lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 20e08: 88 eb ldi r24, 0xB8 ; 184 20e0a: 94 e4 ldi r25, 0x44 ; 68 20e0c: 69 cf rjmp .-302 ; 0x20ce0 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); break; case TestError::TriggeringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 20e0e: 88 eb ldi r24, 0xB8 ; 184 20e10: 94 e4 ldi r25, 0x44 ; 68 20e12: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20e16: ac 01 movw r20, r24 20e18: 62 e0 ldi r22, 0x02 ; 2 20e1a: 80 e0 ldi r24, 0x00 ; 0 20e1c: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(0, 3, _T(MSG_FALSE_TRIGGERING)); 20e20: 85 ea ldi r24, 0xA5 ; 165 20e22: 94 e4 ldi r25, 0x44 ; 68 20e24: 53 cf rjmp .-346 ; 0x20ccc break; case TestError::FsensorLevel: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 20e26: 88 eb ldi r24, 0xB8 ; 184 20e28: 94 e4 ldi r25, 0x44 ; 68 20e2a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20e2e: ac 01 movw r20, r24 20e30: 62 e0 ldi r22, 0x02 ; 2 20e32: 80 e0 ldi r24, 0x00 ; 0 20e34: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(0, 3); 20e38: 63 e0 ldi r22, 0x03 ; 3 20e3a: 80 e0 ldi r24, 0x00 ; 0 20e3c: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); 20e40: 81 e9 ldi r24, 0x91 ; 145 20e42: 94 e4 ldi r25, 0x44 ; 68 20e44: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 20e48: df 93 push r29 20e4a: cf 93 push r28 20e4c: 9f 93 push r25 20e4e: 8f 93 push r24 20e50: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 20e54: 0f 90 pop r0 20e56: 0f 90 pop r0 20e58: 0f 90 pop r0 20e5a: 0f 90 pop r0 20e5c: 84 cf rjmp .-248 ; 0x20d66 00020e5e : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 20e5e: 8f 92 push r8 20e60: 9f 92 push r9 20e62: af 92 push r10 20e64: bf 92 push r11 20e66: cf 92 push r12 20e68: df 92 push r13 20e6a: ef 92 push r14 20e6c: ff 92 push r15 20e6e: 0f 93 push r16 20e70: 1f 93 push r17 20e72: cf 93 push r28 20e74: df 93 push r29 20e76: f8 2e mov r15, r24 20e78: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 20e7c: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 20e80: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 20e84: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 20e88: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 20e8c: 4b 01 movw r8, r22 20e8e: 6b 01 movw r12, r22 20e90: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 20e94: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 20e98: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 20e9c: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 20ea0: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 20ea4: eb 01 movw r28, r22 uint8_t _progress = 0; int _checked_snapshot = (_isbed) ? degBed() : degHotend(0); 20ea6: ff 20 and r15, r15 20ea8: 09 f4 brne .+2 ; 0x20eac 20eaa: a6 c0 rjmp .+332 ; 0x20ff8 20eac: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 20eae: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 20eb0: 24 eb ldi r18, 0xB4 ; 180 20eb2: 92 2e mov r9, r18 target_temperature[0] = (_isbed) ? 0 : 200; 20eb4: 90 e0 ldi r25, 0x00 ; 0 20eb6: 80 e0 ldi r24, 0x00 ; 0 20eb8: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e 20ebc: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d target_temperature_bed = (_isbed) ? 100 : 0; 20ec0: 84 e6 ldi r24, 0x64 ; 100 20ec2: 90 e0 ldi r25, 0x00 ; 0 20ec4: f1 10 cpse r15, r1 20ec6: 02 c0 rjmp .+4 ; 0x20ecc 20ec8: 90 e0 ldi r25, 0x00 ; 0 20eca: 80 e0 ldi r24, 0x00 ; 0 20ecc: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c 20ed0: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b thermal_model::reinitialize(); } bool thermal_model_enabled() { return thermal_model::enabled; 20ed4: e0 90 20 05 lds r14, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> #ifdef THERMAL_MODEL bool tm_was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); 20ed8: 80 e0 ldi r24, 0x00 ; 0 20eda: 0f 94 7c 47 call 0x28ef8 ; 0x28ef8 #endif //THERMAL_MODEL manage_heater(); 20ede: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(true); 20ee2: 81 e0 ldi r24, 0x01 ; 1 20ee4: 0e 94 5a 8c call 0x118b4 ; 0x118b4 for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 20ee8: b1 2c mov r11, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 20eea: 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 20eec: 85 e0 ldi r24, 0x05 ; 5 20eee: 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) 20ef0: 80 91 14 05 lds r24, 0x0514 ; 0x800514 20ef4: 81 11 cpse r24, r1 20ef6: 1c c0 rjmp .+56 ; 0x20f30 { manage_heater(); 20ef8: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(true); 20efc: 81 e0 ldi r24, 0x01 ; 1 20efe: 0e 94 5a 8c call 0x118b4 ; 0x118b4 _progress = (_isbed? 20f02: 00 e9 ldi r16, 0x90 ; 144 20f04: 11 e0 ldi r17, 0x01 ; 1 20f06: 20 e0 ldi r18, 0x00 ; 0 20f08: 42 e0 ldi r20, 0x02 ; 2 20f0a: 6a 2d mov r22, r10 20f0c: 87 e0 ldi r24, 0x07 ; 7 20f0e: f1 10 cpse r15, r1 20f10: 01 c0 rjmp .+2 ; 0x20f14 20f12: 88 e0 ldi r24, 0x08 ; 8 20f14: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 20f18: 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 20f1a: 8b 2d mov r24, r11 20f1c: 68 2d mov r22, r8 20f1e: 0f 94 0a de call 0x3bc14 ; 0x3bc14 <__udivmodqi4> 20f22: 91 11 cpse r25, r1 20f24: 02 c0 rjmp .+4 ; 0x20f2a 20f26: 0e 94 69 79 call 0xf2d2 ; 0xf2d2 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 20f2a: b3 94 inc r11 20f2c: b9 10 cpse r11, r9 20f2e: e0 cf rjmp .-64 ; 0x20ef0 MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 20f30: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 20f34: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d target_temperature_bed = 0; 20f38: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 20f3c: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b manage_heater(); 20f40: 0f 94 9b 4d call 0x29b36 ; 0x29b36 20f44: b6 01 movw r22, r12 20f46: dd 0c add r13, r13 20f48: 88 0b sbc r24, r24 20f4a: 99 0b sbc r25, r25 20f4c: 4e 01 movw r8, r28 20f4e: dd 0f add r29, r29 20f50: aa 08 sbc r10, r10 20f52: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 20f54: ff 20 and r15, r15 20f56: 09 f4 brne .+2 ; 0x20f5a 20f58: 54 c0 rjmp .+168 ; 0x21002 20f5a: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 20f5e: 9b 01 movw r18, r22 20f60: ac 01 movw r20, r24 20f62: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 20f66: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 20f6a: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 20f6e: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 20f72: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 20f76: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 20f7a: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 20f7c: c5 01 movw r24, r10 20f7e: b4 01 movw r22, r8 20f80: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 20f84: 9b 01 movw r18, r22 20f86: ac 01 movw r20, r24 20f88: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 20f8c: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 20f90: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 20f94: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 20f98: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 20f9c: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 20fa0: 10 91 14 05 lds r17, 0x0514 ; 0x800514 20fa4: 11 11 cpse r17, r1 20fa6: 0c c0 rjmp .+24 ; 0x20fc0 20fa8: f1 10 cpse r15, r1 20faa: 4b c0 rjmp .+150 ; 0x21042 20fac: 69 30 cpi r22, 0x09 ; 9 20fae: 71 05 cpc r23, r1 20fb0: 0c f0 brlt .+2 ; 0x20fb4 20fb2: 4d c0 rjmp .+154 ; 0x2104e { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 20fb4: 8e e1 ldi r24, 0x1E ; 30 20fb6: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 20fb8: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 20fba: c8 17 cp r28, r24 20fbc: d9 07 cpc r29, r25 20fbe: 34 f4 brge .+12 ; 0x20fcc _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 20fc0: 64 ef ldi r22, 0xF4 ; 244 20fc2: 72 e0 ldi r23, 0x02 ; 2 20fc4: 80 e0 ldi r24, 0x00 ; 0 20fc6: 0f 94 18 06 call 0x20c30 ; 0x20c30 MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 20fca: 10 e0 ldi r17, 0x00 ; 0 { lcd_selftest_error(TestError::Bed, "", ""); } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); 20fcc: 8e 2d mov r24, r14 20fce: 0f 94 7c 47 call 0x28ef8 ; 0x28ef8 #endif //THERMAL_MODEL manage_heater(); 20fd2: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(true); 20fd6: 81 e0 ldi r24, 0x01 ; 1 20fd8: 0e 94 5a 8c call 0x118b4 ; 0x118b4 return _stepresult; } 20fdc: 81 2f mov r24, r17 20fde: df 91 pop r29 20fe0: cf 91 pop r28 20fe2: 1f 91 pop r17 20fe4: 0f 91 pop r16 20fe6: ff 90 pop r15 20fe8: ef 90 pop r14 20fea: df 90 pop r13 20fec: cf 90 pop r12 20fee: bf 90 pop r11 20ff0: af 90 pop r10 20ff2: 9f 90 pop r9 20ff4: 8f 90 pop r8 20ff6: 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 20ff8: 9c e3 ldi r25, 0x3C ; 60 20ffa: 99 2e mov r9, r25 target_temperature[0] = (_isbed) ? 0 : 200; 20ffc: 88 ec ldi r24, 0xC8 ; 200 20ffe: 90 e0 ldi r25, 0x00 ; 0 21000: 5b cf rjmp .-330 ; 0x20eb8 target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 21002: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 21006: 9b 01 movw r18, r22 21008: ac 01 movw r20, r24 2100a: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 2100e: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 21012: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 21016: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 2101a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 2101e: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 21022: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 21024: c5 01 movw r24, r10 21026: b4 01 movw r22, r8 21028: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 2102c: 9b 01 movw r18, r22 2102e: ac 01 movw r20, r24 21030: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 21034: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 21038: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 2103c: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 21040: ab cf rjmp .-170 ; 0x20f98 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 21042: 89 e0 ldi r24, 0x09 ; 9 21044: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 21046: 6e 31 cpi r22, 0x1E ; 30 21048: 71 05 cpc r23, r1 2104a: 0c f4 brge .+2 ; 0x2104e 2104c: b5 cf rjmp .-150 ; 0x20fb8 else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 2104e: 64 ef ldi r22, 0xF4 ; 244 21050: 72 e0 ldi r23, 0x02 ; 2 21052: 81 e0 ldi r24, 0x01 ; 1 21054: 0f 94 18 06 call 0x20c30 ; 0x20c30 21058: b9 cf rjmp .-142 ; 0x20fcc 0002105a : plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); crashdet_use_eeprom_setting(); } static bool lcd_selfcheck_axis_sg(uint8_t axis) { 2105a: 2f 92 push r2 2105c: 3f 92 push r3 2105e: 4f 92 push r4 21060: 5f 92 push r5 21062: 6f 92 push r6 21064: 7f 92 push r7 21066: 8f 92 push r8 21068: 9f 92 push r9 2106a: af 92 push r10 2106c: bf 92 push r11 2106e: cf 92 push r12 21070: df 92 push r13 21072: ef 92 push r14 21074: ff 92 push r15 21076: 1f 93 push r17 21078: cf 93 push r28 2107a: df 93 push r29 2107c: 00 d0 rcall .+0 ; 0x2107e 2107e: 00 d0 rcall .+0 ; 0x21080 21080: 1f 92 push r1 21082: cd b7 in r28, 0x3d ; 61 21084: de b7 in r29, 0x3e ; 62 21086: 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) { 21088: 68 2e mov r6, r24 2108a: 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; 2108c: 81 2c mov r8, r1 2108e: 20 e8 ldi r18, 0x80 ; 128 21090: 92 2e mov r9, r18 21092: 2c e5 ldi r18, 0x5C ; 92 21094: a2 2e mov r10, r18 21096: 23 e4 ldi r18, 0x43 ; 67 21098: 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) { 2109a: 81 30 cpi r24, 0x01 ; 1 2109c: 31 f0 breq .+12 ; 0x210aa case 0: axis_length = X_MAX_POS; break; 2109e: 81 2c mov r8, r1 210a0: 91 2c mov r9, r1 210a2: 9f e7 ldi r25, 0x7F ; 127 210a4: a9 2e mov r10, r25 210a6: 93 e4 ldi r25, 0x43 ; 67 210a8: 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; 210aa: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c tmc2130_home_exit(); 210ae: 0f 94 5f 3a call 0x274be ; 0x274be } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 210b2: 81 e0 ldi r24, 0x01 ; 1 210b4: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); raise_z_above(MESH_HOME_Z_SEARCH); 210b8: 60 e0 ldi r22, 0x00 ; 0 210ba: 70 e0 ldi r23, 0x00 ; 0 210bc: 80 ea ldi r24, 0xA0 ; 160 210be: 90 e4 ldi r25, 0x40 ; 64 210c0: 0e 94 95 6f call 0xdf2a ; 0xdf2a tmc2130_home_enter(1 << axis); 210c4: 81 e0 ldi r24, 0x01 ; 1 210c6: 01 2e mov r0, r17 210c8: 01 c0 rjmp .+2 ; 0x210cc 210ca: 88 0f add r24, r24 210cc: 0a 94 dec r0 210ce: ea f7 brpl .-6 ; 0x210ca 210d0: 0f 94 8e 3a call 0x2751c ; 0x2751c // first axis length measurement begin current_position[axis] -= (axis_length + margin); 210d4: 20 e0 ldi r18, 0x00 ; 0 210d6: 30 e0 ldi r19, 0x00 ; 0 210d8: 40 e7 ldi r20, 0x70 ; 112 210da: 52 e4 ldi r21, 0x42 ; 66 210dc: c5 01 movw r24, r10 210de: b4 01 movw r22, r8 210e0: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 210e4: 69 83 std Y+1, r22 ; 0x01 210e6: 7a 83 std Y+2, r23 ; 0x02 210e8: 8b 83 std Y+3, r24 ; 0x03 210ea: 9c 83 std Y+4, r25 ; 0x04 210ec: 13 01 movw r2, r6 210ee: 22 0c add r2, r2 210f0: 33 1c adc r3, r3 210f2: 22 0c add r2, r2 210f4: 33 1c adc r3, r3 210f6: c1 01 movw r24, r2 210f8: 8d 5b subi r24, 0xBD ; 189 210fa: 98 4f sbci r25, 0xF8 ; 248 210fc: 9e 83 std Y+6, r25 ; 0x06 210fe: 8d 83 std Y+5, r24 ; 0x05 21100: 29 81 ldd r18, Y+1 ; 0x01 21102: 3a 81 ldd r19, Y+2 ; 0x02 21104: 4b 81 ldd r20, Y+3 ; 0x03 21106: 5c 81 ldd r21, Y+4 ; 0x04 21108: fc 01 movw r30, r24 2110a: 60 81 ld r22, Z 2110c: 71 81 ldd r23, Z+1 ; 0x01 2110e: 82 81 ldd r24, Z+2 ; 0x02 21110: 93 81 ldd r25, Z+3 ; 0x03 21112: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 21116: ed 81 ldd r30, Y+5 ; 0x05 21118: fe 81 ldd r31, Y+6 ; 0x06 2111a: 60 83 st Z, r22 2111c: 71 83 std Z+1, r23 ; 0x01 2111e: 82 83 std Z+2, r24 ; 0x02 21120: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 21122: 60 e0 ldi r22, 0x00 ; 0 21124: 70 e0 ldi r23, 0x00 ; 0 21126: 84 e3 ldi r24, 0x34 ; 52 21128: 92 e4 ldi r25, 0x42 ; 66 2112a: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 2112e: 0f 94 27 58 call 0x2b04e ; 0x2b04e #endif } void tmc2130_sg_measure_start(uint8_t axis) { tmc2130_sg_measure = axis; 21132: 10 93 3b 02 sts 0x023B, r17 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.487> tmc2130_sg_measure_cnt = 0; 21136: 10 92 c9 03 sts 0x03C9, r1 ; 0x8003c9 <_ZL22tmc2130_sg_measure_cnt.lto_priv.489> 2113a: 10 92 ca 03 sts 0x03CA, r1 ; 0x8003ca <_ZL22tmc2130_sg_measure_cnt.lto_priv.489+0x1> 2113e: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb <_ZL22tmc2130_sg_measure_cnt.lto_priv.489+0x2> 21142: 10 92 cc 03 sts 0x03CC, r1 ; 0x8003cc <_ZL22tmc2130_sg_measure_cnt.lto_priv.489+0x3> tmc2130_sg_measure_val = 0; 21146: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL22tmc2130_sg_measure_val.lto_priv.488> 2114a: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce <_ZL22tmc2130_sg_measure_val.lto_priv.488+0x1> 2114e: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf <_ZL22tmc2130_sg_measure_val.lto_priv.488+0x2> 21152: 10 92 d0 03 sts 0x03D0, r1 ; 0x8003d0 <_ZL22tmc2130_sg_measure_val.lto_priv.488+0x3> tmc2130_sg_measure_start(axis); current_position_init = st_get_position_mm(axis); 21156: 81 2f mov r24, r17 21158: 0f 94 13 58 call 0x2b026 ; 0x2b026 2115c: 6b 01 movw r12, r22 2115e: 7c 01 movw r14, r24 current_position[axis] += 2 * margin; 21160: 20 e0 ldi r18, 0x00 ; 0 21162: 30 e0 ldi r19, 0x00 ; 0 21164: 40 ef ldi r20, 0xF0 ; 240 21166: 52 e4 ldi r21, 0x42 ; 66 21168: ed 81 ldd r30, Y+5 ; 0x05 2116a: fe 81 ldd r31, Y+6 ; 0x06 2116c: 60 81 ld r22, Z 2116e: 71 81 ldd r23, Z+1 ; 0x01 21170: 82 81 ldd r24, Z+2 ; 0x02 21172: 93 81 ldd r25, Z+3 ; 0x03 21174: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 21178: ed 81 ldd r30, Y+5 ; 0x05 2117a: fe 81 ldd r31, Y+6 ; 0x06 2117c: 60 83 st Z, r22 2117e: 71 83 std Z+1, r23 ; 0x01 21180: 82 83 std Z+2, r24 ; 0x02 21182: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 21184: 60 e0 ldi r22, 0x00 ; 0 21186: 70 e0 ldi r23, 0x00 ; 0 21188: 84 e3 ldi r24, 0x34 ; 52 2118a: 92 e4 ldi r25, 0x42 ; 66 2118c: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 21190: 0f 94 27 58 call 0x2b04e ; 0x2b04e current_position[axis] += axis_length; 21194: a5 01 movw r20, r10 21196: 94 01 movw r18, r8 21198: ed 81 ldd r30, Y+5 ; 0x05 2119a: fe 81 ldd r31, Y+6 ; 0x06 2119c: 60 81 ld r22, Z 2119e: 71 81 ldd r23, Z+1 ; 0x01 211a0: 82 81 ldd r24, Z+2 ; 0x02 211a2: 93 81 ldd r25, Z+3 ; 0x03 211a4: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 211a8: ed 81 ldd r30, Y+5 ; 0x05 211aa: fe 81 ldd r31, Y+6 ; 0x06 211ac: 60 83 st Z, r22 211ae: 71 83 std Z+1, r23 ; 0x01 211b0: 82 83 std Z+2, r24 ; 0x02 211b2: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 211b4: 60 e0 ldi r22, 0x00 ; 0 211b6: 70 e0 ldi r23, 0x00 ; 0 211b8: 84 e3 ldi r24, 0x34 ; 52 211ba: 92 e4 ldi r25, 0x42 ; 66 211bc: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 211c0: 0f 94 27 58 call 0x2b04e ; 0x2b04e } uint16_t tmc2130_sg_measure_stop() { tmc2130_sg_measure = 0xff; 211c4: 8f ef ldi r24, 0xFF ; 255 211c6: 80 93 3b 02 sts 0x023B, r24 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.487> return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; 211ca: 60 91 cd 03 lds r22, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_val.lto_priv.488> 211ce: 70 91 ce 03 lds r23, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_val.lto_priv.488+0x1> 211d2: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf <_ZL22tmc2130_sg_measure_val.lto_priv.488+0x2> 211d6: 90 91 d0 03 lds r25, 0x03D0 ; 0x8003d0 <_ZL22tmc2130_sg_measure_val.lto_priv.488+0x3> 211da: 20 91 c9 03 lds r18, 0x03C9 ; 0x8003c9 <_ZL22tmc2130_sg_measure_cnt.lto_priv.489> 211de: 30 91 ca 03 lds r19, 0x03CA ; 0x8003ca <_ZL22tmc2130_sg_measure_cnt.lto_priv.489+0x1> 211e2: 40 91 cb 03 lds r20, 0x03CB ; 0x8003cb <_ZL22tmc2130_sg_measure_cnt.lto_priv.489+0x2> 211e6: 50 91 cc 03 lds r21, 0x03CC ; 0x8003cc <_ZL22tmc2130_sg_measure_cnt.lto_priv.489+0x3> 211ea: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 211ee: 2d 83 std Y+5, r18 ; 0x05 211f0: 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); 211f2: 3f 93 push r19 211f4: 2f 93 push r18 211f6: f8 e5 ldi r31, 0x58 ; 88 211f8: 6f 0e add r6, r31 211fa: 71 1c adc r7, r1 211fc: 7f 92 push r7 211fe: 6f 92 push r6 21200: 88 ec ldi r24, 0xC8 ; 200 21202: 9c e8 ldi r25, 0x8C ; 140 21204: 9f 93 push r25 21206: 8f 93 push r24 21208: 0f 94 1d dc call 0x3b83a ; 0x3b83a eeprom_write_word_notify(((uint16_t*)((axis == X_AXIS)?EEPROM_BELTSTATUS_X:EEPROM_BELTSTATUS_Y)), sg1); 2120c: 0f 90 pop r0 2120e: 0f 90 pop r0 21210: 0f 90 pop r0 21212: 0f 90 pop r0 21214: 0f 90 pop r0 21216: 0f 90 pop r0 21218: 8b e5 ldi r24, 0x5B ; 91 2121a: 9f e0 ldi r25, 0x0F ; 15 2121c: 11 11 cpse r17, r1 2121e: 02 c0 rjmp .+4 ; 0x21224 21220: 8d e5 ldi r24, 0x5D ; 93 21222: 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); 21224: 6d 81 ldd r22, Y+5 ; 0x05 21226: 7f 81 ldd r23, Y+7 ; 0x07 21228: 0f 94 b9 dd call 0x3bb72 ; 0x3bb72 current_position_final = st_get_position_mm(axis); 2122c: 81 2f mov r24, r17 2122e: 0f 94 13 58 call 0x2b026 ; 0x2b026 21232: 2b 01 movw r4, r22 21234: 3c 01 movw r6, r24 measured_axis_length[0] = fabs(current_position_final - current_position_init); 21236: a7 01 movw r20, r14 21238: 96 01 movw r18, r12 2123a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 2123e: 6b 01 movw r12, r22 21240: 7c 01 movw r14, r24 21242: e8 94 clt 21244: f7 f8 bld r15, 7 // first measurement end and second measurement begin current_position[axis] -= margin; 21246: c1 01 movw r24, r2 21248: 8d 5b subi r24, 0xBD ; 189 2124a: 98 4f sbci r25, 0xF8 ; 248 2124c: 9e 83 std Y+6, r25 ; 0x06 2124e: 8d 83 std Y+5, r24 ; 0x05 21250: 20 e0 ldi r18, 0x00 ; 0 21252: 30 e0 ldi r19, 0x00 ; 0 21254: 40 e7 ldi r20, 0x70 ; 112 21256: 52 e4 ldi r21, 0x42 ; 66 21258: fc 01 movw r30, r24 2125a: 60 81 ld r22, Z 2125c: 71 81 ldd r23, Z+1 ; 0x01 2125e: 82 81 ldd r24, Z+2 ; 0x02 21260: 93 81 ldd r25, Z+3 ; 0x03 21262: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 21266: ed 81 ldd r30, Y+5 ; 0x05 21268: fe 81 ldd r31, Y+6 ; 0x06 2126a: 60 83 st Z, r22 2126c: 71 83 std Z+1, r23 ; 0x01 2126e: 82 83 std Z+2, r24 ; 0x02 21270: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 21272: 60 e0 ldi r22, 0x00 ; 0 21274: 70 e0 ldi r23, 0x00 ; 0 21276: 84 e3 ldi r24, 0x34 ; 52 21278: 92 e4 ldi r25, 0x42 ; 66 2127a: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 2127e: 0f 94 27 58 call 0x2b04e ; 0x2b04e current_position[axis] -= (axis_length + margin); 21282: 29 81 ldd r18, Y+1 ; 0x01 21284: 3a 81 ldd r19, Y+2 ; 0x02 21286: 4b 81 ldd r20, Y+3 ; 0x03 21288: 5c 81 ldd r21, Y+4 ; 0x04 2128a: ed 81 ldd r30, Y+5 ; 0x05 2128c: fe 81 ldd r31, Y+6 ; 0x06 2128e: 60 81 ld r22, Z 21290: 71 81 ldd r23, Z+1 ; 0x01 21292: 82 81 ldd r24, Z+2 ; 0x02 21294: 93 81 ldd r25, Z+3 ; 0x03 21296: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 2129a: ed 81 ldd r30, Y+5 ; 0x05 2129c: fe 81 ldd r31, Y+6 ; 0x06 2129e: 60 83 st Z, r22 212a0: 71 83 std Z+1, r23 ; 0x01 212a2: 82 83 std Z+2, r24 ; 0x02 212a4: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 212a6: 60 e0 ldi r22, 0x00 ; 0 212a8: 70 e0 ldi r23, 0x00 ; 0 212aa: 84 e3 ldi r24, 0x34 ; 52 212ac: 92 e4 ldi r25, 0x42 ; 66 212ae: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 212b2: 0f 94 27 58 call 0x2b04e ; 0x2b04e current_position_init = st_get_position_mm(axis); 212b6: 81 2f mov r24, r17 212b8: 0f 94 13 58 call 0x2b026 ; 0x2b026 212bc: 9b 01 movw r18, r22 212be: ac 01 movw r20, r24 measured_axis_length[1] = fabs(current_position_final - current_position_init); 212c0: c3 01 movw r24, r6 212c2: b2 01 movw r22, r4 212c4: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 212c8: 2b 01 movw r4, r22 212ca: 3c 01 movw r6, r24 212cc: e8 94 clt 212ce: 77 f8 bld r7, 7 tmc2130_home_exit(); 212d0: 0f 94 5f 3a call 0x274be ; 0x274be //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]); 212d4: ff 92 push r15 212d6: ef 92 push r14 212d8: df 92 push r13 212da: cf 92 push r12 212dc: 8c e3 ldi r24, 0x3C ; 60 212de: 9c e6 ldi r25, 0x6C ; 108 212e0: 9f 93 push r25 212e2: 8f 93 push r24 212e4: 0f 94 1d dc call 0x3b83a ; 0x3b83a if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 212e8: a5 01 movw r20, r10 212ea: 94 01 movw r18, r8 212ec: c7 01 movw r24, r14 212ee: b6 01 movw r22, r12 212f0: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 212f4: 9f 77 andi r25, 0x7F ; 127 212f6: 0f 90 pop r0 212f8: 0f 90 pop r0 212fa: 0f 90 pop r0 212fc: 0f 90 pop r0 212fe: 0f 90 pop r0 21300: 0f 90 pop r0 21302: 20 e0 ldi r18, 0x00 ; 0 21304: 30 e0 ldi r19, 0x00 ; 0 21306: 40 ea ldi r20, 0xA0 ; 160 21308: 50 e4 ldi r21, 0x40 ; 64 2130a: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 2130e: 18 16 cp r1, r24 21310: 0c f4 brge .+2 ; 0x21314 21312: 53 c0 rjmp .+166 ; 0x213ba 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]); 21314: 7f 92 push r7 21316: 6f 92 push r6 21318: 5f 92 push r5 2131a: 4f 92 push r4 2131c: 8c e3 ldi r24, 0x3C ; 60 2131e: 9c e6 ldi r25, 0x6C ; 108 21320: 9f 93 push r25 21322: 8f 93 push r24 21324: 0f 94 1d dc call 0x3b83a ; 0x3b83a if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 21328: a5 01 movw r20, r10 2132a: 94 01 movw r18, r8 2132c: c3 01 movw r24, r6 2132e: b2 01 movw r22, r4 21330: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 21334: 9f 77 andi r25, 0x7F ; 127 21336: 0f 90 pop r0 21338: 0f 90 pop r0 2133a: 0f 90 pop r0 2133c: 0f 90 pop r0 2133e: 0f 90 pop r0 21340: 0f 90 pop r0 21342: 20 e0 ldi r18, 0x00 ; 0 21344: 30 e0 ldi r19, 0x00 ; 0 21346: 40 ea ldi r20, 0xA0 ; 160 21348: 50 e4 ldi r21, 0x40 ; 64 2134a: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 2134e: 18 16 cp r1, r24 21350: a4 f1 brlt .+104 ; 0x213ba endstops_hit_on_purpose(); return false; } } printf_P(_N("Axis length difference:%.3f\n"), fabs(measured_axis_length[0] - measured_axis_length[1])); 21352: a3 01 movw r20, r6 21354: 92 01 movw r18, r4 21356: c7 01 movw r24, r14 21358: b6 01 movw r22, r12 2135a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 2135e: 6b 01 movw r12, r22 21360: 7c 01 movw r14, r24 21362: e8 94 clt 21364: f7 f8 bld r15, 7 21366: ff 92 push r15 21368: ef 92 push r14 2136a: df 92 push r13 2136c: cf 92 push r12 2136e: 8f e1 ldi r24, 0x1F ; 31 21370: 9c e6 ldi r25, 0x6C ; 108 21372: 9f 93 push r25 21374: 8f 93 push r24 21376: 0f 94 1d dc call 0x3b83a ; 0x3b83a if (fabs(measured_axis_length[0] - measured_axis_length[1]) > 1) { //check if difference between first and second measurement is low 2137a: 0f 90 pop r0 2137c: 0f 90 pop r0 2137e: 0f 90 pop r0 21380: 0f 90 pop r0 21382: 0f 90 pop r0 21384: 0f 90 pop r0 21386: 20 e0 ldi r18, 0x00 ; 0 21388: 30 e0 ldi r19, 0x00 ; 0 2138a: 40 e8 ldi r20, 0x80 ; 128 2138c: 5f e3 ldi r21, 0x3F ; 63 2138e: c7 01 movw r24, r14 21390: b6 01 movw r22, r12 21392: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 21396: 18 16 cp r1, r24 21398: 0c f4 brge .+2 ; 0x2139c 2139a: 44 c0 rjmp .+136 ; 0x21424 plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return false; } current_position[axis] = 0; 2139c: ed 81 ldd r30, Y+5 ; 0x05 2139e: fe 81 ldd r31, Y+6 ; 0x06 213a0: 10 82 st Z, r1 213a2: 11 82 std Z+1, r1 ; 0x01 213a4: 12 82 std Z+2, r1 ; 0x02 213a6: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 213a8: 0f 94 1d b9 call 0x3723a ; 0x3723a reset_crash_det(axis); 213ac: 81 2f mov r24, r17 213ae: 0e 94 67 d6 call 0x1acce ; 0x1acce endstops_hit_on_purpose(); 213b2: 0f 94 71 63 call 0x2c6e2 ; 0x2c6e2 return true; 213b6: 81 e0 ldi r24, 0x01 ; 1 213b8: 1d c0 rjmp .+58 ; 0x213f4 213ba: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); const char *_error_1; if (axis == X_AXIS) _error_1 = "X"; if (axis == Y_AXIS) _error_1 = "Y"; 213be: 67 ef ldi r22, 0xF7 ; 247 213c0: 72 e0 ldi r23, 0x02 ; 2 213c2: 11 30 cpi r17, 0x01 ; 1 213c4: 11 f0 breq .+4 ; 0x213ca 213c6: 65 ef ldi r22, 0xF5 ; 245 213c8: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Axis, _error_1, ""); 213ca: 88 e0 ldi r24, 0x08 ; 8 213cc: 0f 94 18 06 call 0x20c30 ; 0x20c30 current_position[axis] = 0; 213d0: f1 01 movw r30, r2 213d2: ed 5b subi r30, 0xBD ; 189 213d4: f8 4f sbci r31, 0xF8 ; 248 213d6: 10 82 st Z, r1 213d8: 11 82 std Z+1, r1 ; 0x01 213da: 12 82 std Z+2, r1 ; 0x02 213dc: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 213de: 0f 94 1d b9 call 0x3723a ; 0x3723a reset_crash_det(axis); 213e2: 81 2f mov r24, r17 213e4: 0e 94 67 d6 call 0x1acce ; 0x1acce 213e8: 81 e0 ldi r24, 0x01 ; 1 213ea: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> lcd_selftest_error(TestError::Pulley, _error_1, ""); current_position[axis] = 0; plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); 213ee: 0f 94 71 63 call 0x2c6e2 ; 0x2c6e2 return false; 213f2: 80 e0 ldi r24, 0x00 ; 0 current_position[axis] = 0; plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return true; } 213f4: 27 96 adiw r28, 0x07 ; 7 213f6: 0f b6 in r0, 0x3f ; 63 213f8: f8 94 cli 213fa: de bf out 0x3e, r29 ; 62 213fc: 0f be out 0x3f, r0 ; 63 213fe: cd bf out 0x3d, r28 ; 61 21400: df 91 pop r29 21402: cf 91 pop r28 21404: 1f 91 pop r17 21406: ff 90 pop r15 21408: ef 90 pop r14 2140a: df 90 pop r13 2140c: cf 90 pop r12 2140e: bf 90 pop r11 21410: af 90 pop r10 21412: 9f 90 pop r9 21414: 8f 90 pop r8 21416: 7f 90 pop r7 21418: 6f 90 pop r6 2141a: 5f 90 pop r5 2141c: 4f 90 pop r4 2141e: 3f 90 pop r3 21420: 2f 90 pop r2 21422: 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"; 21424: 67 ef ldi r22, 0xF7 ; 247 21426: 72 e0 ldi r23, 0x02 ; 2 21428: 11 30 cpi r17, 0x01 ; 1 2142a: 11 f0 breq .+4 ; 0x21430 2142c: 65 ef ldi r22, 0xF5 ; 245 2142e: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Pulley, _error_1, ""); 21430: 87 e0 ldi r24, 0x07 ; 7 21432: 0f 94 18 06 call 0x20c30 ; 0x20c30 current_position[axis] = 0; 21436: f1 01 movw r30, r2 21438: ed 5b subi r30, 0xBD ; 189 2143a: f8 4f sbci r31, 0xF8 ; 248 2143c: 10 82 st Z, r1 2143e: 11 82 std Z+1, r1 ; 0x01 21440: 12 82 std Z+2, r1 ; 0x02 21442: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 21444: 0f 94 1d b9 call 0x3723a ; 0x3723a reset_crash_det(axis); 21448: 81 2f mov r24, r17 2144a: 0e 94 67 d6 call 0x1acce ; 0x1acce 2144e: cf cf rjmp .-98 ; 0x213ee 00021450 : default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } #ifdef TMC2130 static void lcd_belttest_v() { 21450: 0f 93 push r16 21452: 1f 93 push r17 21454: cf 93 push r28 21456: df 93 push r29 menu_back_if_clicked(); } void lcd_belttest() { lcd_clear(); 21458: 0e 94 48 70 call 0xe090 ; 0xe090 // Belttest requires high power mode. Enable it. FORCE_HIGH_POWER_START; 2145c: 81 e0 ldi r24, 0x01 ; 1 2145e: 0e 94 e5 67 call 0xcfca ; 0xcfca uint16_t X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 21462: 8d e5 ldi r24, 0x5D ; 93 21464: 9f e0 ldi r25, 0x0F ; 15 21466: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 2146a: ec 01 movw r28, r24 uint16_t Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 2146c: 8b e5 ldi r24, 0x5B ; 91 2146e: 9f e0 ldi r25, 0x0F ; 15 21470: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 21474: 18 2f mov r17, r24 21476: 09 2f mov r16, r25 lcd_puts_P(_T(MSG_CHECKING_X)); 21478: 86 e4 ldi r24, 0x46 ; 70 2147a: 90 e4 ldi r25, 0x40 ; 64 2147c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 21480: 0e 94 00 70 call 0xe000 ; 0xe000 lcd_set_cursor(0,1), lcd_printf_P(PSTR("X: %u -> ..."),X); 21484: 61 e0 ldi r22, 0x01 ; 1 21486: 80 e0 ldi r24, 0x00 ; 0 21488: 0e 94 15 70 call 0xe02a ; 0xe02a 2148c: df 93 push r29 2148e: cf 93 push r28 21490: 83 e2 ldi r24, 0x23 ; 35 21492: 9c e8 ldi r25, 0x8C ; 140 21494: 9f 93 push r25 21496: 8f 93 push r24 21498: 0e 94 ee 6f call 0xdfdc ; 0xdfdc KEEPALIVE_STATE(IN_HANDLER); 2149c: 82 e0 ldi r24, 0x02 ; 2 2149e: 80 93 96 02 sts 0x0296, r24 ; 0x800296 // 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)){ 214a2: 80 e0 ldi r24, 0x00 ; 0 214a4: 0f 94 2d 08 call 0x2105a ; 0x2105a 214a8: 0f 90 pop r0 214aa: 0f 90 pop r0 214ac: 0f 90 pop r0 214ae: 0f 90 pop r0 214b0: 88 23 and r24, r24 214b2: 09 f4 brne .+2 ; 0x214b6 214b4: 45 c0 rjmp .+138 ; 0x21540 X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 214b6: 8d e5 ldi r24, 0x5D ; 93 214b8: 9f e0 ldi r25, 0x0F ; 15 214ba: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 214be: ec 01 movw r28, r24 lcd_set_cursor(10, 1); 214c0: 61 e0 ldi r22, 0x01 ; 1 214c2: 8a e0 ldi r24, 0x0A ; 10 214c4: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 214c8: be 01 movw r22, r28 214ca: 90 e0 ldi r25, 0x00 ; 0 214cc: 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); 214ce: 4a e0 ldi r20, 0x0A ; 10 214d0: 0e 94 69 71 call 0xe2d2 ; 0xe2d2 lcd_print(X); // Show new X value next to old one. lcd_puts_at_P(0, 2, _T(MSG_CHECKING_Y)); 214d4: 84 e3 ldi r24, 0x34 ; 52 214d6: 90 e4 ldi r25, 0x40 ; 64 214d8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 214dc: ac 01 movw r20, r24 214de: 62 e0 ldi r22, 0x02 ; 2 214e0: 80 e0 ldi r24, 0x00 ; 0 214e2: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(0, 3), lcd_printf_P(PSTR("Y: %u -> ..."),Y); 214e6: 63 e0 ldi r22, 0x03 ; 3 214e8: 80 e0 ldi r24, 0x00 ; 0 214ea: 0e 94 15 70 call 0xe02a ; 0xe02a 214ee: 0f 93 push r16 214f0: 1f 93 push r17 214f2: 86 e1 ldi r24, 0x16 ; 22 214f4: 9c e8 ldi r25, 0x8C ; 140 214f6: 9f 93 push r25 214f8: 8f 93 push r24 214fa: 0e 94 ee 6f call 0xdfdc ; 0xdfdc if (lcd_selfcheck_axis_sg(Y_AXIS)) 214fe: 81 e0 ldi r24, 0x01 ; 1 21500: 0f 94 2d 08 call 0x2105a ; 0x2105a 21504: 0f 90 pop r0 21506: 0f 90 pop r0 21508: 0f 90 pop r0 2150a: 0f 90 pop r0 2150c: 88 23 and r24, r24 2150e: c1 f0 breq .+48 ; 0x21540 { Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 21510: 8b e5 ldi r24, 0x5B ; 91 21512: 9f e0 ldi r25, 0x0F ; 15 21514: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 21518: ec 01 movw r28, r24 lcd_set_cursor(10, 3); 2151a: 63 e0 ldi r22, 0x03 ; 3 2151c: 8a e0 ldi r24, 0x0A ; 10 2151e: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 21522: be 01 movw r22, r28 21524: 90 e0 ldi r25, 0x00 ; 0 21526: 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); 21528: 4a e0 ldi r20, 0x0A ; 10 2152a: 0e 94 69 71 call 0xe2d2 ; 0xe2d2 lcd_print(Y); lcd_putc_at(19, 3, LCD_STR_UPLEVEL[0]); 2152e: 43 e8 ldi r20, 0x83 ; 131 21530: 63 e0 ldi r22, 0x03 ; 3 21532: 83 e1 ldi r24, 0x13 ; 19 21534: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_wait_for_click_delay(10); 21538: 8a e0 ldi r24, 0x0A ; 10 2153a: 90 e0 ldi r25, 0x00 ; 0 2153c: 0f 94 6e 4f call 0x29edc ; 0x29edc } } FORCE_HIGH_POWER_END; 21540: 80 e0 ldi r24, 0x00 ; 0 21542: 0e 94 e5 67 call 0xcfca ; 0xcfca KEEPALIVE_STATE(NOT_BUSY); 21546: 81 e0 ldi r24, 0x01 ; 1 21548: 80 93 96 02 sts 0x0296, r24 ; 0x800296 #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); } 2154c: df 91 pop r29 2154e: cf 91 pop r28 21550: 1f 91 pop r17 21552: 0f 91 pop r16 } #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); 21554: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 00021558 : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 21558: 0f 94 4e 26 call 0x24c9c ; 0x24c9c lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2155c: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.453> temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 21560: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 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() 21564: 81 11 cpse r24, r1 21566: 32 c0 rjmp .+100 ; 0x215cc } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 21568: 80 91 38 02 lds r24, 0x0238 ; 0x800238 2156c: 81 11 cpse r24, r1 2156e: 02 c0 rjmp .+4 ; 0x21574 #endif ) { return false; // abort if error persists } return true; 21570: 81 e0 ldi r24, 0x01 ; 1 21572: 08 95 ret static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); 21574: 8f ef ldi r24, 0xFF ; 255 21576: 0e 94 b9 cf call 0x19f72 ; 0x19f72 setExtruderAutoFanState(3); //force enables the hotend fan 2157a: 83 e0 ldi r24, 0x03 ; 3 2157c: 0e 94 51 77 call 0xeea2 ; 0xeea2 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 21580: 0f 94 86 3e call 0x27d0c ; 0x27d0c 21584: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c 21588: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d 2158c: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e 21590: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f fan_measuring = true; 21594: 81 e0 ldi r24, 0x01 ; 1 21596: 80 93 36 05 sts 0x0536, r24 ; 0x800536 #endif //FAN_SOFT_PWM _delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe) 2159a: 68 ee ldi r22, 0xE8 ; 232 2159c: 73 e0 ldi r23, 0x03 ; 3 2159e: 80 e0 ldi r24, 0x00 ; 0 215a0: 90 e0 ldi r25, 0x00 ; 0 215a2: 0f 94 8d 3c call 0x2791a ; 0x2791a manage_heater(); 215a6: 0f 94 9b 4d call 0x29b36 ; 0x29b36 setExtruderAutoFanState(1); //releases lock on the hotend fan 215aa: 81 e0 ldi r24, 0x01 ; 1 215ac: 0e 94 51 77 call 0xeea2 ; 0xeea2 lcd_selftest_setfan(0); 215b0: 80 e0 ldi r24, 0x00 ; 0 215b2: 0e 94 b9 cf call 0x19f72 ; 0x19f72 #ifdef TACH_0 if (fan_speed[0] <= 20) { //hotend fan error 215b6: 80 91 b1 04 lds r24, 0x04B1 ; 0x8004b1 215ba: 90 91 b2 04 lds r25, 0x04B2 ; 0x8004b2 215be: 45 97 sbiw r24, 0x15 ; 21 215c0: 3c f4 brge .+14 ; 0x215d0 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 215c2: 62 e0 ldi r22, 0x02 ; 2 215c4: 87 eb ldi r24, 0xB7 ; 183 215c6: 9b e6 ldi r25, 0x6B ; 107 return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 215c8: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 215cc: 80 e0 ldi r24, 0x00 ; 0 } return true; } 215ce: 08 95 ret LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error 215d0: 80 91 b3 04 lds r24, 0x04B3 ; 0x8004b3 215d4: 90 91 b4 04 lds r25, 0x04B4 ; 0x8004b4 215d8: 45 97 sbiw r24, 0x15 ; 21 215da: 54 f6 brge .-108 ; 0x21570 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 215dc: 62 e0 ldi r22, 0x02 ; 2 215de: 83 ea ldi r24, 0xA3 ; 163 215e0: 9b e6 ldi r25, 0x6B ; 107 215e2: f2 cf rjmp .-28 ; 0x215c8 000215e4 : //! @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; 215e4: 0f 94 ac 0a call 0x21558 ; 0x21558 215e8: 88 23 and r24, r24 215ea: 21 f0 breq .+8 ; 0x215f4 // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 215ec: 8d ed ldi r24, 0xDD ; 221 215ee: 9b e6 ldi r25, 0x6B ; 107 215f0: 0c 94 86 7b jmp 0xf70c ; 0xf70c } 215f4: 08 95 ret 000215f6 : if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); } void lcd_setstatus_serial(const char* message) { 215f6: cf 93 push r28 215f8: df 93 push r29 215fa: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 215fc: 80 e0 ldi r24, 0x00 ; 0 215fe: 0f 94 d3 05 call 0x20ba6 ; 0x20ba6 21602: 88 23 and r24, r24 21604: 21 f0 breq .+8 ; 0x2160e lcd_updatestatus(message); 21606: 60 e0 ldi r22, 0x00 ; 0 21608: ce 01 movw r24, r28 2160a: 0f 94 b8 05 call 0x20b70 ; 0x20b70 SERIAL_ECHOLN(message); 2160e: ce 01 movw r24, r28 } 21610: df 91 pop r29 21612: cf 91 pop r28 void lcd_setstatus_serial(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); SERIAL_ECHOLN(message); 21614: 0d 94 60 d6 jmp 0x3acc0 ; 0x3acc0 00021618 : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 21618: cf 93 push r28 2161a: df 93 push r29 2161c: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 2161e: 80 e0 ldi r24, 0x00 ; 0 21620: 0f 94 d3 05 call 0x20ba6 ; 0x20ba6 21624: 88 23 and r24, r24 21626: 31 f0 breq .+12 ; 0x21634 lcd_updatestatus(message, true); 21628: 61 e0 ldi r22, 0x01 ; 1 2162a: ce 01 movw r24, r28 } 2162c: df 91 pop r29 2162e: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 21630: 0d 94 b8 05 jmp 0x20b70 ; 0x20b70 } 21634: df 91 pop r29 21636: cf 91 pop r28 21638: 08 95 ret 0002163a : } } void lcd_print_stop_finish(); void lcd_commands() 2163a: 2f 92 push r2 2163c: 3f 92 push r3 2163e: 4f 92 push r4 21640: 5f 92 push r5 21642: 6f 92 push r6 21644: 7f 92 push r7 21646: 8f 92 push r8 21648: 9f 92 push r9 2164a: af 92 push r10 2164c: bf 92 push r11 2164e: cf 92 push r12 21650: df 92 push r13 21652: ef 92 push r14 21654: ff 92 push r15 21656: 0f 93 push r16 21658: 1f 93 push r17 2165a: cf 93 push r28 2165c: df 93 push r29 2165e: 00 d0 rcall .+0 ; 0x21660 21660: 1f 92 push r1 21662: 1f 92 push r1 21664: cd b7 in r28, 0x3d ; 61 21666: 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) 21668: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 2166c: 81 30 cpi r24, 0x01 ; 1 2166e: 09 f0 breq .+2 ; 0x21672 21670: 61 c0 rjmp .+194 ; 0x21734 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); 21672: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 21676: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 { if (!blocks_queued() && !homing_flag) 2167a: 98 13 cpse r25, r24 2167c: 5b c0 rjmp .+182 ; 0x21734 2167e: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 21682: 81 11 cpse r24, r1 21684: 57 c0 rjmp .+174 ; 0x21734 { custom_message_type = CustomMsg::Status; 21686: 10 92 75 07 sts 0x0775, r1 ; 0x800775 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 2168a: 8d ef ldi r24, 0xFD ; 253 2168c: 90 e4 ldi r25, 0x40 ; 64 2168e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 21692: 0f 94 0c 0b call 0x21618 ; 0x21618 lcd_commands_type = LcdCommands::Idle; 21696: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 2169a: 82 e0 ldi r24, 0x02 ; 2 2169c: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 216a0: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 #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(); 216a4: 0f 94 f0 57 call 0x2afe0 ; 0x2afe0 save_statistics(); 216a8: 0e 94 54 67 call 0xcea8 ; 0xcea8 // lift Z raise_z(10); 216ac: 60 e0 ldi r22, 0x00 ; 0 216ae: 70 e0 ldi r23, 0x00 ; 0 216b0: 80 e2 ldi r24, 0x20 ; 32 216b2: 91 e4 ldi r25, 0x41 ; 65 216b4: 0e 94 16 6f call 0xde2c ; 0xde2c // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 216b8: 80 91 40 07 lds r24, 0x0740 ; 0x800740 216bc: 88 23 and r24, r24 216be: 21 f1 breq .+72 ; 0x21708 216c0: 80 91 41 07 lds r24, 0x0741 ; 0x800741 216c4: 88 23 and r24, r24 216c6: 01 f1 breq .+64 ; 0x21708 current_position[X_AXIS] = X_CANCEL_POS; 216c8: 80 e0 ldi r24, 0x00 ; 0 216ca: 90 e0 ldi r25, 0x00 ; 0 216cc: a8 e4 ldi r26, 0x48 ; 72 216ce: b2 e4 ldi r27, 0x42 ; 66 216d0: 80 93 43 07 sts 0x0743, r24 ; 0x800743 216d4: 90 93 44 07 sts 0x0744, r25 ; 0x800744 216d8: a0 93 45 07 sts 0x0745, r26 ; 0x800745 216dc: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = Y_CANCEL_POS; 216e0: 80 e0 ldi r24, 0x00 ; 0 216e2: 90 e0 ldi r25, 0x00 ; 0 216e4: ae e3 ldi r26, 0x3E ; 62 216e6: b3 e4 ldi r27, 0x43 ; 67 216e8: 80 93 47 07 sts 0x0747, r24 ; 0x800747 216ec: 90 93 48 07 sts 0x0748, r25 ; 0x800748 216f0: a0 93 49 07 sts 0x0749, r26 ; 0x800749 216f4: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 216f8: 60 e0 ldi r22, 0x00 ; 0 216fa: 70 e0 ldi r23, 0x00 ; 0 216fc: 84 e3 ldi r24, 0x34 ; 52 216fe: 92 e4 ldi r25, 0x42 ; 66 21700: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 21704: 0f 94 27 58 call 0x2b04e ; 0x2b04e 21708: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> // 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()) { 2170c: 88 23 and r24, r24 2170e: 09 f4 brne .+2 ; 0x21712 21710: c9 c0 rjmp .+402 ; 0x218a4 // time to stop the error beep WRITE(BEEPER, LOW); 21712: 9f b7 in r25, 0x3f ; 63 21714: f8 94 cli 21716: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2171a: 8b 7f andi r24, 0xFB ; 251 2171c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 21720: 9f bf out 0x3f, r25 ; 63 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 21722: 0f 94 67 44 call 0x288ce ; 0x288ce finishAndDisableSteppers(); //M84 21726: 0e 94 13 84 call 0x10826 ; 0x10826 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 2172a: 88 e0 ldi r24, 0x08 ; 8 2172c: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 did_pause_print = false; // Clear pause state in case the print was aborted while paused 21730: 10 92 e0 03 sts 0x03E0, r1 ; 0x8003e0 lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 21734: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 21738: 82 30 cpi r24, 0x02 ; 2 2173a: 09 f0 breq .+2 ; 0x2173e 2173c: 6a c0 rjmp .+212 ; 0x21812 2173e: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 21742: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 { if (!blocks_queued() && !homing_flag) 21746: 98 13 cpse r25, r24 21748: 64 c0 rjmp .+200 ; 0x21812 2174a: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 2174e: 81 11 cpse r24, r1 21750: 60 c0 rjmp .+192 ; 0x21812 { if (custom_message_type != CustomMsg::M117) 21752: 80 91 75 07 lds r24, 0x0775 ; 0x800775 21756: 87 30 cpi r24, 0x07 ; 7 21758: 41 f0 breq .+16 ; 0x2176a { custom_message_type = CustomMsg::Status; 2175a: 10 92 75 07 sts 0x0775, r1 ; 0x800775 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 2175e: 8e ee ldi r24, 0xEE ; 238 21760: 90 e4 ldi r25, 0x40 ; 64 21762: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 21766: 0f 94 0c 0b call 0x21618 ; 0x21618 } lcd_commands_type = LcdCommands::Idle; 2176a: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 2176e: 82 e0 ldi r24, 0x02 ; 2 21770: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 21774: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 21778: 0f 94 27 58 call 0x2b04e ; 0x2b04e // Stop heaters heating_status = HeatingStatus::NO_HEATING; 2177c: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 21780: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 21784: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 21788: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.495+0x8> 2178c: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.495+0x9> 21790: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.495+0xa> 21794: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.495+0xb> 21798: 0e 94 16 6f call 0xde2c ; 0xde2c // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 2179c: 80 91 40 07 lds r24, 0x0740 ; 0x800740 217a0: 88 23 and r24, r24 217a2: 51 f1 breq .+84 ; 0x217f8 217a4: 80 91 41 07 lds r24, 0x0741 ; 0x800741 217a8: 88 23 and r24, r24 217aa: 31 f1 breq .+76 ; 0x217f8 current_position[X_AXIS] = pause_position[X_AXIS]; 217ac: 80 91 3f 02 lds r24, 0x023F ; 0x80023f <_ZL14pause_position.lto_priv.495> 217b0: 90 91 40 02 lds r25, 0x0240 ; 0x800240 <_ZL14pause_position.lto_priv.495+0x1> 217b4: a0 91 41 02 lds r26, 0x0241 ; 0x800241 <_ZL14pause_position.lto_priv.495+0x2> 217b8: b0 91 42 02 lds r27, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.495+0x3> 217bc: 80 93 43 07 sts 0x0743, r24 ; 0x800743 217c0: 90 93 44 07 sts 0x0744, r25 ; 0x800744 217c4: a0 93 45 07 sts 0x0745, r26 ; 0x800745 217c8: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = pause_position[Y_AXIS]; 217cc: 80 91 43 02 lds r24, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.495+0x4> 217d0: 90 91 44 02 lds r25, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.495+0x5> 217d4: a0 91 45 02 lds r26, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.495+0x6> 217d8: b0 91 46 02 lds r27, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.495+0x7> 217dc: 80 93 47 07 sts 0x0747, r24 ; 0x800747 217e0: 90 93 48 07 sts 0x0748, r25 ; 0x800748 217e4: a0 93 49 07 sts 0x0749, r26 ; 0x800749 217e8: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(50); 217ec: 60 e0 ldi r22, 0x00 ; 0 217ee: 70 e0 ldi r23, 0x00 ; 0 217f0: 88 e4 ldi r24, 0x48 ; 72 217f2: 92 e4 ldi r25, 0x42 ; 66 217f4: 0f 94 5d ba call 0x374ba ; 0x374ba 217f8: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> } // did we come here from a thermal error? if(get_temp_error()) { 217fc: 88 23 and r24, r24 217fe: 09 f4 brne .+2 ; 0x21802 21800: 78 c0 rjmp .+240 ; 0x218f2 // time to stop the error beep WRITE(BEEPER, LOW); 21802: 9f b7 in r25, 0x3f ; 63 21804: f8 94 cli 21806: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2180a: 8b 7f andi r24, 0xFB ; 251 2180c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 21810: 9f bf out 0x3f, r25 ; 63 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 21812: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 21816: 84 30 cpi r24, 0x04 ; 4 21818: 09 f0 breq .+2 ; 0x2181c 2181a: aa c0 rjmp .+340 ; 0x21970 { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 2181c: 85 ea ldi r24, 0xA5 ; 165 2181e: 9d e0 ldi r25, 0x0D ; 13 21820: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 21824: 30 91 56 0e lds r19, 0x0E56 ; 0x800e56 21828: 20 91 57 0e lds r18, 0x0E57 ; 0x800e57 const float extrusion_width = (nozzle_dia + 20)/1000.0f; const float layer_height = 0.2f; if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 2182c: 32 13 cpse r19, r18 2182e: 79 c1 rjmp .+754 ; 0x21b22 21830: 20 91 81 10 lds r18, 0x1081 ; 0x801081 21834: 30 91 82 10 lds r19, 0x1082 ; 0x801082 21838: 23 2b or r18, r19 2183a: 09 f0 breq .+2 ; 0x2183e 2183c: 72 c1 rjmp .+740 ; 0x21b22 2183e: 20 91 5a 0e lds r18, 0x0E5A ; 0x800e5a 21842: 29 83 std Y+1, r18 ; 0x01 21844: 21 11 cpse r18, r1 21846: 6d c1 rjmp .+730 ; 0x21b22 { if (lcd_commands_step == 0) 21848: 20 91 f7 03 lds r18, 0x03F7 ; 0x8003f7 2184c: 21 11 cpse r18, r1 2184e: 54 c0 rjmp .+168 ; 0x218f8 lcd_commands_step = 12; 21850: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 21852: 20 93 f7 03 sts 0x03F7, r18 ; 0x8003f7 } 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; 21856: 44 96 adiw r24, 0x14 ; 20 21858: bc 01 movw r22, r24 2185a: 90 e0 ldi r25, 0x00 ; 0 2185c: 80 e0 ldi r24, 0x00 ; 0 2185e: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 21862: 20 e0 ldi r18, 0x00 ; 0 21864: 30 e0 ldi r19, 0x00 ; 0 21866: 4a e7 ldi r20, 0x7A ; 122 21868: 54 e4 ldi r21, 0x44 ; 68 2186a: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 2186e: 6b 01 movw r12, r22 21870: 7c 01 movw r14, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 21872: e0 91 f7 03 lds r30, 0x03F7 ; 0x8003f7 21876: e1 50 subi r30, 0x01 ; 1 21878: ec 30 cpi r30, 0x0C ; 12 2187a: 08 f0 brcs .+2 ; 0x2187e 2187c: 79 c0 rjmp .+242 ; 0x21970 2187e: f0 e0 ldi r31, 0x00 ; 0 21880: 88 27 eor r24, r24 21882: ea 5b subi r30, 0xBA ; 186 21884: f3 4f sbci r31, 0xF3 ; 243 21886: 8e 4f sbci r24, 0xFE ; 254 21888: 0d 94 6b de jmp 0x3bcd6 ; 0x3bcd6 <__tablejump2__> 2188c: 3c 3b cpi r19, 0xBC ; 188 2188e: 3a 3a cpi r19, 0xAA ; 170 21890: a2 3a cpi r26, 0xA2 ; 162 21892: ae 39 cpi r26, 0x9E ; 158 21894: cc 3a cpi r28, 0xAC ; 172 21896: 54 3b cpi r21, 0xB4 ; 180 21898: f8 39 cpi r31, 0x98 ; 152 2189a: ae 3a cpi r26, 0xAE ; 174 2189c: 34 3b cpi r19, 0xB4 ; 180 2189e: 54 3a cpi r21, 0xA4 ; 164 218a0: 16 3a cpi r17, 0xA6 ; 166 218a2: b0 3a cpi r27, 0xA0 ; 160 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 218a4: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 // restore the auto hotend state hotendDefaultAutoFanState(); 218a8: 0e 94 a3 77 call 0xef46 ; 0xef46 if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 218ac: 80 91 98 13 lds r24, 0x1398 ; 0x801398 218b0: 81 30 cpi r24, 0x01 ; 1 218b2: 09 f0 breq .+2 ; 0x218b6 218b4: 36 cf rjmp .-404 ; 0x21722 fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 218b6: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 218ba: 88 23 and r24, r24 218bc: 09 f4 brne .+2 ; 0x218c0 218be: 31 cf rjmp .-414 ; 0x21722 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 218c0: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 218c4: 82 30 cpi r24, 0x02 ; 2 218c6: 09 f4 brne .+2 ; 0x218ca 218c8: 2c cf rjmp .-424 ; 0x21722 #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()) 218ca: 0e 94 ba 68 call 0xd174 ; 0xd174 218ce: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 218d0: 0e 94 fe 65 call 0xcbfc ; 0xcbfc } // 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) { 218d4: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d 218d8: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e 218dc: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 218e0: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 218e4: 28 17 cp r18, r24 218e6: 39 07 cpc r19, r25 218e8: 0c f4 brge .+2 ; 0x218ec 218ea: 1b cf rjmp .-458 ; 0x21722 MMU2::mmu2.unload(); // M702 218ec: 0f 94 37 a0 call 0x3406e ; 0x3406e 218f0: 18 cf rjmp .-464 ; 0x21722 } else { // Turn off the print fan fanSpeed = 0; 218f2: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 218f6: 8d cf rjmp .-230 ; 0x21812 if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 218f8: 21 50 subi r18, 0x01 ; 1 218fa: ab cf rjmp .-170 ; 0x21852 preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 218fc: 65 e0 ldi r22, 0x05 ; 5 218fe: 8a ea ldi r24, 0xAA ; 170 21900: 9d e8 ldi r25, 0x8D ; 141 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]))); 21902: 0e 94 4a 8a call 0x11494 ; 0x11494 21906: 34 c0 rjmp .+104 ; 0x21970 //! @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()) 21908: 80 91 98 13 lds r24, 0x1398 ; 0x801398 2190c: 81 30 cpi r24, 0x01 ; 1 2190e: 69 f5 brne .+90 ; 0x2196a { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 21910: 30 91 f6 03 lds r19, 0x03F6 ; 0x8003f6 <_ZL16lay1cal_filament.lto_priv.454> 21914: 3b 83 std Y+3, r19 ; 0x03 { enquecommand_P(MSG_M83); 21916: 61 e0 ldi r22, 0x01 ; 1 21918: 81 ec ldi r24, 0xC1 ; 193 2191a: 9c e6 ldi r25, 0x6C ; 108 2191c: 0e 94 cb 89 call 0x11396 ; 0x11396 enquecommand_P(PSTR("G1 Y-3 F1000")); 21920: 61 e0 ldi r22, 0x01 ; 1 21922: 8d e9 ldi r24, 0x9D ; 157 21924: 9d e8 ldi r25, 0x8D ; 141 21926: 0e 94 cb 89 call 0x11396 ; 0x11396 enquecommand_P(PSTR("G1 Z0.4 F1000")); 2192a: 61 e0 ldi r22, 0x01 ; 1 2192c: 8f e8 ldi r24, 0x8F ; 143 2192e: 9d e8 ldi r25, 0x8D ; 141 21930: 0e 94 cb 89 call 0x11396 ; 0x11396 uint8_t currentTool = MMU2::mmu2.get_current_tool(); 21934: 0f 94 a4 75 call 0x2eb48 ; 0x2eb48 if(currentTool == filament ){ 21938: 9b 81 ldd r25, Y+3 ; 0x03 2193a: 98 17 cp r25, r24 2193c: b1 f0 breq .+44 ; 0x2196a // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 2193e: 8f 3f cpi r24, 0xFF ; 255 21940: 29 f0 breq .+10 ; 0x2194c // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 21942: 61 e0 ldi r22, 0x01 ; 1 21944: 8c eb ldi r24, 0xBC ; 188 21946: 9c e6 ldi r25, 0x6C ; 108 21948: 0e 94 cb 89 call 0x11396 ; 0x11396 } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 2194c: 1f 92 push r1 2194e: 2b 81 ldd r18, Y+3 ; 0x03 21950: 2f 93 push r18 21952: 8b e8 ldi r24, 0x8B ; 139 21954: 9d e8 ldi r25, 0x8D ; 141 21956: 9f 93 push r25 21958: 8f 93 push r24 2195a: 0e 94 61 8a call 0x114c2 ; 0x114c2 2195e: 0f 90 pop r0 21960: 0f 90 pop r0 21962: 0f 90 pop r0 21964: 0f 90 pop r0 return true; 21966: 31 e0 ldi r19, 0x01 ; 1 21968: 39 83 std Y+1, r19 ; 0x01 2196a: 89 81 ldd r24, Y+1 ; 0x01 2196c: 80 93 f5 03 sts 0x03F5, r24 ; 0x8003f5 break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 21970: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 21974: 83 30 cpi r24, 0x03 ; 3 21976: 09 f0 breq .+2 ; 0x2197a 21978: d4 c0 rjmp .+424 ; 0x21b22 if (lcd_commands_step == 0) { 2197a: 90 91 f7 03 lds r25, 0x03F7 ; 0x8003f7 2197e: 91 11 cpse r25, r1 21980: 09 c0 rjmp .+18 ; 0x21994 custom_message_type = CustomMsg::PidCal; 21982: 80 93 75 07 sts 0x0775, r24 ; 0x800775 custom_message_state = 1; 21986: 91 e0 ldi r25, 0x01 ; 1 21988: 90 93 f3 03 sts 0x03F3, r25 ; 0x8003f3 lcd_draw_update = 3; 2198c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_commands_step = 3; 21990: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 21994: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 21998: 83 30 cpi r24, 0x03 ; 3 2199a: 19 f5 brne .+70 ; 0x219e2 2199c: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 219a0: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 219a4: 98 13 cpse r25, r24 219a6: 1d c0 rjmp .+58 ; 0x219e2 return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 219a8: 0f 94 52 44 call 0x288a4 ; 0x288a4 pid_tuning_finished = false; 219ac: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.471> 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); 219b0: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.455+0x1> 219b4: 8f 93 push r24 219b6: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.455> 219ba: 8f 93 push r24 219bc: 85 e3 ldi r24, 0x35 ; 53 219be: 9e e8 ldi r25, 0x8E ; 142 219c0: 9f 93 push r25 219c2: 8f 93 push r24 219c4: 0e 94 61 8a call 0x114c2 ; 0x114c2 lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 219c8: 83 ee ldi r24, 0xE3 ; 227 219ca: 90 e4 ldi r25, 0x40 ; 64 219cc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 219d0: 0f 94 0c 0b call 0x21618 ; 0x21618 lcd_commands_step = 2; 219d4: 82 e0 ldi r24, 0x02 ; 2 219d6: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 219da: 0f 90 pop r0 219dc: 0f 90 pop r0 219de: 0f 90 pop r0 219e0: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 219e2: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 219e6: 82 30 cpi r24, 0x02 ; 2 219e8: 09 f0 breq .+2 ; 0x219ec 219ea: 7c c0 rjmp .+248 ; 0x21ae4 219ec: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.471> 219f0: 88 23 and r24, r24 219f2: 09 f4 brne .+2 ; 0x219f6 219f4: 77 c0 rjmp .+238 ; 0x21ae4 custom_message_state = 0; 219f6: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 219fa: 8f ec ldi r24, 0xCF ; 207 219fc: 90 e4 ldi r25, 0x40 ; 64 219fe: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 21a02: 0f 94 0c 0b call 0x21618 ; 0x21618 21a06: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 21a0a: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 21a0e: 30 91 ef 03 lds r19, 0x03EF ; 0x8003ef <_Kp> 21a12: 39 83 std Y+1, r19 ; 0x01 21a14: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 <_Kp+0x1> 21a18: 8b 83 std Y+3, r24 ; 0x03 21a1a: 10 91 f1 03 lds r17, 0x03F1 ; 0x8003f1 <_Kp+0x2> 21a1e: 00 91 f2 03 lds r16, 0x03F2 ; 0x8003f2 <_Kp+0x3> 21a22: 20 e0 ldi r18, 0x00 ; 0 21a24: 30 e0 ldi r19, 0x00 ; 0 21a26: a9 01 movw r20, r18 21a28: b9 81 ldd r27, Y+1 ; 0x01 21a2a: f8 01 movw r30, r16 21a2c: 6b 2f mov r22, r27 21a2e: 78 2f mov r23, r24 21a30: 8f 2f mov r24, r31 21a32: 9e 2f mov r25, r30 21a34: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 21a38: 81 11 cpse r24, r1 21a3a: 1f c0 rjmp .+62 ; 0x21a7a 21a3c: 20 e0 ldi r18, 0x00 ; 0 21a3e: 30 e0 ldi r19, 0x00 ; 0 21a40: a9 01 movw r20, r18 21a42: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb <_Ki> 21a46: 70 91 ec 03 lds r23, 0x03EC ; 0x8003ec <_Ki+0x1> 21a4a: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Ki+0x2> 21a4e: 90 91 ee 03 lds r25, 0x03EE ; 0x8003ee <_Ki+0x3> 21a52: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 21a56: 81 11 cpse r24, r1 21a58: 10 c0 rjmp .+32 ; 0x21a7a 21a5a: 20 e0 ldi r18, 0x00 ; 0 21a5c: 30 e0 ldi r19, 0x00 ; 0 21a5e: a9 01 movw r20, r18 21a60: 60 91 e7 03 lds r22, 0x03E7 ; 0x8003e7 <_Kd> 21a64: 70 91 e8 03 lds r23, 0x03E8 ; 0x8003e8 <_Kd+0x1> 21a68: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 <_Kd+0x2> 21a6c: 90 91 ea 03 lds r25, 0x03EA ; 0x8003ea <_Kd+0x3> 21a70: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 21a74: 88 23 and r24, r24 21a76: 09 f4 brne .+2 ; 0x21a7a 21a78: 5a c2 rjmp .+1204 ; 0x21f2e enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 21a7a: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea <_Kd+0x3> 21a7e: 8f 93 push r24 21a80: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 <_Kd+0x2> 21a84: 8f 93 push r24 21a86: 80 91 e8 03 lds r24, 0x03E8 ; 0x8003e8 <_Kd+0x1> 21a8a: 8f 93 push r24 21a8c: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 <_Kd> 21a90: 8f 93 push r24 21a92: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee <_Ki+0x3> 21a96: 8f 93 push r24 21a98: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Ki+0x2> 21a9c: 8f 93 push r24 21a9e: 80 91 ec 03 lds r24, 0x03EC ; 0x8003ec <_Ki+0x1> 21aa2: 8f 93 push r24 21aa4: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb <_Ki> 21aa8: 8f 93 push r24 21aaa: 0f 93 push r16 21aac: 1f 93 push r17 21aae: 9b 81 ldd r25, Y+3 ; 0x03 21ab0: 9f 93 push r25 21ab2: 29 81 ldd r18, Y+1 ; 0x01 21ab4: 2f 93 push r18 21ab6: 8e e1 ldi r24, 0x1E ; 30 21ab8: 9e e8 ldi r25, 0x8E ; 142 21aba: 9f 93 push r25 21abc: 8f 93 push r24 21abe: 0e 94 61 8a call 0x114c2 ; 0x114c2 enquecommand_P(MSG_M500); 21ac2: 61 e0 ldi r22, 0x01 ; 1 21ac4: 8b ec ldi r24, 0xCB ; 203 21ac6: 9c e6 ldi r25, 0x6C ; 108 21ac8: 0e 94 cb 89 call 0x11396 ; 0x11396 21acc: 0f b6 in r0, 0x3f ; 63 21ace: f8 94 cli 21ad0: de bf out 0x3e, r29 ; 62 21ad2: 0f be out 0x3f, r0 ; 63 21ad4: cd bf out 0x3d, r28 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 21ad6: 84 ee ldi r24, 0xE4 ; 228 21ad8: 93 e0 ldi r25, 0x03 ; 3 21ada: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> lcd_commands_step = 1; 21ade: 81 e0 ldi r24, 0x01 ; 1 21ae0: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 21ae4: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 21ae8: 81 30 cpi r24, 0x01 ; 1 21aea: d9 f4 brne .+54 ; 0x21b22 21aec: 60 ed ldi r22, 0xD0 ; 208 21aee: 77 e0 ldi r23, 0x07 ; 7 21af0: 84 ee ldi r24, 0xE4 ; 228 21af2: 93 e0 ldi r25, 0x03 ; 3 21af4: 0f 94 b8 3e call 0x27d70 ; 0x27d70 ::expired(unsigned short)> 21af8: 88 23 and r24, r24 21afa: 99 f0 breq .+38 ; 0x21b22 lcd_setstatuspgm(MSG_WELCOME); 21afc: 8e e0 ldi r24, 0x0E ; 14 21afe: 91 e7 ldi r25, 0x71 ; 113 21b00: 0f 94 0c 0b call 0x21618 ; 0x21618 custom_message_type = CustomMsg::Status; 21b04: 10 92 75 07 sts 0x0775, r1 ; 0x800775 pid_temp = DEFAULT_PID_TEMP; 21b08: 82 ed ldi r24, 0xD2 ; 210 21b0a: 90 e0 ldi r25, 0x00 ; 0 21b0c: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.455+0x1> 21b10: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.455> lcd_commands_step = 0; 21b14: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 lcd_commands_type = LcdCommands::Idle; 21b18: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 21b1c: 82 e0 ldi r24, 0x02 ; 2 21b1e: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::Idle); } } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) 21b22: 90 91 65 0e lds r25, 0x0E65 ; 0x800e65 21b26: 95 30 cpi r25, 0x05 ; 5 21b28: a1 f4 brne .+40 ; 0x21b52 21b2a: 20 91 81 10 lds r18, 0x1081 ; 0x801081 21b2e: 30 91 82 10 lds r19, 0x1082 ; 0x801082 21b32: 23 2b or r18, r19 21b34: 09 f0 breq .+2 ; 0x21b38 21b36: 4b c2 rjmp .+1174 ; 0x21fce { switch (lcd_commands_step) 21b38: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 21b3c: 82 30 cpi r24, 0x02 ; 2 21b3e: 09 f4 brne .+2 ; 0x21b42 21b40: 1f c2 rjmp .+1086 ; 0x21f80 21b42: 08 f0 brcs .+2 ; 0x21b46 21b44: f9 c1 rjmp .+1010 ; 0x21f38 21b46: 88 23 and r24, r24 21b48: 09 f4 brne .+2 ; 0x21b4c 21b4a: 0a c2 rjmp .+1044 ; 0x21f60 21b4c: 81 30 cpi r24, 0x01 ; 1 21b4e: 09 f4 brne .+2 ; 0x21b52 21b50: 22 c2 rjmp .+1092 ; 0x21f96 break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 21b52: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 21b56: 86 30 cpi r24, 0x06 ; 6 21b58: 09 f0 breq .+2 ; 0x21b5c 21b5a: 39 c2 rjmp .+1138 ; 0x21fce 21b5c: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 21b60: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 21b64: 98 13 cpse r25, r24 21b66: 33 c2 rjmp .+1126 ; 0x21fce 21b68: 80 91 81 10 lds r24, 0x1081 ; 0x801081 21b6c: 90 91 82 10 lds r25, 0x1082 ; 0x801082 21b70: 89 2b or r24, r25 21b72: 09 f0 breq .+2 ; 0x21b76 21b74: 2c c2 rjmp .+1112 ; 0x21fce 21b76: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 21b7a: 81 11 cpse r24, r1 21b7c: 28 c2 rjmp .+1104 ; 0x21fce #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) 21b7e: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 21b82: 81 30 cpi r24, 0x01 ; 1 21b84: 09 f4 brne .+2 ; 0x21b88 21b86: 4e c2 rjmp .+1180 ; 0x22024 21b88: 08 f4 brcc .+2 ; 0x21b8c 21b8a: 1e c2 rjmp .+1084 ; 0x21fc8 21b8c: 82 30 cpi r24, 0x02 ; 2 21b8e: 09 f4 brne .+2 ; 0x21b92 21b90: 36 c2 rjmp .+1132 ; 0x21ffe 21b92: 83 30 cpi r24, 0x03 ; 3 21b94: 09 f0 breq .+2 ; 0x21b98 21b96: 1b c2 rjmp .+1078 ; 0x21fce #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 21b98: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 21b9c: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 21ba0: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 21ba4: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 21ba8: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 21bac: 69 32 cpi r22, 0x29 ; 41 21bae: 71 05 cpc r23, r1 21bb0: 7c f0 brlt .+30 ; 0x21bd0 fanSpeed = 255; //turn on fan 21bb2: 9f ef ldi r25, 0xFF ; 255 21bb4: 90 93 e3 03 sts 0x03E3, r25 ; 0x8003e3 disable_heater(); 21bb8: 0f 94 52 44 call 0x288a4 ; 0x288a4 uint8_t choice = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_COOLDOWN), true, LCD_LEFT_BUTTON_CHOICE); 21bbc: 8b ea ldi r24, 0xAB ; 171 21bbe: 90 e4 ldi r25, 0x40 ; 64 21bc0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 21bc4: 40 e0 ldi r20, 0x00 ; 0 21bc6: 61 e0 ldi r22, 0x01 ; 1 21bc8: 0f 94 b3 64 call 0x2c966 ; 0x2c966 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 21bcc: 81 30 cpi r24, 0x01 ; 1 21bce: 21 f7 brne .-56 ; 0x21b98 break; } } enquecommand_P(G28W); //home 21bd0: 61 e0 ldi r22, 0x01 ; 1 21bd2: 85 ec ldi r24, 0xC5 ; 197 21bd4: 9c e6 ldi r25, 0x6C ; 108 21bd6: 0e 94 cb 89 call 0x11396 ; 0x11396 enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center 21bda: 61 e0 ldi r22, 0x01 ; 1 21bdc: 8b eb ldi r24, 0xBB ; 187 21bde: 9d e8 ldi r25, 0x8D ; 141 21be0: 0e 94 cb 89 call 0x11396 ; 0x11396 #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 21be4: 82 e0 ldi r24, 0x02 ; 2 21be6: f1 c1 rjmp .+994 ; 0x21fca break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 21be8: 0e 94 48 70 call 0xe090 ; 0xe090 menu_depth = 0; 21bec: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 menu_submenu(lcd_babystep_z, true); 21bf0: 61 e0 ldi r22, 0x01 ; 1 21bf2: 88 ea ldi r24, 0xA8 ; 168 21bf4: 9a e3 ldi r25, 0x3A ; 58 21bf6: 0f 94 47 d0 call 0x3a08e ; 0x3a08e cmd_intro_mmu_10, cmd_intro_mmu_11, cmd_intro_mmu_12, }; if (MMU2::mmu2.Enabled()) 21bfa: 80 91 98 13 lds r24, 0x1398 ; 0x801398 21bfe: 81 30 cpi r24, 0x01 ; 1 21c00: f1 f4 brne .+60 ; 0x21c3e { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(intro_mmu_cmd)/sizeof(intro_mmu_cmd[0])); ++i) 21c02: 80 91 f5 03 lds r24, 0x03F5 ; 0x8003f5 21c06: 10 e0 ldi r17, 0x00 ; 0 21c08: 81 11 cpse r24, r1 21c0a: 01 c0 rjmp .+2 ; 0x21c0e 21c0c: 12 e0 ldi r17, 0x02 ; 2 21c0e: 21 2f mov r18, r17 21c10: 30 e0 ldi r19, 0x00 ; 0 21c12: 22 0f add r18, r18 21c14: 33 1f adc r19, r19 21c16: 29 58 subi r18, 0x89 ; 137 21c18: 32 47 sbci r19, 0x72 ; 114 21c1a: 3a 83 std Y+2, r19 ; 0x02 21c1c: 29 83 std Y+1, r18 ; 0x01 { enquecommand_P(static_cast(pgm_read_ptr(&intro_mmu_cmd[i]))); 21c1e: e9 81 ldd r30, Y+1 ; 0x01 21c20: fa 81 ldd r31, Y+2 ; 0x02 21c22: 85 91 lpm r24, Z+ 21c24: 94 91 lpm r25, Z 21c26: 61 e0 ldi r22, 0x01 ; 1 21c28: 0e 94 cb 89 call 0x11396 ; 0x11396 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) 21c2c: 1f 5f subi r17, 0xFF ; 255 21c2e: 89 81 ldd r24, Y+1 ; 0x01 21c30: 9a 81 ldd r25, Y+2 ; 0x02 21c32: 02 96 adiw r24, 0x02 ; 2 21c34: 9a 83 std Y+2, r25 ; 0x02 21c36: 89 83 std Y+1, r24 ; 0x01 21c38: 1a 30 cpi r17, 0x0A ; 10 21c3a: 89 f7 brne .-30 ; 0x21c1e 21c3c: 99 ce rjmp .-718 ; 0x21970 } } 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)); 21c3e: 20 e0 ldi r18, 0x00 ; 0 21c40: 30 e0 ldi r19, 0x00 ; 0 21c42: 40 e8 ldi r20, 0x80 ; 128 21c44: 50 e4 ldi r21, 0x40 ; 64 21c46: c7 01 movw r24, r14 21c48: b6 01 movw r22, r12 21c4a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 21c4e: 20 e0 ldi r18, 0x00 ; 0 21c50: 30 e0 ldi r19, 0x00 ; 0 21c52: 40 e7 ldi r20, 0x70 ; 112 21c54: 52 e4 ldi r21, 0x42 ; 66 21c56: 0f 94 5d 86 call 0x30cba ; 0x30cba 21c5a: 9f 93 push r25 21c5c: 8f 93 push r24 21c5e: 7f 93 push r23 21c60: 6f 93 push r22 21c62: 1f 92 push r1 21c64: 8c e3 ldi r24, 0x3C ; 60 21c66: 8f 93 push r24 21c68: 23 e6 ldi r18, 0x63 ; 99 21c6a: 3d e8 ldi r19, 0x8D ; 141 21c6c: 3f 93 push r19 21c6e: 2f 93 push r18 21c70: 0e 94 61 8a call 0x114c2 ; 0x114c2 enquecommandf_P(fmt1, 100, count_e(layer_height, extrusion_width * 8.f, 40)); 21c74: 20 e0 ldi r18, 0x00 ; 0 21c76: 30 e0 ldi r19, 0x00 ; 0 21c78: 40 e0 ldi r20, 0x00 ; 0 21c7a: 51 e4 ldi r21, 0x41 ; 65 21c7c: c7 01 movw r24, r14 21c7e: b6 01 movw r22, r12 21c80: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 21c84: 20 e0 ldi r18, 0x00 ; 0 21c86: 30 e0 ldi r19, 0x00 ; 0 21c88: 40 e2 ldi r20, 0x20 ; 32 21c8a: 52 e4 ldi r21, 0x42 ; 66 21c8c: 0f 94 5d 86 call 0x30cba ; 0x30cba 21c90: 9f 93 push r25 21c92: 8f 93 push r24 21c94: 7f 93 push r23 21c96: 6f 93 push r22 21c98: 1f 92 push r1 21c9a: 84 e6 ldi r24, 0x64 ; 100 21c9c: 8f 93 push r24 21c9e: 23 e6 ldi r18, 0x63 ; 99 21ca0: 3d e8 ldi r19, 0x8D ; 141 21ca2: 3f 93 push r19 21ca4: 2f 93 push r18 21ca6: 0e 94 61 8a call 0x114c2 ; 0x114c2 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)); 21caa: 0f b6 in r0, 0x3f ; 63 21cac: f8 94 cli 21cae: de bf out 0x3e, r29 ; 62 21cb0: 0f be out 0x3f, r0 ; 63 21cb2: cd bf out 0x3d, r28 ; 61 21cb4: 5d ce rjmp .-838 ; 0x21970 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]))); 21cb6: 67 e0 ldi r22, 0x07 ; 7 21cb8: 85 e5 ldi r24, 0x55 ; 85 21cba: 9d e8 ldi r25, 0x8D ; 141 21cbc: 22 ce rjmp .-956 ; 0x21902 } //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { enquecommand_P(PSTR("G1 X50 Y155")); 21cbe: 61 e0 ldi r22, 0x01 ; 1 21cc0: 89 e4 ldi r24, 0x49 ; 73 21cc2: 9d e8 ldi r25, 0x8D ; 141 21cc4: 0e 94 cb 89 call 0x11396 ; 0x11396 static const char fmt1[] PROGMEM = "G1 Z%-.3f F7200"; enquecommandf_P(fmt1, layer_height); 21cc8: 8e e3 ldi r24, 0x3E ; 62 21cca: 8f 93 push r24 21ccc: 8c e4 ldi r24, 0x4C ; 76 21cce: 8f 93 push r24 21cd0: 8c ec ldi r24, 0xCC ; 204 21cd2: 8f 93 push r24 21cd4: 8d ec ldi r24, 0xCD ; 205 21cd6: 8f 93 push r24 21cd8: 89 e3 ldi r24, 0x39 ; 57 21cda: 9d e8 ldi r25, 0x8D ; 141 21cdc: 9f 93 push r25 21cde: 8f 93 push r24 21ce0: 0e 94 61 8a call 0x114c2 ; 0x114c2 enquecommand_P(PSTR("G1 F1080")); 21ce4: 61 e0 ldi r22, 0x01 ; 1 21ce6: 80 e3 ldi r24, 0x30 ; 48 21ce8: 9d e8 ldi r25, 0x8D ; 141 21cea: 0e 94 cb 89 call 0x11396 ; 0x11396 enquecommandf_P(extrude_fmt, 75, 155, count_e(layer_height, extrusion_width * 4.f, 25)); 21cee: 20 e0 ldi r18, 0x00 ; 0 21cf0: 30 e0 ldi r19, 0x00 ; 0 21cf2: 40 e8 ldi r20, 0x80 ; 128 21cf4: 50 e4 ldi r21, 0x40 ; 64 21cf6: c7 01 movw r24, r14 21cf8: b6 01 movw r22, r12 21cfa: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 21cfe: 20 e0 ldi r18, 0x00 ; 0 21d00: 30 e0 ldi r19, 0x00 ; 0 21d02: 48 ec ldi r20, 0xC8 ; 200 21d04: 51 e4 ldi r21, 0x41 ; 65 21d06: 0f 94 5d 86 call 0x30cba ; 0x30cba 21d0a: 9f 93 push r25 21d0c: 8f 93 push r24 21d0e: 7f 93 push r23 21d10: 6f 93 push r22 21d12: 1f 92 push r1 21d14: 1b e9 ldi r17, 0x9B ; 155 21d16: 1f 93 push r17 21d18: 1f 92 push r1 21d1a: 8b e4 ldi r24, 0x4B ; 75 21d1c: 8f 93 push r24 21d1e: 8e e1 ldi r24, 0x1E ; 30 21d20: 9d e8 ldi r25, 0x8D ; 141 21d22: 9f 93 push r25 21d24: 8f 93 push r24 21d26: 0e 94 61 8a call 0x114c2 ; 0x114c2 enquecommandf_P(extrude_fmt, 100, 155, count_e(layer_height, extrusion_width * 2.f, 25)); 21d2a: a7 01 movw r20, r14 21d2c: 96 01 movw r18, r12 21d2e: c7 01 movw r24, r14 21d30: b6 01 movw r22, r12 21d32: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 21d36: 20 e0 ldi r18, 0x00 ; 0 21d38: 30 e0 ldi r19, 0x00 ; 0 21d3a: 48 ec ldi r20, 0xC8 ; 200 21d3c: 51 e4 ldi r21, 0x41 ; 65 21d3e: 0f 94 5d 86 call 0x30cba ; 0x30cba 21d42: 9f 93 push r25 21d44: 8f 93 push r24 21d46: 7f 93 push r23 21d48: 6f 93 push r22 21d4a: 1f 92 push r1 21d4c: 1f 93 push r17 21d4e: 1f 92 push r1 21d50: 84 e6 ldi r24, 0x64 ; 100 21d52: 8f 93 push r24 21d54: 8e e1 ldi r24, 0x1E ; 30 21d56: 9d e8 ldi r25, 0x8D ; 141 21d58: 9f 93 push r25 21d5a: 8f 93 push r24 21d5c: 0e 94 61 8a call 0x114c2 ; 0x114c2 enquecommandf_P(extrude_fmt, 200, 155, count_e(layer_height, extrusion_width, 100)); 21d60: 20 e0 ldi r18, 0x00 ; 0 21d62: 30 e0 ldi r19, 0x00 ; 0 21d64: 48 ec ldi r20, 0xC8 ; 200 21d66: 52 e4 ldi r21, 0x42 ; 66 21d68: c7 01 movw r24, r14 21d6a: b6 01 movw r22, r12 21d6c: 0f 94 5d 86 call 0x30cba ; 0x30cba 21d70: 9f 93 push r25 21d72: 8f 93 push r24 21d74: 7f 93 push r23 21d76: 6f 93 push r22 21d78: 1f 92 push r1 21d7a: 1f 93 push r17 21d7c: 1f 92 push r1 21d7e: 18 ec ldi r17, 0xC8 ; 200 21d80: 1f 93 push r17 21d82: 8e e1 ldi r24, 0x1E ; 30 21d84: 9d e8 ldi r25, 0x8D ; 141 21d86: 9f 93 push r25 21d88: 8f 93 push r24 21d8a: 0e 94 61 8a call 0x114c2 ; 0x114c2 enquecommandf_P(extrude_fmt, 200, 135, count_e(layer_height, extrusion_width, 20)); 21d8e: 0f b6 in r0, 0x3f ; 63 21d90: f8 94 cli 21d92: de bf out 0x3e, r29 ; 62 21d94: 0f be out 0x3f, r0 ; 63 21d96: cd bf out 0x3d, r28 ; 61 21d98: 20 e0 ldi r18, 0x00 ; 0 21d9a: 30 e0 ldi r19, 0x00 ; 0 21d9c: 40 ea ldi r20, 0xA0 ; 160 21d9e: 51 e4 ldi r21, 0x41 ; 65 21da0: c7 01 movw r24, r14 21da2: b6 01 movw r22, r12 21da4: 0f 94 5d 86 call 0x30cba ; 0x30cba 21da8: 9f 93 push r25 21daa: 8f 93 push r24 21dac: 7f 93 push r23 21dae: 6f 93 push r22 21db0: 1f 92 push r1 21db2: 87 e8 ldi r24, 0x87 ; 135 21db4: 8f 93 push r24 21db6: 1f 92 push r1 21db8: 1f 93 push r17 21dba: 2e e1 ldi r18, 0x1E ; 30 21dbc: 3d e8 ldi r19, 0x8D ; 141 21dbe: 3f 93 push r19 21dc0: 2f 93 push r18 21dc2: 0e 94 61 8a call 0x114c2 ; 0x114c2 21dc6: 71 cf rjmp .-286 ; 0x21caa //! @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); 21dc8: 20 e0 ldi r18, 0x00 ; 0 21dca: 30 e0 ldi r19, 0x00 ; 0 21dcc: 46 e1 ldi r20, 0x16 ; 22 21dce: 53 e4 ldi r21, 0x43 ; 67 21dd0: c7 01 movw r24, r14 21dd2: b6 01 movw r22, r12 21dd4: 0f 94 5d 86 call 0x30cba ; 0x30cba 21dd8: 56 2e mov r5, r22 21dda: 47 2e mov r4, r23 21ddc: 38 2e mov r3, r24 21dde: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 21de0: 20 e0 ldi r18, 0x00 ; 0 21de2: 30 e0 ldi r19, 0x00 ; 0 21de4: 40 ea ldi r20, 0xA0 ; 160 21de6: 51 e4 ldi r21, 0x41 ; 65 21de8: c7 01 movw r24, r14 21dea: b6 01 movw r22, r12 21dec: 0f 94 5d 86 call 0x30cba ; 0x30cba 21df0: 6b 83 std Y+3, r22 ; 0x03 21df2: c7 2e mov r12, r23 21df4: 78 2e mov r7, r24 21df6: 69 2e mov r6, r25 21df8: 85 e0 ldi r24, 0x05 ; 5 21dfa: 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; 21dfc: 81 2c mov r8, r1 21dfe: 91 2c mov r9, r1 21e00: 96 e1 ldi r25, 0x16 ; 22 21e02: a9 2e mov r10, r25 21e04: 93 e4 ldi r25, 0x43 ; 67 21e06: 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; 21e08: 32 e3 ldi r19, 0x32 ; 50 21e0a: 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; 21e0c: 87 e8 ldi r24, 0x87 ; 135 21e0e: 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); 21e10: 0e e1 ldi r16, 0x1E ; 30 21e12: 1d e8 ldi r17, 0x8D ; 141 21e14: 9d 81 ldd r25, Y+5 ; 0x05 21e16: e9 2e mov r14, r25 21e18: f1 2c mov r15, r1 21e1a: 3c 81 ldd r19, Y+4 ; 0x04 21e1c: 23 2f mov r18, r19 21e1e: 30 e0 ldi r19, 0x00 ; 0 21e20: 3a 83 std Y+2, r19 ; 0x02 21e22: 29 83 std Y+1, r18 ; 0x01 21e24: 2f 92 push r2 21e26: 3f 92 push r3 21e28: 4f 92 push r4 21e2a: 5f 92 push r5 21e2c: 1f 92 push r1 21e2e: 9f 93 push r25 21e30: 1f 92 push r1 21e32: 8c 81 ldd r24, Y+4 ; 0x04 21e34: 8f 93 push r24 21e36: 1f 93 push r17 21e38: 0f 93 push r16 21e3a: 0e 94 61 8a call 0x114c2 ; 0x114c2 y_pos -= short_length; 21e3e: b7 01 movw r22, r14 21e40: ff 0c add r15, r15 21e42: 88 0b sbc r24, r24 21e44: 99 0b sbc r25, r25 21e46: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 21e4a: 20 e0 ldi r18, 0x00 ; 0 21e4c: 30 e0 ldi r19, 0x00 ; 0 21e4e: 40 ea ldi r20, 0xA0 ; 160 21e50: 51 e4 ldi r21, 0x41 ; 65 21e52: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 21e56: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 21e5a: 6d 83 std Y+5, r22 ; 0x05 enquecommandf_P(extrude_fmt, x_pos, y_pos, short_extrusion); 21e5c: 6f 92 push r6 21e5e: 7f 92 push r7 21e60: cf 92 push r12 21e62: 9b 81 ldd r25, Y+3 ; 0x03 21e64: 9f 93 push r25 21e66: 1f 92 push r1 21e68: 2d 81 ldd r18, Y+5 ; 0x05 21e6a: 2f 93 push r18 21e6c: 1f 92 push r1 21e6e: 3c 81 ldd r19, Y+4 ; 0x04 21e70: 3f 93 push r19 21e72: 1f 93 push r17 21e74: 0f 93 push r16 21e76: 0e 94 61 8a call 0x114c2 ; 0x114c2 x_pos += long_length; 21e7a: 29 81 ldd r18, Y+1 ; 0x01 21e7c: 3a 81 ldd r19, Y+2 ; 0x02 21e7e: b9 01 movw r22, r18 21e80: 33 0f add r19, r19 21e82: 88 0b sbc r24, r24 21e84: 99 0b sbc r25, r25 21e86: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 21e8a: a5 01 movw r20, r10 21e8c: 94 01 movw r18, r8 21e8e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 21e92: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 21e96: 6c 83 std Y+4, r22 ; 0x04 long_length = -long_length; 21e98: b7 fa bst r11, 7 21e9a: b0 94 com r11 21e9c: b7 f8 bld r11, 7 21e9e: b0 94 com r11 21ea0: 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) 21ea2: 0f b6 in r0, 0x3f ; 63 21ea4: f8 94 cli 21ea6: de bf out 0x3e, r29 ; 62 21ea8: 0f be out 0x3f, r0 ; 63 21eaa: cd bf out 0x3d, r28 ; 61 21eac: d1 10 cpse r13, r1 21eae: b2 cf rjmp .-156 ; 0x21e14 21eb0: 5f cd rjmp .-1346 ; 0x21970 break; case 7: lay1cal_meander(layer_height, extrusion_width); break; case 6: lay1cal_square(0, layer_height, extrusion_width); 21eb2: b7 01 movw r22, r14 21eb4: a6 01 movw r20, r12 21eb6: 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); 21eb8: 0f 94 84 86 call 0x30d08 ; 0x30d08 21ebc: 59 cd rjmp .-1358 ; 0x21970 break; case 6: lay1cal_square(0, layer_height, extrusion_width); break; case 5: lay1cal_square(4, layer_height, extrusion_width); 21ebe: b7 01 movw r22, r14 21ec0: a6 01 movw r20, r12 21ec2: 84 e0 ldi r24, 0x04 ; 4 21ec4: f9 cf rjmp .-14 ; 0x21eb8 break; case 4: lay1cal_square(8, layer_height, extrusion_width); 21ec6: b7 01 movw r22, r14 21ec8: a6 01 movw r20, r12 21eca: 88 e0 ldi r24, 0x08 ; 8 21ecc: f5 cf rjmp .-22 ; 0x21eb8 break; case 3: lay1cal_square(12, layer_height, extrusion_width); 21ece: b7 01 movw r22, r14 21ed0: a6 01 movw r20, r12 21ed2: 8c e0 ldi r24, 0x0C ; 12 21ed4: f1 cf rjmp .-30 ; 0x21eb8 21ed6: 90 91 98 13 lds r25, 0x1398 ; 0x801398 21eda: 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]))); 21edc: 66 e0 ldi r22, 0x06 ; 6 21ede: 82 e1 ldi r24, 0x12 ; 18 21ee0: 9d e8 ldi r25, 0x8D ; 141 21ee2: 0e 94 4a 8a call 0x11494 ; 0x11494 if (mmu_enabled) enquecommand_P(MSG_M702); //unload from nozzle 21ee6: 29 81 ldd r18, Y+1 ; 0x01 21ee8: 21 30 cpi r18, 0x01 ; 1 21eea: 29 f4 brne .+10 ; 0x21ef6 21eec: 61 e0 ldi r22, 0x01 ; 1 21eee: 8c eb ldi r24, 0xBC ; 188 21ef0: 9c e6 ldi r25, 0x6C ; 108 21ef2: 0e 94 cb 89 call 0x11396 ; 0x11396 enquecommand_P(MSG_M84);// disable motors 21ef6: 61 e0 ldi r22, 0x01 ; 1 21ef8: 88 eb ldi r24, 0xB8 ; 184 21efa: 9c e6 ldi r25, 0x6C ; 108 21efc: 0e 94 cb 89 call 0x11396 ; 0x11396 21f00: 37 cd rjmp .-1426 ; 0x21970 break; case 2: lay1cal_finish(MMU2::mmu2.Enabled()); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 21f02: 8e e0 ldi r24, 0x0E ; 14 21f04: 91 e7 ldi r25, 0x71 ; 113 21f06: 0f 94 0c 0b call 0x21618 ; 0x21618 lcd_commands_step = 0; 21f0a: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 lcd_commands_type = LcdCommands::Idle; 21f0e: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 21f12: 82 e0 ldi r24, 0x02 ; 2 21f14: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 21f18: 8f e5 ldi r24, 0x5F ; 95 21f1a: 9f e0 ldi r25, 0x0F ; 15 21f1c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 21f20: 88 23 and r24, r24 21f22: 09 f4 brne .+2 ; 0x21f26 21f24: fe cd rjmp .-1028 ; 0x21b22 lcd_wizard(WizState::RepeatLay1Cal); 21f26: 8c e0 ldi r24, 0x0C ; 12 21f28: 0f 94 dc 64 call 0x2c9b8 ; 0x2c9b8 21f2c: 21 cd rjmp .-1470 ; 0x21970 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."); 21f2e: 8e ee ldi r24, 0xEE ; 238 21f30: 9d e8 ldi r25, 0x8D ; 141 21f32: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 21f36: cf cd rjmp .-1122 ; 0x21ad6 } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) 21f38: 84 30 cpi r24, 0x04 ; 4 21f3a: a9 f0 breq .+42 ; 0x21f66 21f3c: c0 f0 brcs .+48 ; 0x21f6e 21f3e: 85 30 cpi r24, 0x05 ; 5 21f40: 09 f0 breq .+2 ; 0x21f44 21f42: 07 ce rjmp .-1010 ; 0x21b52 case 0: lcd_commands_step = 5; [[fallthrough]]; case 5: enquecommand_P(G28W); 21f44: 61 e0 ldi r22, 0x01 ; 1 21f46: 85 ec ldi r24, 0xC5 ; 197 21f48: 9c e6 ldi r25, 0x6C ; 108 21f4a: 0e 94 cb 89 call 0x11396 ; 0x11396 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); 21f4e: 61 e0 ldi r22, 0x01 ; 1 21f50: 88 ed ldi r24, 0xD8 ; 216 21f52: 9d e8 ldi r25, 0x8D ; 141 21f54: 0e 94 cb 89 call 0x11396 ; 0x11396 lcd_commands_step = 4; 21f58: 84 e0 ldi r24, 0x04 ; 4 break; case 4: st_synchronize(); lcd_commands_step = 3; 21f5a: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 21f5e: f9 cd rjmp .-1038 ; 0x21b52 if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) { case 0: lcd_commands_step = 5; 21f60: 90 93 f7 03 sts 0x03F7, r25 ; 0x8003f7 21f64: ef cf rjmp .-34 ; 0x21f44 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); lcd_commands_step = 4; break; case 4: st_synchronize(); 21f66: 0f 94 27 58 call 0x2b04e ; 0x2b04e lcd_commands_step = 3; 21f6a: 83 e0 ldi r24, 0x03 ; 3 21f6c: f6 cf rjmp .-20 ; 0x21f5a SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); } void thermal_model_set_warn_beep(bool enabled) { thermal_model::warn_beep = enabled; 21f6e: 10 92 3d 02 sts 0x023D, r1 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.468> break; case 3: thermal_model_set_warn_beep(false); enquecommand_P(PSTR("M310 A F1")); 21f72: 61 e0 ldi r22, 0x01 ; 1 21f74: 8e ec ldi r24, 0xCE ; 206 21f76: 9d e8 ldi r25, 0x8D ; 141 21f78: 0e 94 cb 89 call 0x11396 ; 0x11396 lcd_commands_step = 2; 21f7c: 82 e0 ldi r24, 0x02 ; 2 21f7e: ed cf rjmp .-38 ; 0x21f5a break; case 2: if (thermal_model_autotune_result()) 21f80: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.555> 21f84: 81 11 cpse r24, r1 21f86: 05 c0 rjmp .+10 ; 0x21f92 enquecommand_P(MSG_M500); 21f88: 61 e0 ldi r22, 0x01 ; 1 21f8a: 8b ec ldi r24, 0xCB ; 203 21f8c: 9c e6 ldi r25, 0x6C ; 108 21f8e: 0e 94 cb 89 call 0x11396 ; 0x11396 lcd_commands_step = 1; 21f92: 81 e0 ldi r24, 0x01 ; 1 21f94: e2 cf rjmp .-60 ; 0x21f5a break; case 1: lcd_commands_step = 0; 21f96: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 lcd_commands_type = LcdCommands::Idle; 21f9a: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 21f9e: 92 e0 ldi r25, 0x02 ; 2 21fa0: 90 93 67 0e sts 0x0E67, r25 ; 0x800e67 <_ZL13printer_state.lto_priv.395> 21fa4: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.468> SetPrinterState(PrinterState::Idle); thermal_model_set_warn_beep(true); bool res = thermal_model_autotune_result(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 21fa8: 8f e5 ldi r24, 0x5F ; 95 21faa: 9f e0 ldi r25, 0x0F ; 15 21fac: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 21fb0: 88 23 and r24, r24 21fb2: 69 f0 breq .+26 ; 0x21fce // resume the wizard lcd_wizard(res ? WizState::Restore : WizState::Failed); 21fb4: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.555> 21fb8: 81 11 cpse r24, r1 21fba: 04 c0 rjmp .+8 ; 0x21fc4 21fbc: 81 e0 ldi r24, 0x01 ; 1 21fbe: 0f 94 dc 64 call 0x2c9b8 ; 0x2c9b8 21fc2: c7 cd rjmp .-1138 ; 0x21b52 21fc4: 8e e0 ldi r24, 0x0E ; 14 21fc6: fb cf rjmp .-10 ; 0x21fbe #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 21fc8: 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; 21fca: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 menu_depth = 3; break; } } } } 21fce: 0f 90 pop r0 21fd0: 0f 90 pop r0 21fd2: 0f 90 pop r0 21fd4: 0f 90 pop r0 21fd6: 0f 90 pop r0 21fd8: df 91 pop r29 21fda: cf 91 pop r28 21fdc: 1f 91 pop r17 21fde: 0f 91 pop r16 21fe0: ff 90 pop r15 21fe2: ef 90 pop r14 21fe4: df 90 pop r13 21fe6: cf 90 pop r12 21fe8: bf 90 pop r11 21fea: af 90 pop r10 21fec: 9f 90 pop r9 21fee: 8f 90 pop r8 21ff0: 7f 90 pop r7 21ff2: 6f 90 pop r6 21ff4: 5f 90 pop r5 21ff6: 4f 90 pop r4 21ff8: 3f 90 pop r3 21ffa: 2f 90 pop r2 21ffc: 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")); 21ffe: 61 e0 ldi r22, 0x01 ; 1 22000: 84 eb ldi r24, 0xB4 ; 180 22002: 9d e8 ldi r25, 0x8D ; 141 22004: 0e 94 cb 89 call 0x11396 ; 0x11396 if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 22008: 89 e9 ldi r24, 0x99 ; 153 2200a: 90 e4 ldi r25, 0x40 ; 64 2200c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 22010: 41 e0 ldi r20, 0x01 ; 1 22012: 60 e0 ldi r22, 0x00 ; 0 22014: 0f 94 b3 64 call 0x2c966 ; 0x2c966 22018: 81 11 cpse r24, r1 2201a: d9 cf rjmp .-78 ; 0x21fce setTargetHotend(0); #ifdef THERMAL_MODEL thermal_model_set_enabled(was_enabled); #endif //THERMAL_MODEL #else fanSpeed = 0; //turn off fan 2201c: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 1; 22020: 81 e0 ldi r24, 0x01 ; 1 22022: d3 cf rjmp .-90 ; 0x21fca } break; case 1: lcd_commands_step = 0; 22024: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 lcd_commands_type = LcdCommands::Idle; 22028: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 2202c: 82 e0 ldi r24, 0x02 ; 2 2202e: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 22032: 20 e0 ldi r18, 0x00 ; 0 22034: 41 e0 ldi r20, 0x01 ; 1 22036: 62 e0 ldi r22, 0x02 ; 2 22038: 70 e0 ldi r23, 0x00 ; 0 2203a: 84 ef ldi r24, 0xF4 ; 244 2203c: 99 e3 ldi r25, 0x39 ; 57 2203e: 0f 94 04 cf call 0x39e08 ; 0x39e08 menu_depth = 3; 22042: 83 e0 ldi r24, 0x03 ; 3 22044: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 22048: c2 cf rjmp .-124 ; 0x21fce 0002204a : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 2204a: 0f 93 push r16 2204c: 1f 93 push r17 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 2204e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 22052: 80 95 com r24 22054: 81 70 andi r24, 0x01 ; 1 22056: 90 91 0e 04 lds r25, 0x040E ; 0x80040e 2205a: 89 17 cp r24, r25 2205c: a1 f1 breq .+104 ; 0x220c6 { if(menu_menu == lcd_sdcard_menu) { 2205e: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 22062: 90 91 6a 0e lds r25, 0x0E6A ; 0x800e6a 22066: 8e 5d subi r24, 0xDE ; 222 22068: 99 43 sbci r25, 0x39 ; 57 2206a: 11 f4 brne .+4 ; 0x22070 // 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(); 2206c: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 } lcd_draw_update = 2; 22070: 82 e0 ldi r24, 0x02 ; 2 22072: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_oldcardstatus = IS_SD_INSERTED; 22076: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2207a: 80 95 com r24 2207c: 81 70 andi r24, 0x01 ; 1 2207e: 80 93 0e 04 sts 0x040E, r24 ; 0x80040e lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 22082: 0e 94 c1 70 call 0xe182 ; 0xe182 backlight_wake(); 22086: 80 e0 ldi r24, 0x00 ; 0 22088: 0e 94 18 8c call 0x11830 ; 0x11830 if (lcd_oldcardstatus) 2208c: 80 91 0e 04 lds r24, 0x040E ; 0x80040e 22090: 88 23 and r24, r24 22092: 09 f4 brne .+2 ; 0x22096 22094: 71 c0 rjmp .+226 ; 0x22178 { if (!card.mounted) 22096: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 2209a: 81 11 cpse r24, r1 2209c: 05 c0 rjmp .+10 ; 0x220a8 { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 2209e: 0f 94 3f 80 call 0x3007e ; 0x3007e card.presort_flag = true; //force sorting of the SD menu 220a2: 81 e0 ldi r24, 0x01 ; 1 220a4: 80 93 bd 14 sts 0x14BD, r24 ; 0x8014bd } LCD_MESSAGERPGM(MSG_WELCOME); 220a8: 8e e0 ldi r24, 0x0E ; 14 220aa: 91 e7 ldi r25, 0x71 ; 113 220ac: 0f 94 0c 0b call 0x21618 ; 0x21618 bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 220b0: 10 92 dd 03 sts 0x03DD, r1 ; 0x8003dd menu_submenu(lcd_sdcard_menu, true); 220b4: 61 e0 ldi r22, 0x01 ; 1 220b6: 8e ed ldi r24, 0xDE ; 222 220b8: 99 e3 ldi r25, 0x39 ; 57 220ba: 0f 94 47 d0 call 0x3a08e ; 0x3a08e lcd_timeoutToStatus.start(); 220be: 88 ed ldi r24, 0xD8 ; 216 220c0: 93 e0 ldi r25, 0x03 ; 3 220c2: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 220c6: 0f 94 86 3e call 0x27d0c ; 0x27d0c 220ca: 00 91 d4 03 lds r16, 0x03D4 ; 0x8003d4 220ce: 10 91 d5 03 lds r17, 0x03D5 ; 0x8003d5 220d2: 20 91 d6 03 lds r18, 0x03D6 ; 0x8003d6 220d6: 30 91 d7 03 lds r19, 0x03D7 ; 0x8003d7 220da: 06 17 cp r16, r22 220dc: 17 07 cpc r17, r23 220de: 28 07 cpc r18, r24 220e0: 39 07 cpc r19, r25 220e2: e8 f5 brcc .+122 ; 0x2215e { if (lcd_draw_update) { 220e4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 220e8: 88 23 and r24, r24 220ea: 31 f0 breq .+12 ; 0x220f8 lcd_timeoutToStatus.start(); 220ec: 88 ed ldi r24, 0xD8 ; 216 220ee: 93 e0 ldi r25, 0x03 ; 3 220f0: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> lcd_frame_start(); 220f4: 0e 94 c9 6f call 0xdf92 ; 0xdf92 } (*menu_menu)(); 220f8: e0 91 69 0e lds r30, 0x0E69 ; 0x800e69 220fc: f0 91 6a 0e lds r31, 0x0E6A ; 0x800e6a 22100: 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)))); 22102: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 22106: 90 91 6a 0e lds r25, 0x0E6A ; 0x800e6a 2210a: 88 5a subi r24, 0xA8 ; 168 2210c: 9a 43 sbci r25, 0x3A ; 58 2210e: 09 f4 brne .+2 ; 0x22112 22110: 46 c0 rjmp .+140 ; 0x2219e } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 22112: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 22116: 90 91 6a 0e lds r25, 0x0E6A ; 0x800e6a && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 2211a: 2a e3 ldi r18, 0x3A ; 58 2211c: 84 36 cpi r24, 0x64 ; 100 2211e: 92 07 cpc r25, r18 22120: 09 f0 breq .+2 ; 0x22124 22122: 5e c0 rjmp .+188 ; 0x221e0 } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 22124: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22128: 82 30 cpi r24, 0x02 ; 2 2212a: 21 f4 brne .+8 ; 0x22134 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 2212c: 0e 94 c1 70 call 0xe182 ; 0xe182 lcd_status_message_idx = 0; // Re-draw message from beginning 22130: 10 92 39 05 sts 0x0539, r1 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.462> lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); if (lcd_draw_update) lcd_draw_update--; 22134: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22138: 88 23 and r24, r24 2213a: 19 f0 breq .+6 ; 0x22142 2213c: 81 50 subi r24, 0x01 ; 1 2213e: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 22142: 0f 94 86 3e call 0x27d0c ; 0x27d0c 22146: 6c 59 subi r22, 0x9C ; 156 22148: 7f 4f sbci r23, 0xFF ; 255 2214a: 8f 4f sbci r24, 0xFF ; 255 2214c: 9f 4f sbci r25, 0xFF ; 255 2214e: 60 93 d4 03 sts 0x03D4, r22 ; 0x8003d4 22152: 70 93 d5 03 sts 0x03D5, r23 ; 0x8003d5 22156: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 2215a: 90 93 d7 03 sts 0x03D7, r25 ; 0x8003d7 } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 2215e: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 22162: 84 30 cpi r24, 0x04 ; 4 22164: 09 f0 breq .+2 ; 0x22168 22166: 53 c0 rjmp .+166 ; 0x2220e 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) { 22168: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 2216c: 81 11 cpse r24, r1 2216e: 4f c0 rjmp .+158 ; 0x2220e 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(); } 22170: 1f 91 pop r17 22172: 0f 91 pop r16 22174: 0d 94 1d 0b jmp 0x2163a ; 0x2163a presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 22178: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e mounted = false; 2217c: 10 92 6f 14 sts 0x146F, r1 ; 0x80146f SERIAL_ECHO_START; 22180: 82 ef ldi r24, 0xF2 ; 242 22182: 9a ea ldi r25, 0xAA ; 170 22184: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 22188: 8d e6 ldi r24, 0x6D ; 109 2218a: 9c e6 ldi r25, 0x6C ; 108 2218c: 0e 94 86 7b call 0xf70c ; 0xf70c lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 22190: 8c e6 ldi r24, 0x6C ; 108 22192: 90 e4 ldi r25, 0x40 ; 64 22194: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 22198: 0f 94 0c 0b call 0x21618 ; 0x21618 2219c: 94 cf rjmp .-216 ; 0x220c6 // 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)))); 2219e: 0e 94 d4 68 call 0xd1a8 ; 0xd1a8 221a2: 81 11 cpse r24, r1 221a4: 0e c0 rjmp .+28 ; 0x221c2 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) 221a6: e0 91 69 0e lds r30, 0x0E69 ; 0x800e69 221aa: f0 91 6a 0e lds r31, 0x0E6A ; 0x800e6a 221ae: 30 97 sbiw r30, 0x00 ; 0 221b0: 39 f5 brne .+78 ; 0x22200 { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 221b2: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_return_to_status(); 221b6: 0f 94 4e 26 call 0x24c9c ; 0x24c9c lcd_draw_update = 2; 221ba: 82 e0 ldi r24, 0x02 ; 2 221bc: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 221c0: b1 cf rjmp .-158 ; 0x22124 // 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)))); 221c2: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 221c6: 81 11 cpse r24, r1 221c8: a4 cf rjmp .-184 ; 0x22112 221ca: 40 e9 ldi r20, 0x90 ; 144 221cc: 5f e5 ldi r21, 0x5F ; 95 221ce: 61 e0 ldi r22, 0x01 ; 1 221d0: 70 e0 ldi r23, 0x00 ; 0 221d2: 88 ed ldi r24, 0xD8 ; 216 221d4: 93 e0 ldi r25, 0x03 ; 3 221d6: 0f 94 6a 3f call 0x27ed4 ; 0x27ed4 ::expired(unsigned long)> 221da: 81 11 cpse r24, r1 221dc: e4 cf rjmp .-56 ; 0x221a6 221de: 99 cf rjmp .-206 ; 0x22112 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 221e0: 88 5a subi r24, 0xA8 ; 168 221e2: 9a 43 sbci r25, 0x3A ; 58 221e4: 09 f4 brne .+2 ; 0x221e8 221e6: 9e cf rjmp .-196 ; 0x22124 && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 221e8: 40 e3 ldi r20, 0x30 ; 48 221ea: 55 e7 ldi r21, 0x75 ; 117 221ec: 60 e0 ldi r22, 0x00 ; 0 221ee: 70 e0 ldi r23, 0x00 ; 0 221f0: 88 ed ldi r24, 0xD8 ; 216 221f2: 93 e0 ldi r25, 0x03 ; 3 221f4: 0f 94 6a 3f call 0x27ed4 ; 0x27ed4 ::expired(unsigned long)> 221f8: 88 23 and r24, r24 221fa: 09 f4 brne .+2 ; 0x221fe 221fc: 93 cf rjmp .-218 ; 0x22124 221fe: d3 cf rjmp .-90 ; 0x221a6 // 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; 22200: 81 e0 ldi r24, 0x01 ; 1 22202: 80 93 d3 03 sts 0x03D3, r24 ; 0x8003d3 (*menu_menu)(); 22206: 19 95 eicall menu_leaving = 0; 22208: 10 92 d3 03 sts 0x03D3, r1 ; 0x8003d3 2220c: d2 cf rjmp .-92 ; 0x221b2 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(); } 2220e: 1f 91 pop r17 22210: 0f 91 pop r16 22212: 08 95 ret 00022214 : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 22214: 2f 92 push r2 22216: 3f 92 push r3 22218: 4f 92 push r4 2221a: 5f 92 push r5 2221c: 6f 92 push r6 2221e: 7f 92 push r7 22220: 8f 92 push r8 22222: 9f 92 push r9 22224: af 92 push r10 22226: bf 92 push r11 22228: cf 92 push r12 2222a: df 92 push r13 2222c: ef 92 push r14 2222e: ff 92 push r15 22230: 0f 93 push r16 22232: 1f 93 push r17 22234: cf 93 push r28 22236: df 93 push r29 22238: cd b7 in r28, 0x3d ; 61 2223a: de b7 in r29, 0x3e ; 62 2223c: 2d 97 sbiw r28, 0x0d ; 13 2223e: 0f b6 in r0, 0x3f ; 63 22240: f8 94 cli 22242: de bf out 0x3e, r29 ; 62 22244: 0f be out 0x3f, r0 ; 63 22246: 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) 22248: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 2224c: 81 30 cpi r24, 0x01 ; 1 2224e: 31 f1 breq .+76 ; 0x2229c 22250: 30 f0 brcs .+12 ; 0x2225e 22252: 82 30 cpi r24, 0x02 ; 2 22254: 09 f4 brne .+2 ; 0x22258 22256: 7d c2 rjmp .+1274 ; 0x22752 { _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. 22258: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 2225c: fe c0 rjmp .+508 ; 0x2245a switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 2225e: 80 91 bd 14 lds r24, 0x14BD ; 0x8014bd 22262: 88 23 and r24, r24 22264: 49 f0 breq .+18 ; 0x22278 { card.presort_flag = false; 22266: 10 92 bd 14 sts 0x14BD, r1 ; 0x8014bd lcd_update_enabled = false; 2226a: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e card.presort(); 2226e: 0f 94 0f 7c call 0x2f81e ; 0x2f81e lcd_update_enabled = true; 22272: 81 e0 ldi r24, 0x01 ; 1 22274: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } _md->fileCnt = card.getnrfilenames(); 22278: 0f 94 bf 7a call 0x2f57e ; 0x2f57e 2227c: 90 93 b1 03 sts 0x03B1, r25 ; 0x8003b1 22280: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 22284: 89 e0 ldi r24, 0x09 ; 9 22286: 9f e0 ldi r25, 0x0F ; 15 22288: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2228c: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 _md->menuState = _standard; 22290: 81 e0 ldi r24, 0x01 ; 1 22292: 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. 22296: 8f ef ldi r24, 0xFF ; 255 22298: 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. 2229c: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 222a0: 81 11 cpse r24, r1 222a2: 07 c0 rjmp .+14 ; 0x222b2 { _md->lcd_scrollTimer.start(); 222a4: 84 eb ldi r24, 0xB4 ; 180 222a6: 93 e0 ldi r25, 0x03 ; 3 222a8: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> lcd_draw_update = 1; 222ac: 81 e0 ldi r24, 0x01 ; 1 222ae: 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. 222b2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 222b6: 81 11 cpse r24, r1 222b8: 21 c0 rjmp .+66 ; 0x222fc 222ba: 64 ef ldi r22, 0xF4 ; 244 222bc: 71 e0 ldi r23, 0x01 ; 1 222be: 84 eb ldi r24, 0xB4 ; 180 222c0: 93 e0 ldi r25, 0x03 ; 3 222c2: 0f 94 b8 3e call 0x27d70 ; 0x27d70 ::expired(unsigned short)> 222c6: 88 23 and r24, r24 222c8: a1 f0 breq .+40 ; 0x222f2 222ca: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 222ce: 8f 3f cpi r24, 0xFF ; 255 222d0: 81 f0 breq .+32 ; 0x222f2 { _md->menuState = _scrolling; 222d2: 82 e0 ldi r24, 0x02 ; 2 222d4: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 _md->offset = 0; 222d8: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->scrollPointer = NULL; 222dc: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad 222e0: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac _md->lcd_scrollTimer.start(); 222e4: 84 eb ldi r24, 0xB4 ; 180 222e6: 93 e0 ldi r25, 0x03 ; 3 222e8: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 222ec: 81 e0 ldi r24, 0x01 ; 1 222ee: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update == 0 && !lcd_clicked()) 222f2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 222f6: 88 23 and r24, r24 222f8: 09 f4 brne .+2 ; 0x222fc 222fa: ab c0 rjmp .+342 ; 0x22452 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. 222fc: 8f ef ldi r24, 0xFF ; 255 222fe: 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(); 22302: 84 eb ldi r24, 0xB4 ; 180 22304: 93 e0 ldi r25, 0x03 ; 3 22306: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> MENU_BEGIN(); 2230a: 0f 94 da ce call 0x39db4 ; 0x39db4 2230e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 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); 22312: ce 01 movw r24, r28 22314: 01 96 adiw r24, 0x01 ; 1 22316: 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); 22318: f1 e9 ldi r31, 0x91 ; 145 2231a: 2f 2e mov r2, r31 2231c: f1 e7 ldi r31, 0x71 ; 113 2231e: 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(); 22320: 80 91 15 05 lds r24, 0x0515 ; 0x800515 22324: 84 30 cpi r24, 0x04 ; 4 22326: 08 f0 brcs .+2 ; 0x2232a 22328: 98 c0 rjmp .+304 ; 0x2245a 2232a: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(bMain?MSG_MAIN:MSG_BACK)); // i.e. default menu-item / menu-item after card insertion 2232e: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 22332: 88 23 and r24, r24 22334: 09 f4 brne .+2 ; 0x22338 22336: aa c0 rjmp .+340 ; 0x2248c 22338: 8a e1 ldi r24, 0x1A ; 26 2233a: 9e e3 ldi r25, 0x3E ; 62 2233c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 22340: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a 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;}; 22344: 60 e7 ldi r22, 0x70 ; 112 22346: 74 e1 ldi r23, 0x14 ; 20 22348: 89 e1 ldi r24, 0x19 ; 25 2234a: 95 e1 ldi r25, 0x15 ; 21 2234c: 0f 94 61 a4 call 0x348c2 ; 0x348c2 card.getWorkDirName(); if (card.filename[0] == '/') 22350: 80 91 70 14 lds r24, 0x1470 ; 0x801470 22354: 8f 32 cpi r24, 0x2F ; 47 22356: 09 f0 breq .+2 ; 0x2235a 22358: 9c c0 rjmp .+312 ; 0x22492 { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 2235a: 80 91 df 16 lds r24, 0x16DF ; 0x8016df 2235e: 88 23 and r24, r24 22360: 41 f0 breq .+16 ; 0x22372 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 22362: 8f e0 ldi r24, 0x0F ; 15 22364: 9e e3 ldi r25, 0x3E ; 62 22366: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2236a: 69 e8 ldi r22, 0x89 ; 137 2236c: 76 ed ldi r23, 0xD6 ; 214 #endif } else MENU_ITEM_FUNCTION_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir); //Show the updir button if in a subdir. 2236e: 0f 94 57 ce call 0x39cae ; 0x39cae for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 22372: c0 90 b0 03 lds r12, 0x03B0 ; 0x8003b0 22376: 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; 2237a: 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. 2237c: 91 e0 ldi r25, 0x01 ; 1 2237e: c9 1a sub r12, r25 22380: d1 08 sbc r13, r1 22382: 08 f4 brcc .+2 ; 0x22386 22384: d9 c1 rjmp .+946 ; 0x22738 { if (menu_item == menu_line) //If the file is on the screen. 22386: 80 91 18 05 lds r24, 0x0518 ; 0x800518 2238a: 90 91 17 05 lds r25, 0x0517 ; 0x800517 2238e: 89 13 cpse r24, r25 22390: cf c1 rjmp .+926 ; 0x22730 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 22392: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 22396: c6 01 movw r24, r12 22398: 0f 94 7d 84 call 0x308fa ; 0x308fa #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 2239c: 80 91 18 05 lds r24, 0x0518 ; 0x800518 223a0: 90 e0 ldi r25, 0x00 ; 0 223a2: 20 91 37 05 lds r18, 0x0537 ; 0x800537 223a6: 30 91 38 05 lds r19, 0x0538 ; 0x800538 223aa: 10 91 ba 14 lds r17, 0x14BA ; 0x8014ba 223ae: 82 17 cp r24, r18 223b0: 93 07 cpc r25, r19 223b2: 51 f4 brne .+20 ; 0x223c8 { _md->selectedFileID = i; 223b4: d0 92 af 03 sts 0x03AF, r13 ; 0x8003af 223b8: c0 92 ae 03 sts 0x03AE, r12 ; 0x8003ae _md->isDir = card.filenameIsDir; 223bc: 10 93 ab 03 sts 0x03AB, r17 ; 0x8003ab _md->row = menu_row; 223c0: 40 91 15 05 lds r20, 0x0515 ; 0x800515 223c4: 40 93 b2 03 sts 0x03B2, r20 ; 0x8003b2 223c8: 40 91 6d 02 lds r20, 0x026D ; 0x80026d } if (card.filenameIsDir) 223cc: 11 23 and r17, r17 223ce: 09 f4 brne .+2 ; 0x223d2 223d0: 65 c0 rjmp .+202 ; 0x2249c #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) 223d2: 44 23 and r20, r20 223d4: e9 f0 breq .+58 ; 0x22410 { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 223d6: 40 91 85 14 lds r20, 0x1485 ; 0x801485 223da: e0 e7 ldi r30, 0x70 ; 112 223dc: ae 2e mov r10, r30 223de: e4 e1 ldi r30, 0x14 ; 20 223e0: be 2e mov r11, r30 223e2: 44 23 and r20, r20 223e4: 21 f0 breq .+8 ; 0x223ee 223e6: 75 e8 ldi r23, 0x85 ; 133 223e8: a7 2e mov r10, r23 223ea: 74 e1 ldi r23, 0x14 ; 20 223ec: b7 2e mov r11, r23 223ee: 60 91 15 05 lds r22, 0x0515 ; 0x800515 } 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)?'>':' '); 223f2: 4e e3 ldi r20, 0x3E ; 62 223f4: 82 17 cp r24, r18 223f6: 93 07 cpc r25, r19 223f8: 09 f0 breq .+2 ; 0x223fc 223fa: 40 e2 ldi r20, 0x20 ; 32 223fc: 80 e0 ldi r24, 0x00 ; 0 223fe: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_putc(LCD_STR_FOLDER[0]); 22402: 85 e8 ldi r24, 0x85 ; 133 22404: 0e 94 04 70 call 0xe008 ; 0xe008 lcd_print_pad(longFilename, len); 22408: 62 e1 ldi r22, 0x12 ; 18 2240a: c5 01 movw r24, r10 2240c: 0e 94 04 72 call 0xe408 ; 0xe408 22410: 80 91 18 05 lds r24, 0x0518 ; 0x800518 { 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)) 22414: 90 91 16 05 lds r25, 0x0516 ; 0x800516 22418: 99 23 and r25, r25 2241a: 09 f4 brne .+2 ; 0x2241e 2241c: 89 c1 rjmp .+786 ; 0x22730 2241e: 20 91 37 05 lds r18, 0x0537 ; 0x800537 22422: 30 91 38 05 lds r19, 0x0538 ; 0x800538 22426: 82 17 cp r24, r18 22428: 13 06 cpc r1, r19 2242a: 09 f0 breq .+2 ; 0x2242e 2242c: 81 c1 rjmp .+770 ; 0x22730 { lcd_update_enabled = false; 2242e: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 22432: 61 e0 ldi r22, 0x01 ; 1 22434: 80 e7 ldi r24, 0x70 ; 112 22436: 94 e1 ldi r25, 0x14 ; 20 22438: 0f 94 91 7d call 0x2fb22 ; 0x2fb22 lcd_encoder = 0; 2243c: 10 92 38 05 sts 0x0538, r1 ; 0x800538 22440: 10 92 37 05 sts 0x0537, r1 ; 0x800537 menu_data_reset(); //Forces reloading of cached variables. 22444: 0f 94 fc ce call 0x39df8 ; 0x39df8 } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 22448: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e menu_item_ret(); 2244c: 0f 94 c0 cd call 0x39b80 ; 0x39b80 22450: 95 cf rjmp .-214 ; 0x2237c _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()) 22452: 0e 94 32 72 call 0xe464 ; 0xe464 22456: 81 11 cpse r24, r1 22458: 51 cf rjmp .-350 ; 0x222fc _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 2245a: 2d 96 adiw r28, 0x0d ; 13 2245c: 0f b6 in r0, 0x3f ; 63 2245e: f8 94 cli 22460: de bf out 0x3e, r29 ; 62 22462: 0f be out 0x3f, r0 ; 63 22464: cd bf out 0x3d, r28 ; 61 22466: df 91 pop r29 22468: cf 91 pop r28 2246a: 1f 91 pop r17 2246c: 0f 91 pop r16 2246e: ff 90 pop r15 22470: ef 90 pop r14 22472: df 90 pop r13 22474: cf 90 pop r12 22476: bf 90 pop r11 22478: af 90 pop r10 2247a: 9f 90 pop r9 2247c: 8f 90 pop r8 2247e: 7f 90 pop r7 22480: 6f 90 pop r6 22482: 5f 90 pop r5 22484: 4f 90 pop r4 22486: 3f 90 pop r3 22488: 2f 90 pop r2 2248a: 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 2248c: 8b e7 ldi r24, 0x7B ; 123 2248e: 90 e4 ldi r25, 0x40 ; 64 22490: 55 cf rjmp .-342 ; 0x2233c 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. 22492: 63 e9 ldi r22, 0x93 ; 147 22494: 76 ed ldi r23, 0xD6 ; 214 22496: 82 e1 ldi r24, 0x12 ; 18 22498: 9c e8 ldi r25, 0x8C ; 140 2249a: 69 cf rjmp .-302 ; 0x2236e menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 2249c: 44 23 and r20, r20 2249e: d1 f0 breq .+52 ; 0x224d4 { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 224a0: 40 91 85 14 lds r20, 0x1485 ; 0x801485 224a4: 60 e7 ldi r22, 0x70 ; 112 224a6: a6 2e mov r10, r22 224a8: 64 e1 ldi r22, 0x14 ; 20 224aa: b6 2e mov r11, r22 224ac: 44 23 and r20, r20 224ae: 21 f0 breq .+8 ; 0x224b8 224b0: 55 e8 ldi r21, 0x85 ; 133 224b2: a5 2e mov r10, r21 224b4: 54 e1 ldi r21, 0x14 ; 20 224b6: b5 2e mov r11, r21 224b8: 60 91 15 05 lds r22, 0x0515 ; 0x800515 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)?'>':' '); 224bc: 4e e3 ldi r20, 0x3E ; 62 224be: 82 17 cp r24, r18 224c0: 93 07 cpc r25, r19 224c2: 09 f0 breq .+2 ; 0x224c6 224c4: 40 e2 ldi r20, 0x20 ; 32 224c6: 80 e0 ldi r24, 0x00 ; 0 224c8: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_print_pad(longFilename, len); 224cc: 63 e1 ldi r22, 0x13 ; 19 224ce: c5 01 movw r24, r10 224d0: 0e 94 04 72 call 0xe408 ; 0xe408 224d4: 80 91 18 05 lds r24, 0x0518 ; 0x800518 { 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)) 224d8: 90 91 16 05 lds r25, 0x0516 ; 0x800516 224dc: 99 23 and r25, r25 224de: 09 f4 brne .+2 ; 0x224e2 224e0: 27 c1 rjmp .+590 ; 0x22730 224e2: 20 91 37 05 lds r18, 0x0537 ; 0x800537 224e6: 30 91 38 05 lds r19, 0x0538 ; 0x800538 224ea: 82 17 cp r24, r18 224ec: 13 06 cpc r1, r19 224ee: 09 f0 breq .+2 ; 0x224f2 224f0: 1f c1 rjmp .+574 ; 0x22730 { lcd_update_enabled = false; 224f2: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 224f6: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 224fa: 81 11 cpse r24, r1 224fc: a5 cf rjmp .-182 ; 0x22448 // 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); 224fe: 60 e7 ldi r22, 0x70 ; 112 22500: 74 e1 ldi r23, 0x14 ; 20 22502: c7 01 movw r24, r14 22504: 0f 94 c6 e3 call 0x3c78c ; 0x3c78c 22508: 47 01 movw r8, r14 2250a: 45 e9 ldi r20, 0x95 ; 149 2250c: a4 2e mov r10, r20 2250e: 4f e0 ldi r20, 0x0F ; 15 22510: 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] == '.') { 22512: f4 01 movw r30, r8 22514: 61 91 ld r22, Z+ 22516: 4f 01 movw r8, r30 22518: 66 23 and r22, r22 2251a: 19 f0 breq .+6 ; 0x22522 2251c: 6e 32 cpi r22, 0x2E ; 46 2251e: 09 f0 breq .+2 ; 0x22522 22520: 4b c0 rjmp .+150 ; 0x225b8 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 22522: 60 e0 ldi r22, 0x00 ; 0 22524: c5 01 movw r24, r10 22526: 0f 94 7f dd call 0x3bafe ; 0x3bafe 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, '.'); 2252a: 6e e2 ldi r22, 0x2E ; 46 2252c: 70 e0 ldi r23, 0x00 ; 0 2252e: c7 01 movw r24, r14 22530: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 22534: 3c 01 movw r6, r24 if (extension_ptr) { 22536: 89 2b or r24, r25 22538: 19 f0 breq .+6 ; 0x22540 extension_ptr++; // skip the '.' 2253a: 8f ef ldi r24, 0xFF ; 255 2253c: 68 1a sub r6, r24 2253e: 78 0a sbc r7, r24 22540: 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); 22542: 31 e9 ldi r19, 0x91 ; 145 22544: a3 2e mov r10, r19 22546: 3c e0 ldi r19, 0x0C ; 12 22548: 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') { 2254a: 61 14 cp r6, r1 2254c: 71 04 cpc r7, r1 2254e: 21 f0 breq .+8 ; 0x22558 22550: f4 01 movw r30, r8 22552: 60 81 ld r22, Z 22554: 61 11 cpse r22, r1 22556: 01 c0 rjmp .+2 ; 0x2255a 22558: 60 e0 ldi r22, 0x00 ; 0 2255a: c5 01 movw r24, r10 2255c: 0f 94 7f dd call 0x3bafe ; 0x3bafe 22560: ff ef ldi r31, 0xFF ; 255 22562: af 1a sub r10, r31 22564: bf 0a sbc r11, r31 22566: 2f ef ldi r18, 0xFF ; 255 22568: 82 1a sub r8, r18 2256a: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 2256c: 84 e9 ldi r24, 0x94 ; 148 2256e: a8 16 cp r10, r24 22570: 8c e0 ldi r24, 0x0C ; 12 22572: b8 06 cpc r11, r24 22574: 51 f7 brne .-44 ; 0x2254a { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 22576: 60 90 0e 16 lds r6, 0x160E ; 0x80160e 2257a: 66 2d mov r22, r6 2257c: 8a e5 ldi r24, 0x5A ; 90 2257e: 9f e0 ldi r25, 0x0F ; 15 22580: 0f 94 7f dd call 0x3bafe ; 0x3bafe 22584: 8c e6 ldi r24, 0x6C ; 108 22586: 94 e1 ldi r25, 0x14 ; 20 22588: 2a e0 ldi r18, 0x0A ; 10 2258a: a2 2e mov r10, r18 2258c: 2f e0 ldi r18, 0x0F ; 15 2258e: 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++) { 22590: 71 2c mov r7, r1 22592: 4c 01 movw r8, r24 22594: e9 e0 ldi r30, 0x09 ; 9 22596: 8e 0e add r8, r30 22598: 91 1c adc r9, r1 2259a: 76 14 cp r7, r6 2259c: d1 f0 breq .+52 ; 0x225d2 #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); 2259e: 48 e0 ldi r20, 0x08 ; 8 225a0: 50 e0 ldi r21, 0x00 ; 0 225a2: b5 01 movw r22, r10 225a4: 8e 5a subi r24, 0xAE ; 174 225a6: 9f 4f sbci r25, 0xFF ; 255 225a8: 0f 94 6f dd call 0x3bade ; 0x3bade 225ac: 73 94 inc r7 225ae: f8 e0 ldi r31, 0x08 ; 8 225b0: af 0e add r10, r31 225b2: b1 1c adc r11, r1 225b4: c4 01 movw r24, r8 225b6: ed cf rjmp .-38 ; 0x22592 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 225b8: c5 01 movw r24, r10 225ba: 0f 94 7f dd call 0x3bafe ; 0x3bafe 225be: ff ef ldi r31, 0xFF ; 255 225c0: af 1a sub r10, r31 225c2: 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++) { 225c4: 2d e9 ldi r18, 0x9D ; 157 225c6: a2 16 cp r10, r18 225c8: 2f e0 ldi r18, 0x0F ; 15 225ca: b2 06 cpc r11, r18 225cc: 09 f0 breq .+2 ; 0x225d0 225ce: a1 cf rjmp .-190 ; 0x22512 225d0: ac cf rjmp .-168 ; 0x2252a /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 225d2: 61 e0 ldi r22, 0x01 ; 1 225d4: c7 01 movw r24, r14 225d6: 0f 94 c8 7e call 0x2fd90 ; 0x2fd90 } uint32_t CardReader::getFileSize() { return filesize; 225da: 40 90 7b 17 lds r4, 0x177B ; 0x80177b 225de: 50 90 7c 17 lds r5, 0x177C ; 0x80177c 225e2: 60 90 7d 17 lds r6, 0x177D ; 0x80177d 225e6: 70 90 7e 17 lds r7, 0x177E ; 0x80177e bool result = false; const uint32_t filesize = card.getFileSize(); uint32_t startPos = 0; const uint16_t bytesToCheck = min(END_FILE_SECTION, filesize); 225ea: 94 2d mov r25, r4 225ec: 85 2d mov r24, r5 225ee: 21 e0 ldi r18, 0x01 ; 1 225f0: 42 16 cp r4, r18 225f2: 28 e7 ldi r18, 0x78 ; 120 225f4: 52 06 cpc r5, r18 225f6: 61 04 cpc r6, r1 225f8: 71 04 cpc r7, r1 225fa: 10 f0 brcs .+4 ; 0x22600 225fc: 90 e0 ldi r25, 0x00 ; 0 225fe: 88 e7 ldi r24, 0x78 ; 120 22600: a9 2e mov r10, r25 22602: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 22604: 81 e0 ldi r24, 0x01 ; 1 22606: 48 16 cp r4, r24 22608: 88 e7 ldi r24, 0x78 ; 120 2260a: 58 06 cpc r5, r24 2260c: 61 04 cpc r6, r1 2260e: 71 04 cpc r7, r1 22610: 08 f4 brcc .+2 ; 0x22614 22612: 5d c0 rjmp .+186 ; 0x226ce startPos = filesize - END_FILE_SECTION; 22614: 98 e7 ldi r25, 0x78 ; 120 22616: 59 1a sub r5, r25 22618: 61 08 sbc r6, r1 2261a: 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);}; 2261c: 40 92 82 17 sts 0x1782, r4 ; 0x801782 22620: 50 92 83 17 sts 0x1783, r5 ; 0x801783 22624: 60 92 84 17 sts 0x1784, r6 ; 0x801784 22628: 70 92 85 17 sts 0x1785, r7 ; 0x801785 2262c: c3 01 movw r24, r6 2262e: b2 01 movw r22, r4 22630: 0f 94 87 76 call 0x2ed0e ; 0x2ed0e card.setIndex(startPos); } cmdqueue_reset(); 22634: 0e 94 4f 81 call 0x1029e ; 0x1029e cmdqueue_serial_disabled = true; 22638: 00 93 a6 03 sts 0x03A6, r16 ; 0x8003a6 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 2263c: 8b ed ldi r24, 0xDB ; 219 2263e: 9d e3 ldi r25, 0x3D ; 61 22640: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 22644: bc 01 movw r22, r24 22646: c5 01 movw r24, r10 22648: 0f 94 3c cd call 0x39a78 ; 0x39a78 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; } 2264c: 80 91 82 17 lds r24, 0x1782 ; 0x801782 22650: 90 91 83 17 lds r25, 0x1783 ; 0x801783 22654: a0 91 84 17 lds r26, 0x1784 ; 0x801784 22658: b0 91 85 17 lds r27, 0x1785 ; 0x801785 while (!card.eof() && !result) { 2265c: 40 91 7b 17 lds r20, 0x177B ; 0x80177b 22660: 50 91 7c 17 lds r21, 0x177C ; 0x80177c 22664: 60 91 7d 17 lds r22, 0x177D ; 0x80177d 22668: 70 91 7e 17 lds r23, 0x177E ; 0x80177e 2266c: 84 17 cp r24, r20 2266e: 95 07 cpc r25, r21 22670: a6 07 cpc r26, r22 22672: b7 07 cpc r27, r23 22674: 80 f5 brcc .+96 ; 0x226d6 22676: 11 11 cpse r17, r1 22678: 2e c0 rjmp .+92 ; 0x226d6 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); }; 2267a: 20 91 01 17 lds r18, 0x1701 ; 0x801701 2267e: 21 11 cpse r18, r1 22680: 03 c0 rjmp .+6 ; 0x22688 22682: 80 e0 ldi r24, 0x00 ; 0 22684: 90 e0 ldi r25, 0x00 ; 0 22686: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 22688: 84 19 sub r24, r4 2268a: 95 09 sbc r25, r5 2268c: 0f 94 0d cd call 0x39a1a ; 0x39a1a card.sdprinting = true; 22690: 00 93 6e 14 sts 0x146E, r16 ; 0x80146e get_command(); 22694: 0e 94 cb 84 call 0x10996 ; 0x10996 #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 22698: 80 91 81 10 lds r24, 0x1081 ; 0x801081 2269c: 90 91 82 10 lds r25, 0x1082 ; 0x801082 226a0: 89 2b or r24, r25 226a2: a1 f2 breq .-88 ; 0x2264c { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 226a4: 88 eb ldi r24, 0xB8 ; 184 226a6: 9c e6 ldi r25, 0x6C ; 108 226a8: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 226ac: 81 11 cpse r24, r1 226ae: 05 c0 rjmp .+10 ; 0x226ba 226b0: 8d e0 ldi r24, 0x0D ; 13 226b2: 9c e8 ldi r25, 0x8C ; 140 226b4: 0e 94 5b 69 call 0xd2b6 ; 0xd2b6 226b8: 81 11 cpse r24, r1 226ba: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 226bc: 80 91 80 10 lds r24, 0x1080 ; 0x801080 226c0: 81 11 cpse r24, r1 226c2: 02 c0 rjmp .+4 ; 0x226c8 cmdqueue_pop_front(); 226c4: 0e 94 c7 78 call 0xf18e ; 0xf18e cmdbuffer_front_already_processed = false; 226c8: 10 92 80 10 sts 0x1080, r1 ; 0x801080 226cc: e5 cf rjmp .-54 ; 0x22698 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; 226ce: 41 2c mov r4, r1 226d0: 51 2c mov r5, r1 226d2: 32 01 movw r6, r4 226d4: af cf rjmp .-162 ; 0x22634 // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 226d6: 0f 94 2e cd call 0x39a5c ; 0x39a5c cmdqueue_serial_disabled = false; 226da: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 card.printingHasFinished(); 226de: 0f 94 00 80 call 0x30000 ; 0x30000 lcd_setstatuspgm(MSG_WELCOME); 226e2: 8e e0 ldi r24, 0x0E ; 14 226e4: 91 e7 ldi r25, 0x71 ; 113 226e6: 0f 94 0c 0b call 0x21618 ; 0x21618 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)) { 226ea: 11 23 and r17, r17 226ec: 91 f0 breq .+36 ; 0x22712 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); 226ee: ff 92 push r15 226f0: ef 92 push r14 226f2: 3f 92 push r3 226f4: 2f 92 push r2 226f6: 0e 94 61 8a call 0x114c2 ; 0x114c2 enquecommand_P(MSG_M24); 226fa: 61 e0 ldi r22, 0x01 ; 1 226fc: 8d e8 ldi r24, 0x8D ; 141 226fe: 91 e7 ldi r25, 0x71 ; 113 22700: 0e 94 cb 89 call 0x11396 ; 0x11396 22704: 0f 90 pop r0 22706: 0f 90 pop r0 22708: 0f 90 pop r0 2270a: 0f 90 pop r0 } lcd_return_to_status(); 2270c: 0f 94 4e 26 call 0x24c9c ; 0x24c9c 22710: 9b ce rjmp .-714 ; 0x22448 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); 22712: 8b ee ldi r24, 0xEB ; 235 22714: 9d e3 ldi r25, 0x3D ; 61 22716: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2271a: 41 e0 ldi r20, 0x01 ; 1 2271c: 60 e0 ldi r22, 0x00 ; 0 2271e: 0f 94 b3 64 call 0x2c966 ; 0x2c966 22722: 18 2f mov r17, r24 lcd_update_enable(true); 22724: 81 e0 ldi r24, 0x01 ; 1 22726: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 } if (result) { 2272a: 11 23 and r17, r17 2272c: 01 f3 breq .-64 ; 0x226ee 2272e: ee cf rjmp .-36 ; 0x2270c lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 22730: 8f 5f subi r24, 0xFF ; 255 22732: 80 93 18 05 sts 0x0518, r24 ; 0x800518 22736: 22 ce rjmp .-956 ; 0x2237c else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 22738: 0f 94 ae ce call 0x39d5c ; 0x39d5c _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(); 2273c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 22740: 8f 5f subi r24, 0xFF ; 255 22742: 80 93 15 05 sts 0x0515, r24 ; 0x800515 22746: 80 91 17 05 lds r24, 0x0517 ; 0x800517 2274a: 8f 5f subi r24, 0xFF ; 255 2274c: 80 93 17 05 sts 0x0517, r24 ; 0x800517 22750: e7 cd rjmp .-1074 ; 0x22320 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. 22752: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 22756: 11 e0 ldi r17, 0x01 ; 1 22758: 81 11 cpse r24, r1 2275a: 05 c0 rjmp .+10 ; 0x22766 2275c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22760: 81 11 cpse r24, r1 22762: 01 c0 rjmp .+2 ; 0x22766 22764: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 22766: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 2276a: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 2276e: 89 2b or r24, r25 22770: 91 f4 brne .+36 ; 0x22796 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 22772: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 22776: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 2277a: 90 91 af 03 lds r25, 0x03AF ; 0x8003af 2277e: 0f 94 7d 84 call 0x308fa ; 0x308fa #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 22782: 80 91 85 14 lds r24, 0x1485 ; 0x801485 22786: 81 11 cpse r24, r1 22788: 46 c0 rjmp .+140 ; 0x22816 2278a: 80 e7 ldi r24, 0x70 ; 112 2278c: 94 e1 ldi r25, 0x14 ; 20 2278e: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 22792: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac } if (rewindFlag) 22796: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 22798: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 2279c: 6c e2 ldi r22, 0x2C ; 44 2279e: 71 e0 ldi r23, 0x01 ; 1 227a0: 84 eb ldi r24, 0xB4 ; 180 227a2: 93 e0 ldi r25, 0x03 ; 3 227a4: 0f 94 b8 3e call 0x27d70 ; 0x27d70 ::expired(unsigned short)> 227a8: 81 11 cpse r24, r1 227aa: 03 c0 rjmp .+6 ; 0x227b2 227ac: 11 23 and r17, r17 227ae: 09 f4 brne .+2 ; 0x227b2 227b0: 54 ce rjmp .-856 ; 0x2245a { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 227b2: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 227b6: 02 e1 ldi r16, 0x12 ; 18 227b8: 81 11 cpse r24, r1 227ba: 01 c0 rjmp .+2 ; 0x227be 227bc: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 227be: 4e e3 ldi r20, 0x3E ; 62 227c0: 60 91 b2 03 lds r22, 0x03B2 ; 0x8003b2 227c4: 80 e0 ldi r24, 0x00 ; 0 227c6: 0e 94 35 70 call 0xe06a ; 0xe06a if (_md->isDir) 227ca: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 227ce: 88 23 and r24, r24 227d0: 19 f0 breq .+6 ; 0x227d8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 227d2: 85 e8 ldi r24, 0x85 ; 133 227d4: 0e 94 c4 70 call 0xe188 ; 0xe188 lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 227d8: 20 91 aa 03 lds r18, 0x03AA ; 0x8003aa 227dc: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 227e0: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 227e4: 60 2f mov r22, r16 227e6: 82 0f add r24, r18 227e8: 91 1d adc r25, r1 227ea: 0e 94 04 72 call 0xe408 ; 0xe408 227ee: 81 11 cpse r24, r1 227f0: 15 c0 rjmp .+42 ; 0x2281c { _md->lcd_scrollTimer.start(); 227f2: 84 eb ldi r24, 0xB4 ; 180 227f4: 93 e0 ldi r25, 0x03 ; 3 227f6: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> _md->offset++; 227fa: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 227fe: 8f 5f subi r24, 0xFF ; 255 22800: 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. 22804: 11 23 and r17, r17 22806: 09 f4 brne .+2 ; 0x2280a 22808: 28 ce rjmp .-944 ; 0x2245a 2280a: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 2280e: 81 e0 ldi r24, 0x01 ; 1 22810: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 22814: 22 ce rjmp .-956 ; 0x2245a #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; 22816: 85 e8 ldi r24, 0x85 ; 133 22818: 94 e1 ldi r25, 0x14 ; 20 2281a: b9 cf rjmp .-142 ; 0x2278e 2281c: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 22820: f1 cf rjmp .-30 ; 0x22804 00022822 : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 22822: 61 e0 ldi r22, 0x01 ; 1 22824: 83 e2 ldi r24, 0x23 ; 35 22826: 91 e7 ldi r25, 0x71 ; 113 22828: 0e 94 cb 89 call 0x11396 ; 0x11396 custom_message_type = CustomMsg::FilamentLoading; //just print status message 2282c: 82 e0 ldi r24, 0x02 ; 2 2282e: 80 93 75 07 sts 0x0775, r24 ; 0x800775 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 22832: 81 ef ldi r24, 0xF1 ; 241 22834: 99 e5 ldi r25, 0x59 ; 89 22836: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2283a: 0f 94 0c 0b call 0x21618 ; 0x21618 lcd_return_to_status(); 2283e: 0f 94 4e 26 call 0x24c9c ; 0x24c9c lcd_draw_update = 3; 22842: 83 e0 ldi r24, 0x03 ; 3 22844: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 22848: 08 95 ret 0002284a : //! @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; 2284a: 0f 94 ac 0a call 0x21558 ; 0x21558 2284e: 88 23 and r24, r24 22850: 39 f1 breq .+78 ; 0x228a0 cmdqueue_serial_disabled = false; 22852: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 22856: 81 ef ldi r24, 0xF1 ; 241 22858: 99 e5 ldi r25, 0x59 ; 89 2285a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2285e: 0f 94 0c 0b call 0x21618 ; 0x21618 st_synchronize(); 22862: 0f 94 27 58 call 0x2b04e ; 0x2b04e custom_message_type = CustomMsg::Resuming; 22866: 88 e0 ldi r24, 0x08 ; 8 22868: 80 93 75 07 sts 0x0775, r24 ; 0x800775 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); 2286c: 0e 94 a3 77 call 0xef46 ; 0xef46 Stopped = false; 22870: 10 92 14 05 sts 0x0514, r1 ; 0x800514 restore_print_from_ram_and_continue(default_retraction); 22874: 60 e0 ldi r22, 0x00 ; 0 22876: 70 e0 ldi r23, 0x00 ; 0 22878: 80 e8 ldi r24, 0x80 ; 128 2287a: 9f e3 ldi r25, 0x3F ; 63 2287c: 0e 94 79 69 call 0xd2f2 ; 0xd2f2 did_pause_print = false; 22880: 10 92 e0 03 sts 0x03E0, r1 ; 0x8003e0 // Resume the print job timer if it was running if (print_job_timer.isPaused()) print_job_timer.start(); 22884: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 22888: 82 30 cpi r24, 0x02 ; 2 2288a: 11 f4 brne .+4 ; 0x22890 2288c: 0f 94 cc 57 call 0x2af98 ; 0x2af98 refresh_cmd_timeout(); 22890: 0e 94 f8 67 call 0xcff0 ; 0xcff0 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 22894: 8c ec ldi r24, 0xCC ; 204 22896: 9b e6 ldi r25, 0x6B ; 107 22898: 0e 94 86 7b call 0xf70c ; 0xf70c custom_message_type = CustomMsg::Status; 2289c: 10 92 75 07 sts 0x0775, r1 ; 0x800775 } 228a0: 08 95 ret 000228a2 : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 228a2: cf 93 push r28 228a4: df 93 push r29 228a6: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 228a8: 80 e0 ldi r24, 0x00 ; 0 228aa: 0f 94 d3 05 call 0x20ba6 ; 0x20ba6 228ae: 88 23 and r24, r24 228b0: 31 f0 breq .+12 ; 0x228be lcd_updatestatus(message); 228b2: 60 e0 ldi r22, 0x00 ; 0 228b4: ce 01 movw r24, r28 } 228b6: df 91 pop r29 228b8: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 228ba: 0d 94 b8 05 jmp 0x20b70 ; 0x20b70 } 228be: df 91 pop r29 228c0: cf 91 pop r28 228c2: 08 95 ret 000228c4 : #endif //TMC2130 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) // called also from marlin_main.cpp void printf_IRSensorAnalogBoardChange(){ printf_P(PSTR("Filament sensor board change detected: revision%S\n"), fsensor.getIRVersionText()); 228c4: 0f 94 b6 7b call 0x2f76c ; 0x2f76c 228c8: 9f 93 push r25 228ca: 8f 93 push r24 228cc: 80 e3 ldi r24, 0x30 ; 48 228ce: 9c e8 ldi r25, 0x8C ; 140 228d0: 9f 93 push r25 228d2: 8f 93 push r24 228d4: 0f 94 1d dc call 0x3b83a ; 0x3b83a 228d8: 0f 90 pop r0 228da: 0f 90 pop r0 228dc: 0f 90 pop r0 228de: 0f 90 pop r0 } 228e0: 08 95 ret 000228e2 : printf_IRSensorAnalogBoardChange(); } return true; } static void lcd_detect_IRsensor(){ 228e2: ef 92 push r14 228e4: ff 92 push r15 228e6: 0f 93 push r16 228e8: 1f 93 push r17 228ea: cf 93 push r28 228ec: df 93 push r29 bool bAction; bool loaded; /// Check if filament is loaded. If it is loaded stop detection. /// @todo Add autodetection with MMU2s loaded = fsensor.getFilamentPresent(); 228ee: 0e 94 df e3 call 0x1c7be ; 0x1c7be 228f2: c8 2f mov r28, r24 if(loaded){ lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 228f4: 8e e1 ldi r24, 0x1E ; 30 228f6: 9f e3 ldi r25, 0x3F ; 63 bool bAction; bool loaded; /// Check if filament is loaded. If it is loaded stop detection. /// @todo Add autodetection with MMU2s loaded = fsensor.getFilamentPresent(); if(loaded){ 228f8: c1 11 cpse r28, r1 228fa: 8a c0 rjmp .+276 ; 0x22a10 lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); return; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IR_CONNECTION)); 228fc: 89 ed ldi r24, 0xD9 ; 217 228fe: 9e e3 ldi r25, 0x3E ; 62 22900: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 22904: 0f 94 07 35 call 0x26a0e ; 0x26a0e 22908: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2290c: 10 92 89 17 sts 0x1789, r1 ; 0x801789 22910: d0 91 91 17 lds r29, 0x1791 ; 0x801791 static bool lcd_selftest_IRsensor(bool bStandalone) { FSensorBlockRunout fsBlockRunout; IR_sensor_analog::SensorRevision oldSensorRevision = fsensor.getSensorRevision(); IR_sensor_analog::SensorRevision newSensorRevision; uint16_t volt_IR_int = fsensor.getVoltRaw(); 22914: 0f 94 ae 7b call 0x2f75c ; 0x2f75c 22918: 8c 01 movw r16, r24 #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) constexpr static uint16_t Voltage2Raw(float V) { return (V * 1023 * OVERSAMPLENR / VOLT_DIV_REF ) + 0.5F; } constexpr static float Raw2Voltage(uint16_t raw) { return VOLT_DIV_REF * (raw / (1023.F * OVERSAMPLENR)); 2291a: bc 01 movw r22, r24 2291c: 90 e0 ldi r25, 0x00 ; 0 2291e: 80 e0 ldi r24, 0x00 ; 0 22920: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 22924: 20 e0 ldi r18, 0x00 ; 0 22926: 30 ec ldi r19, 0xC0 ; 192 22928: 4f e7 ldi r20, 0x7F ; 127 2292a: 56 e4 ldi r21, 0x46 ; 70 2292c: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 22930: 20 e0 ldi r18, 0x00 ; 0 22932: 30 e0 ldi r19, 0x00 ; 0 22934: 40 ea ldi r20, 0xA0 ; 160 22936: 50 e4 ldi r21, 0x40 ; 64 22938: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> newSensorRevision = (volt_IR_int < fsensor.IRsensor_Hopen_TRESHOLD) ? IR_sensor_analog::SensorRevision::_Rev04 : IR_sensor_analog::SensorRevision::_Old; printf_P(PSTR("Measured filament sensor high level: %4.2fV\n"), Raw2Voltage(volt_IR_int) ); 2293c: 9f 93 push r25 2293e: 8f 93 push r24 22940: 7f 93 push r23 22942: 6f 93 push r22 22944: 8f e8 ldi r24, 0x8F ; 143 22946: 9c e8 ldi r25, 0x8C ; 140 22948: 9f 93 push r25 2294a: 8f 93 push r24 2294c: 0f 94 1d dc call 0x3b83a ; 0x3b83a if(volt_IR_int < fsensor.IRsensor_Hmin_TRESHOLD){ 22950: 0f 90 pop r0 22952: 0f 90 pop r0 22954: 0f 90 pop r0 22956: 0f 90 pop r0 22958: 0f 90 pop r0 2295a: 0f 90 pop r0 2295c: 0d 35 cpi r16, 0x5D ; 93 2295e: 86 e2 ldi r24, 0x26 ; 38 22960: 18 07 cpc r17, r24 22962: 08 f4 brcc .+2 ; 0x22966 22964: 3f c0 rjmp .+126 ; 0x229e4 if(!bStandalone) lcd_selftest_error(TestError::FsensorLevel,"HIGH",""); return false; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_INSERT_FIL)); 22966: 81 e2 ldi r24, 0x21 ; 33 22968: 9e e3 ldi r25, 0x3E ; 62 2296a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2296e: 0f 94 07 35 call 0x26a0e ; 0x26a0e volt_IR_int = fsensor.getVoltRaw(); 22972: 0f 94 ae 7b call 0x2f75c ; 0x2f75c 22976: 7c 01 movw r14, r24 22978: bc 01 movw r22, r24 2297a: 90 e0 ldi r25, 0x00 ; 0 2297c: 80 e0 ldi r24, 0x00 ; 0 2297e: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 22982: 20 e0 ldi r18, 0x00 ; 0 22984: 30 ec ldi r19, 0xC0 ; 192 22986: 4f e7 ldi r20, 0x7F ; 127 22988: 56 e4 ldi r21, 0x46 ; 70 2298a: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 2298e: 20 e0 ldi r18, 0x00 ; 0 22990: 30 e0 ldi r19, 0x00 ; 0 22992: 40 ea ldi r20, 0xA0 ; 160 22994: 50 e4 ldi r21, 0x40 ; 64 22996: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> printf_P(PSTR("Measured filament sensor low level: %4.2fV\n"), Raw2Voltage(volt_IR_int)); 2299a: 9f 93 push r25 2299c: 8f 93 push r24 2299e: 7f 93 push r23 229a0: 6f 93 push r22 229a2: 83 e6 ldi r24, 0x63 ; 99 229a4: 9c e8 ldi r25, 0x8C ; 140 229a6: 9f 93 push r25 229a8: 8f 93 push r24 229aa: 0f 94 1d dc call 0x3b83a ; 0x3b83a if(volt_IR_int > (fsensor.IRsensor_Lmax_TRESHOLD)){ 229ae: 0f 90 pop r0 229b0: 0f 90 pop r0 229b2: 0f 90 pop r0 229b4: 0f 90 pop r0 229b6: 0f 90 pop r0 229b8: 0f 90 pop r0 229ba: 8f e2 ldi r24, 0x2F ; 47 229bc: e8 16 cp r14, r24 229be: 83 e1 ldi r24, 0x13 ; 19 229c0: f8 06 cpc r15, r24 229c2: 80 f4 brcc .+32 ; 0x229e4 FSensorBlockRunout fsBlockRunout; IR_sensor_analog::SensorRevision oldSensorRevision = fsensor.getSensorRevision(); IR_sensor_analog::SensorRevision newSensorRevision; uint16_t volt_IR_int = fsensor.getVoltRaw(); newSensorRevision = (volt_IR_int < fsensor.IRsensor_Hopen_TRESHOLD) ? IR_sensor_analog::SensorRevision::_Rev04 : IR_sensor_analog::SensorRevision::_Old; 229c4: 61 e0 ldi r22, 0x01 ; 1 229c6: 03 3d cpi r16, 0xD3 ; 211 229c8: 1a 43 sbci r17, 0x3A ; 58 229ca: 08 f0 brcs .+2 ; 0x229ce 229cc: 60 e0 ldi r22, 0x00 ; 0 if(volt_IR_int > (fsensor.IRsensor_Lmax_TRESHOLD)){ if(!bStandalone) lcd_selftest_error(TestError::FsensorLevel,"LOW",""); return false; } if(newSensorRevision != oldSensorRevision) { 229ce: d6 17 cp r29, r22 229d0: 41 f0 breq .+16 ; 0x229e2 return _T(MSG_IR_UNKNOWN); } } void IR_sensor_analog::setSensorRevision(SensorRevision rev, bool updateEEPROM) { sensorRevision = rev; 229d2: 60 93 91 17 sts 0x1791, r22 ; 0x801791 229d6: 88 e4 ldi r24, 0x48 ; 72 229d8: 9d e0 ldi r25, 0x0D ; 13 229da: 0f 94 7f dd call 0x3bafe ; 0x3bafe fsensor.setSensorRevision(newSensorRevision, true); printf_IRSensorAnalogBoardChange(); 229de: 0f 94 62 14 call 0x228c4 ; 0x228c4 } return true; 229e2: c1 e0 ldi r28, 0x01 ; 1 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 229e4: 88 e8 ldi r24, 0x88 ; 136 229e6: 97 e1 ldi r25, 0x17 ; 23 229e8: 0e 94 04 76 call 0xec08 ; 0xec08 } if(bAction){ lcd_show_fullscreen_message_and_wait_P(_T(MSG_FS_VERIFIED)); fsensor.init(); } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FIL_FAILED)); 229ec: 8f e9 ldi r24, 0x9F ; 159 229ee: 9e e3 ldi r25, 0x3E ; 62 return; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IR_CONNECTION)); bAction = lcd_selftest_IRsensor(true); } if(bAction){ 229f0: cc 23 and r28, r28 229f2: 71 f0 breq .+28 ; 0x22a10 lcd_show_fullscreen_message_and_wait_P(_T(MSG_FS_VERIFIED)); 229f4: 83 e7 ldi r24, 0x73 ; 115 229f6: 9e e3 ldi r25, 0x3E ; 62 229f8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 229fc: 0f 94 07 35 call 0x26a0e ; 0x26a0e fsensor.init(); } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FIL_FAILED)); } } 22a00: df 91 pop r29 22a02: cf 91 pop r28 22a04: 1f 91 pop r17 22a06: 0f 91 pop r16 22a08: ff 90 pop r15 22a0a: ef 90 pop r14 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IR_CONNECTION)); bAction = lcd_selftest_IRsensor(true); } if(bAction){ lcd_show_fullscreen_message_and_wait_P(_T(MSG_FS_VERIFIED)); fsensor.init(); 22a0c: 0d 94 3b 86 jmp 0x30c76 ; 0x30c76 } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FIL_FAILED)); 22a10: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 } } 22a14: df 91 pop r29 22a16: cf 91 pop r28 22a18: 1f 91 pop r17 22a1a: 0f 91 pop r16 22a1c: ff 90 pop r15 22a1e: ef 90 pop r14 } if(bAction){ lcd_show_fullscreen_message_and_wait_P(_T(MSG_FS_VERIFIED)); fsensor.init(); } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FIL_FAILED)); 22a20: 0d 94 07 35 jmp 0x26a0e ; 0x26a0e 00022a24 : 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) { 22a24: cf 93 push r28 22a26: df 93 push r29 22a28: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 22a2a: 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) { 22a2c: 66 23 and r22, r22 22a2e: d9 f1 breq .+118 ; 0x22aa6 22a30: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 22a32: 0f 94 52 44 call 0x288a4 ; 0x288a4 cancel_heatup = true; 22a36: 81 e0 ldi r24, 0x01 ; 1 22a38: 80 93 66 0e sts 0x0E66, r24 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.402> heating_status = HeatingStatus::NO_HEATING; 22a3c: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df // Clear any saved printing state cancel_saved_printing(); 22a40: 0e 94 e2 65 call 0xcbc4 ; 0xcbc4 // Abort the planner planner_abort_hard(); 22a44: 0f 94 d7 bb call 0x377ae ; 0x377ae // Reset the queue cmdqueue_reset(); 22a48: 0e 94 4f 81 call 0x1029e ; 0x1029e cmdqueue_serial_disabled = false; 22a4c: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 st_reset_timer(); 22a50: 0f 94 81 58 call 0x2b102 ; 0x2b102 CRITICAL_SECTION_END; 22a54: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 22a56: 10 92 e0 03 sts 0x03E0, r1 ; 0x8003e0 print_job_timer.stop(); 22a5a: 0f 94 f0 57 call 0x2afe0 ; 0x2afe0 } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 22a5e: 80 91 01 17 lds r24, 0x1701 ; 0x801701 22a62: 88 23 and r24, r24 22a64: 71 f0 breq .+28 ; 0x22a82 // Reset the sd status card.sdprinting = false; 22a66: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 22a6a: 8e ef ldi r24, 0xFE ; 254 22a6c: 96 e1 ldi r25, 0x16 ; 22 22a6e: 0f 94 41 6d call 0x2da82 ; 0x2da82 file.close(); 22a72: 8e ef ldi r24, 0xFE ; 254 22a74: 96 e1 ldi r25, 0x16 ; 22 22a76: 0f 94 3e a4 call 0x3487c ; 0x3487c saving = false; 22a7a: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c logging = false; 22a7e: 10 92 6d 14 sts 0x146D, r1 ; 0x80146d card.closefile(); } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 22a82: 8f e0 ldi r24, 0x0F ; 15 22a84: 9c e6 ldi r25, 0x6C ; 108 22a86: 0e 94 86 7b call 0xf70c ; 0xf70c #ifdef MESH_BED_LEVELING mbl.active = false; 22a8a: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 #endif if (interactive) { 22a8e: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 22a90: 10 92 14 05 sts 0x0514, r1 ; 0x800514 } // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::StopPrint; 22a94: 81 e0 ldi r24, 0x01 ; 1 22a96: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 22a9a: 10 92 67 0e sts 0x0E67, r1 ; 0x800e67 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 22a9e: df 91 pop r29 22aa0: 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(); 22aa2: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c } void ConditionalStop() { CRITICAL_SECTION_START; 22aa6: 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; 22aa8: 81 e0 ldi r24, 0x01 ; 1 22aaa: 80 93 66 0e sts 0x0E66, r24 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.402> heating_status = HeatingStatus::NO_HEATING; 22aae: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df // Clear any saved printing state cancel_saved_printing(); 22ab2: 0e 94 e2 65 call 0xcbc4 ; 0xcbc4 // Abort the planner planner_abort_hard(); 22ab6: 0f 94 d7 bb call 0x377ae ; 0x377ae // Reset the queue cmdqueue_reset(); 22aba: 0e 94 4f 81 call 0x1029e ; 0x1029e cmdqueue_serial_disabled = false; 22abe: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 st_reset_timer(); 22ac2: 0f 94 81 58 call 0x2b102 ; 0x2b102 CRITICAL_SECTION_END; 22ac6: df bf out 0x3f, r29 ; 63 22ac8: ca cf rjmp .-108 ; 0x22a5e 00022aca : } void lcd_print_stop() { print_stop(true); 22aca: 60 e0 ldi r22, 0x00 ; 0 22acc: 81 e0 ldi r24, 0x01 ; 1 22ace: 0d 94 12 15 jmp 0x22a24 ; 0x22a24 00022ad2 : } static void render_M862_warnings(const char* warning, const char* strict, uint8_t check) { if (check == 1) { // Warning, stop print if user selects 'No' 22ad2: 41 30 cpi r20, 0x01 ; 1 22ad4: 41 f4 brne .+16 ; 0x22ae6 if (lcd_show_multiscreen_message_yes_no_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 22ad6: 40 e0 ldi r20, 0x00 ; 0 22ad8: 61 e0 ldi r22, 0x01 ; 1 22ada: 0f 94 b3 64 call 0x2c966 ; 0x2c966 22ade: 81 30 cpi r24, 0x01 ; 1 22ae0: 41 f4 brne .+16 ; 0x22af2 lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 22ae2: 0d 94 65 15 jmp 0x22aca ; 0x22aca { 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 22ae6: 42 30 cpi r20, 0x02 ; 2 22ae8: 21 f4 brne .+8 ; 0x22af2 lcd_show_fullscreen_message_and_wait_P(strict); 22aea: cb 01 movw r24, r22 22aec: 0f 94 07 35 call 0x26a0e ; 0x26a0e 22af0: f8 cf rjmp .-16 ; 0x22ae2 lcd_print_stop(); } } 22af2: 08 95 ret 00022af4 : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 22af4: 0f 93 push r16 22af6: 1f 93 push r17 22af8: 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)) { 22afa: 8c ea ldi r24, 0xAC ; 172 22afc: 9c e0 ldi r25, 0x0C ; 12 22afe: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 22b02: 88 23 and r24, r24 22b04: 29 f0 breq .+10 ; 0x22b10 return false; } } done: return true; 22b06: 81 e0 ldi r24, 0x01 ; 1 } 22b08: cf 91 pop r28 22b0a: 1f 91 pop r17 22b0c: 0f 91 pop r16 22b0e: 08 95 ret // should always tell the MMU which filament to load. if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) { goto done; } if (fsensor.isEnabled() && !fsensor.getFilamentPresent()) { 22b10: 80 91 88 17 lds r24, 0x1788 ; 0x801788 22b14: 88 23 and r24, r24 22b16: b9 f3 breq .-18 ; 0x22b06 22b18: 0e 94 df e3 call 0x1c7be ; 0x1c7be 22b1c: 81 11 cpse r24, r1 22b1e: f3 cf rjmp .-26 ; 0x22b06 if (oCheckFilament == ClCheckMode::_None) { 22b20: c0 91 ea 04 lds r28, 0x04EA ; 0x8004ea 22b24: cc 23 and r28, r28 22b26: 79 f3 breq .-34 ; 0x22b06 goto done; } render_M862_warnings( 22b28: 8b ec ldi r24, 0xCB ; 203 22b2a: 91 e4 ldi r25, 0x41 ; 65 22b2c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 22b30: 8c 01 movw r16, r24 22b32: 82 ea ldi r24, 0xA2 ; 162 22b34: 91 e4 ldi r25, 0x41 ; 65 22b36: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 22b3a: 4c 2f mov r20, r28 22b3c: b8 01 movw r22, r16 22b3e: 0f 94 69 15 call 0x22ad2 ; 0x22ad2 _T(MSG_MISSING_FILAMENT_CONTINUE) ,_T(MSG_MISSING_FILAMENT_CANCELLED) ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 22b42: 81 e0 ldi r24, 0x01 ; 1 22b44: 90 91 65 0e lds r25, 0x0E65 ; 0x800e65 22b48: 91 30 cpi r25, 0x01 ; 1 22b4a: f1 f6 brne .-68 ; 0x22b08 22b4c: 80 e0 ldi r24, 0x00 ; 0 22b4e: dc cf rjmp .-72 ; 0x22b08 00022b50 : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 22b50: 1f 93 push r17 22b52: cf 93 push r28 22b54: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 22b56: 10 91 ef 04 lds r17, 0x04EF ; 0x8004ef 22b5a: 11 23 and r17, r17 22b5c: f9 f0 breq .+62 ; 0x22b9c 22b5e: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 22b60: 85 ea ldi r24, 0xA5 ; 165 22b62: 9d e0 ldi r25, 0x0D ; 13 22b64: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 if (nDiameter == nDiameter_um) 22b68: 8c 17 cp r24, r28 22b6a: 9d 07 cpc r25, r29 22b6c: b9 f0 breq .+46 ; 0x22b9c // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 22b6e: 82 e4 ldi r24, 0x42 ; 66 22b70: 91 e4 ldi r25, 0x41 ; 65 22b72: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 22b76: ec 01 movw r28, r24 22b78: 8d e0 ldi r24, 0x0D ; 13 22b7a: 91 e4 ldi r25, 0x41 ; 65 22b7c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 22b80: 41 2f mov r20, r17 22b82: be 01 movw r22, r28 22b84: 0f 94 69 15 call 0x22ad2 ; 0x22ad2 ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 22b88: 10 92 f8 03 sts 0x03F8, r1 ; 0x8003f8 menu_submenu(lcd_hw_setup_menu); 22b8c: 60 e0 ldi r22, 0x00 ; 0 22b8e: 84 ef ldi r24, 0xF4 ; 244 22b90: 99 e3 ldi r25, 0x39 ; 57 } } 22b92: df 91 pop r29 22b94: cf 91 pop r28 22b96: 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); 22b98: 0d 94 47 d0 jmp 0x3a08e ; 0x3a08e } } 22b9c: df 91 pop r29 22b9e: cf 91 pop r28 22ba0: 1f 91 pop r17 22ba2: 08 95 ret 00022ba4 : } /// @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) { 22ba4: cf 92 push r12 22ba6: df 92 push r13 22ba8: ef 92 push r14 22baa: ff 92 push r15 22bac: cf 93 push r28 22bae: 6b 01 movw r12, r22 22bb0: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 22bb2: 82 e0 ldi r24, 0x02 ; 2 22bb4: 80 93 75 07 sts 0x0775, r24 ; 0x800775 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 22bb8: 84 e9 ldi r24, 0x94 ; 148 22bba: 99 e5 ldi r25, 0x59 ; 89 22bbc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 22bc0: 0f 94 0c 0b call 0x21618 ; 0x21618 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 22bc4: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 22bc8: 10 92 89 17 sts 0x1789, r1 ; 0x801789 FSensorBlockRunout fsBlockRunout; current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 22bcc: 20 e0 ldi r18, 0x00 ; 0 22bce: 30 e0 ldi r19, 0x00 ; 0 22bd0: 44 e3 ldi r20, 0x34 ; 52 22bd2: 52 e4 ldi r21, 0x42 ; 66 22bd4: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 22bd8: 70 91 50 07 lds r23, 0x0750 ; 0x800750 22bdc: 80 91 51 07 lds r24, 0x0751 ; 0x800751 22be0: 90 91 52 07 lds r25, 0x0752 ; 0x800752 22be4: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 22be8: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 22bec: 70 93 50 07 sts 0x0750, r23 ; 0x800750 22bf0: 80 93 51 07 sts 0x0751, r24 ; 0x800751 22bf4: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 22bf8: 6a e0 ldi r22, 0x0A ; 10 22bfa: 77 e5 ldi r23, 0x57 ; 87 22bfc: 8d ea ldi r24, 0xAD ; 173 22bfe: 92 e4 ldi r25, 0x42 ; 66 22c00: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 22c04: 0f 94 27 58 call 0x2b04e ; 0x2b04e current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 22c08: 20 e0 ldi r18, 0x00 ; 0 22c0a: 30 e0 ldi r19, 0x00 ; 0 22c0c: 4c e0 ldi r20, 0x0C ; 12 22c0e: 52 e4 ldi r21, 0x42 ; 66 22c10: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 22c14: 70 91 50 07 lds r23, 0x0750 ; 0x800750 22c18: 80 91 51 07 lds r24, 0x0751 ; 0x800751 22c1c: 90 91 52 07 lds r25, 0x0752 ; 0x800752 22c20: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 22c24: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 22c28: 70 93 50 07 sts 0x0750, r23 ; 0x800750 22c2c: 80 93 51 07 sts 0x0751, r24 ; 0x800751 22c30: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 22c34: 69 e2 ldi r22, 0x29 ; 41 22c36: 7c e5 ldi r23, 0x5C ; 92 22c38: 85 e8 ldi r24, 0x85 ; 133 22c3a: 91 e4 ldi r25, 0x41 ; 65 22c3c: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 22c40: 0f 94 27 58 call 0x2b04e ; 0x2b04e // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 22c44: 20 e0 ldi r18, 0x00 ; 0 22c46: 30 e0 ldi r19, 0x00 ; 0 22c48: a9 01 movw r20, r18 22c4a: c7 01 movw r24, r14 22c4c: b6 01 movw r22, r12 22c4e: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 22c52: 88 23 and r24, r24 22c54: e1 f0 breq .+56 ; 0x22c8e { current_position[E_AXIS] += unloadLength; 22c56: a7 01 movw r20, r14 22c58: 96 01 movw r18, r12 22c5a: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 22c5e: 70 91 50 07 lds r23, 0x0750 ; 0x800750 22c62: 80 91 51 07 lds r24, 0x0751 ; 0x800751 22c66: 90 91 52 07 lds r25, 0x0752 ; 0x800752 22c6a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 22c6e: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 22c72: 70 93 50 07 sts 0x0750, r23 ; 0x800750 22c76: 80 93 51 07 sts 0x0751, r24 ; 0x800751 22c7a: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 22c7e: 60 e0 ldi r22, 0x00 ; 0 22c80: 70 e0 ldi r23, 0x00 ; 0 22c82: 80 e2 ldi r24, 0x20 ; 32 22c84: 91 e4 ldi r25, 0x41 ; 65 22c86: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 22c8a: 0f 94 27 58 call 0x2b04e ; 0x2b04e } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 22c8e: 8a e3 ldi r24, 0x3A ; 58 22c90: 9b e3 ldi r25, 0x3B ; 59 22c92: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 22c96: 0f 94 80 34 call 0x26900 ; 0x26900 //disable extruder steppers so filament can be removed disable_e0(); 22c9a: 14 9a sbi 0x02, 4 ; 2 _delay(100); 22c9c: 64 e6 ldi r22, 0x64 ; 100 22c9e: 70 e0 ldi r23, 0x00 ; 0 22ca0: 80 e0 ldi r24, 0x00 ; 0 22ca2: 90 e0 ldi r25, 0x00 ; 0 22ca4: 0f 94 8d 3c call 0x2791a ; 0x2791a Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 22ca8: 82 e0 ldi r24, 0x02 ; 2 22caa: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 22cae: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 22cb0: 0e 94 32 72 call 0xe464 ; 0xe464 22cb4: 81 11 cpse r24, r1 22cb6: 07 c0 rjmp .+14 ; 0x22cc6 22cb8: c1 50 subi r28, 0x01 ; 1 22cba: 29 f0 breq .+10 ; 0x22cc6 delay_keep_alive(100); 22cbc: 84 e6 ldi r24, 0x64 ; 100 22cbe: 90 e0 ldi r25, 0x00 ; 0 22cc0: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 22cc4: f5 cf rjmp .-22 ; 0x22cb0 counterBeep++; } st_synchronize(); 22cc6: 0f 94 27 58 call 0x2b04e ; 0x2b04e while (lcd_clicked()) delay_keep_alive(100); 22cca: 0e 94 32 72 call 0xe464 ; 0xe464 22cce: 88 23 and r24, r24 22cd0: 29 f0 breq .+10 ; 0x22cdc 22cd2: 84 e6 ldi r24, 0x64 ; 100 22cd4: 90 e0 ldi r25, 0x00 ; 0 22cd6: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 22cda: f7 cf rjmp .-18 ; 0x22cca lcd_update_enable(true); 22cdc: 81 e0 ldi r24, 0x01 ; 1 22cde: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_setstatuspgm(MSG_WELCOME); 22ce2: 8e e0 ldi r24, 0x0E ; 14 22ce4: 91 e7 ldi r25, 0x71 ; 113 22ce6: 0f 94 0c 0b call 0x21618 ; 0x21618 custom_message_type = CustomMsg::Status; 22cea: 10 92 75 07 sts 0x0775, r1 ; 0x800775 clearFilamentAction(); 22cee: 0f 94 ef 35 call 0x26bde ; 0x26bde #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 22cf2: 88 e8 ldi r24, 0x88 ; 136 22cf4: 97 e1 ldi r25, 0x17 ; 23 } 22cf6: cf 91 pop r28 22cf8: ff 90 pop r15 22cfa: ef 90 pop r14 22cfc: df 90 pop r13 22cfe: cf 90 pop r12 22d00: 0c 94 04 76 jmp 0xec08 ; 0xec08 00022d04 : 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() 22d04: 2f 92 push r2 22d06: 3f 92 push r3 22d08: 4f 92 push r4 22d0a: 5f 92 push r5 22d0c: 6f 92 push r6 22d0e: 7f 92 push r7 22d10: 8f 92 push r8 22d12: 9f 92 push r9 22d14: af 92 push r10 22d16: bf 92 push r11 22d18: cf 92 push r12 22d1a: df 92 push r13 22d1c: ef 92 push r14 22d1e: ff 92 push r15 22d20: 0f 93 push r16 22d22: 1f 93 push r17 22d24: cf 93 push r28 22d26: df 93 push r29 22d28: 00 d0 rcall .+0 ; 0x22d2a 22d2a: 00 d0 rcall .+0 ; 0x22d2c 22d2c: 00 d0 rcall .+0 ; 0x22d2e 22d2e: cd b7 in r28, 0x3d ; 61 22d30: de b7 in r29, 0x3e ; 62 22d32: 00 ea ldi r16, 0xA0 ; 160 22d34: 13 e1 ldi r17, 0x13 ; 19 22d36: 1f 83 std Y+7, r17 ; 0x07 22d38: 0e 83 std Y+6, r16 ; 0x06 22d3a: 2e 80 ldd r2, Y+6 ; 0x06 22d3c: 3f 80 ldd r3, Y+7 ; 0x07 22d3e: 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])) 22d40: f1 01 movw r30, r2 22d42: 61 81 ldd r22, Z+1 ; 0x01 22d44: 72 81 ldd r23, Z+2 ; 0x02 22d46: 83 81 ldd r24, Z+3 ; 0x03 22d48: 94 81 ldd r25, Z+4 ; 0x04 22d4a: 9b 01 movw r18, r22 22d4c: ac 01 movw r20, r24 22d4e: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 22d52: 88 23 and r24, r24 22d54: 09 f4 brne .+2 ; 0x22d58 22d56: 7c c0 rjmp .+248 ; 0x22e50 mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 22d58: 89 81 ldd r24, Y+1 ; 0x01 22d5a: 0f 94 79 c7 call 0x38ef2 ; 0x38ef2 22d5e: 20 e0 ldi r18, 0x00 ; 0 22d60: 30 e0 ldi r19, 0x00 ; 0 22d62: 48 eb ldi r20, 0xB8 ; 184 22d64: 51 e4 ldi r21, 0x41 ; 65 22d66: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 22d6a: 6b 01 movw r12, r22 22d6c: 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)) + 22d6e: 20 e0 ldi r18, 0x00 ; 0 22d70: 30 e0 ldi r19, 0x00 ; 0 22d72: 4c ef ldi r20, 0xFC ; 252 22d74: 52 e4 ldi r21, 0x42 ; 66 22d76: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 22d7a: 2b 01 movw r4, r22 22d7c: 3c 01 movw r6, r24 22d7e: 20 e0 ldi r18, 0x00 ; 0 22d80: 30 e0 ldi r19, 0x00 ; 0 22d82: 44 e6 ldi r20, 0x64 ; 100 22d84: 53 e4 ldi r21, 0x43 ; 67 22d86: c7 01 movw r24, r14 22d88: b6 01 movw r22, r12 22d8a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 22d8e: 4b 01 movw r8, r22 22d90: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 22d92: 20 e0 ldi r18, 0x00 ; 0 22d94: 30 e0 ldi r19, 0x00 ; 0 22d96: 40 ec ldi r20, 0xC0 ; 192 22d98: 51 e4 ldi r21, 0x41 ; 65 22d9a: c7 01 movw r24, r14 22d9c: b6 01 movw r22, r12 22d9e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 22da2: 6b 01 movw r12, r22 22da4: 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)) + 22da6: ee 81 ldd r30, Y+6 ; 0x06 22da8: ff 81 ldd r31, Y+7 ; 0x07 22daa: 21 81 ldd r18, Z+1 ; 0x01 22dac: 32 81 ldd r19, Z+2 ; 0x02 22dae: 43 81 ldd r20, Z+3 ; 0x03 22db0: 54 81 ldd r21, Z+4 ; 0x04 22db2: c3 01 movw r24, r6 22db4: b2 01 movw r22, r4 22db6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 22dba: a5 01 movw r20, r10 22dbc: 94 01 movw r18, r8 22dbe: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 22dc2: 20 e0 ldi r18, 0x00 ; 0 22dc4: 30 e9 ldi r19, 0x90 ; 144 22dc6: 42 ea ldi r20, 0xA2 ; 162 22dc8: 56 e4 ldi r21, 0x46 ; 70 22dca: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 22dce: 6a 83 std Y+2, r22 ; 0x02 22dd0: 7b 83 std Y+3, r23 ; 0x03 22dd2: 8c 83 std Y+4, r24 ; 0x04 22dd4: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 22dd6: ee 81 ldd r30, Y+6 ; 0x06 22dd8: ff 81 ldd r31, Y+7 ; 0x07 22dda: 25 85 ldd r18, Z+13 ; 0x0d 22ddc: 36 85 ldd r19, Z+14 ; 0x0e 22dde: 47 85 ldd r20, Z+15 ; 0x0f 22de0: 50 89 ldd r21, Z+16 ; 0x10 22de2: c7 01 movw r24, r14 22de4: b6 01 movw r22, r12 22de6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 22dea: a5 01 movw r20, r10 22dec: 94 01 movw r18, r8 22dee: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 22df2: 20 e0 ldi r18, 0x00 ; 0 22df4: 30 e9 ldi r19, 0x90 ; 144 22df6: 42 e2 ldi r20, 0x22 ; 34 22df8: 56 ec ldi r21, 0xC6 ; 198 22dfa: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 22dfe: 9b 01 movw r18, r22 22e00: 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)) + 22e02: 6a 81 ldd r22, Y+2 ; 0x02 22e04: 7b 81 ldd r23, Y+3 ; 0x03 22e06: 8c 81 ldd r24, Y+4 ; 0x04 22e08: 9d 81 ldd r25, Y+5 ; 0x05 22e0a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 22e0e: 4b 01 movw r8, r22 22e10: 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)); 22e12: ee 81 ldd r30, Y+6 ; 0x06 22e14: ff 81 ldd r31, Y+7 ; 0x07 22e16: 21 8d ldd r18, Z+25 ; 0x19 22e18: 32 8d ldd r19, Z+26 ; 0x1a 22e1a: 43 8d ldd r20, Z+27 ; 0x1b 22e1c: 54 8d ldd r21, Z+28 ; 0x1c 22e1e: c7 01 movw r24, r14 22e20: b6 01 movw r22, r12 22e22: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 22e26: a3 01 movw r20, r6 22e28: 92 01 movw r18, r4 22e2a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 22e2e: 20 e0 ldi r18, 0x00 ; 0 22e30: 30 e9 ldi r19, 0x90 ; 144 22e32: 42 ea ldi r20, 0xA2 ; 162 22e34: 56 e4 ldi r21, 0x46 ; 70 22e36: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 22e3a: 9b 01 movw r18, r22 22e3c: 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)) + 22e3e: c5 01 movw r24, r10 22e40: b4 01 movw r22, r8 22e42: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__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] = 22e46: f1 01 movw r30, r2 22e48: 61 83 std Z+1, r22 ; 0x01 22e4a: 72 83 std Z+2, r23 ; 0x02 22e4c: 83 83 std Z+3, r24 ; 0x03 22e4e: 94 83 std Z+4, r25 ; 0x04 22e50: f4 e0 ldi r31, 0x04 ; 4 22e52: 2f 0e add r2, r31 22e54: 31 1c adc r3, r1 22e56: 29 81 ldd r18, Y+1 ; 0x01 22e58: 2f 5f subi r18, 0xFF ; 255 22e5a: 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) { 22e5c: 27 30 cpi r18, 0x07 ; 7 22e5e: 09 f0 breq .+2 ; 0x22e62 22e60: 6f cf rjmp .-290 ; 0x22d40 22e62: 8e 81 ldd r24, Y+6 ; 0x06 22e64: 9f 81 ldd r25, Y+7 ; 0x07 22e66: 4c 96 adiw r24, 0x1c ; 28 22e68: 9f 83 std Y+7, r25 ; 0x07 22e6a: 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) { 22e6c: 84 56 subi r24, 0x64 ; 100 22e6e: 94 41 sbci r25, 0x14 ; 20 22e70: 09 f0 breq .+2 ; 0x22e74 22e72: 63 cf rjmp .-314 ; 0x22d3a 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() 22e74: 19 87 std Y+9, r17 ; 0x09 22e76: 08 87 std Y+8, r16 ; 0x08 22e78: f1 e0 ldi r31, 0x01 ; 1 22e7a: 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)) + 22e7c: c8 01 movw r24, r16 22e7e: 8b 5a subi r24, 0xAB ; 171 22e80: 9f 4f sbci r25, 0xFF ; 255 22e82: 9f 83 std Y+7, r25 ; 0x07 22e84: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 22e86: 18 01 movw r2, r16 22e88: 99 ea ldi r25, 0xA9 ; 169 22e8a: 29 0e add r2, r25 22e8c: 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])) 22e8e: e8 85 ldd r30, Y+8 ; 0x08 22e90: f9 85 ldd r31, Y+9 ; 0x09 22e92: 65 8d ldd r22, Z+29 ; 0x1d 22e94: 76 8d ldd r23, Z+30 ; 0x1e 22e96: 87 8d ldd r24, Z+31 ; 0x1f 22e98: 90 a1 ldd r25, Z+32 ; 0x20 22e9a: 9b 01 movw r18, r22 22e9c: ac 01 movw r20, r24 22e9e: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 22ea2: 88 23 and r24, r24 22ea4: 09 f4 brne .+2 ; 0x22ea8 22ea6: 79 c0 rjmp .+242 ; 0x22f9a static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 22ea8: 89 81 ldd r24, Y+1 ; 0x01 22eaa: 0f 94 79 c7 call 0x38ef2 ; 0x38ef2 22eae: 20 e0 ldi r18, 0x00 ; 0 22eb0: 30 e0 ldi r19, 0x00 ; 0 22eb2: 40 ea ldi r20, 0xA0 ; 160 22eb4: 50 e4 ldi r21, 0x40 ; 64 22eb6: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 22eba: 6b 01 movw r12, r22 22ebc: 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)) + 22ebe: 20 e0 ldi r18, 0x00 ; 0 22ec0: 30 e0 ldi r19, 0x00 ; 0 22ec2: 48 ed ldi r20, 0xD8 ; 216 22ec4: 52 e4 ldi r21, 0x42 ; 66 22ec6: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 22eca: 2b 01 movw r4, r22 22ecc: 3c 01 movw r6, r24 22ece: 20 e0 ldi r18, 0x00 ; 0 22ed0: 30 e0 ldi r19, 0x00 ; 0 22ed2: 42 e5 ldi r20, 0x52 ; 82 22ed4: 53 e4 ldi r21, 0x43 ; 67 22ed6: c7 01 movw r24, r14 22ed8: b6 01 movw r22, r12 22eda: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 22ede: 4b 01 movw r8, r22 22ee0: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 22ee2: 20 e0 ldi r18, 0x00 ; 0 22ee4: 30 e0 ldi r19, 0x00 ; 0 22ee6: 40 ec ldi r20, 0xC0 ; 192 22ee8: 50 e4 ldi r21, 0x40 ; 64 22eea: c7 01 movw r24, r14 22eec: b6 01 movw r22, r12 22eee: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 22ef2: 6b 01 movw r12, r22 22ef4: 7c 01 movw r14, r24 22ef6: ee 81 ldd r30, Y+6 ; 0x06 22ef8: ff 81 ldd r31, Y+7 ; 0x07 22efa: 20 81 ld r18, Z 22efc: 31 81 ldd r19, Z+1 ; 0x01 22efe: 42 81 ldd r20, Z+2 ; 0x02 22f00: 53 81 ldd r21, Z+3 ; 0x03 22f02: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 22f06: a5 01 movw r20, r10 22f08: 94 01 movw r18, r8 22f0a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 22f0e: 20 e0 ldi r18, 0x00 ; 0 22f10: 30 e9 ldi r19, 0x90 ; 144 22f12: 42 e2 ldi r20, 0x22 ; 34 22f14: 56 ec ldi r21, 0xC6 ; 198 22f16: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 22f1a: 6a 83 std Y+2, r22 ; 0x02 22f1c: 7b 83 std Y+3, r23 ; 0x03 22f1e: 8c 83 std Y+4, r24 ; 0x04 22f20: 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)) + 22f22: f8 01 movw r30, r16 22f24: 21 81 ldd r18, Z+1 ; 0x01 22f26: 32 81 ldd r19, Z+2 ; 0x02 22f28: 43 81 ldd r20, Z+3 ; 0x03 22f2a: 54 81 ldd r21, Z+4 ; 0x04 22f2c: c3 01 movw r24, r6 22f2e: b2 01 movw r22, r4 22f30: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 22f34: a5 01 movw r20, r10 22f36: 94 01 movw r18, r8 22f38: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 22f3c: 20 e0 ldi r18, 0x00 ; 0 22f3e: 30 e9 ldi r19, 0x90 ; 144 22f40: 42 ea ldi r20, 0xA2 ; 162 22f42: 56 e4 ldi r21, 0x46 ; 70 22f44: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 22f48: 9b 01 movw r18, r22 22f4a: ac 01 movw r20, r24 22f4c: 6a 81 ldd r22, Y+2 ; 0x02 22f4e: 7b 81 ldd r23, Y+3 ; 0x03 22f50: 8c 81 ldd r24, Y+4 ; 0x04 22f52: 9d 81 ldd r25, Y+5 ; 0x05 22f54: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 22f58: 4b 01 movw r8, r22 22f5a: 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)); 22f5c: f1 01 movw r30, r2 22f5e: 20 81 ld r18, Z 22f60: 31 81 ldd r19, Z+1 ; 0x01 22f62: 42 81 ldd r20, Z+2 ; 0x02 22f64: 53 81 ldd r21, Z+3 ; 0x03 22f66: c7 01 movw r24, r14 22f68: b6 01 movw r22, r12 22f6a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 22f6e: a3 01 movw r20, r6 22f70: 92 01 movw r18, r4 22f72: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 22f76: 20 e0 ldi r18, 0x00 ; 0 22f78: 30 e9 ldi r19, 0x90 ; 144 22f7a: 42 ea ldi r20, 0xA2 ; 162 22f7c: 56 e4 ldi r21, 0x46 ; 70 22f7e: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 22f82: 9b 01 movw r18, r22 22f84: 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)) + 22f86: c5 01 movw r24, r10 22f88: b4 01 movw r22, r8 22f8a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__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] = 22f8e: e8 85 ldd r30, Y+8 ; 0x08 22f90: f9 85 ldd r31, Y+9 ; 0x09 22f92: 65 8f std Z+29, r22 ; 0x1d 22f94: 76 8f std Z+30, r23 ; 0x1e 22f96: 87 8f std Z+31, r24 ; 0x1f 22f98: 90 a3 std Z+32, r25 ; 0x20 22f9a: 88 85 ldd r24, Y+8 ; 0x08 22f9c: 99 85 ldd r25, Y+9 ; 0x09 22f9e: 4c 96 adiw r24, 0x1c ; 28 22fa0: 99 87 std Y+9, r25 ; 0x09 22fa2: 88 87 std Y+8, r24 ; 0x08 22fa4: 99 81 ldd r25, Y+1 ; 0x01 22fa6: 9f 5f subi r25, 0xFF ; 255 22fa8: 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) { 22faa: 96 30 cpi r25, 0x06 ; 6 22fac: 09 f0 breq .+2 ; 0x22fb0 22fae: 6f cf rjmp .-290 ; 0x22e8e 22fb0: 0c 5f subi r16, 0xFC ; 252 22fb2: 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) { 22fb4: e3 e1 ldi r30, 0x13 ; 19 22fb6: 0c 3b cpi r16, 0xBC ; 188 22fb8: 1e 07 cpc r17, r30 22fba: 09 f0 breq .+2 ; 0x22fbe 22fbc: 5b cf rjmp .-330 ; 0x22e74 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 22fbe: 29 96 adiw r28, 0x09 ; 9 22fc0: 0f b6 in r0, 0x3f ; 63 22fc2: f8 94 cli 22fc4: de bf out 0x3e, r29 ; 62 22fc6: 0f be out 0x3f, r0 ; 63 22fc8: cd bf out 0x3d, r28 ; 61 22fca: df 91 pop r29 22fcc: cf 91 pop r28 22fce: 1f 91 pop r17 22fd0: 0f 91 pop r16 22fd2: ff 90 pop r15 22fd4: ef 90 pop r14 22fd6: df 90 pop r13 22fd8: cf 90 pop r12 22fda: bf 90 pop r11 22fdc: af 90 pop r10 22fde: 9f 90 pop r9 22fe0: 8f 90 pop r8 22fe2: 7f 90 pop r7 22fe4: 6f 90 pop r6 22fe6: 5f 90 pop r5 22fe8: 4f 90 pop r4 22fea: 3f 90 pop r3 22fec: 2f 90 pop r2 22fee: 08 95 ret 00022ff0 : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 22ff0: 2f 92 push r2 22ff2: 3f 92 push r3 22ff4: 4f 92 push r4 22ff6: 5f 92 push r5 22ff8: 6f 92 push r6 22ffa: 7f 92 push r7 22ffc: 8f 92 push r8 22ffe: 9f 92 push r9 23000: af 92 push r10 23002: bf 92 push r11 23004: cf 92 push r12 23006: df 92 push r13 23008: ef 92 push r14 2300a: ff 92 push r15 2300c: 0f 93 push r16 2300e: 1f 93 push r17 23010: cf 93 push r28 23012: df 93 push r29 23014: cd b7 in r28, 0x3d ; 61 23016: de b7 in r29, 0x3e ; 62 23018: 67 97 sbiw r28, 0x17 ; 23 2301a: 0f b6 in r0, 0x3f ; 63 2301c: f8 94 cli 2301e: de bf out 0x3e, r29 ; 62 23020: 0f be out 0x3f, r0 ; 63 23022: cd bf out 0x3d, r28 ; 61 23024: 08 2f mov r16, r24 23026: ce 01 movw r24, r28 23028: 46 96 adiw r24, 0x16 ; 22 2302a: 9f 8b std Y+23, r25 ; 0x17 2302c: 8e 8b std Y+22, r24 ; 0x16 2302e: 83 e0 ldi r24, 0x03 ; 3 23030: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 23032: 95 e1 ldi r25, 0x15 ; 21 23034: 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 23036: 0f 94 f8 c2 call 0x385f0 ; 0x385f0 tool_change_extruder = slot; 2303a: 00 93 80 13 sts 0x1380, r16 ; 0x801380 state = State::Stopped; currentScope = Scope::Stopped; } void ProtocolLogic::ToolChange(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Tool, slot)); 2303e: 40 2f mov r20, r16 23040: 64 e5 ldi r22, 0x54 ; 84 23042: ce 01 movw r24, r28 23044: 01 96 adiw r24, 0x01 ; 1 23046: 0f 94 d6 c2 call 0x385ac ; 0x385ac 2304a: 49 81 ldd r20, Y+1 ; 0x01 2304c: 5a 81 ldd r21, Y+2 ; 0x02 2304e: 6b 81 ldd r22, Y+3 ; 0x03 23050: 7c 81 ldd r23, Y+4 ; 0x04 23052: 8d 81 ldd r24, Y+5 ; 0x05 23054: 0f 94 48 98 call 0x33090 ; 0x33090 logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 23058: 61 e0 ldi r22, 0x01 ; 1 2305a: 81 e0 ldi r24, 0x01 ; 1 2305c: 0f 94 6c 9f call 0x33ed8 ; 0x33ed8 23060: 18 2f mov r17, r24 23062: 81 11 cpse r24, r1 23064: 07 c0 rjmp .+14 ; 0x23074 break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 23066: 0f 94 3a c2 call 0x38474 ; 0x38474 // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 2306a: 0f 94 0a 9f call 0x33e14 ; 0x33e14 // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 2306e: 0f 94 fa 9f call 0x33ff4 ; 0x33ff4 23072: e1 cf rjmp .-62 ; 0x23036 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 23074: 0f 94 27 58 call 0x2b04e ; 0x2b04e } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 23078: 0f 94 2e c3 call 0x3865c ; 0x3865c 2307c: 81 30 cpi r24, 0x01 ; 1 2307e: 79 f1 breq .+94 ; 0x230de // 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(); 23080: 0f 94 fa 9f call 0x33ff4 ; 0x33ff4 if (retries == 2 && cutter_enabled()) { 23084: 92 e0 ldi r25, 0x02 ; 2 23086: f9 12 cpse r15, r25 23088: 09 c0 rjmp .+18 ; 0x2309c 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; 2308a: 8e ec ldi r24, 0xCE ; 206 2308c: 9e e0 ldi r25, 0x0E ; 14 2308e: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 23092: 81 30 cpi r24, 0x01 ; 1 23094: 19 f4 brne .+6 ; 0x2309c CutFilamentInner(slot); // try cutting filament tip at the last attempt 23096: 80 2f mov r24, r16 23098: 0f 94 e5 a0 call 0x341ca ; 0x341ca 2309c: 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) { 2309e: f1 10 cpse r15, r1 230a0: ca cf rjmp .-108 ; 0x23036 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()) { 230a2: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 230a6: 88 23 and r24, r24 230a8: 09 f4 brne .+2 ; 0x230ac 230aa: ef c0 rjmp .+478 ; 0x2328a SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 230ac: 67 96 adiw r28, 0x17 ; 23 230ae: 0f b6 in r0, 0x3f ; 63 230b0: f8 94 cli 230b2: de bf out 0x3e, r29 ; 62 230b4: 0f be out 0x3f, r0 ; 63 230b6: cd bf out 0x3d, r28 ; 61 230b8: df 91 pop r29 230ba: cf 91 pop r28 230bc: 1f 91 pop r17 230be: 0f 91 pop r16 230c0: ff 90 pop r15 230c2: ef 90 pop r14 230c4: df 90 pop r13 230c6: cf 90 pop r12 230c8: bf 90 pop r11 230ca: af 90 pop r10 230cc: 9f 90 pop r9 230ce: 8f 90 pop r8 230d0: 7f 90 pop r7 230d2: 6f 90 pop r6 230d4: 5f 90 pop r5 230d6: 4f 90 pop r4 230d8: 3f 90 pop r3 230da: 2f 90 pop r2 230dc: 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(); 230de: 60 91 75 13 lds r22, 0x1375 ; 0x801375 230e2: 70 e0 ldi r23, 0x00 ; 0 230e4: 90 e0 ldi r25, 0x00 ; 0 230e6: 80 e0 ldi r24, 0x00 ; 0 230e8: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 230ec: 9b 01 movw r18, r22 230ee: ac 01 movw r20, r24 230f0: 60 e0 ldi r22, 0x00 ; 0 230f2: 70 e0 ldi r23, 0x00 ; 0 230f4: 8c e5 ldi r24, 0x5C ; 92 230f6: 92 e4 ldi r25, 0x42 ; 66 230f8: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 230fc: 36 2e mov r3, r22 230fe: 87 2e mov r8, r23 23100: 98 2e mov r9, r24 23102: 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)) 23104: 26 2f mov r18, r22 23106: 37 2f mov r19, r23 23108: 48 2f mov r20, r24 2310a: 59 2f mov r21, r25 2310c: 60 e0 ldi r22, 0x00 ; 0 2310e: 70 e0 ldi r23, 0x00 ; 0 23110: 80 e2 ldi r24, 0x20 ; 32 23112: 91 e4 ldi r25, 0x41 ; 65 23114: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 23118: 2b 01 movw r4, r22 2311a: 3c 01 movw r6, r24 2311c: ea e3 ldi r30, 0x3A ; 58 2311e: f5 e0 ldi r31, 0x05 ; 5 23120: 82 2d mov r24, r2 23122: 11 92 st Z+, r1 23124: 8a 95 dec r24 23126: e9 f7 brne .-6 ; 0x23122 lcd_status_message_idx = 0; 23128: 10 92 39 05 sts 0x0539, r1 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.462> 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); 2312c: 83 2d mov r24, r3 2312e: 98 2d mov r25, r8 23130: a9 2d mov r26, r9 23132: be 2d mov r27, r14 23134: bc 01 movw r22, r24 23136: 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++) { 23138: 91 2c mov r9, r1 2313a: 31 2c mov r3, r1 2313c: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 2313e: 5b 01 movw r10, r22 23140: 6c 01 movw r12, r24 23142: d7 fa bst r13, 7 23144: d0 94 com r13 23146: d7 f8 bld r13, 7 23148: d0 94 com r13 2314a: 20 e0 ldi r18, 0x00 ; 0 2314c: 30 e0 ldi r19, 0x00 ; 0 2314e: 48 e4 ldi r20, 0x48 ; 72 23150: 52 e4 ldi r21, 0x42 ; 66 23152: 0f 94 fa c2 call 0x385f4 ; 0x385f4 23156: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 2315a: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 while (planner_any_moves()) { 2315e: 98 17 cp r25, r24 23160: 09 f4 brne .+2 ; 0x23164 23162: 49 c0 rjmp .+146 ; 0x231f6 filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 23164: 11 23 and r17, r17 23166: 31 f0 breq .+12 ; 0x23174 23168: 0f 94 2e c3 call 0x3865c ; 0x3865c 2316c: 11 e0 ldi r17, 0x01 ; 1 2316e: 81 30 cpi r24, 0x01 ; 1 23170: 09 f0 breq .+2 ; 0x23174 23172: 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); 23174: 83 e0 ldi r24, 0x03 ; 3 23176: 0f 94 13 58 call 0x2b026 ; 0x2b026 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); 2317a: 20 91 4f 07 lds r18, 0x074F ; 0x80074f 2317e: 30 91 50 07 lds r19, 0x0750 ; 0x800750 23182: 40 91 51 07 lds r20, 0x0751 ; 0x800751 23186: 50 91 52 07 lds r21, 0x0752 ; 0x800752 2318a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 2318e: a3 01 movw r20, r6 23190: 92 01 movw r18, r4 23192: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 23196: 0f 94 61 df call 0x3bec2 ; 0x3bec2 2319a: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 2319e: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 231a0: e6 16 cp r14, r22 231a2: c1 f0 breq .+48 ; 0x231d4 231a4: e3 2d mov r30, r3 231a6: e4 31 cpi r30, 0x14 ; 20 231a8: 08 f0 brcs .+2 ; 0x231ac 231aa: 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); 231ac: 33 24 eor r3, r3 231ae: 33 94 inc r3 231b0: 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] : '-'); 231b2: 8f ef ldi r24, 0xFF ; 255 231b4: 11 11 cpse r17, r1 231b6: 01 c0 rjmp .+2 ; 0x231ba 231b8: 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; 231ba: f0 e0 ldi r31, 0x00 ; 0 231bc: e6 5c subi r30, 0xC6 ; 198 231be: fa 4f sbci r31, 0xFA ; 250 231c0: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 231c2: 91 e0 ldi r25, 0x01 ; 1 231c4: 90 93 6d 02 sts 0x026D, r25 ; 0x80026d if (!lcd_update_enabled) lcdui_print_status_line(); 231c8: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 231cc: 81 11 cpse r24, r1 231ce: 02 c0 rjmp .+4 ; 0x231d4 231d0: 0f 94 ad 3f call 0x27f5a ; 0x27f5a void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 231d4: 90 e0 ldi r25, 0x00 ; 0 231d6: 80 e0 ldi r24, 0x00 ; 0 231d8: 0e 94 ff 8e call 0x11dfe ; 0x11dfe } 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); 231dc: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 231de: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 231e2: 88 23 and r24, r24 231e4: 09 f4 brne .+2 ; 0x231e8 231e6: b7 cf rjmp .-146 ; 0x23156 return false; // power panic or a similar issue happened, bail out fast 231e8: 10 e0 ldi r17, 0x00 ; 0 231ea: 37 c0 rjmp .+110 ; 0x2325a 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); 231ec: c6 01 movw r24, r12 231ee: b5 01 movw r22, r10 231f0: 99 24 eor r9, r9 231f2: 93 94 inc r9 231f4: aa cf rjmp .-172 ; 0x2314a 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++) { 231f6: 91 e0 ldi r25, 0x01 ; 1 231f8: 99 12 cpse r9, r25 231fa: f8 cf rjmp .-16 ; 0x231ec return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 231fc: 0f 94 f8 c2 call 0x385f0 ; 0x385f0 if (!filament_inserted) { 23200: 11 11 cpse r17, r1 23202: 08 c0 rjmp .+16 ; 0x23214 eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 23204: 8f ec ldi r24, 0xCF ; 207 23206: 9e e0 ldi r25, 0x0E ; 14 23208: 0e 94 33 78 call 0xf066 ; 0xf066 eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 2320c: 80 ed ldi r24, 0xD0 ; 208 2320e: 9e e0 ldi r25, 0x0E ; 14 23210: 0e 94 26 78 call 0xf04c ; 0xf04c 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); 23214: 44 e1 ldi r20, 0x14 ; 20 23216: 50 e0 ldi r21, 0x00 ; 0 23218: 6a e3 ldi r22, 0x3A ; 58 2321a: 75 e0 ldi r23, 0x05 ; 5 2321c: ce 01 movw r24, r28 2321e: 01 96 adiw r24, 0x01 ; 1 23220: 0f 94 db e3 call 0x3c7b6 ; 0x3c7b6 23224: fe 01 movw r30, r28 23226: 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'; 23228: 81 91 ld r24, Z+ 2322a: 87 fd sbrc r24, 7 2322c: 2c c0 rjmp .+88 ; 0x23286 2322e: 80 e3 ldi r24, 0x30 ; 48 23230: df 01 movw r26, r30 23232: 11 97 sbiw r26, 0x01 ; 1 23234: 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++) { 23236: 8e 89 ldd r24, Y+22 ; 0x16 23238: 9f 89 ldd r25, Y+23 ; 0x17 2323a: 8e 17 cp r24, r30 2323c: 9f 07 cpc r25, r31 2323e: a1 f7 brne .-24 ; 0x23228 // 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; 23240: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 23242: 82 ef ldi r24, 0xF2 ; 242 23244: 9a ea ldi r25, 0xAA ; 170 23246: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2324a: 8a e7 ldi r24, 0x7A ; 122 2324c: 91 e9 ldi r25, 0x91 ; 145 2324e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 23252: ce 01 movw r24, r28 23254: 01 96 adiw r24, 0x01 ; 1 23256: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 2325a: 8f e4 ldi r24, 0x4F ; 79 2325c: 95 e0 ldi r25, 0x05 ; 5 2325e: 0f 94 29 41 call 0x28252 ; 0x28252 ::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()) { 23262: 11 23 and r17, r17 23264: 09 f4 brne .+2 ; 0x23268 23266: 0c cf rjmp .-488 ; 0x23080 // 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 23268: 80 2f mov r24, r16 2326a: 0f 94 9f 87 call 0x30f3e ; 0x30f3e } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 2326e: 00 93 27 13 sts 0x1327, r16 ; 0x801327 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 23272: 80 91 9c 13 lds r24, 0x139C ; 0x80139c 23276: 90 91 9d 13 lds r25, 0x139D ; 0x80139d 2327a: 01 96 adiw r24, 0x01 ; 1 2327c: 90 93 9d 13 sts 0x139D, r25 ; 0x80139d 23280: 80 93 9c 13 sts 0x139C, r24 ; 0x80139c 23284: 13 cf rjmp .-474 ; 0x230ac 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'; 23286: 81 e3 ldi r24, 0x31 ; 49 23288: d3 cf rjmp .-90 ; 0x23230 void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 2328a: 8a e2 ldi r24, 0x2A ; 42 2328c: 90 e8 ldi r25, 0x80 ; 128 2328e: 90 93 2a 13 sts 0x132A, r25 ; 0x80132a 23292: 80 93 29 13 sts 0x1329, r24 ; 0x801329 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 23296: 61 e0 ldi r22, 0x01 ; 1 23298: 81 e0 ldi r24, 0x01 ; 1 2329a: 0f 94 6c 9f call 0x33ed8 ; 0x33ed8 2329e: c7 ce rjmp .-626 ; 0x2302e 000232a0 : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 232a0: cf 93 push r28 232a2: df 93 push r29 232a4: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 232a6: 0f 94 20 88 call 0x31040 ; 0x31040 232aa: c8 2f mov r28, r24 232ac: 88 23 and r24, r24 232ae: d9 f0 breq .+54 ; 0x232e6 return false; } if (slot != extruder) { 232b0: 80 91 7f 13 lds r24, 0x137F ; 0x80137f 232b4: 8d 17 cp r24, r29 232b6: b9 f0 breq .+46 ; 0x232e6 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(); 232b8: 0e 94 16 69 call 0xd22c ; 0xd22c if (/*FindaDetectsFilament()*/ 232bc: 81 11 cpse r24, r1 232be: 02 c0 rjmp .+4 ; 0x232c4 /*!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(); 232c0: 0f 94 37 a0 call 0x3406e ; 0x3406e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 232c4: 0f 94 94 87 call 0x30f28 ; 0x30f28 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 232c8: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 232cc: 10 92 89 17 sts 0x1789, r1 ; 0x801789 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 232d0: 0f 94 27 58 call 0x2b04e ; 0x2b04e } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); 232d4: 8d 2f mov r24, r29 232d6: 0f 94 f8 17 call 0x22ff0 ; 0x22ff0 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 232da: 88 e8 ldi r24, 0x88 ; 136 232dc: 97 e1 ldi r25, 0x17 ; 23 232de: 0e 94 04 76 call 0xec08 ; 0xec08 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 232e2: 0f 94 15 88 call 0x3102a ; 0x3102a FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 232e6: 8c 2f mov r24, r28 232e8: df 91 pop r29 232ea: cf 91 pop r28 232ec: 08 95 ret 000232ee : { (void)lcd_selftest(); } bool lcd_selftest() { 232ee: cf 92 push r12 232f0: df 92 push r13 232f2: ef 92 push r14 232f4: ff 92 push r15 232f6: 0f 93 push r16 232f8: 1f 93 push r17 232fa: cf 93 push r28 232fc: df 93 push r29 232fe: 00 d0 rcall .+0 ; 0x23300 23300: 1f 92 push r1 23302: cd b7 in r28, 0x3d ; 61 23304: de b7 in r29, 0x3e ; 62 bool _swapped_fan = false; #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) //! Check if IR sensor is in unknown state, if so run Fsensor Detection //! As the Fsensor Detection isn't yet ready for the mmu2s we set temporarily the IR sensor 0.3 or older for mmu2s //! @todo Don't forget to remove this as soon Fsensor Detection works with mmu if(fsensor.getSensorRevision() == IR_sensor_analog::SensorRevision::_Undef) { 23306: 80 91 91 17 lds r24, 0x1791 ; 0x801791 2330a: 8f 3f cpi r24, 0xFF ; 255 2330c: 31 f4 brne .+12 ; 0x2331a if (!MMU2::mmu2.Enabled()) { 2330e: 80 91 98 13 lds r24, 0x1398 ; 0x801398 23312: 81 30 cpi r24, 0x01 ; 1 23314: 11 f0 breq .+4 ; 0x2331a lcd_detect_IRsensor(); 23316: 0f 94 71 14 call 0x228e2 ; 0x228e2 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(); 2331a: 0f 94 52 44 call 0x288a4 ; 0x288a4 uint8_t fanSpeedBckp = fanSpeed; 2331e: d0 90 e3 03 lds r13, 0x03E3 ; 0x8003e3 fanSpeed = 255; 23322: 8f ef ldi r24, 0xFF ; 255 23324: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 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)); 23328: 82 ec ldi r24, 0xC2 ; 194 2332a: e8 2e mov r14, r24 2332c: 8c e8 ldi r24, 0x8C ; 140 2332e: 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()); 23330: 0c eb ldi r16, 0xBC ; 188 23332: 1c e8 ldi r17, 0x8C ; 140 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)) { 23334: 20 e0 ldi r18, 0x00 ; 0 23336: 30 e0 ldi r19, 0x00 ; 0 23338: 48 e4 ldi r20, 0x48 ; 72 2333a: 52 e4 ldi r21, 0x42 ; 66 2333c: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 23340: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 23344: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 23348: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 2334c: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 23350: 18 16 cp r1, r24 23352: 8c f0 brlt .+34 ; 0x23376 23354: 20 e0 ldi r18, 0x00 ; 0 23356: 30 e0 ldi r19, 0x00 ; 0 23358: 48 e4 ldi r20, 0x48 ; 72 2335a: 52 e4 ldi r21, 0x42 ; 66 2335c: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 23360: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 23364: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 23368: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 2336c: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 23370: 18 16 cp r1, r24 23372: 0c f0 brlt .+2 ; 0x23376 23374: 42 c0 rjmp .+132 ; 0x233fa lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 23376: 8b e5 ldi r24, 0x5B ; 91 23378: 9f e3 ldi r25, 0x3F ; 63 2337a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2337e: 0f 94 80 34 call 0x26900 ; 0x26900 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 23382: 42 e8 ldi r20, 0x82 ; 130 23384: 64 e0 ldi r22, 0x04 ; 4 23386: 80 e0 ldi r24, 0x00 ; 0 23388: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 2338c: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 23390: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 23394: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 23398: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 2339c: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 233a0: 7f 93 push r23 233a2: 6f 93 push r22 233a4: ff 92 push r15 233a6: ef 92 push r14 233a8: 0e 94 ee 6f call 0xdfdc ; 0xdfdc lcd_putc(LCD_STR_DEGREE[0]); 233ac: 81 e8 ldi r24, 0x81 ; 129 233ae: 0e 94 04 70 call 0xe008 ; 0xe008 lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 233b2: 40 e8 ldi r20, 0x80 ; 128 233b4: 64 e0 ldi r22, 0x04 ; 4 233b6: 89 e0 ldi r24, 0x09 ; 9 233b8: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 233bc: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 233c0: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 233c4: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 233c8: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 233cc: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 233d0: 7f 93 push r23 233d2: 6f 93 push r22 233d4: 1f 93 push r17 233d6: 0f 93 push r16 233d8: 0e 94 ee 6f call 0xdfdc ; 0xdfdc lcd_putc(LCD_STR_DEGREE[0]); 233dc: 81 e8 ldi r24, 0x81 ; 129 233de: 0e 94 04 70 call 0xe008 ; 0xe008 delay_keep_alive(1000); 233e2: 88 ee ldi r24, 0xE8 ; 232 233e4: 93 e0 ldi r25, 0x03 ; 3 233e6: 0e 94 ff 8e call 0x11dfe ; 0x11dfe serialecho_temperatures(); 233ea: 0e 94 69 79 call 0xf2d2 ; 0xf2d2 233ee: 0f b6 in r0, 0x3f ; 63 233f0: f8 94 cli 233f2: de bf out 0x3e, r29 ; 62 233f4: 0f be out 0x3f, r0 ; 63 233f6: cd bf out 0x3d, r28 ; 61 233f8: 9d cf rjmp .-198 ; 0x23334 } fanSpeed = fanSpeedBckp; 233fa: d0 92 e3 03 sts 0x03E3, r13 ; 0x8003e3 lcd_update_enable(true); 233fe: 81 e0 ldi r24, 0x01 ; 1 23400: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 23404: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 23408: 81 ea ldi r24, 0xA1 ; 161 2340a: 9f e3 ldi r25, 0x3F ; 63 2340c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 23410: ac 01 movw r20, r24 23412: 60 e0 ldi r22, 0x00 ; 0 23414: 80 e0 ldi r24, 0x00 ; 0 23416: 0e 94 29 70 call 0xe052 ; 0xe052 #ifdef TMC2130 FORCE_HIGH_POWER_START; 2341a: 81 e0 ldi r24, 0x01 ; 1 2341c: 0e 94 e5 67 call 0xcfca ; 0xcfca #endif // TMC2130 FORCE_BL_ON_START; 23420: 81 e0 ldi r24, 0x01 ; 1 23422: 0e 94 f4 8b call 0x117e8 ; 0x117e8 _delay(2000); 23426: 60 ed ldi r22, 0xD0 ; 208 23428: 77 e0 ldi r23, 0x07 ; 7 2342a: 80 e0 ldi r24, 0x00 ; 0 2342c: 90 e0 ldi r25, 0x00 ; 0 2342e: 0f 94 8d 3c call 0x2791a ; 0x2791a KEEPALIVE_STATE(IN_HANDLER); 23432: 82 e0 ldi r24, 0x02 ; 2 23434: 80 93 96 02 sts 0x0296, r24 ; 0x800296 _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 23438: 00 ed ldi r16, 0xD0 ; 208 2343a: 17 e0 ldi r17, 0x07 ; 7 2343c: 21 e0 ldi r18, 0x01 ; 1 2343e: 43 e0 ldi r20, 0x03 ; 3 23440: 60 e0 ldi r22, 0x00 ; 0 23442: 80 e0 ldi r24, 0x00 ; 0 23444: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 23448: 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 2344a: 83 e0 ldi r24, 0x03 ; 3 2344c: 0e 94 51 77 call 0xeea2 ; 0xeea2 lcd_selftest_setfan(0); // print fan off 23450: 80 e0 ldi r24, 0x00 ; 0 23452: 0e 94 b9 cf call 0x19f72 ; 0x19f72 lcd_selftest_measure_fans(2, 18, 2); 23456: 62 e0 ldi r22, 0x02 ; 2 23458: 82 e0 ldi r24, 0x02 ; 2 2345a: 0e 94 4d d0 call 0x1a09a ; 0x1a09a setExtruderAutoFanState(0); // hotend fan off 2345e: 80 e0 ldi r24, 0x00 ; 0 23460: 0e 94 51 77 call 0xeea2 ; 0xeea2 if (fan_speed[0] < failThr) { 23464: c0 90 b1 04 lds r12, 0x04B1 ; 0x8004b1 23468: d0 90 b2 04 lds r13, 0x04B2 ; 0x8004b2 2346c: 94 e1 ldi r25, 0x14 ; 20 2346e: c9 16 cp r12, r25 23470: d1 04 cpc r13, r1 23472: 5c f1 brlt .+86 ; 0x234ca lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 23474: 21 e0 ldi r18, 0x01 ; 1 23476: 43 e0 ldi r20, 0x03 ; 3 23478: 6f 2d mov r22, r15 2347a: 81 e0 ldi r24, 0x01 ; 1 2347c: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 23480: f8 2e mov r15, r24 return FanCheck::SwappedFan; } break; case 1: lcd_selftest_setfan(255); 23482: 8f ef ldi r24, 0xFF ; 255 23484: 0e 94 b9 cf call 0x19f72 ; 0x19f72 lcd_selftest_measure_fans(5, 18, 3); 23488: 63 e0 ldi r22, 0x03 ; 3 2348a: 85 e0 ldi r24, 0x05 ; 5 2348c: 0e 94 4d d0 call 0x1a09a ; 0x1a09a lcd_selftest_setfan(0); 23490: 80 e0 ldi r24, 0x00 ; 0 23492: 0e 94 b9 cf call 0x19f72 ; 0x19f72 if (fan_speed[1] < failThr) { 23496: 80 91 b3 04 lds r24, 0x04B3 ; 0x8004b3 2349a: 90 91 b4 04 lds r25, 0x04B4 ; 0x8004b4 2349e: 84 31 cpi r24, 0x14 ; 20 234a0: 91 05 cpc r25, r1 234a2: cc f4 brge .+50 ; 0x234d6 #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 234a4: 64 ef ldi r22, 0xF4 ; 244 234a6: 72 e0 ldi r23, 0x02 ; 2 234a8: 85 e0 ldi r24, 0x05 ; 5 234aa: 0f 94 18 06 call 0x20c30 ; 0x20c30 } } if (_swapped_fan) { 234ae: 96 e4 ldi r25, 0x46 ; 70 234b0: c9 16 cp r12, r25 234b2: d1 04 cpc r13, r1 234b4: 9c f4 brge .+38 ; 0x234dc { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 234b6: 08 e8 ldi r16, 0x88 ; 136 234b8: 13 e1 ldi r17, 0x13 ; 19 234ba: 21 e0 ldi r18, 0x01 ; 1 234bc: 43 e0 ldi r20, 0x03 ; 3 234be: 6f 2d mov r22, r15 234c0: 8d e0 ldi r24, 0x0D ; 13 234c2: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 234c6: e1 2c mov r14, r1 234c8: 5d c1 rjmp .+698 ; 0x23784 #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 234ca: 64 ef ldi r22, 0xF4 ; 244 234cc: 72 e0 ldi r23, 0x02 ; 2 234ce: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 234d0: 0f 94 18 06 call 0x20c30 ; 0x20c30 234d4: f0 cf rjmp .-32 ; 0x234b6 lcd_selftest_measure_fans(5, 18, 3); lcd_selftest_setfan(0); if (fan_speed[1] < failThr) { return FanCheck::PrintFan; } if (fan_speed[1] < printFanThr) { 234d6: 86 34 cpi r24, 0x46 ; 70 234d8: 91 05 cpc r25, r1 234da: 54 f4 brge .+20 ; 0x234f0 } } if (_swapped_fan) { //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 234dc: 60 e0 ldi r22, 0x00 ; 0 234de: 81 e0 ldi r24, 0x01 ; 1 234e0: 0e 94 bf cf call 0x19f7e ; 0x19f7e if (_result) { 234e4: 81 11 cpse r24, r1 234e6: 7c c1 rjmp .+760 ; 0x237e0 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 234e8: 64 ef ldi r22, 0xF4 ; 244 234ea: 72 e0 ldi r23, 0x02 ; 2 234ec: 89 e0 ldi r24, 0x09 ; 9 234ee: f0 cf rjmp .-32 ; 0x234d0 { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 234f0: 86 e4 ldi r24, 0x46 ; 70 234f2: c8 16 cp r12, r24 234f4: d1 04 cpc r13, r1 234f6: 94 f7 brge .-28 ; 0x234dc } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 234f8: 00 ed ldi r16, 0xD0 ; 208 234fa: 17 e0 ldi r17, 0x07 ; 7 234fc: 21 e0 ldi r18, 0x01 ; 1 234fe: 43 e0 ldi r20, 0x03 ; 3 23500: 6f 2d mov r22, r15 23502: 82 e0 ldi r24, 0x02 ; 2 23504: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 23508: f8 2e mov r15, r24 static bool lcd_selfcheck_endstops() { bool _result = true; if ( 2350a: 1c 9b sbis 0x03, 4 ; 3 2350c: 18 c0 rjmp .+48 ; 0x2353e { #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; 2350e: 1c 9b sbis 0x03, 4 ; 3 23510: 16 c0 rjmp .+44 ; 0x2353e 23512: 20 e0 ldi r18, 0x00 ; 0 23514: 30 e0 ldi r19, 0x00 ; 0 23516: 40 e2 ldi r20, 0x20 ; 32 23518: 51 e4 ldi r21, 0x41 ; 65 2351a: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 2351e: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 23522: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 23526: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 2352a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 2352e: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 23532: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 23536: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 2353a: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 2353e: 60 e0 ldi r22, 0x00 ; 0 23540: 70 e0 ldi r23, 0x00 ; 0 23542: 84 e3 ldi r24, 0x34 ; 52 23544: 92 e4 ldi r25, 0x42 ; 66 23546: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 2354a: 0f 94 27 58 call 0x2b04e ; 0x2b04e if ( 2354e: 1c 9b sbis 0x03, 4 ; 3 23550: 51 c1 rjmp .+674 ; 0x237f4 ((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] = ""; 23552: 1a 82 std Y+2, r1 ; 0x02 23554: 19 82 std Y+1, r1 ; 0x01 23556: 1c 82 std Y+4, r1 ; 0x04 23558: 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"); 2355a: 1c 9b sbis 0x03, 4 ; 3 2355c: 06 c0 rjmp .+12 ; 0x2356a 2355e: 69 ef ldi r22, 0xF9 ; 249 23560: 72 e0 ldi r23, 0x02 ; 2 23562: ce 01 movw r24, r28 23564: 01 96 adiw r24, 0x01 ; 1 23566: 0f 94 a7 e3 call 0x3c74e ; 0x3c74e lcd_selftest_error(TestError::Endstops, _error, ""); 2356a: be 01 movw r22, r28 2356c: 6f 5f subi r22, 0xFF ; 255 2356e: 7f 4f sbci r23, 0xFF ; 255 23570: 82 e0 ldi r24, 0x02 ; 2 23572: 0f 94 18 06 call 0x20c30 ; 0x20c30 ((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; 23576: 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(); 23578: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(true); 2357c: 81 e0 ldi r24, 0x01 ; 1 2357e: 0e 94 5a 8c call 0x118b4 ; 0x118b4 { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 23582: 11 23 and r17, r17 23584: 09 f4 brne .+2 ; 0x23588 23586: 97 cf rjmp .-210 ; 0x234b6 { //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); 23588: 00 ed ldi r16, 0xD0 ; 208 2358a: 17 e0 ldi r17, 0x07 ; 7 2358c: 21 e0 ldi r18, 0x01 ; 1 2358e: 43 e0 ldi r20, 0x03 ; 3 23590: 6f 2d mov r22, r15 23592: 84 e0 ldi r24, 0x04 ; 4 23594: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 23598: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); 2359a: 80 e0 ldi r24, 0x00 ; 0 2359c: 0f 94 2d 08 call 0x2105a ; 0x2105a } if (_result) 235a0: 88 23 and r24, r24 235a2: 09 f4 brne .+2 ; 0x235a6 235a4: 88 cf rjmp .-240 ; 0x234b6 { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 235a6: 10 e0 ldi r17, 0x00 ; 0 235a8: 00 e0 ldi r16, 0x00 ; 0 235aa: 21 e0 ldi r18, 0x01 ; 1 235ac: 43 e0 ldi r20, 0x03 ; 3 235ae: 6f 2d mov r22, r15 235b0: 84 e0 ldi r24, 0x04 ; 4 235b2: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 } if (_result) { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 235b6: 0c ed ldi r16, 0xDC ; 220 235b8: 15 e0 ldi r17, 0x05 ; 5 235ba: 21 e0 ldi r18, 0x01 ; 1 235bc: 43 e0 ldi r20, 0x03 ; 3 235be: 68 2f mov r22, r24 235c0: 85 e0 ldi r24, 0x05 ; 5 235c2: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 235c6: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); 235c8: 81 e0 ldi r24, 0x01 ; 1 235ca: 0f 94 2d 08 call 0x2105a ; 0x2105a #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); #endif // TMC2130 } if (_result) 235ce: 88 23 and r24, r24 235d0: 09 f4 brne .+2 ; 0x235d4 235d2: 71 cf rjmp .-286 ; 0x234b6 { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 235d4: 10 e0 ldi r17, 0x00 ; 0 235d6: 00 e0 ldi r16, 0x00 ; 0 235d8: 21 e0 ldi r18, 0x01 ; 1 235da: 43 e0 ldi r20, 0x03 ; 3 235dc: 6f 2d mov r22, r15 235de: 86 e0 ldi r24, 0x06 ; 6 235e0: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 235e4: f8 2e mov r15, r24 if (_result) { #ifdef TMC2130 tmc2130_home_exit(); 235e6: 0f 94 5f 3a call 0x274be ; 0x274be 235ea: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); #endif //homeaxis(X_AXIS); //homeaxis(Y_AXIS); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 235ee: ec e0 ldi r30, 0x0C ; 12 235f0: f3 e9 ldi r31, 0x93 ; 147 235f2: 85 91 lpm r24, Z+ 235f4: 95 91 lpm r25, Z+ 235f6: a5 91 lpm r26, Z+ 235f8: b4 91 lpm r27, Z 235fa: 80 93 43 07 sts 0x0743, r24 ; 0x800743 235fe: 90 93 44 07 sts 0x0744, r25 ; 0x800744 23602: a0 93 45 07 sts 0x0745, r26 ; 0x800745 23606: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 2360a: e0 e1 ldi r30, 0x10 ; 16 2360c: f3 e9 ldi r31, 0x93 ; 147 2360e: 65 91 lpm r22, Z+ 23610: 75 91 lpm r23, Z+ 23612: 85 91 lpm r24, Z+ 23614: 94 91 lpm r25, Z #ifdef TMC2130 //current_position[X_AXIS] += 0; current_position[Y_AXIS] += 4; 23616: 20 e0 ldi r18, 0x00 ; 0 23618: 30 e0 ldi r19, 0x00 ; 0 2361a: 40 e8 ldi r20, 0x80 ; 128 2361c: 50 e4 ldi r21, 0x40 ; 64 2361e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 23622: 60 93 47 07 sts 0x0747, r22 ; 0x800747 23626: 70 93 48 07 sts 0x0748, r23 ; 0x800748 2362a: 80 93 49 07 sts 0x0749, r24 ; 0x800749 2362e: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a #endif //TMC2130 raise_z(10); 23632: 60 e0 ldi r22, 0x00 ; 0 23634: 70 e0 ldi r23, 0x00 ; 0 23636: 80 e2 ldi r24, 0x20 ; 32 23638: 91 e4 ldi r25, 0x41 ; 65 2363a: 0e 94 16 6f call 0xde2c ; 0xde2c set_destination_to_current(); 2363e: 0e 94 6f 69 call 0xd2de ; 0xd2de _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 23642: 0c ed ldi r16, 0xDC ; 220 23644: 15 e0 ldi r17, 0x05 ; 5 23646: 21 e0 ldi r18, 0x01 ; 1 23648: 43 e0 ldi r20, 0x03 ; 3 2364a: 6f 2d mov r22, r15 2364c: 86 e0 ldi r24, 0x06 ; 6 2364e: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 #ifdef TMC2130 homeaxis(Z_AXIS); //In case of failure, the code gets stuck in this function. 23652: 50 e0 ldi r21, 0x00 ; 0 23654: 40 e0 ldi r20, 0x00 ; 0 23656: 61 e0 ldi r22, 0x01 ; 1 23658: 82 e0 ldi r24, 0x02 ; 2 2365a: 0e 94 76 7c call 0xf8ec ; 0xf8ec #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); 2365e: 60 e0 ldi r22, 0x00 ; 0 23660: 70 e0 ldi r23, 0x00 ; 0 23662: 80 ea ldi r24, 0xA0 ; 160 23664: 91 e4 ldi r25, 0x41 ; 65 23666: 0e 94 16 6f call 0xde2c ; 0xde2c } #ifdef TMC2130 if (_result) { raise_z(10); 2366a: 60 e0 ldi r22, 0x00 ; 0 2366c: 70 e0 ldi r23, 0x00 ; 0 2366e: 80 e2 ldi r24, 0x20 ; 32 23670: 91 e4 ldi r25, 0x41 ; 65 23672: 0e 94 16 6f call 0xde2c ; 0xde2c _progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0); 23676: 10 e0 ldi r17, 0x00 ; 0 23678: 00 e0 ldi r16, 0x00 ; 0 2367a: 21 e0 ldi r18, 0x01 ; 1 2367c: 42 e0 ldi r20, 0x02 ; 2 2367e: 60 e0 ldi r22, 0x00 ; 0 23680: 8e e0 ldi r24, 0x0E ; 14 23682: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 bool bres = tmc2130_home_calibrate(X_AXIS); 23686: 80 e0 ldi r24, 0x00 ; 0 23688: 0f 94 51 37 call 0x26ea2 ; 0x26ea2 2368c: e8 2e mov r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 1, 2, true, 0); 2368e: 21 e0 ldi r18, 0x01 ; 1 23690: 42 e0 ldi r20, 0x02 ; 2 23692: 61 e0 ldi r22, 0x01 ; 1 23694: 8e e0 ldi r24, 0x0E ; 14 23696: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 bres &= tmc2130_home_calibrate(Y_AXIS); 2369a: 81 e0 ldi r24, 0x01 ; 1 2369c: 0f 94 51 37 call 0x26ea2 ; 0x26ea2 236a0: e8 22 and r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 2, 2, true, 0); 236a2: 21 e0 ldi r18, 0x01 ; 1 236a4: 42 e0 ldi r20, 0x02 ; 2 236a6: 62 e0 ldi r22, 0x02 ; 2 236a8: 8e e0 ldi r24, 0x0E ; 14 236aa: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 236ae: f8 2e mov r15, r24 if (bres) 236b0: ee 20 and r14, r14 236b2: 09 f4 brne .+2 ; 0x236b6 236b4: 00 cf rjmp .-512 ; 0x234b6 236b6: 61 e0 ldi r22, 0x01 ; 1 236b8: 88 ef ldi r24, 0xF8 ; 248 236ba: 9e e0 ldi r25, 0x0E ; 14 236bc: 0f 94 7f dd call 0x3bafe ; 0x3bafe } #endif //TMC2130 if (_result) { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 236c0: 00 ed ldi r16, 0xD0 ; 208 236c2: 17 e0 ldi r17, 0x07 ; 7 236c4: 21 e0 ldi r18, 0x01 ; 1 236c6: 43 e0 ldi r20, 0x03 ; 3 236c8: 6f 2d mov r22, r15 236ca: 87 e0 ldi r24, 0x07 ; 7 236cc: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 236d0: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 236d2: 81 e0 ldi r24, 0x01 ; 1 236d4: 0f 94 2f 07 call 0x20e5e ; 0x20e5e } if (_result) 236d8: 88 23 and r24, r24 236da: 09 f4 brne .+2 ; 0x236de 236dc: ec ce rjmp .-552 ; 0x234b6 { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 236de: 08 ee ldi r16, 0xE8 ; 232 236e0: 13 e0 ldi r17, 0x03 ; 3 236e2: 21 e0 ldi r18, 0x01 ; 1 236e4: 43 e0 ldi r20, 0x03 ; 3 236e6: 6f 2d mov r22, r15 236e8: 88 e0 ldi r24, 0x08 ; 8 236ea: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 236ee: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 236f0: 80 e0 ldi r24, 0x00 ; 0 236f2: 0f 94 2f 07 call 0x20e5e ; 0x20e5e 236f6: e8 2e mov r14, r24 } if (_result) 236f8: 88 23 and r24, r24 236fa: 09 f4 brne .+2 ; 0x236fe 236fc: dc ce rjmp .-584 ; 0x234b6 { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 236fe: 00 ed ldi r16, 0xD0 ; 208 23700: 17 e0 ldi r17, 0x07 ; 7 23702: 21 e0 ldi r18, 0x01 ; 1 23704: 43 e0 ldi r20, 0x03 ; 3 23706: 6f 2d mov r22, r15 23708: 89 e0 ldi r24, 0x09 ; 9 2370a: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 } #ifdef FILAMENT_SENSOR if (_result) { #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (MMU2::mmu2.Enabled()) 2370e: 90 91 98 13 lds r25, 0x1398 ; 0x801398 23712: 91 30 cpi r25, 0x01 ; 1 23714: 79 f5 brne .+94 ; 0x23774 { _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor 23716: 21 e0 ldi r18, 0x01 ; 1 23718: 43 e0 ldi r20, 0x03 ; 3 2371a: 68 2f mov r22, r24 2371c: 8a e0 ldi r24, 0x0A ; 10 2371e: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 23722: f8 2e mov r15, r24 //! @retval true passed //! @retval false failed static bool selftest_irsensor() { // Ask user which slot to load filament from uint8_t slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); 23724: 80 e8 ldi r24, 0x80 ; 128 23726: 9f e3 ldi r25, 0x3F ; 63 23728: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2372c: 70 e0 ldi r23, 0x00 ; 0 2372e: 60 e0 ldi r22, 0x00 ; 0 23730: 0e 94 dd d8 call 0x1b1ba ; 0x1b1ba 23734: d8 2e mov r13, r24 // Render self-test screen lcd_selftest_screen(TestScreen::Fsensor, 0, 1, true, 0); 23736: 10 e0 ldi r17, 0x00 ; 0 23738: 00 e0 ldi r16, 0x00 ; 0 2373a: 21 e0 ldi r18, 0x01 ; 1 2373c: 41 e0 ldi r20, 0x01 ; 1 2373e: 60 e0 ldi r22, 0x00 ; 0 23740: 8a e0 ldi r24, 0x0A ; 10 23742: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 23746: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 2374a: 10 92 6b 02 sts 0x026B, r1 ; 0x80026b // Run self-test set_extrude_min_temp(0); MMU2::mmu2.tool_change(slot); 2374e: 8d 2d mov r24, r13 23750: 0f 94 50 19 call 0x232a0 ; 0x232a0 MMU2::mmu2.unload(); //Unload filament 23754: 0f 94 37 a0 call 0x3406e ; 0x3406e 23758: 8f ea ldi r24, 0xAF ; 175 2375a: 90 e0 ldi r25, 0x00 ; 0 2375c: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 23760: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b { _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor _result = selftest_irsensor(); if (_result) { _progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000); //fil sensor OK 23764: 00 ed ldi r16, 0xD0 ; 208 23766: 17 e0 ldi r17, 0x07 ; 7 23768: 21 e0 ldi r18, 0x01 ; 1 2376a: 43 e0 ldi r20, 0x03 ; 3 2376c: 6f 2d mov r22, r15 2376e: 8b e0 ldi r24, 0x0B ; 11 23770: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 23774: 08 e8 ldi r16, 0x88 ; 136 23776: 13 e1 ldi r17, 0x13 ; 19 23778: 21 e0 ldi r18, 0x01 ; 1 2377a: 43 e0 ldi r20, 0x03 ; 3 2377c: 68 2f mov r22, r24 2377e: 8c e0 ldi r24, 0x0C ; 12 23780: 0e 94 d2 d4 call 0x1a9a4 ; 0x1a9a4 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 23784: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.453> else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); } lcd_reset_alert_level(); enquecommand_P(MSG_M84); 23788: 61 e0 ldi r22, 0x01 ; 1 2378a: 88 eb ldi r24, 0xB8 ; 184 2378c: 9c e6 ldi r25, 0x6C ; 108 2378e: 0e 94 cb 89 call 0x11396 ; 0x11396 lcd_update_enable(true); 23792: 81 e0 ldi r24, 0x01 ; 1 23794: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if (_result) 23798: ee 20 and r14, r14 2379a: 71 f1 breq .+92 ; 0x237f8 { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 2379c: 81 e0 ldi r24, 0x01 ; 1 2379e: 0e 94 88 e6 call 0x1cd10 ; 0x1cd10 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 237a2: 83 e9 ldi r24, 0x93 ; 147 237a4: 9f e3 ldi r25, 0x3F ; 63 237a6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 237aa: 0f 94 0c 0b call 0x21618 ; 0x21618 lcd_return_to_status(); 237ae: 0f 94 4e 26 call 0x24c9c ; 0x24c9c else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); } #ifdef TMC2130 FORCE_HIGH_POWER_END; 237b2: 80 e0 ldi r24, 0x00 ; 0 237b4: 0e 94 e5 67 call 0xcfca ; 0xcfca #endif // TMC2130 FORCE_BL_ON_END; 237b8: 80 e0 ldi r24, 0x00 ; 0 237ba: 0e 94 f4 8b call 0x117e8 ; 0x117e8 KEEPALIVE_STATE(NOT_BUSY); 237be: 81 e0 ldi r24, 0x01 ; 1 237c0: 80 93 96 02 sts 0x0296, r24 ; 0x800296 return(_result); } 237c4: 8e 2d mov r24, r14 237c6: 0f 90 pop r0 237c8: 0f 90 pop r0 237ca: 0f 90 pop r0 237cc: 0f 90 pop r0 237ce: df 91 pop r29 237d0: cf 91 pop r28 237d2: 1f 91 pop r17 237d4: 0f 91 pop r16 237d6: ff 90 pop r15 237d8: ef 90 pop r14 237da: df 90 pop r13 237dc: cf 90 pop r12 237de: 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); 237e0: 61 e0 ldi r22, 0x01 ; 1 237e2: 80 e0 ldi r24, 0x00 ; 0 237e4: 0e 94 bf cf call 0x19f7e ; 0x19f7e if (!_result){ 237e8: 81 11 cpse r24, r1 237ea: 86 ce rjmp .-756 ; 0x234f8 lcd_selftest_error(TestError::PrintFan, "", ""); 237ec: 64 ef ldi r22, 0xF4 ; 244 237ee: 72 e0 ldi r23, 0x02 ; 2 237f0: 85 e0 ldi r24, 0x05 ; 5 237f2: 6e ce rjmp .-804 ; 0x234d0 #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 237f4: 11 e0 ldi r17, 0x01 ; 1 237f6: c0 ce rjmp .-640 ; 0x23578 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 237f8: 8f e7 ldi r24, 0x7F ; 127 237fa: 94 e4 ldi r25, 0x44 ; 68 237fc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 23800: 62 e0 ldi r22, 0x02 ; 2 23802: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 23806: d5 cf rjmp .-86 ; 0x237b2 00023808 : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 23808: 0d 94 77 19 jmp 0x232ee ; 0x232ee 0002380c : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 2380c: cf 93 push r28 2380e: 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); 23810: 8c e1 ldi r24, 0x1C ; 28 23812: 9b e3 ldi r25, 0x3B ; 59 23814: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 23818: 6c 2f mov r22, r28 2381a: 0f 94 1b c2 call 0x38436 ; 0x38436 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 2381e: 8c 2f mov r24, r28 23820: 0f 94 50 19 call 0x232a0 ; 0x232a0 23824: 0f 94 27 58 call 0x2b04e ; 0x2b04e planner_synchronize(); unload(); 23828: 0f 94 37 a0 call 0x3406e ; 0x3406e ScreenUpdateEnable(); 2382c: 0f 94 18 c2 call 0x38430 ; 0x38430 MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 23830: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 23832: 0d 94 ef 35 jmp 0x26bde ; 0x26bde 00023836 : 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(){ 23836: cf 93 push r28 for(uint8_t i = 0; i < 5; ++i){ 23838: c0 e0 ldi r28, 0x00 ; 0 2383a: 8c e1 ldi r24, 0x1C ; 28 2383c: 9b e3 ldi r25, 0x3B ; 59 2383e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 23842: 6c 2f mov r22, r28 23844: 0f 94 1b c2 call 0x38436 ; 0x38436 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 23848: 8c 2f mov r24, r28 2384a: 0f 94 50 19 call 0x232a0 ; 0x232a0 2384e: 0f 94 27 58 call 0x2b04e ; 0x2b04e planner_synchronize(); unload(); 23852: 0f 94 37 a0 call 0x3406e ; 0x3406e ScreenUpdateEnable(); 23856: 0f 94 18 c2 call 0x38430 ; 0x38430 2385a: cf 5f subi r28, 0xFF ; 255 2385c: c5 30 cpi r28, 0x05 ; 5 2385e: 69 f7 brne .-38 ; 0x2383a MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 23860: cf 91 pop r28 for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 23862: 0d 94 ef 35 jmp 0x26bde ; 0x26bde 00023866 : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 23866: cf 93 push r28 23868: df 93 push r29 2386a: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 2386c: 0f 94 20 88 call 0x31040 ; 0x31040 23870: c8 2f mov r28, r24 23872: 88 23 and r24, r24 23874: 69 f1 breq .+90 ; 0x238d0 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 23876: 88 ec ldi r24, 0xC8 ; 200 23878: 90 e0 ldi r25, 0x00 ; 0 2387a: 0f 94 77 c6 call 0x38cee ; 0x38cee (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> 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); 2387e: 82 e0 ldi r24, 0x02 ; 2 23880: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 23884: 88 e3 ldi r24, 0x38 ; 56 23886: 9d e5 ldi r25, 0x5D ; 93 23888: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2388c: 6d 2f mov r22, r29 2388e: 0f 94 1b c2 call 0x38436 ; 0x38436 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 23892: 0f 94 94 87 call 0x30f28 ; 0x30f28 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 23896: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2389a: 10 92 89 17 sts 0x1789, r1 ; 0x801789 { // used for MMU-menu operation "Load to Nozzle" ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly 2389e: 80 91 7f 13 lds r24, 0x137F ; 0x80137f 238a2: 83 36 cpi r24, 0x63 ; 99 238a4: 29 f0 breq .+10 ; 0x238b0 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 238a6: 62 e1 ldi r22, 0x12 ; 18 238a8: 8f e6 ldi r24, 0x6F ; 111 238aa: 96 ea ldi r25, 0xA6 ; 166 238ac: 0f 94 f7 87 call 0x30fee ; 0x30fee if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 238b0: 8d 2f mov r24, r29 238b2: 0f 94 f8 17 call 0x22ff0 ; 0x22ff0 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 238b6: 0e 94 80 d0 call 0x1a100 ; 0x1a100 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); 238ba: 83 e0 ldi r24, 0x03 ; 3 238bc: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 238c0: 88 e8 ldi r24, 0x88 ; 136 238c2: 97 e1 ldi r25, 0x17 ; 23 238c4: 0e 94 04 76 call 0xec08 ; 0xec08 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 238c8: 0f 94 15 88 call 0x3102a ; 0x3102a // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 238cc: 0f 94 18 c2 call 0x38430 ; 0x38430 return true; } 238d0: 8c 2f mov r24, r28 238d2: df 91 pop r29 238d4: cf 91 pop r28 238d6: 08 95 ret 000238d8 : /// 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) { 238d8: 1f 93 push r17 238da: cf 93 push r28 238dc: df 93 push r29 238de: c8 2f mov r28, r24 238e0: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 238e2: 0f 94 20 88 call 0x31040 ; 0x31040 238e6: d8 2f mov r29, r24 238e8: 88 23 and r24, r24 238ea: a9 f0 breq .+42 ; 0x23916 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 238ec: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 238f0: 10 92 89 17 sts 0x1789, r1 ; 0x801789 return false; } FSensorBlockRunout blockRunout; switch (code) { 238f4: c3 36 cpi r28, 0x63 ; 99 238f6: 11 f1 breq .+68 ; 0x2393c 238f8: c8 37 cpi r28, 0x78 ; 120 238fa: 91 f0 breq .+36 ; 0x23920 238fc: cf 33 cpi r28, 0x3F ; 63 238fe: 39 f4 brne .+14 ; 0x2390e case '?': { waitForHotendTargetTemp(100, [] {}); 23900: 84 e6 ldi r24, 0x64 ; 100 23902: 90 e0 ldi r25, 0x00 ; 0 23904: 0f 94 77 c6 call 0x38cee ; 0x38cee (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> load_filament_to_nozzle(slot); 23908: 81 2f mov r24, r17 2390a: 0f 94 33 1c call 0x23866 ; 0x23866 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 2390e: 88 e8 ldi r24, 0x88 ; 136 23910: 97 e1 ldi r25, 0x17 ; 23 23912: 0e 94 04 76 call 0xec08 ; 0xec08 execute_load_to_nozzle_sequence(); } break; } return true; } 23916: 8d 2f mov r24, r29 23918: df 91 pop r29 2391a: cf 91 pop r28 2391c: 1f 91 pop r17 2391e: 08 95 ret 23920: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 23924: 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); 23928: 81 2f mov r24, r17 2392a: 0f 94 50 19 call 0x232a0 ; 0x232a0 2392e: 8f ea ldi r24, 0xAF ; 175 23930: 90 e0 ldi r25, 0x00 ; 0 23932: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 23936: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 2393a: e9 cf rjmp .-46 ; 0x2390e thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 2393c: 84 e6 ldi r24, 0x64 ; 100 2393e: 90 e0 ldi r25, 0x00 ; 0 23940: 0f 94 77 c6 call 0x38cee ; 0x38cee (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> execute_load_to_nozzle_sequence(); 23944: 0e 94 80 d0 call 0x1a100 ; 0x1a100 23948: e2 cf rjmp .-60 ; 0x2390e 0002394a : 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); 2394a: 0f 94 33 1c call 0x23866 ; 0x23866 // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 2394e: 0e 94 c8 65 call 0xcb90 ; 0xcb90 st_synchronize(); 23952: 0f 94 27 58 call 0x2b04e ; 0x2b04e // Ask user if the extruded color is correct: lcd_return_to_status(); 23956: 0f 94 4e 26 call 0x24c9c ; 0x24c9c lcd_load_filament_color_check(); 2395a: 0f 94 89 67 call 0x2cf12 ; 0x2cf12 lcd_setstatuspgm(MSG_WELCOME); 2395e: 8e e0 ldi r24, 0x0E ; 14 23960: 91 e7 ldi r25, 0x71 ; 113 23962: 0f 94 0c 0b call 0x21618 ; 0x21618 custom_message_type = CustomMsg::Status; 23966: 10 92 75 07 sts 0x0775, r1 ; 0x800775 // Clear the filament action clearFilamentAction(); 2396a: 0d 94 ef 35 jmp 0x26bde ; 0x26bde 0002396e : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 2396e: cf 93 push r28 23970: df 93 push r29 23972: 00 d0 rcall .+0 ; 0x23974 23974: 1f 92 push r1 23976: 1f 92 push r1 23978: cd b7 in r28, 0x3d ; 61 2397a: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 2397c: 48 2f mov r20, r24 2397e: 68 e5 ldi r22, 0x58 ; 88 23980: ce 01 movw r24, r28 23982: 01 96 adiw r24, 0x01 ; 1 23984: 0f 94 d6 c2 call 0x385ac ; 0x385ac 23988: 49 81 ldd r20, Y+1 ; 0x01 2398a: 5a 81 ldd r21, Y+2 ; 0x02 2398c: 6b 81 ldd r22, Y+3 ; 0x03 2398e: 7c 81 ldd r23, Y+4 ; 0x04 23990: 8d 81 ldd r24, Y+5 ; 0x05 23992: 0f 94 48 98 call 0x33090 ; 0x33090 } 23996: 0f 90 pop r0 23998: 0f 90 pop r0 2399a: 0f 90 pop r0 2399c: 0f 90 pop r0 2399e: 0f 90 pop r0 239a0: df 91 pop r29 239a2: cf 91 pop r28 239a4: 08 95 ret 000239a6 : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 239a6: 1f 93 push r17 239a8: cf 93 push r28 239aa: df 93 push r29 239ac: 00 d0 rcall .+0 ; 0x239ae 239ae: 1f 92 push r1 239b0: 1f 92 push r1 239b2: cd b7 in r28, 0x3d ; 61 239b4: de b7 in r29, 0x3e ; 62 239b6: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 239b8: 0f 94 20 88 call 0x31040 ; 0x31040 239bc: 88 23 and r24, r24 239be: d9 f0 breq .+54 ; 0x239f6 void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 239c0: 41 2f mov r20, r17 239c2: 62 e5 ldi r22, 0x52 ; 82 239c4: ce 01 movw r24, r28 239c6: 01 96 adiw r24, 0x01 ; 1 239c8: 0f 94 d6 c2 call 0x385ac ; 0x385ac 239cc: 49 81 ldd r20, Y+1 ; 0x01 239ce: 5a 81 ldd r21, Y+2 ; 0x02 239d0: 6b 81 ldd r22, Y+3 ; 0x03 239d2: 7c 81 ldd r23, Y+4 ; 0x04 239d4: 8d 81 ldd r24, Y+5 ; 0x05 239d6: 0f 94 48 98 call 0x33090 ; 0x33090 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)); 239da: 60 e0 ldi r22, 0x00 ; 0 239dc: 80 e0 ldi r24, 0x00 ; 0 239de: 0f 94 6c 9f call 0x33ed8 ; 0x33ed8 239e2: 88 23 and r24, r24 239e4: 69 f3 breq .-38 ; 0x239c0 // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 239e6: 20 91 44 13 lds r18, 0x1344 ; 0x801344 239ea: 30 91 45 13 lds r19, 0x1345 ; 0x801345 239ee: 30 93 95 13 sts 0x1395, r19 ; 0x801395 239f2: 20 93 94 13 sts 0x1394, r18 ; 0x801394 return true; } 239f6: 0f 90 pop r0 239f8: 0f 90 pop r0 239fa: 0f 90 pop r0 239fc: 0f 90 pop r0 239fe: 0f 90 pop r0 23a00: df 91 pop r29 23a02: cf 91 pop r28 23a04: 1f 91 pop r17 23a06: 08 95 ret 00023a08 : waiting_handler(); } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { 23a08: ff 92 push r15 23a0a: 0f 93 push r16 23a0c: 1f 93 push r17 23a0e: cf 93 push r28 23a10: df 93 push r29 23a12: 1f 92 push r1 23a14: cd b7 in r28, 0x3d ; 61 23a16: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 23a18: ce 01 movw r24, r28 23a1a: 01 96 adiw r24, 0x01 ; 1 23a1c: 0f 94 d9 46 call 0x28db2 ; 0x28db2 uint16_t pos = 0; 23a20: 10 e0 ldi r17, 0x00 ; 0 23a22: 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]; 23a24: 85 e0 ldi r24, 0x05 ; 5 23a26: 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()) { 23a28: d1 99 sbic 0x1a, 1 ; 26 23a2a: 11 c0 rjmp .+34 ; 0x23a4e // temperatures not ready yet, just manage heaters while waiting to reduce jitter manage_heater(); 23a2c: 0f 94 9b 4d call 0x29b36 ; 0x29b36 static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; uint16_t pos = 0; while(pos < samples) { 23a30: 0e 3d cpi r16, 0xDE ; 222 23a32: 11 05 cpc r17, r1 23a34: c9 f7 brne .-14 ; 0x23a28 } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; 23a36: ce 01 movw r24, r28 23a38: 01 96 adiw r24, 0x01 ; 1 23a3a: 0f 94 cc 46 call 0x28d98 ; 0x28d98 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); } return pos; } 23a3e: c8 01 movw r24, r16 23a40: 0f 90 pop r0 23a42: df 91 pop r29 23a44: cf 91 pop r28 23a46: 1f 91 pop r17 23a48: 0f 91 pop r16 23a4a: ff 90 pop r15 23a4c: 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(); 23a4e: d1 9a sbi 0x1a, 1 ; 26 // manually repeat what the regular isr would do if(adc_values_ready != true) continue; 23a50: 80 91 1f 05 lds r24, 0x051F ; 0x80051f <_ZL16adc_values_ready.lto_priv.470> 23a54: 88 23 and r24, r24 23a56: 61 f3 breq .-40 ; 0x23a30 adc_values_ready = false; 23a58: 10 92 1f 05 sts 0x051F, r1 ; 0x80051f <_ZL16adc_values_ready.lto_priv.470> adc_start_cycle(); 23a5c: 0e 94 fc 8f call 0x11ff8 ; 0x11ff8 temp_mgr_isr(); 23a60: 0f 94 f8 4a call 0x295f0 ; 0x295f0 // stop recording for an hard error condition if(temp_error_state.v) 23a64: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 23a68: 81 11 cpse r24, r1 23a6a: 1b c0 rjmp .+54 ; 0x23aa2 return 0; // record a new entry rec_entry& entry = rec_buffer[pos]; 23a6c: f0 9e mul r15, r16 23a6e: f0 01 movw r30, r0 23a70: f1 9e mul r15, r17 23a72: f0 0d add r31, r0 23a74: 11 24 eor r1, r1 23a76: ea 58 subi r30, 0x8A ; 138 23a78: f8 4f sbci r31, 0xF8 ; 248 entry.temp = current_temperature_isr[0]; 23a7a: 80 91 1a 05 lds r24, 0x051A ; 0x80051a 23a7e: 90 91 1b 05 lds r25, 0x051B ; 0x80051b 23a82: a0 91 1c 05 lds r26, 0x051C ; 0x80051c 23a86: b0 91 1d 05 lds r27, 0x051D ; 0x80051d 23a8a: 80 83 st Z, r24 23a8c: 91 83 std Z+1, r25 ; 0x01 23a8e: a2 83 std Z+2, r26 ; 0x02 23a90: b3 83 std Z+3, r27 ; 0x03 entry.pwm = soft_pwm[0]; 23a92: 80 91 19 05 lds r24, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.472> 23a96: 84 83 std Z+4, r24 ; 0x04 ++pos; 23a98: 0f 5f subi r16, 0xFF ; 255 23a9a: 1f 4f sbci r17, 0xFF ; 255 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); 23a9c: 0f 94 c3 4f call 0x29f86 ; 0x29f86 23aa0: c7 cf rjmp .-114 ; 0x23a30 adc_start_cycle(); temp_mgr_isr(); // stop recording for an hard error condition if(temp_error_state.v) return 0; 23aa2: 10 e0 ldi r17, 0x00 ; 0 23aa4: 00 e0 ldi r16, 0x00 ; 0 23aa6: c7 cf rjmp .-114 ; 0x23a36 00023aa8 : 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) { 23aa8: fc 01 movw r30, r24 switch(*oCheckSetting) { 23aaa: 80 81 ld r24, Z 23aac: 88 23 and r24, r24 23aae: 21 f0 breq .+8 ; 0x23ab8 23ab0: 81 30 cpi r24, 0x01 ; 1 23ab2: 29 f4 brne .+10 ; 0x23abe case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 23ab4: 82 e0 ldi r24, 0x02 ; 2 23ab6: 01 c0 rjmp .+2 ; 0x23aba while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 23ab8: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 23aba: 80 83 st Z, r24 23abc: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 23abe: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 23ac0: 08 95 ret 00023ac2 : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 23ac2: fc 01 movw r30, r24 23ac4: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 23ac6: 90 32 cpi r25, 0x20 ; 32 23ac8: 49 f0 breq .+18 ; 0x23adc 23aca: 87 ef ldi r24, 0xF7 ; 247 23acc: 89 0f add r24, r25 23ace: 82 30 cpi r24, 0x02 ; 2 23ad0: 28 f0 brcs .+10 ; 0x23adc 23ad2: 81 e0 ldi r24, 0x01 ; 1 23ad4: 9d 30 cpi r25, 0x0D ; 13 23ad6: 19 f0 breq .+6 ; 0x23ade 23ad8: 80 e0 ldi r24, 0x00 ; 0 23ada: 08 95 ret 23adc: 81 e0 ldi r24, 0x01 ; 1 } 23ade: 08 95 ret 00023ae0 : 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; 23ae0: 88 3e cpi r24, 0xE8 ; 232 23ae2: 23 e0 ldi r18, 0x03 ; 3 23ae4: 92 07 cpc r25, r18 23ae6: 10 f0 brcs .+4 ; 0x23aec 23ae8: 87 ee ldi r24, 0xE7 ; 231 23aea: 93 e0 ldi r25, 0x03 ; 3 } 23aec: 08 95 ret 00023aee : return 0; } int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 23aee: 90 91 24 05 lds r25, 0x0524 ; 0x800524 23af2: 80 91 23 05 lds r24, 0x0523 ; 0x800523 23af6: 2f ef ldi r18, 0xFF ; 255 23af8: 3f ef ldi r19, 0xFF ; 255 23afa: 89 17 cp r24, r25 23afc: 71 f0 breq .+28 ; 0x23b1a _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 23afe: e9 2f mov r30, r25 23b00: f0 e0 ldi r31, 0x00 ; 0 23b02: ea 5d subi r30, 0xDA ; 218 23b04: fa 4f sbci r31, 0xFA ; 250 23b06: 20 81 ld r18, Z 23b08: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 23b0a: 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 23b0c: 80 91 22 05 lds r24, 0x0522 ; 0x800522 23b10: 98 17 cp r25, r24 23b12: 08 f0 brcs .+2 ; 0x23b16 23b14: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 23b16: 90 93 24 05 sts 0x0524, r25 ; 0x800524 return rbuf_get(uart2_ibuf); } 23b1a: c9 01 movw r24, r18 23b1c: 08 95 ret 00023b1e : FILE _uart2io = {0}; int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 23b1e: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 23b22: 95 ff sbrs r25, 5 23b24: fc cf rjmp .-8 ; 0x23b1e UDR2 = c; // transmit byte 23b26: 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; } 23b2a: 90 e0 ldi r25, 0x00 ; 0 23b2c: 80 e0 ldi r24, 0x00 ; 0 23b2e: 08 95 ret 00023b30 : } 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) { 23b30: cf 92 push r12 23b32: df 92 push r13 23b34: ef 92 push r14 23b36: ff 92 push r15 23b38: 0f 93 push r16 23b3a: 1f 93 push r17 23b3c: cf 93 push r28 23b3e: df 93 push r29 23b40: 8c 01 movw r16, r24 23b42: ea 01 movw r28, r20 uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23b44: 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; 23b46: 50 e0 ldi r21, 0x00 ; 0 for (uint8_t i = 0; i < (size - 1); i++) 23b48: 61 50 subi r22, 0x01 ; 1 23b4a: 77 0b sbc r23, r23 23b4c: 29 2f mov r18, r25 23b4e: 30 e0 ldi r19, 0x00 ; 0 23b50: 26 17 cp r18, r22 23b52: 37 07 cpc r19, r23 23b54: 2c f0 brlt .+10 ; 0x23b60 } void bubblesort_uint8(uint8_t* data, uint8_t size, uint8_t* data2) { uint8_t changed = 1; while (changed) 23b56: 55 23 and r21, r21 23b58: 19 f1 breq .+70 ; 0x23ba0 { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23b5a: 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; 23b5c: 50 e0 ldi r21, 0x00 ; 0 23b5e: f6 cf rjmp .-20 ; 0x23b4c for (uint8_t i = 0; i < (size - 1); i++) if (data[i] > data[i+1]) 23b60: 78 01 movw r14, r16 23b62: e2 0e add r14, r18 23b64: f3 1e adc r15, r19 23b66: f7 01 movw r30, r14 23b68: 80 81 ld r24, Z 23b6a: d9 01 movw r26, r18 23b6c: 11 96 adiw r26, 0x01 ; 1 23b6e: 68 01 movw r12, r16 23b70: ca 0e add r12, r26 23b72: db 1e adc r13, r27 23b74: f6 01 movw r30, r12 23b76: 40 81 ld r20, Z 23b78: 48 17 cp r20, r24 23b7a: 80 f4 brcc .+32 ; 0x23b9c { uint8_t d = data[i]; data[i] = data[i+1]; 23b7c: f7 01 movw r30, r14 23b7e: 40 83 st Z, r20 data[i+1] = d; 23b80: f6 01 movw r30, r12 23b82: 80 83 st Z, r24 if (data2) 23b84: 20 97 sbiw r28, 0x00 ; 0 23b86: 49 f0 breq .+18 ; 0x23b9a { d = data2[i]; 23b88: fe 01 movw r30, r28 23b8a: e2 0f add r30, r18 23b8c: f3 1f adc r31, r19 23b8e: 80 81 ld r24, Z data2[i] = data2[i+1]; 23b90: ac 0f add r26, r28 23b92: bd 1f adc r27, r29 23b94: 2c 91 ld r18, X 23b96: 20 83 st Z, r18 data2[i+1] = d; 23b98: 8c 93 st X, r24 } changed = 1; 23b9a: 51 e0 ldi r21, 0x01 ; 1 { uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23b9c: 9f 5f subi r25, 0xFF ; 255 23b9e: d6 cf rjmp .-84 ; 0x23b4c data2[i+1] = d; } changed = 1; } } } 23ba0: df 91 pop r29 23ba2: cf 91 pop r28 23ba4: 1f 91 pop r17 23ba6: 0f 91 pop r16 23ba8: ff 90 pop r15 23baa: ef 90 pop r14 23bac: df 90 pop r13 23bae: cf 90 pop r12 23bb0: 08 95 ret 00023bb2 : } } inline void tmc2130_cs_high(uint8_t axis) { switch (axis) 23bb2: 81 30 cpi r24, 0x01 ; 1 23bb4: 41 f0 breq .+16 ; 0x23bc6 23bb6: 28 f0 brcs .+10 ; 0x23bc2 23bb8: 82 30 cpi r24, 0x02 ; 2 23bba: 39 f0 breq .+14 ; 0x23bca 23bbc: 83 30 cpi r24, 0x03 ; 3 23bbe: 71 f0 breq .+28 ; 0x23bdc 23bc0: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, HIGH); break; 23bc2: a0 9a sbi 0x14, 0 ; 20 23bc4: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, HIGH); break; 23bc6: a2 9a sbi 0x14, 2 ; 20 23bc8: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, HIGH); break; 23bca: 9f b7 in r25, 0x3f ; 63 23bcc: f8 94 cli 23bce: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23bd2: 80 62 ori r24, 0x20 ; 32 case E_AXIS: WRITE(E0_TMC2130_CS, HIGH); break; 23bd4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23bd8: 9f bf out 0x3f, r25 ; 63 } } 23bda: 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; 23bdc: 9f b7 in r25, 0x3f ; 63 23bde: f8 94 cli 23be0: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23be4: 80 61 ori r24, 0x10 ; 16 23be6: f6 cf rjmp .-20 ; 0x23bd4 00023be8 : } inline void tmc2130_cs_low(uint8_t axis) { switch (axis) 23be8: 81 30 cpi r24, 0x01 ; 1 23bea: 41 f0 breq .+16 ; 0x23bfc 23bec: 28 f0 brcs .+10 ; 0x23bf8 23bee: 82 30 cpi r24, 0x02 ; 2 23bf0: 39 f0 breq .+14 ; 0x23c00 23bf2: 83 30 cpi r24, 0x03 ; 3 23bf4: 71 f0 breq .+28 ; 0x23c12 23bf6: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, LOW); break; 23bf8: a0 98 cbi 0x14, 0 ; 20 23bfa: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, LOW); break; 23bfc: a2 98 cbi 0x14, 2 ; 20 23bfe: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, LOW); break; 23c00: 9f b7 in r25, 0x3f ; 63 23c02: f8 94 cli 23c04: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23c08: 8f 7d andi r24, 0xDF ; 223 case E_AXIS: WRITE(E0_TMC2130_CS, LOW); break; 23c0a: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23c0e: 9f bf out 0x3f, r25 ; 63 } } 23c10: 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; 23c12: 9f b7 in r25, 0x3f ; 63 23c14: f8 94 cli 23c16: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23c1a: 8f 7e andi r24, 0xEF ; 239 23c1c: f6 cf rjmp .-20 ; 0x23c0a 00023c1e : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 23c1e: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 23c20: 0d b4 in r0, 0x2d ; 45 23c22: 07 fe sbrs r0, 7 23c24: fd cf rjmp .-6 ; 0x23c20 return SPDR; 23c26: 8e b5 in r24, 0x2e ; 46 } 23c28: 08 95 ret 00023c2a : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 23c2a: 2f 92 push r2 23c2c: 3f 92 push r3 23c2e: 4f 92 push r4 23c30: 5f 92 push r5 23c32: 6f 92 push r6 23c34: 7f 92 push r7 23c36: 8f 92 push r8 23c38: 9f 92 push r9 23c3a: af 92 push r10 23c3c: bf 92 push r11 23c3e: cf 92 push r12 23c40: df 92 push r13 23c42: ef 92 push r14 23c44: ff 92 push r15 23c46: 0f 93 push r16 23c48: 1f 93 push r17 23c4a: cf 93 push r28 23c4c: df 93 push r29 23c4e: cd b7 in r28, 0x3d ; 61 23c50: de b7 in r29, 0x3e ; 62 23c52: 2e 97 sbiw r28, 0x0e ; 14 23c54: 0f b6 in r0, 0x3f ; 63 23c56: f8 94 cli 23c58: de bf out 0x3e, r29 ; 62 23c5a: 0f be out 0x3f, r0 ; 63 23c5c: 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]); 23c5e: 20 90 1b 06 lds r2, 0x061B ; 0x80061b 23c62: 30 90 1c 06 lds r3, 0x061C ; 0x80061c 23c66: 40 90 1a 05 lds r4, 0x051A ; 0x80051a 23c6a: 50 90 1b 05 lds r5, 0x051B ; 0x80051b 23c6e: 60 90 1c 05 lds r6, 0x051C ; 0x80051c 23c72: 70 90 1d 05 lds r7, 0x051D ; 0x80051d #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 23c76: 21 14 cp r2, r1 23c78: 31 04 cpc r3, r1 23c7a: 39 f4 brne .+14 ; 0x23c8a pid_output = 0; pid_reset[e] = true; 23c7c: 81 e0 ldi r24, 0x01 ; 1 23c7e: 80 93 f2 05 sts 0x05F2, r24 ; 0x8005f2 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; 23c82: 81 2c mov r8, r1 23c84: 91 2c mov r9, r1 23c86: 54 01 movw r10, r8 23c88: f9 c0 rjmp .+498 ; 0x23e7c #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 23c8a: b1 01 movw r22, r2 23c8c: 03 2c mov r0, r3 23c8e: 00 0c add r0, r0 23c90: 88 0b sbc r24, r24 23c92: 99 0b sbc r25, r25 23c94: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 23c98: a3 01 movw r20, r6 23c9a: 92 01 movw r18, r4 23c9c: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 23ca0: 6b 01 movw r12, r22 23ca2: 7c 01 movw r14, r24 if(pid_reset[e]) { 23ca4: 80 91 f2 05 lds r24, 0x05F2 ; 0x8005f2 23ca8: 88 23 and r24, r24 23caa: 91 f0 breq .+36 ; 0x23cd0 iState_sum[e] = 0.0; 23cac: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee 23cb0: 10 92 ef 05 sts 0x05EF, r1 ; 0x8005ef 23cb4: 10 92 f0 05 sts 0x05F0, r1 ; 0x8005f0 23cb8: 10 92 f1 05 sts 0x05F1, r1 ; 0x8005f1 dTerm[e] = 0.0; // 'dState_last[e]' initial setting is not necessary (see end of if-statement) 23cbc: 10 92 ea 05 sts 0x05EA, r1 ; 0x8005ea 23cc0: 10 92 eb 05 sts 0x05EB, r1 ; 0x8005eb 23cc4: 10 92 ec 05 sts 0x05EC, r1 ; 0x8005ec 23cc8: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed pid_reset[e] = false; 23ccc: 10 92 f2 05 sts 0x05F2, r1 ; 0x8005f2 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 23cd0: 20 91 d6 06 lds r18, 0x06D6 ; 0x8006d6 23cd4: 30 91 d7 06 lds r19, 0x06D7 ; 0x8006d7 23cd8: 40 91 d8 06 lds r20, 0x06D8 ; 0x8006d8 23cdc: 50 91 d9 06 lds r21, 0x06D9 ; 0x8006d9 23ce0: c7 01 movw r24, r14 23ce2: b6 01 movw r22, r12 23ce4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 23ce8: 69 83 std Y+1, r22 ; 0x01 23cea: 7a 83 std Y+2, r23 ; 0x02 23cec: 8b 83 std Y+3, r24 ; 0x03 23cee: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 23cf0: 20 91 ee 05 lds r18, 0x05EE ; 0x8005ee 23cf4: 30 91 ef 05 lds r19, 0x05EF ; 0x8005ef 23cf8: 40 91 f0 05 lds r20, 0x05F0 ; 0x8005f0 23cfc: 50 91 f1 05 lds r21, 0x05F1 ; 0x8005f1 23d00: c7 01 movw r24, r14 23d02: b6 01 movw r22, r12 23d04: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 23d08: 4b 01 movw r8, r22 23d0a: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 23d0c: 20 91 ad 04 lds r18, 0x04AD ; 0x8004ad <_ZL14iState_sum_min.lto_priv.481> 23d10: 2d 87 std Y+13, r18 ; 0x0d 23d12: 30 91 ae 04 lds r19, 0x04AE ; 0x8004ae <_ZL14iState_sum_min.lto_priv.481+0x1> 23d16: 39 87 std Y+9, r19 ; 0x09 23d18: 10 91 af 04 lds r17, 0x04AF ; 0x8004af <_ZL14iState_sum_min.lto_priv.481+0x2> 23d1c: 00 91 b0 04 lds r16, 0x04B0 ; 0x8004b0 <_ZL14iState_sum_min.lto_priv.481+0x3> 23d20: 41 2f mov r20, r17 23d22: 50 2f mov r21, r16 23d24: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 23d28: 87 fd sbrc r24, 7 23d2a: 17 c0 rjmp .+46 ; 0x23d5a 23d2c: 80 91 a9 04 lds r24, 0x04A9 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.482> 23d30: 8d 87 std Y+13, r24 ; 0x0d 23d32: 90 91 aa 04 lds r25, 0x04AA ; 0x8004aa <_ZL14iState_sum_max.lto_priv.482+0x1> 23d36: 99 87 std Y+9, r25 ; 0x09 23d38: 10 91 ab 04 lds r17, 0x04AB ; 0x8004ab <_ZL14iState_sum_max.lto_priv.482+0x2> 23d3c: 00 91 ac 04 lds r16, 0x04AC ; 0x8004ac <_ZL14iState_sum_max.lto_priv.482+0x3> 23d40: 9c 01 movw r18, r24 23d42: 41 2f mov r20, r17 23d44: 50 2f mov r21, r16 23d46: b4 01 movw r22, r8 23d48: c5 01 movw r24, r10 23d4a: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 23d4e: 18 16 cp r1, r24 23d50: 24 f0 brlt .+8 ; 0x23d5a 23d52: 8d 86 std Y+13, r8 ; 0x0d 23d54: 99 86 std Y+9, r9 ; 0x09 23d56: 1a 2d mov r17, r10 23d58: 0b 2d mov r16, r11 23d5a: 8d 85 ldd r24, Y+13 ; 0x0d 23d5c: 99 85 ldd r25, Y+9 ; 0x09 23d5e: a1 2f mov r26, r17 23d60: b0 2f mov r27, r16 23d62: 80 93 ee 05 sts 0x05EE, r24 ; 0x8005ee 23d66: 90 93 ef 05 sts 0x05EF, r25 ; 0x8005ef 23d6a: a0 93 f0 05 sts 0x05F0, r26 ; 0x8005f0 23d6e: b0 93 f1 05 sts 0x05F1, r27 ; 0x8005f1 iTerm[e] = cs.Ki * iState_sum[e]; 23d72: 20 91 da 06 lds r18, 0x06DA ; 0x8006da 23d76: 30 91 db 06 lds r19, 0x06DB ; 0x8006db 23d7a: 40 91 dc 06 lds r20, 0x06DC ; 0x8006dc 23d7e: 50 91 dd 06 lds r21, 0x06DD ; 0x8006dd 23d82: bc 01 movw r22, r24 23d84: 81 2f mov r24, r17 23d86: 90 2f mov r25, r16 23d88: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 23d8c: 6d 83 std Y+5, r22 ; 0x05 23d8e: 7e 83 std Y+6, r23 ; 0x06 23d90: 8f 83 std Y+7, r24 ; 0x07 23d92: 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 23d94: 20 91 e6 05 lds r18, 0x05E6 ; 0x8005e6 23d98: 30 91 e7 05 lds r19, 0x05E7 ; 0x8005e7 23d9c: 40 91 e8 05 lds r20, 0x05E8 ; 0x8005e8 23da0: 50 91 e9 05 lds r21, 0x05E9 ; 0x8005e9 23da4: c3 01 movw r24, r6 23da6: b2 01 movw r22, r4 23da8: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 23dac: 20 91 de 06 lds r18, 0x06DE ; 0x8006de 23db0: 30 91 df 06 lds r19, 0x06DF ; 0x8006df 23db4: 40 91 e0 06 lds r20, 0x06E0 ; 0x8006e0 23db8: 50 91 e1 06 lds r21, 0x06E1 ; 0x8006e1 23dbc: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 23dc0: 20 ed ldi r18, 0xD0 ; 208 23dc2: 3c ec ldi r19, 0xCC ; 204 23dc4: 4c e4 ldi r20, 0x4C ; 76 23dc6: 5d e3 ldi r21, 0x3D ; 61 23dc8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 23dcc: 4b 01 movw r8, r22 23dce: 5c 01 movw r10, r24 23dd0: 23 e3 ldi r18, 0x33 ; 51 23dd2: 33 e3 ldi r19, 0x33 ; 51 23dd4: 43 e7 ldi r20, 0x73 ; 115 23dd6: 5f e3 ldi r21, 0x3F ; 63 23dd8: 60 91 ea 05 lds r22, 0x05EA ; 0x8005ea 23ddc: 70 91 eb 05 lds r23, 0x05EB ; 0x8005eb 23de0: 80 91 ec 05 lds r24, 0x05EC ; 0x8005ec 23de4: 90 91 ed 05 lds r25, 0x05ED ; 0x8005ed 23de8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 23dec: 9b 01 movw r18, r22 23dee: ac 01 movw r20, r24 23df0: c5 01 movw r24, r10 23df2: b4 01 movw r22, r8 23df4: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 23df8: 4b 01 movw r8, r22 23dfa: 5c 01 movw r10, r24 23dfc: 80 92 ea 05 sts 0x05EA, r8 ; 0x8005ea 23e00: 90 92 eb 05 sts 0x05EB, r9 ; 0x8005eb 23e04: a0 92 ec 05 sts 0x05EC, r10 ; 0x8005ec 23e08: b0 92 ed 05 sts 0x05ED, r11 ; 0x8005ed 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) 23e0c: 2d 81 ldd r18, Y+5 ; 0x05 23e0e: 3e 81 ldd r19, Y+6 ; 0x06 23e10: 4f 81 ldd r20, Y+7 ; 0x07 23e12: 58 85 ldd r21, Y+8 ; 0x08 23e14: 69 81 ldd r22, Y+1 ; 0x01 23e16: 7a 81 ldd r23, Y+2 ; 0x02 23e18: 8b 81 ldd r24, Y+3 ; 0x03 23e1a: 9c 81 ldd r25, Y+4 ; 0x04 23e1c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 23e20: a5 01 movw r20, r10 23e22: 94 01 movw r18, r8 23e24: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 23e28: 4b 01 movw r8, r22 23e2a: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 23e2c: 20 e0 ldi r18, 0x00 ; 0 23e2e: 30 e0 ldi r19, 0x00 ; 0 23e30: 4f e7 ldi r20, 0x7F ; 127 23e32: 53 e4 ldi r21, 0x43 ; 67 23e34: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 23e38: 20 e0 ldi r18, 0x00 ; 0 23e3a: 30 e0 ldi r19, 0x00 ; 0 23e3c: 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) { 23e3e: 18 16 cp r1, r24 23e40: 0c f0 brlt .+2 ; 0x23e44 23e42: 6d c1 rjmp .+730 ; 0x2411e if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 23e44: c7 01 movw r24, r14 23e46: b6 01 movw r22, r12 23e48: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 23e4c: 18 16 cp r1, r24 23e4e: 84 f4 brge .+32 ; 0x23e70 23e50: a7 01 movw r20, r14 23e52: 96 01 movw r18, r12 23e54: 6d 85 ldd r22, Y+13 ; 0x0d 23e56: 79 85 ldd r23, Y+9 ; 0x09 23e58: 81 2f mov r24, r17 23e5a: 90 2f mov r25, r16 23e5c: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 23e60: 60 93 ee 05 sts 0x05EE, r22 ; 0x8005ee 23e64: 70 93 ef 05 sts 0x05EF, r23 ; 0x8005ef 23e68: 80 93 f0 05 sts 0x05F0, r24 ; 0x8005f0 23e6c: 90 93 f1 05 sts 0x05F1, r25 ; 0x8005f1 pid_output=PID_MAX; 23e70: 81 2c mov r8, r1 23e72: 91 2c mov r9, r1 23e74: 3f e7 ldi r19, 0x7F ; 127 23e76: a3 2e mov r10, r19 23e78: 33 e4 ldi r19, 0x43 ; 67 23e7a: 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; 23e7c: 40 92 e6 05 sts 0x05E6, r4 ; 0x8005e6 23e80: 50 92 e7 05 sts 0x05E7, r5 ; 0x8005e7 23e84: 60 92 e8 05 sts 0x05E8, r6 ; 0x8005e8 23e88: 70 92 e9 05 sts 0x05E9, r7 ; 0x8005e9 pid_output = PID_MAX; } #endif // Check if temperature is within the correct range if((current < maxttemp[e]) && (target != 0)) 23e8c: 60 91 56 02 lds r22, 0x0256 ; 0x800256 <_ZL8maxttemp.lto_priv.483> 23e90: 70 91 57 02 lds r23, 0x0257 ; 0x800257 <_ZL8maxttemp.lto_priv.483+0x1> 23e94: 07 2e mov r0, r23 23e96: 00 0c add r0, r0 23e98: 88 0b sbc r24, r24 23e9a: 99 0b sbc r25, r25 23e9c: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 23ea0: 9b 01 movw r18, r22 23ea2: ac 01 movw r20, r24 23ea4: c3 01 movw r24, r6 23ea6: b2 01 movw r22, r4 23ea8: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 23eac: 87 ff sbrs r24, 7 23eae: 57 c1 rjmp .+686 ; 0x2415e 23eb0: 23 28 or r2, r3 23eb2: 09 f4 brne .+2 ; 0x23eb6 23eb4: 54 c1 rjmp .+680 ; 0x2415e soft_pwm[e] = (int)pid_output >> 1; 23eb6: c5 01 movw r24, r10 23eb8: b4 01 movw r22, r8 23eba: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 23ebe: 75 95 asr r23 23ec0: 67 95 ror r22 23ec2: 60 93 19 05 sts 0x0519, r22 ; 0x800519 <_ZL8soft_pwm.lto_priv.472> 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); 23ec6: 20 91 14 06 lds r18, 0x0614 ; 0x800614 23eca: 30 91 15 06 lds r19, 0x0615 ; 0x800615 23ece: 3a 83 std Y+2, r19 ; 0x02 23ed0: 29 83 std Y+1, r18 ; 0x01 23ed2: 40 90 16 06 lds r4, 0x0616 ; 0x800616 23ed6: 50 90 17 06 lds r5, 0x0617 ; 0x800617 23eda: 60 90 18 06 lds r6, 0x0618 ; 0x800618 23ede: 70 90 19 06 lds r7, 0x0619 ; 0x800619 #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 23ee2: b9 01 movw r22, r18 23ee4: 33 0f add r19, r19 23ee6: 88 0b sbc r24, r24 23ee8: 99 0b sbc r25, r25 23eea: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 23eee: a3 01 movw r20, r6 23ef0: 92 01 movw r18, r4 23ef2: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 23ef6: 6b 01 movw r12, r22 23ef8: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 23efa: 20 91 e2 06 lds r18, 0x06E2 ; 0x8006e2 23efe: 30 91 e3 06 lds r19, 0x06E3 ; 0x8006e3 23f02: 40 91 e4 06 lds r20, 0x06E4 ; 0x8006e4 23f06: 50 91 e5 06 lds r21, 0x06E5 ; 0x8006e5 23f0a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 23f0e: 6d 83 std Y+5, r22 ; 0x05 23f10: 7e 83 std Y+6, r23 ; 0x06 23f12: 8f 83 std Y+7, r24 ; 0x07 23f14: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 23f16: 20 91 fb 05 lds r18, 0x05FB ; 0x8005fb 23f1a: 30 91 fc 05 lds r19, 0x05FC ; 0x8005fc 23f1e: 40 91 fd 05 lds r20, 0x05FD ; 0x8005fd 23f22: 50 91 fe 05 lds r21, 0x05FE ; 0x8005fe 23f26: c7 01 movw r24, r14 23f28: b6 01 movw r22, r12 23f2a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 23f2e: 5b 01 movw r10, r22 23f30: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 23f32: 30 91 a5 04 lds r19, 0x04A5 ; 0x8004a5 <_ZL19temp_iState_min_bed.lto_priv.479> 23f36: 3e 87 std Y+14, r19 ; 0x0e 23f38: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 <_ZL19temp_iState_min_bed.lto_priv.479+0x1> 23f3c: 8d 87 std Y+13, r24 ; 0x0d 23f3e: 30 90 a7 04 lds r3, 0x04A7 ; 0x8004a7 <_ZL19temp_iState_min_bed.lto_priv.479+0x2> 23f42: 20 90 a8 04 lds r2, 0x04A8 ; 0x8004a8 <_ZL19temp_iState_min_bed.lto_priv.479+0x3> 23f46: 23 2f mov r18, r19 23f48: 38 2f mov r19, r24 23f4a: 43 2d mov r20, r3 23f4c: 52 2d mov r21, r2 23f4e: b5 01 movw r22, r10 23f50: c8 01 movw r24, r16 23f52: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 23f56: 87 fd sbrc r24, 7 23f58: 18 c0 rjmp .+48 ; 0x23f8a 23f5a: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.480> 23f5e: 9e 87 std Y+14, r25 ; 0x0e 23f60: 20 91 a2 04 lds r18, 0x04A2 ; 0x8004a2 <_ZL19temp_iState_max_bed.lto_priv.480+0x1> 23f64: 2d 87 std Y+13, r18 ; 0x0d 23f66: 30 90 a3 04 lds r3, 0x04A3 ; 0x8004a3 <_ZL19temp_iState_max_bed.lto_priv.480+0x2> 23f6a: 20 90 a4 04 lds r2, 0x04A4 ; 0x8004a4 <_ZL19temp_iState_max_bed.lto_priv.480+0x3> 23f6e: 29 2f mov r18, r25 23f70: 3d 85 ldd r19, Y+13 ; 0x0d 23f72: 43 2d mov r20, r3 23f74: 52 2d mov r21, r2 23f76: b5 01 movw r22, r10 23f78: c8 01 movw r24, r16 23f7a: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 23f7e: 18 16 cp r1, r24 23f80: 24 f0 brlt .+8 ; 0x23f8a 23f82: ae 86 std Y+14, r10 ; 0x0e 23f84: bd 86 std Y+13, r11 ; 0x0d 23f86: 30 2e mov r3, r16 23f88: 21 2e mov r2, r17 23f8a: 8e 85 ldd r24, Y+14 ; 0x0e 23f8c: 9d 85 ldd r25, Y+13 ; 0x0d 23f8e: a3 2d mov r26, r3 23f90: b2 2d mov r27, r2 23f92: 80 93 fb 05 sts 0x05FB, r24 ; 0x8005fb 23f96: 90 93 fc 05 sts 0x05FC, r25 ; 0x8005fc 23f9a: a0 93 fd 05 sts 0x05FD, r26 ; 0x8005fd 23f9e: b0 93 fe 05 sts 0x05FE, r27 ; 0x8005fe iTerm_bed = cs.bedKi * temp_iState_bed; 23fa2: 20 91 e6 06 lds r18, 0x06E6 ; 0x8006e6 23fa6: 30 91 e7 06 lds r19, 0x06E7 ; 0x8006e7 23faa: 40 91 e8 06 lds r20, 0x06E8 ; 0x8006e8 23fae: 50 91 e9 06 lds r21, 0x06E9 ; 0x8006e9 23fb2: bc 01 movw r22, r24 23fb4: 83 2d mov r24, r3 23fb6: 92 2d mov r25, r2 23fb8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 23fbc: 69 87 std Y+9, r22 ; 0x09 23fbe: 7a 87 std Y+10, r23 ; 0x0a 23fc0: 8b 87 std Y+11, r24 ; 0x0b 23fc2: 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); 23fc4: 20 91 f7 05 lds r18, 0x05F7 ; 0x8005f7 23fc8: 30 91 f8 05 lds r19, 0x05F8 ; 0x8005f8 23fcc: 40 91 f9 05 lds r20, 0x05F9 ; 0x8005f9 23fd0: 50 91 fa 05 lds r21, 0x05FA ; 0x8005fa 23fd4: c3 01 movw r24, r6 23fd6: b2 01 movw r22, r4 23fd8: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 23fdc: 20 91 ea 06 lds r18, 0x06EA ; 0x8006ea 23fe0: 30 91 eb 06 lds r19, 0x06EB ; 0x8006eb 23fe4: 40 91 ec 06 lds r20, 0x06EC ; 0x8006ec 23fe8: 50 91 ed 06 lds r21, 0x06ED ; 0x8006ed 23fec: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 23ff0: 20 ed ldi r18, 0xD0 ; 208 23ff2: 3c ec ldi r19, 0xCC ; 204 23ff4: 4c e4 ldi r20, 0x4C ; 76 23ff6: 5d e3 ldi r21, 0x3D ; 61 23ff8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 23ffc: 4b 01 movw r8, r22 23ffe: 5c 01 movw r10, r24 24000: 23 e3 ldi r18, 0x33 ; 51 24002: 33 e3 ldi r19, 0x33 ; 51 24004: 43 e7 ldi r20, 0x73 ; 115 24006: 5f e3 ldi r21, 0x3F ; 63 24008: 60 91 f3 05 lds r22, 0x05F3 ; 0x8005f3 2400c: 70 91 f4 05 lds r23, 0x05F4 ; 0x8005f4 24010: 80 91 f5 05 lds r24, 0x05F5 ; 0x8005f5 24014: 90 91 f6 05 lds r25, 0x05F6 ; 0x8005f6 24018: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2401c: 9b 01 movw r18, r22 2401e: ac 01 movw r20, r24 24020: c5 01 movw r24, r10 24022: b4 01 movw r22, r8 24024: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 24028: 4b 01 movw r8, r22 2402a: 5c 01 movw r10, r24 2402c: 80 92 f3 05 sts 0x05F3, r8 ; 0x8005f3 24030: 90 92 f4 05 sts 0x05F4, r9 ; 0x8005f4 24034: a0 92 f5 05 sts 0x05F5, r10 ; 0x8005f5 24038: b0 92 f6 05 sts 0x05F6, r11 ; 0x8005f6 temp_dState_bed = pid_input; 2403c: 40 92 f7 05 sts 0x05F7, r4 ; 0x8005f7 24040: 50 92 f8 05 sts 0x05F8, r5 ; 0x8005f8 24044: 60 92 f9 05 sts 0x05F9, r6 ; 0x8005f9 24048: 70 92 fa 05 sts 0x05FA, r7 ; 0x8005fa pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 2404c: 29 85 ldd r18, Y+9 ; 0x09 2404e: 3a 85 ldd r19, Y+10 ; 0x0a 24050: 4b 85 ldd r20, Y+11 ; 0x0b 24052: 5c 85 ldd r21, Y+12 ; 0x0c 24054: 6d 81 ldd r22, Y+5 ; 0x05 24056: 7e 81 ldd r23, Y+6 ; 0x06 24058: 8f 81 ldd r24, Y+7 ; 0x07 2405a: 98 85 ldd r25, Y+8 ; 0x08 2405c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 24060: a5 01 movw r20, r10 24062: 94 01 movw r18, r8 24064: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 24068: 4b 01 movw r8, r22 2406a: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 2406c: 20 e0 ldi r18, 0x00 ; 0 2406e: 30 e0 ldi r19, 0x00 ; 0 24070: 4f e7 ldi r20, 0x7F ; 127 24072: 53 e4 ldi r21, 0x43 ; 67 24074: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 24078: 20 e0 ldi r18, 0x00 ; 0 2407a: 30 e0 ldi r19, 0x00 ; 0 2407c: 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) { 2407e: 18 16 cp r1, r24 24080: 0c f0 brlt .+2 ; 0x24084 24082: 70 c0 rjmp .+224 ; 0x24164 if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 24084: c7 01 movw r24, r14 24086: b6 01 movw r22, r12 24088: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 2408c: 18 16 cp r1, r24 2408e: 84 f4 brge .+32 ; 0x240b0 24090: a7 01 movw r20, r14 24092: 96 01 movw r18, r12 24094: 6e 85 ldd r22, Y+14 ; 0x0e 24096: 7d 85 ldd r23, Y+13 ; 0x0d 24098: 83 2d mov r24, r3 2409a: 92 2d mov r25, r2 2409c: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 240a0: 60 93 fb 05 sts 0x05FB, r22 ; 0x8005fb 240a4: 70 93 fc 05 sts 0x05FC, r23 ; 0x8005fc 240a8: 80 93 fd 05 sts 0x05FD, r24 ; 0x8005fd 240ac: 90 93 fe 05 sts 0x05FE, r25 ; 0x8005fe pid_output=MAX_BED_POWER; 240b0: 81 2c mov r8, r1 240b2: 91 2c mov r9, r1 240b4: 9f e7 ldi r25, 0x7F ; 127 240b6: a9 2e mov r10, r25 240b8: 93 e4 ldi r25, 0x43 ; 67 240ba: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 240bc: 20 e0 ldi r18, 0x00 ; 0 240be: 30 e0 ldi r19, 0x00 ; 0 240c0: 4a ef ldi r20, 0xFA ; 250 240c2: 52 e4 ldi r21, 0x42 ; 66 240c4: c3 01 movw r24, r6 240c6: b2 01 movw r22, r4 240c8: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 240cc: 87 ff sbrs r24, 7 240ce: 6d c0 rjmp .+218 ; 0x241aa { soft_pwm_bed = (int)pid_output >> 1; 240d0: c5 01 movw r24, r10 240d2: b4 01 movw r22, r8 240d4: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 240d8: 75 95 asr r23 240da: 67 95 ror r22 240dc: 60 93 1a 06 sts 0x061A, r22 ; 0x80061a soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 240e0: 89 81 ldd r24, Y+1 ; 0x01 240e2: 9a 81 ldd r25, Y+2 ; 0x02 240e4: 89 2b or r24, r25 240e6: 11 f4 brne .+4 ; 0x240ec { soft_pwm_bed = 0; 240e8: 10 92 1a 06 sts 0x061A, r1 ; 0x80061a 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); } 240ec: 2e 96 adiw r28, 0x0e ; 14 240ee: 0f b6 in r0, 0x3f ; 63 240f0: f8 94 cli 240f2: de bf out 0x3e, r29 ; 62 240f4: 0f be out 0x3f, r0 ; 63 240f6: cd bf out 0x3d, r28 ; 61 240f8: df 91 pop r29 240fa: cf 91 pop r28 240fc: 1f 91 pop r17 240fe: 0f 91 pop r16 24100: ff 90 pop r15 24102: ef 90 pop r14 24104: df 90 pop r13 24106: cf 90 pop r12 24108: bf 90 pop r11 2410a: af 90 pop r10 2410c: 9f 90 pop r9 2410e: 8f 90 pop r8 24110: 7f 90 pop r7 24112: 6f 90 pop r6 24114: 5f 90 pop r5 24116: 4f 90 pop r4 24118: 3f 90 pop r3 2411a: 2f 90 pop r2 2411c: 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) { 2411e: c5 01 movw r24, r10 24120: b4 01 movw r22, r8 24122: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 24126: 87 ff sbrs r24, 7 24128: a9 ce rjmp .-686 ; 0x23e7c if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 2412a: 20 e0 ldi r18, 0x00 ; 0 2412c: 30 e0 ldi r19, 0x00 ; 0 2412e: a9 01 movw r20, r18 24130: c7 01 movw r24, r14 24132: b6 01 movw r22, r12 24134: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 24138: 87 ff sbrs r24, 7 2413a: a3 cd rjmp .-1210 ; 0x23c82 2413c: a7 01 movw r20, r14 2413e: 96 01 movw r18, r12 24140: 6d 85 ldd r22, Y+13 ; 0x0d 24142: 79 85 ldd r23, Y+9 ; 0x09 24144: 81 2f mov r24, r17 24146: 90 2f mov r25, r16 24148: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 2414c: 60 93 ee 05 sts 0x05EE, r22 ; 0x8005ee 24150: 70 93 ef 05 sts 0x05EF, r23 ; 0x8005ef 24154: 80 93 f0 05 sts 0x05F0, r24 ; 0x8005f0 24158: 90 93 f1 05 sts 0x05F1, r25 ; 0x8005f1 2415c: 92 cd rjmp .-1244 ; 0x23c82 // 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; 2415e: 10 92 19 05 sts 0x0519, r1 ; 0x800519 <_ZL8soft_pwm.lto_priv.472> 24162: b1 ce rjmp .-670 ; 0x23ec6 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){ 24164: c5 01 movw r24, r10 24166: b4 01 movw r22, r8 24168: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 2416c: 87 ff sbrs r24, 7 2416e: a6 cf rjmp .-180 ; 0x240bc if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 24170: 20 e0 ldi r18, 0x00 ; 0 24172: 30 e0 ldi r19, 0x00 ; 0 24174: a9 01 movw r20, r18 24176: c7 01 movw r24, r14 24178: b6 01 movw r22, r12 2417a: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 2417e: 87 ff sbrs r24, 7 24180: 10 c0 rjmp .+32 ; 0x241a2 24182: a7 01 movw r20, r14 24184: 96 01 movw r18, r12 24186: 6e 85 ldd r22, Y+14 ; 0x0e 24188: 7d 85 ldd r23, Y+13 ; 0x0d 2418a: 83 2d mov r24, r3 2418c: 92 2d mov r25, r2 2418e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 24192: 60 93 fb 05 sts 0x05FB, r22 ; 0x8005fb 24196: 70 93 fc 05 sts 0x05FC, r23 ; 0x8005fc 2419a: 80 93 fd 05 sts 0x05FD, r24 ; 0x8005fd 2419e: 90 93 fe 05 sts 0x05FE, r25 ; 0x8005fe pid_output=0; 241a2: 81 2c mov r8, r1 241a4: 91 2c mov r9, r1 241a6: 54 01 movw r10, r8 241a8: 89 cf rjmp .-238 ; 0x240bc { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 241aa: 10 92 1a 06 sts 0x061A, r1 ; 0x80061a 241ae: 98 cf rjmp .-208 ; 0x240e0 000241b0 : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 241b4: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 241b8: 90 93 1c 06 sts 0x061C, r25 ; 0x80061c 241bc: 80 93 1b 06 sts 0x061B, r24 ; 0x80061b target_temperature_bed_isr = target_temperature_bed; 241c0: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 241c4: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 241c8: 90 93 15 06 sts 0x0615, r25 ; 0x800615 241cc: 80 93 14 06 sts 0x0614, r24 ; 0x800614 } 241d0: 08 95 ret 000241d2 : { // 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) 241d2: 81 30 cpi r24, 0x01 ; 1 241d4: 41 f1 breq .+80 ; 0x24226 241d6: 20 f0 brcs .+8 ; 0x241e0 241d8: 82 30 cpi r24, 0x02 ; 2 241da: 09 f4 brne .+2 ; 0x241de 241dc: 45 c0 rjmp .+138 ; 0x24268 241de: 08 95 ret { case X_AXIS: { enable_x(); 241e0: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); //if dualzstepper, both point to same direction. 241e2: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 241e6: 81 70 andi r24, 0x01 ; 1 uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction; 241e8: 91 e0 ldi r25, 0x01 ; 1 241ea: 69 27 eor r22, r25 //setup new step if (new_x_dir_pin != old_x_dir_pin) { 241ec: 86 17 cp r24, r22 241ee: 59 f0 breq .+22 ; 0x24206 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 241f0: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 241f4: 66 23 and r22, r22 241f6: 89 f0 breq .+34 ; 0x2421a 241f8: 91 60 ori r25, 0x01 ; 1 241fa: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 241fe: eb e4 ldi r30, 0x4B ; 75 24200: f0 e0 ldi r31, 0x00 ; 0 24202: 31 97 sbiw r30, 0x01 ; 1 24204: f1 f7 brne .-4 ; 0x24202 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 24206: 91 e0 ldi r25, 0x01 ; 1 24208: 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); 2420a: 88 23 and r24, r24 2420c: 41 f0 breq .+16 ; 0x2421e 2420e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24212: 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); 24214: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 24218: 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); 2421a: 9e 7f andi r25, 0xFE ; 254 2421c: ee cf rjmp .-36 ; 0x241fa #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); 2421e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24222: 8e 7f andi r24, 0xFE ; 254 24224: f7 cf rjmp .-18 ; 0x24214 } break; case Y_AXIS: { enable_y(); 24226: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); //if dualzstepper, both point to same direction. 24228: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 2422c: 81 e0 ldi r24, 0x01 ; 1 2422e: 29 2f mov r18, r25 24230: 22 70 andi r18, 0x02 ; 2 24232: 91 ff sbrs r25, 1 24234: 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) { 24236: 86 17 cp r24, r22 24238: 59 f0 breq .+22 ; 0x24250 WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 2423a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2423e: 66 23 and r22, r22 24240: 79 f0 breq .+30 ; 0x24260 24242: 82 60 ori r24, 0x02 ; 2 24244: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24248: 8b e4 ldi r24, 0x4B ; 75 2424a: 90 e0 ldi r25, 0x00 ; 0 2424c: 01 97 sbiw r24, 0x01 ; 1 2424e: f1 f7 brne .-4 ; 0x2424c delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 24250: 82 e0 ldi r24, 0x02 ; 2 24252: 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); 24254: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24258: 22 23 and r18, r18 2425a: 21 f0 breq .+8 ; 0x24264 2425c: 82 60 ori r24, 0x02 ; 2 2425e: da cf rjmp .-76 ; 0x24214 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); 24260: 8d 7f andi r24, 0xFD ; 253 24262: f0 cf rjmp .-32 ; 0x24244 #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); 24264: 8d 7f andi r24, 0xFD ; 253 24266: d6 cf rjmp .-84 ; 0x24214 } break; case Z_AXIS: { enable_z(); 24268: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); //if dualzstepper, both point to same direction. 2426a: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 2426e: 81 e0 ldi r24, 0x01 ; 1 24270: 29 2f mov r18, r25 24272: 24 70 andi r18, 0x04 ; 4 24274: 92 ff sbrs r25, 2 24276: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_z_dir_pin = (INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z; 24278: 91 e0 ldi r25, 0x01 ; 1 2427a: 69 27 eor r22, r25 //setup new step if (new_z_dir_pin != old_z_dir_pin) { 2427c: 86 17 cp r24, r22 2427e: 59 f0 breq .+22 ; 0x24296 WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 24280: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24284: 66 23 and r22, r22 24286: 91 f0 breq .+36 ; 0x242ac 24288: 94 60 ori r25, 0x04 ; 4 2428a: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2428e: eb e4 ldi r30, 0x4B ; 75 24290: f0 e0 ldi r31, 0x00 ; 0 24292: 31 97 sbiw r30, 0x01 ; 1 24294: f1 f7 brne .-4 ; 0x24292 #endif delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 24296: 94 e0 ldi r25, 0x04 ; 4 24298: 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) { 2429a: 86 17 cp r24, r22 2429c: 09 f4 brne .+2 ; 0x242a0 2429e: bc cf rjmp .-136 ; 0x24218 WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 242a0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 242a4: 22 23 and r18, r18 242a6: 21 f0 breq .+8 ; 0x242b0 242a8: 84 60 ori r24, 0x04 ; 4 242aa: b4 cf rjmp .-152 ; 0x24214 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); 242ac: 9b 7f andi r25, 0xFB ; 251 242ae: ed cf rjmp .-38 ; 0x2428a 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); 242b0: 8b 7f andi r24, 0xFB ; 251 242b2: b0 cf rjmp .-160 ; 0x24214 000242b4 : } } static void checkRx(void) { if (selectedSerialPort == 0) { 242b4: 80 91 21 05 lds r24, 0x0521 ; 0x800521 242b8: 81 11 cpse r24, r1 242ba: 25 c0 rjmp .+74 ; 0x24306 if((M_UCSRxA & (1< 242c0: 87 ff sbrs r24, 7 242c2: 3d c0 rjmp .+122 ; 0x2433e // Test for a framing error. if (M_UCSRxA & (1< 242c8: 84 ff sbrs r24, 4 242ca: 03 c0 rjmp .+6 ; 0x242d2 // 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); 242cc: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 242d0: 08 95 ret } else { unsigned char c = M_UDRx; 242d2: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 242d6: 20 91 93 04 lds r18, 0x0493 ; 0x800493 242da: 30 91 94 04 lds r19, 0x0494 ; 0x800494 242de: c9 01 movw r24, r18 242e0: 01 96 adiw r24, 0x01 ; 1 242e2: 8f 77 andi r24, 0x7F ; 127 242e4: 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) { 242e6: 60 91 95 04 lds r22, 0x0495 ; 0x800495 242ea: 70 91 96 04 lds r23, 0x0496 ; 0x800496 242ee: 86 17 cp r24, r22 242f0: 97 07 cpc r25, r23 242f2: 29 f1 breq .+74 ; 0x2433e // 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; 242f4: 2d 5e subi r18, 0xED ; 237 242f6: 3b 4f sbci r19, 0xFB ; 251 242f8: f9 01 movw r30, r18 242fa: 40 83 st Z, r20 rx_buffer.head = i; 242fc: 90 93 94 04 sts 0x0494, r25 ; 0x800494 24300: 80 93 93 04 sts 0x0493, r24 ; 0x800493 24304: 1c c0 rjmp .+56 ; 0x2433e UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 2430a: 87 ff sbrs r24, 7 2430c: 18 c0 rjmp .+48 ; 0x2433e // Test for a framing error. if (UCSR1A & (1< 24312: 84 ff sbrs r24, 4 24314: 03 c0 rjmp .+6 ; 0x2431c // 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); 24316: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 2431a: 08 95 ret } else { unsigned char c = UDR1; 2431c: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 24320: 20 91 93 04 lds r18, 0x0493 ; 0x800493 24324: 30 91 94 04 lds r19, 0x0494 ; 0x800494 24328: c9 01 movw r24, r18 2432a: 01 96 adiw r24, 0x01 ; 1 2432c: 8f 77 andi r24, 0x7F ; 127 2432e: 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) { 24330: 60 91 95 04 lds r22, 0x0495 ; 0x800495 24334: 70 91 96 04 lds r23, 0x0496 ; 0x800496 24338: 68 17 cp r22, r24 2433a: 79 07 cpc r23, r25 2433c: d9 f6 brne .-74 ; 0x242f4 M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 2433e: 08 95 ret 00024340 : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 24340: 23 e0 ldi r18, 0x03 ; 3 24342: 81 11 cpse r24, r1 24344: 21 e0 ldi r18, 0x01 ; 1 for(nI=0;nI 24358: 94 60 ori r25, 0x04 ; 4 2435a: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2435e: 3f bf out 0x3f, r19 ; 63 24360: fb 01 movw r30, r22 24362: 31 97 sbiw r30, 0x01 ; 1 24364: f1 f7 brne .-4 ; 0x24362 delayMicroseconds(200); WRITE(BEEPER,LOW); 24366: 3f b7 in r19, 0x3f ; 63 24368: f8 94 cli 2436a: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2436e: 9b 7f andi r25, 0xFB ; 251 24370: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24374: 3f bf out 0x3f, r19 ; 63 24376: fa 01 movw r30, r20 24378: 31 97 sbiw r30, 0x01 ; 1 2437a: f1 f7 brne .-4 ; 0x24378 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); } } 24382: 08 95 ret 00024384 : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 24384: 8a e0 ldi r24, 0x0A ; 10 24386: 2b e8 ldi r18, 0x8B ; 139 24388: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 2438a: 4f b7 in r20, 0x3f ; 63 2438c: f8 94 cli 2438e: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24392: 94 60 ori r25, 0x04 ; 4 24394: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24398: 4f bf out 0x3f, r20 ; 63 2439a: f9 01 movw r30, r18 2439c: 31 97 sbiw r30, 0x01 ; 1 2439e: f1 f7 brne .-4 ; 0x2439c delayMicroseconds(100); WRITE(BEEPER,LOW); 243a0: 4f b7 in r20, 0x3f ; 63 243a2: f8 94 cli 243a4: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 243a8: 9b 7f andi r25, 0xFB ; 251 243aa: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 243ae: 4f bf out 0x3f, r20 ; 63 243b0: f9 01 movw r30, r18 243b2: 31 97 sbiw r30, 0x01 ; 1 243b4: f1 f7 brne .-4 ; 0x243b2 243b6: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 243b8: 41 f7 brne .-48 ; 0x2438a WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 243ba: 08 95 ret 000243bc : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 243bc: 87 ea ldi r24, 0xA7 ; 167 243be: 9c e0 ldi r25, 0x0C ; 12 243c0: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 if (eeprom_setting != 0) 243c4: 81 11 cpse r24, r1 243c6: 05 c0 rjmp .+10 ; 0x243d2 return false; switch(eFilamentAction) { 243c8: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 243cc: 81 50 subi r24, 0x01 ; 1 243ce: 88 30 cpi r24, 0x08 ; 8 243d0: 10 f0 brcs .+4 ; 0x243d6 #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; 243d2: 80 e0 ldi r24, 0x00 ; 0 243d4: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 243d6: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 243d8: 08 95 ret 000243da : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 243da: 0f 94 da ce call 0x39db4 ; 0x39db4 243de: 10 92 15 05 sts 0x0515, r1 ; 0x800515 243e2: 80 91 15 05 lds r24, 0x0515 ; 0x800515 243e6: 84 30 cpi r24, 0x04 ; 4 243e8: a8 f5 brcc .+106 ; 0x24454 243ea: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 243ee: 88 eb ldi r24, 0xB8 ; 184 243f0: 9d e3 ldi r25, 0x3D ; 61 243f2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 243f6: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 243fa: 86 eb ldi r24, 0xB6 ; 182 243fc: 9e e4 ldi r25, 0x4E ; 78 243fe: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24402: 60 e7 ldi r22, 0x70 ; 112 24404: 7b e3 ldi r23, 0x3B ; 59 24406: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 2440a: 8d ea ldi r24, 0xAD ; 173 2440c: 9e e4 ldi r25, 0x4E ; 78 2440e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24412: 66 ec ldi r22, 0xC6 ; 198 24414: 7b e3 ldi r23, 0x3B ; 59 24416: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 2441a: 84 ea ldi r24, 0xA4 ; 164 2441c: 9e e4 ldi r25, 0x4E ; 78 2441e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24422: 60 ee ldi r22, 0xE0 ; 224 24424: 79 e3 ldi r23, 0x39 ; 57 24426: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 2442a: 89 e9 ldi r24, 0x99 ; 153 2442c: 9e e4 ldi r25, 0x4E ; 78 2442e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24432: 68 eb ldi r22, 0xB8 ; 184 24434: 79 e3 ldi r23, 0x39 ; 57 24436: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_END(); 2443a: 0f 94 ae ce call 0x39d5c ; 0x39d5c menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 2443e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24442: 8f 5f subi r24, 0xFF ; 255 24444: 80 93 15 05 sts 0x0515, r24 ; 0x800515 24448: 80 91 17 05 lds r24, 0x0517 ; 0x800517 2444c: 8f 5f subi r24, 0xFF ; 255 2444e: 80 93 17 05 sts 0x0517, r24 ; 0x800517 24452: c7 cf rjmp .-114 ; 0x243e2 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(); } 24454: 08 95 ret 00024456 : //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 24456: 0f 94 da ce call 0x39db4 ; 0x39db4 2445a: 10 92 15 05 sts 0x0515, r1 ; 0x800515 2445e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24462: 84 30 cpi r24, 0x04 ; 4 24464: 28 f5 brcc .+74 ; 0x244b0 24466: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 2446a: 8a e1 ldi r24, 0x1A ; 26 2446c: 9e e3 ldi r25, 0x3E ; 62 2446e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24472: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_print); 24476: 88 e3 ldi r24, 0x38 ; 56 24478: 9b e4 ldi r25, 0x4B ; 75 2447a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2447e: 66 e5 ldi r22, 0x56 ; 86 24480: 7b e3 ldi r23, 0x3B ; 59 24482: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_total); 24486: 80 e3 ldi r24, 0x30 ; 48 24488: 9b e4 ldi r25, 0x4B ; 75 2448a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2448e: 64 e4 ldi r22, 0x44 ; 68 24490: 7a e3 ldi r23, 0x3A ; 58 24492: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_END(); 24496: 0f 94 ae ce call 0x39d5c ; 0x39d5c //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 2449a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2449e: 8f 5f subi r24, 0xFF ; 255 244a0: 80 93 15 05 sts 0x0515, r24 ; 0x800515 244a4: 80 91 17 05 lds r24, 0x0517 ; 0x800517 244a8: 8f 5f subi r24, 0xFF ; 255 244aa: 80 93 17 05 sts 0x0517, r24 ; 0x800517 244ae: d7 cf rjmp .-82 ; 0x2445e 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(); } 244b0: 08 95 ret 000244b2 : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 244b2: 0f 94 da ce call 0x39db4 ; 0x39db4 244b6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 244ba: 80 91 15 05 lds r24, 0x0515 ; 0x800515 244be: 84 30 cpi r24, 0x04 ; 4 244c0: 68 f5 brcc .+90 ; 0x2451c 244c2: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 244c6: 8a e1 ldi r24, 0x1A ; 26 244c8: 9e e3 ldi r25, 0x3E ; 62 244ca: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 244ce: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 244d2: 88 e3 ldi r24, 0x38 ; 56 244d4: 9b e4 ldi r25, 0x4B ; 75 244d6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 244da: 64 e1 ldi r22, 0x14 ; 20 244dc: 7a e3 ldi r23, 0x3A ; 58 244de: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 244e2: 80 e3 ldi r24, 0x30 ; 48 244e4: 9b e4 ldi r25, 0x4B ; 75 244e6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 244ea: 6e e8 ldi r22, 0x8E ; 142 244ec: 7b e3 ldi r23, 0x3B ; 59 244ee: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 244f2: 8e ec ldi r24, 0xCE ; 206 244f4: 9a e4 ldi r25, 0x4A ; 74 244f6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 244fa: 62 e4 ldi r22, 0x42 ; 66 244fc: 7a e3 ldi r23, 0x3A ; 58 244fe: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_END(); 24502: 0f 94 ae ce call 0x39d5c ; 0x39d5c //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 24506: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2450a: 8f 5f subi r24, 0xFF ; 255 2450c: 80 93 15 05 sts 0x0515, r24 ; 0x800515 24510: 80 91 17 05 lds r24, 0x0517 ; 0x800517 24514: 8f 5f subi r24, 0xFF ; 255 24516: 80 93 17 05 sts 0x0517, r24 ; 0x800517 2451a: cf cf rjmp .-98 ; 0x244ba 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(); } 2451c: 08 95 ret 0002451e : Sound_CycleState(); } #ifndef MMU_FORCE_STEALTH_MODE static void lcd_mmu_mode_toggle() { eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); 2451e: 89 ea ldi r24, 0xA9 ; 169 24520: 9d e0 ldi r25, 0x0D ; 13 24522: 0c 94 3f 78 jmp 0xf07e ; 0xf07e 00024526 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 24526: 8c ea ldi r24, 0xAC ; 172 24528: 9c e0 ldi r25, 0x0C ; 12 2452a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 if (current_state) 2452e: 88 23 and r24, r24 24530: 61 f0 breq .+24 ; 0x2454a StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 24532: 10 92 98 13 sts 0x1398, r1 ; 0x801398 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 24536: 10 92 46 13 sts 0x1346, r1 ; 0x801346 currentScope = Scope::Stopped; 2453a: 10 92 2b 13 sts 0x132B, r1 ; 0x80132b else { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); 2453e: 8c ea ldi r24, 0xAC ; 172 24540: 9c e0 ldi r25, 0x0C ; 12 24542: 0e 94 3f 78 call 0xf07e ; 0xf07e MMU2::mmu2.Status(); 24546: 0d 94 ce 75 jmp 0x2eb9c ; 0x2eb9c { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 2454a: 0e 94 46 da call 0x1b48c ; 0x1b48c 2454e: f7 cf rjmp .-18 ; 0x2453e 00024550 : 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) 24550: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 24554: 88 23 and r24, r24 24556: 21 f0 breq .+8 ; 0x24560 24558: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2455c: 88 23 and r24, r24 2455e: 51 f0 breq .+20 ; 0x24574 { _md->status = 1; 24560: 81 e0 ldi r24, 0x01 ; 1 24562: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 24566: 60 e0 ldi r22, 0x00 ; 0 24568: 8a e2 ldi r24, 0x2A ; 42 2456a: 9d e0 ldi r25, 0x0D ; 13 2456c: 0e 94 14 78 call 0xf028 ; 0xf028 24570: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa } MENU_BEGIN(); 24574: 0f 94 da ce call 0x39db4 ; 0x39db4 24578: 10 92 15 05 sts 0x0515, r1 ; 0x800515 2457c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24580: 84 30 cpi r24, 0x04 ; 4 24582: 08 f0 brcs .+2 ; 0x24586 24584: 81 c0 rjmp .+258 ; 0x24688 24586: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 2458a: 80 91 f8 03 lds r24, 0x03F8 ; 0x8003f8 2458e: 81 11 cpse r24, r1 24590: 4a c0 rjmp .+148 ; 0x24626 24592: 8b e7 ldi r24, 0x7B ; 123 24594: 90 e4 ldi r25, 0x40 ; 64 24596: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2459a: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 2459e: 8e e8 ldi r24, 0x8E ; 142 245a0: 9b e3 ldi r25, 0x3B ; 59 245a2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 245a6: 62 e5 ldi r22, 0x52 ; 82 245a8: 7a e3 ldi r23, 0x3A ; 58 245aa: 0f 94 08 d1 call 0x3a210 ; 0x3a210 SETTINGS_NOZZLE; 245ae: 80 91 ee 04 lds r24, 0x04EE ; 0x8004ee 245b2: 8c 33 cpi r24, 0x3C ; 60 245b4: 09 f4 brne .+2 ; 0x245b8 245b6: 54 c0 rjmp .+168 ; 0x24660 245b8: c8 f5 brcc .+114 ; 0x2462c 245ba: 89 31 cpi r24, 0x19 ; 25 245bc: 09 f4 brne .+2 ; 0x245c0 245be: 44 c0 rjmp .+136 ; 0x24648 245c0: 88 32 cpi r24, 0x28 ; 40 245c2: c1 f1 breq .+112 ; 0x24634 MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 245c4: 85 e1 ldi r24, 0x15 ; 21 245c6: 98 e5 ldi r25, 0x58 ; 88 245c8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 245cc: 66 ee ldi r22, 0xE6 ; 230 245ce: 7a e3 ldi r23, 0x3A ; 58 245d0: 0f 94 57 ce call 0x39cae ; 0x39cae MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 245d4: 8c e0 ldi r24, 0x0C ; 12 245d6: 98 e5 ldi r25, 0x58 ; 88 245d8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 245dc: 6a e1 ldi r22, 0x1A ; 26 245de: 7b e3 ldi r23, 0x3B ; 59 245e0: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) //! 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); 245e4: 80 91 98 13 lds r24, 0x1398 ; 0x801398 245e8: 81 30 cpi r24, 0x01 ; 1 245ea: 31 f0 breq .+12 ; 0x245f8 245ec: 66 ed ldi r22, 0xD6 ; 214 245ee: 79 e3 ldi r23, 0x39 ; 57 245f0: 8d e7 ldi r24, 0x7D ; 125 245f2: 95 ea ldi r25, 0xA5 ; 165 245f4: 0f 94 57 ce call 0x39cae ; 0x39cae #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (_md->experimental_menu_visibility) 245f8: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 245fc: 88 23 and r24, r24 245fe: 31 f0 breq .+12 ; 0x2460c { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 24600: 6a e8 ldi r22, 0x8A ; 138 24602: 7a e3 ldi r23, 0x3A ; 58 24604: 80 e7 ldi r24, 0x70 ; 112 24606: 95 ea ldi r25, 0xA5 ; 165 24608: 0f 94 08 d1 call 0x3a210 ; 0x3a210 //! //! 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(); 2460c: 0f 94 ae ce call 0x39d5c ; 0x39d5c _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 24610: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24614: 8f 5f subi r24, 0xFF ; 255 24616: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2461a: 80 91 17 05 lds r24, 0x0517 ; 0x800517 2461e: 8f 5f subi r24, 0xFF ; 255 24620: 80 93 17 05 sts 0x0517, r24 ; 0x800517 24624: ab cf rjmp .-170 ; 0x2457c MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 24626: 88 eb ldi r24, 0xB8 ; 184 24628: 9d e3 ldi r25, 0x3D ; 61 2462a: b5 cf rjmp .-150 ; 0x24596 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 2462c: 80 35 cpi r24, 0x50 ; 80 2462e: 11 f1 breq .+68 ; 0x24674 24630: 8f 3f cpi r24, 0xFF ; 255 24632: 41 f6 brne .-112 ; 0x245c4 24634: 88 e3 ldi r24, 0x38 ; 56 24636: 9c e3 ldi r25, 0x3C ; 60 24638: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2463c: 22 e0 ldi r18, 0x02 ; 2 2463e: 4c e0 ldi r20, 0x0C ; 12 24640: 5a e3 ldi r21, 0x3A ; 58 24642: 69 e9 ldi r22, 0x99 ; 153 24644: 75 ea ldi r23, 0xA5 ; 165 24646: 09 c0 rjmp .+18 ; 0x2465a 24648: 88 e3 ldi r24, 0x38 ; 56 2464a: 9c e3 ldi r25, 0x3C ; 60 2464c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24650: 22 e0 ldi r18, 0x02 ; 2 24652: 4c e0 ldi r20, 0x0C ; 12 24654: 5a e3 ldi r21, 0x3A ; 58 24656: 6e e9 ldi r22, 0x9E ; 158 24658: 75 ea ldi r23, 0xA5 ; 165 2465a: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 2465e: b2 cf rjmp .-156 ; 0x245c4 24660: 88 e3 ldi r24, 0x38 ; 56 24662: 9c e3 ldi r25, 0x3C ; 60 24664: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24668: 22 e0 ldi r18, 0x02 ; 2 2466a: 4c e0 ldi r20, 0x0C ; 12 2466c: 5a e3 ldi r21, 0x3A ; 58 2466e: 64 e9 ldi r22, 0x94 ; 148 24670: 75 ea ldi r23, 0xA5 ; 165 24672: f3 cf rjmp .-26 ; 0x2465a 24674: 88 e3 ldi r24, 0x38 ; 56 24676: 9c e3 ldi r25, 0x3C ; 60 24678: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2467c: 22 e0 ldi r18, 0x02 ; 2 2467e: 4c e0 ldi r20, 0x0C ; 12 24680: 5a e3 ldi r21, 0x3A ; 58 24682: 6f e8 ldi r22, 0x8F ; 143 24684: 75 ea ldi r23, 0xA5 ; 165 24686: e9 cf rjmp .-46 ; 0x2465a //! 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(); } 24688: 08 95 ret 0002468a : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 2468a: 80 e0 ldi r24, 0x00 ; 0 2468c: 0d 94 b7 1c jmp 0x2396e ; 0x2396e 00024690 : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 24690: 0f 94 da ce call 0x39db4 ; 0x39db4 24694: 10 92 15 05 sts 0x0515, r1 ; 0x800515 24698: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2469c: 84 30 cpi r24, 0x04 ; 4 2469e: 08 f0 brcs .+2 ; 0x246a2 246a0: 45 c0 rjmp .+138 ; 0x2472c 246a2: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 246a6: 80 e8 ldi r24, 0x80 ; 128 246a8: 98 e5 ldi r25, 0x58 ; 88 246aa: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 246ae: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 246b2: 61 e5 ldi r22, 0x51 ; 81 246b4: 73 ed ldi r23, 0xD3 ; 211 246b6: 89 e4 ldi r24, 0x49 ; 73 246b8: 9d e0 ldi r25, 0x0D ; 13 246ba: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 246be: 6c e4 ldi r22, 0x4C ; 76 246c0: 73 ed ldi r23, 0xD3 ; 211 246c2: 84 e5 ldi r24, 0x54 ; 84 246c4: 9d e0 ldi r25, 0x0D ; 13 246c6: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 246ca: 67 e4 ldi r22, 0x47 ; 71 246cc: 73 ed ldi r23, 0xD3 ; 211 246ce: 8f e5 ldi r24, 0x5F ; 95 246d0: 9d e0 ldi r25, 0x0D ; 13 246d2: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 246d6: 62 e4 ldi r22, 0x42 ; 66 246d8: 73 ed ldi r23, 0xD3 ; 211 246da: 8a e6 ldi r24, 0x6A ; 106 246dc: 9d e0 ldi r25, 0x0D ; 13 246de: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 246e2: 6d e3 ldi r22, 0x3D ; 61 246e4: 73 ed ldi r23, 0xD3 ; 211 246e6: 85 e7 ldi r24, 0x75 ; 117 246e8: 9d e0 ldi r25, 0x0D ; 13 246ea: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 246ee: 68 e3 ldi r22, 0x38 ; 56 246f0: 73 ed ldi r23, 0xD3 ; 211 246f2: 80 e8 ldi r24, 0x80 ; 128 246f4: 9d e0 ldi r25, 0x0D ; 13 246f6: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 246fa: 63 e3 ldi r22, 0x33 ; 51 246fc: 73 ed ldi r23, 0xD3 ; 211 246fe: 8b e8 ldi r24, 0x8B ; 139 24700: 9d e0 ldi r25, 0x0D ; 13 24702: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 24706: 6e e2 ldi r22, 0x2E ; 46 24708: 73 ed ldi r23, 0xD3 ; 211 2470a: 86 e9 ldi r24, 0x96 ; 150 2470c: 9d e0 ldi r25, 0x0D ; 13 2470e: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_END(); 24712: 0f 94 ae ce call 0x39d5c ; 0x39d5c lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 24716: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2471a: 8f 5f subi r24, 0xFF ; 255 2471c: 80 93 15 05 sts 0x0515, r24 ; 0x800515 24720: 80 91 17 05 lds r24, 0x0517 ; 0x800517 24724: 8f 5f subi r24, 0xFF ; 255 24726: 80 93 17 05 sts 0x0517, r24 ; 0x800517 2472a: b6 cf rjmp .-148 ; 0x24698 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(); } 2472c: 08 95 ret 0002472e : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 2472e: 0f 94 da ce call 0x39db4 ; 0x39db4 24732: 10 92 15 05 sts 0x0515, r1 ; 0x800515 24736: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2473a: 84 30 cpi r24, 0x04 ; 4 2473c: d8 f5 brcc .+118 ; 0x247b4 2473e: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 24742: 80 e8 ldi r24, 0x80 ; 128 24744: 98 e5 ldi r25, 0x58 ; 88 24746: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2474a: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 2474e: 83 e0 ldi r24, 0x03 ; 3 24750: 98 e5 ldi r25, 0x58 ; 88 24752: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24756: 4c e6 ldi r20, 0x6C ; 108 24758: 5b e3 ldi r21, 0x3B ; 59 2475a: bc 01 movw r22, r24 2475c: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef 24760: 0e 94 da f8 call 0x1f1b4 ; 0x1f1b4 settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 24764: 8b ef ldi r24, 0xFB ; 251 24766: 97 e5 ldi r25, 0x57 ; 87 24768: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2476c: 4e eb ldi r20, 0xBE ; 190 2476e: 5a e3 ldi r21, 0x3A ; 58 24770: bc 01 movw r22, r24 24772: 80 91 ed 04 lds r24, 0x04ED ; 0x8004ed 24776: 0e 94 da f8 call 0x1f1b4 ; 0x1f1b4 settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 2477a: 46 ea ldi r20, 0xA6 ; 166 2477c: 5b e3 ldi r21, 0x3B ; 59 2477e: 6f ee ldi r22, 0xEF ; 239 24780: 70 e7 ldi r23, 0x70 ; 112 24782: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec 24786: 0e 94 da f8 call 0x1f1b4 ; 0x1f1b4 settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 2478a: 4e e6 ldi r20, 0x6E ; 110 2478c: 5a e3 ldi r21, 0x3A ; 58 2478e: 61 eb ldi r22, 0xB1 ; 177 24790: 7e e6 ldi r23, 0x6E ; 110 24792: 80 91 ea 04 lds r24, 0x04EA ; 0x8004ea 24796: 0e 94 da f8 call 0x1f1b4 ; 0x1f1b4 MENU_END(); 2479a: 0f 94 ae ce call 0x39d5c ; 0x39d5c } } static void lcd_checking_menu(void) { MENU_BEGIN(); 2479e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 247a2: 8f 5f subi r24, 0xFF ; 255 247a4: 80 93 15 05 sts 0x0515, r24 ; 0x800515 247a8: 80 91 17 05 lds r24, 0x0517 ; 0x800517 247ac: 8f 5f subi r24, 0xFF ; 255 247ae: 80 93 17 05 sts 0x0517, r24 ; 0x800517 247b2: c1 cf rjmp .-126 ; 0x24736 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(); } 247b4: 08 95 ret 000247b6 : 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); 247b6: 8a ee ldi r24, 0xEA ; 234 247b8: 94 e0 ldi r25, 0x04 ; 4 247ba: 0f 94 54 1d call 0x23aa8 ; 0x23aa8 247be: 60 91 ea 04 lds r22, 0x04EA ; 0x8004ea 247c2: 80 e2 ldi r24, 0x20 ; 32 247c4: 9c e0 ldi r25, 0x0C ; 12 247c6: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 000247ca : 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); 247ca: 8c ee ldi r24, 0xEC ; 236 247cc: 94 e0 ldi r25, 0x04 ; 4 247ce: 0f 94 54 1d call 0x23aa8 ; 0x23aa8 247d2: 60 91 ec 04 lds r22, 0x04EC ; 0x8004ec 247d6: 83 ea ldi r24, 0xA3 ; 163 247d8: 9d e0 ldi r25, 0x0D ; 13 247da: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 000247de : 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); 247de: 8d ee ldi r24, 0xED ; 237 247e0: 94 e0 ldi r25, 0x04 ; 4 247e2: 0f 94 54 1d call 0x23aa8 ; 0x23aa8 247e6: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed 247ea: 84 ea ldi r24, 0xA4 ; 164 247ec: 9d e0 ldi r25, 0x0D ; 13 247ee: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 000247f2 : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 247f2: 8f ee ldi r24, 0xEF ; 239 247f4: 94 e0 ldi r25, 0x04 ; 4 247f6: 0f 94 54 1d call 0x23aa8 ; 0x23aa8 247fa: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef 247fe: 88 ea ldi r24, 0xA8 ; 168 24800: 9d e0 ldi r25, 0x0D ; 13 24802: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 00024806 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 24806: 80 91 90 17 lds r24, 0x1790 ; 0x801790 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; break; case Filament_sensor::SensorActionOnError::_Pause: act = Filament_sensor::SensorActionOnError::_Continue; 2480a: 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) { 2480c: 81 11 cpse r24, r1 2480e: 01 c0 rjmp .+2 ; 0x24812 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 24810: 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; 24812: 60 93 90 17 sts 0x1790, r22 ; 0x801790 24816: 87 e4 ldi r24, 0x47 ; 71 24818: 9d e0 ldi r25, 0x0D ; 13 2481a: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0002481e : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 2481e: cf 93 push r28 24820: df 93 push r29 MENU_BEGIN(); 24822: 0f 94 da ce call 0x39db4 ; 0x39db4 24826: 10 92 15 05 sts 0x0515, r1 ; 0x800515 2482a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2482e: 84 30 cpi r24, 0x04 ; 4 24830: 08 f0 brcs .+2 ; 0x24834 24832: 96 c0 rjmp .+300 ; 0x24960 24834: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_BACK)); 24838: 8b e7 ldi r24, 0x7B ; 123 2483a: 90 e4 ldi r25, 0x40 ; 64 2483c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24840: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 24844: 80 91 88 17 lds r24, 0x1788 ; 0x801788 24848: 88 23 and r24, r24 2484a: f1 f1 breq .+124 ; 0x248c8 2484c: 8a e0 ldi r24, 0x0A ; 10 2484e: 9e e5 ldi r25, 0x5E ; 94 24850: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24854: ec 01 movw r28, r24 24856: 89 e1 ldi r24, 0x19 ; 25 24858: 9d e3 ldi r25, 0x3D ; 61 2485a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2485e: 22 e0 ldi r18, 0x02 ; 2 24860: 40 ef ldi r20, 0xF0 ; 240 24862: 5a e3 ldi r21, 0x3A ; 58 24864: be 01 movw r22, r28 24866: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 2486a: 80 91 88 17 lds r24, 0x1788 ; 0x801788 if (fsensor.isEnabled()) { 2486e: 88 23 and r24, r24 24870: 09 f4 brne .+2 ; 0x24874 24872: 66 c0 rjmp .+204 ; 0x24940 if (fsensor.isError()) { 24874: 83 30 cpi r24, 0x03 ; 3 24876: 59 f5 brne .+86 ; 0x248ce MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 24878: 88 e5 ldi r24, 0x58 ; 88 2487a: 9d e3 ldi r25, 0x3D ; 61 2487c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24880: ec 01 movw r28, r24 24882: 85 ea ldi r24, 0xA5 ; 165 24884: 97 e5 ldi r25, 0x57 ; 87 24886: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2488a: 22 e0 ldi r18, 0x02 ; 2 2488c: 46 e4 ldi r20, 0x46 ; 70 2488e: 5a e3 ldi r21, 0x3A ; 58 24890: be 01 movw r22, r28 24892: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 24896: 88 e5 ldi r24, 0x58 ; 88 24898: 9d e3 ldi r25, 0x3D ; 61 2489a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2489e: ec 01 movw r28, r24 248a0: 87 e9 ldi r24, 0x97 ; 151 248a2: 97 e5 ldi r25, 0x57 ; 87 248a4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 248a8: 22 e0 ldi r18, 0x02 ; 2 248aa: 46 e4 ldi r20, 0x46 ; 70 248ac: 5a e3 ldi r21, 0x3A ; 58 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } else { MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), fsensor.getRunoutEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_runout_set); MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 248ae: be 01 movw r22, r28 248b0: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), fsensor.getJamDetectionEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_jam_detection_set); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } switch(fsensor.getActionOnError()) { 248b4: 80 91 90 17 lds r24, 0x1790 ; 0x801790 248b8: 88 23 and r24, r24 248ba: 99 f1 breq .+102 ; 0x24922 248bc: 81 30 cpi r24, 0x01 ; 1 248be: 09 f4 brne .+2 ; 0x248c2 248c0: 4c c0 rjmp .+152 ; 0x2495a 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(); 248c2: 0f 94 03 24 call 0x24806 ; 0x24806 248c6: 3c c0 rjmp .+120 ; 0x24940 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); 248c8: 84 e0 ldi r24, 0x04 ; 4 248ca: 9e e5 ldi r25, 0x5E ; 94 248cc: c1 cf rjmp .-126 ; 0x24850 #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); 248ce: 80 91 8a 17 lds r24, 0x178A ; 0x80178a 248d2: 88 23 and r24, r24 248d4: 01 f1 breq .+64 ; 0x24916 248d6: 8a e0 ldi r24, 0x0A ; 10 248d8: 9e e5 ldi r25, 0x5E ; 94 248da: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 248de: ec 01 movw r28, r24 248e0: 85 ea ldi r24, 0xA5 ; 165 248e2: 97 e5 ldi r25, 0x57 ; 87 248e4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 248e8: 22 e0 ldi r18, 0x02 ; 2 248ea: 44 e7 ldi r20, 0x74 ; 116 248ec: 5b e3 ldi r21, 0x3B ; 59 248ee: be 01 movw r22, r28 248f0: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 248f4: 80 91 89 17 lds r24, 0x1789 ; 0x801789 248f8: 88 23 and r24, r24 248fa: 81 f0 breq .+32 ; 0x2491c 248fc: 8a e0 ldi r24, 0x0A ; 10 248fe: 9e e5 ldi r25, 0x5E ; 94 24900: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24904: ec 01 movw r28, r24 24906: 87 e9 ldi r24, 0x97 ; 151 24908: 97 e5 ldi r25, 0x57 ; 87 2490a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2490e: 22 e0 ldi r18, 0x02 ; 2 24910: 4c e9 ldi r20, 0x9C ; 156 24912: 5b e3 ldi r21, 0x3B ; 59 24914: cc cf rjmp .-104 ; 0x248ae #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); 24916: 84 e0 ldi r24, 0x04 ; 4 24918: 9e e5 ldi r25, 0x5E ; 94 2491a: df cf rjmp .-66 ; 0x248da MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 2491c: 84 e0 ldi r24, 0x04 ; 4 2491e: 9e e5 ldi r25, 0x5E ; 94 24920: ef cf rjmp .-34 ; 0x24900 #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); 24922: 8f e8 ldi r24, 0x8F ; 143 24924: 97 e5 ldi r25, 0x57 ; 87 break; case Filament_sensor::SensorActionOnError::_Pause: MENU_ITEM_TOGGLE_P(_T(MSG_FS_ACTION), _T(MSG_PAUSE), lcd_fsensor_actionNA_set); 24926: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2492a: ec 01 movw r28, r24 2492c: 83 e8 ldi r24, 0x83 ; 131 2492e: 97 e5 ldi r25, 0x57 ; 87 24930: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24934: 22 e0 ldi r18, 0x02 ; 2 24936: 4a e2 ldi r20, 0x2A ; 42 24938: 5a e3 ldi r21, 0x3A ; 58 2493a: be 01 movw r22, r28 2493c: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 default: lcd_fsensor_actionNA_set(); } } MENU_END(); 24940: 0f 94 ae ce call 0x39d5c ; 0x39d5c } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 24944: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24948: 8f 5f subi r24, 0xFF ; 255 2494a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2494e: 80 91 17 05 lds r24, 0x0517 ; 0x800517 24952: 8f 5f subi r24, 0xFF ; 255 24954: 80 93 17 05 sts 0x0517, r24 ; 0x800517 24958: 68 cf rjmp .-304 ; 0x2482a 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); 2495a: 8b e7 ldi r24, 0x7B ; 123 2495c: 97 e5 ldi r25, 0x57 ; 87 2495e: e3 cf rjmp .-58 ; 0x24926 lcd_fsensor_actionNA_set(); } } MENU_END(); } 24960: df 91 pop r29 24962: cf 91 pop r28 24964: 08 95 ret 00024966 : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 24966: e8 e8 ldi r30, 0x88 ; 136 24968: f7 e1 ldi r31, 0x17 ; 23 2496a: 61 81 ldd r22, Z+1 ; 0x01 2496c: 81 e0 ldi r24, 0x01 ; 1 2496e: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 24970: 61 83 std Z+1, r22 ; 0x01 24972: 87 e0 ldi r24, 0x07 ; 7 24974: 9f e0 ldi r25, 0x0F ; 15 24976: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0002497a : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 2497a: e8 e8 ldi r30, 0x88 ; 136 2497c: f7 e1 ldi r31, 0x17 ; 23 2497e: 62 81 ldd r22, Z+2 ; 0x02 24980: 81 e0 ldi r24, 0x01 ; 1 24982: 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; 24984: 62 83 std Z+2, r22 ; 0x02 24986: 85 ed ldi r24, 0xD5 ; 213 24988: 9e e0 ldi r25, 0x0E ; 14 2498a: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0002498e : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 2498e: ef ed ldi r30, 0xDF ; 223 24990: f6 e1 ldi r31, 0x16 ; 22 24992: 60 81 ld r22, Z 24994: 81 e0 ldi r24, 0x01 ; 1 24996: 68 27 eor r22, r24 24998: 60 83 st Z, r22 2499a: 8b eb ldi r24, 0xBB ; 187 2499c: 9f e0 ldi r25, 0x0F ; 15 2499e: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 000249a2 : 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; 249a2: 80 91 21 05 lds r24, 0x0521 ; 0x800521 249a6: 81 30 cpi r24, 0x01 ; 1 249a8: 51 f4 brne .+20 ; 0x249be 249aa: 10 92 21 05 sts 0x0521, r1 ; 0x800521 249ae: 60 91 21 05 lds r22, 0x0521 ; 0x800521 249b2: 88 e0 ldi r24, 0x08 ; 8 249b4: 9f e0 ldi r25, 0x0F ; 15 249b6: 0f 94 7f dd call 0x3bafe ; 0x3bafe else selectedSerialPort = 1; eeprom_update_byte_notify((unsigned char *)EEPROM_SECOND_SERIAL_ACTIVE, selectedSerialPort); MYSERIAL.begin(BAUDRATE); 249ba: 0c 94 a4 da jmp 0x1b548 ; 0x1b548 } #ifdef HAS_SECOND_SERIAL_PORT void lcd_second_serial_set() { if(selectedSerialPort == 1) selectedSerialPort = 0; else selectedSerialPort = 1; 249be: 81 e0 ldi r24, 0x01 ; 1 249c0: 80 93 21 05 sts 0x0521, r24 ; 0x800521 249c4: f4 cf rjmp .-24 ; 0x249ae 000249c6 : 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); 249c6: 8f ea ldi r24, 0xAF ; 175 249c8: 9f e0 ldi r25, 0x0F ; 15 249ca: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 temp_cal_active = !temp_cal_active; 249ce: 61 e0 ldi r22, 0x01 ; 1 249d0: 81 11 cpse r24, r1 249d2: 60 e0 ldi r22, 0x00 ; 0 249d4: 8f ea ldi r24, 0xAF ; 175 249d6: 9f e0 ldi r25, 0x0F ; 15 249d8: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 000249dc : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 249dc: 80 91 e1 04 lds r24, 0x04E1 ; 0x8004e1 249e0: 81 30 cpi r24, 0x01 ; 1 249e2: 71 f0 breq .+28 ; 0x24a00 249e4: 20 f0 brcs .+8 ; 0x249ee 249e6: 82 30 cpi r24, 0x02 ; 2 249e8: 69 f4 brne .+26 ; 0x24a04 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 249ea: 83 e0 ldi r24, 0x03 ; 3 249ec: 01 c0 rjmp .+2 ; 0x249f0 void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 249ee: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 249f0: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 249f4: 60 91 e1 04 lds r22, 0x04E1 ; 0x8004e1 249f8: 87 ed ldi r24, 0xD7 ; 215 249fa: 9e e0 ldi r25, 0x0E ; 14 249fc: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 24a00: 82 e0 ldi r24, 0x02 ; 2 24a02: f6 cf rjmp .-20 ; 0x249f0 break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 24a04: 10 92 e1 04 sts 0x04E1, r1 ; 0x8004e1 24a08: f5 cf rjmp .-22 ; 0x249f4 00024a0a : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 24a0a: 89 e0 ldi r24, 0x09 ; 9 24a0c: 9f e0 ldi r25, 0x0F ; 15 24a0e: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 24a12: 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) { 24a14: 88 23 and r24, r24 24a16: 21 f0 breq .+8 ; 0x24a20 case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 24a18: 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) { 24a1a: 81 30 cpi r24, 0x01 ; 1 24a1c: 09 f0 breq .+2 ; 0x24a20 case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 24a1e: 60 e0 ldi r22, 0x00 ; 0 24a20: 89 e0 ldi r24, 0x09 ; 9 24a22: 9f e0 ldi r25, 0x0F ; 15 24a24: 0f 94 7f dd call 0x3bafe ; 0x3bafe } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 24a28: 81 e0 ldi r24, 0x01 ; 1 24a2a: 80 93 bd 14 sts 0x14BD, r24 ; 0x8014bd } 24a2e: 08 95 ret 00024a30 : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 24a30: ef 92 push r14 24a32: ff 92 push r15 24a34: 0f 93 push r16 24a36: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 24a38: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 24a3c: 81 11 cpse r24, r1 24a3e: 35 c0 rjmp .+106 ; 0x24aaa { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 24a40: 80 ec ldi r24, 0xC0 ; 192 24a42: 9f e0 ldi r25, 0x0F ; 15 24a44: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 24a48: 81 30 cpi r24, 0x01 ; 1 24a4a: 61 f5 brne .+88 ; 0x24aa4 { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 24a4c: 8f eb ldi r24, 0xBF ; 191 24a4e: 9f e0 ldi r25, 0x0F ; 15 24a50: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 24a54: 08 2e mov r0, r24 24a56: 00 0c add r0, r0 24a58: 99 0b sbc r25, r25 24a5a: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 24a5e: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 24a62: 8e eb ldi r24, 0xBE ; 190 24a64: 9f e0 ldi r25, 0x0F ; 15 24a66: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 24a6a: 08 2e mov r0, r24 24a6c: 00 0c add r0, r0 24a6e: 99 0b sbc r25, r25 24a70: 90 93 ba 03 sts 0x03BA, r25 ; 0x8003ba 24a74: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 24a78: 8d eb ldi r24, 0xBD ; 189 24a7a: 9f e0 ldi r25, 0x0F ; 15 24a7c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 24a80: 08 2e mov r0, r24 24a82: 00 0c add r0, r0 24a84: 99 0b sbc r25, r25 24a86: 90 93 bc 03 sts 0x03BC, r25 ; 0x8003bc 24a8a: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 24a8e: 8c eb ldi r24, 0xBC ; 188 24a90: 9f e0 ldi r25, 0x0F ; 15 24a92: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 24a96: 08 2e mov r0, r24 24a98: 00 0c add r0, r0 24a9a: 99 0b sbc r25, r25 24a9c: 90 93 be 03 sts 0x03BE, r25 ; 0x8003be 24aa0: 80 93 bd 03 sts 0x03BD, r24 ; 0x8003bd } _md->status = 1; 24aa4: 81 e0 ldi r24, 0x01 ; 1 24aa6: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 } MENU_BEGIN(); 24aaa: 0f 94 da ce call 0x39db4 ; 0x39db4 24aae: 10 92 15 05 sts 0x0515, r1 ; 0x800515 24ab2: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24ab6: 84 30 cpi r24, 0x04 ; 4 24ab8: 08 f0 brcs .+2 ; 0x24abc 24aba: 6e c0 rjmp .+220 ; 0x24b98 24abc: 10 92 18 05 sts 0x0518, r1 ; 0x800518 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 24ac0: 0f 94 5a cd call 0x39ab4 ; 0x39ab4 24ac4: 88 23 and r24, r24 24ac6: e9 f0 breq .+58 ; 0x24b02 24ac8: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 24acc: 8f eb ldi r24, 0xBF ; 191 24ace: 9f e0 ldi r25, 0x0F ; 15 24ad0: 0f 94 7f dd call 0x3bafe ; 0x3bafe 24ad4: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 24ad8: 8d eb ldi r24, 0xBD ; 189 24ada: 9f e0 ldi r25, 0x0F ; 15 24adc: 0f 94 7f dd call 0x3bafe ; 0x3bafe 24ae0: 60 91 bd 03 lds r22, 0x03BD ; 0x8003bd 24ae4: 8c eb ldi r24, 0xBC ; 188 24ae6: 9f e0 ldi r25, 0x0F ; 15 24ae8: 0f 94 7f dd call 0x3bafe ; 0x3bafe 24aec: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 24af0: 8e eb ldi r24, 0xBE ; 190 24af2: 9f e0 ldi r25, 0x0F ; 15 24af4: 0f 94 7f dd call 0x3bafe ; 0x3bafe 24af8: 61 e0 ldi r22, 0x01 ; 1 24afa: 80 ec ldi r24, 0xC0 ; 192 24afc: 9f e0 ldi r25, 0x0F ; 15 24afe: 0f 94 7f dd call 0x3bafe ; 0x3bafe 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)); 24b02: 8b e7 ldi r24, 0x7B ; 123 24b04: 90 e4 ldi r25, 0x40 ; 64 24b06: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24b0a: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24b0e: 8e ef ldi r24, 0xFE ; 254 24b10: 9d e4 ldi r25, 0x4D ; 77 24b12: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24b16: f1 2c mov r15, r1 24b18: e1 2c mov r14, r1 24b1a: 04 e6 ldi r16, 0x64 ; 100 24b1c: 10 e0 ldi r17, 0x00 ; 0 24b1e: 2c e9 ldi r18, 0x9C ; 156 24b20: 3f ef ldi r19, 0xFF ; 255 24b22: 40 e1 ldi r20, 0x10 ; 16 24b24: 67 eb ldi r22, 0xB7 ; 183 24b26: 73 e0 ldi r23, 0x03 ; 3 24b28: 0f 94 2a cf call 0x39e54 ; 0x39e54 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24b2c: 8d ee ldi r24, 0xED ; 237 24b2e: 9d e4 ldi r25, 0x4D ; 77 24b30: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24b34: 2c e9 ldi r18, 0x9C ; 156 24b36: 3f ef ldi r19, 0xFF ; 255 24b38: 40 e1 ldi r20, 0x10 ; 16 24b3a: 69 eb ldi r22, 0xB9 ; 185 24b3c: 73 e0 ldi r23, 0x03 ; 3 24b3e: 0f 94 2a cf call 0x39e54 ; 0x39e54 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24b42: 8c ed ldi r24, 0xDC ; 220 24b44: 9d e4 ldi r25, 0x4D ; 77 24b46: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24b4a: 2c e9 ldi r18, 0x9C ; 156 24b4c: 3f ef ldi r19, 0xFF ; 255 24b4e: 40 e1 ldi r20, 0x10 ; 16 24b50: 6b eb ldi r22, 0xBB ; 187 24b52: 73 e0 ldi r23, 0x03 ; 3 24b54: 0f 94 2a cf call 0x39e54 ; 0x39e54 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24b58: 8b ec ldi r24, 0xCB ; 203 24b5a: 9d e4 ldi r25, 0x4D ; 77 24b5c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24b60: 2c e9 ldi r18, 0x9C ; 156 24b62: 3f ef ldi r19, 0xFF ; 255 24b64: 40 e1 ldi r20, 0x10 ; 16 24b66: 6d eb ldi r22, 0xBD ; 189 24b68: 73 e0 ldi r23, 0x03 ; 3 24b6a: 0f 94 2a cf call 0x39e54 ; 0x39e54 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 24b6e: 81 e6 ldi r24, 0x61 ; 97 24b70: 9b e3 ldi r25, 0x3B ; 59 24b72: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24b76: 60 ed ldi r22, 0xD0 ; 208 24b78: 79 e3 ldi r23, 0x39 ; 57 24b7a: 0f 94 57 ce call 0x39cae ; 0x39cae MENU_END(); 24b7e: 0f 94 ae ce call 0x39d5c ; 0x39d5c _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(); 24b82: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24b86: 8f 5f subi r24, 0xFF ; 255 24b88: 80 93 15 05 sts 0x0515, r24 ; 0x800515 24b8c: 80 91 17 05 lds r24, 0x0517 ; 0x800517 24b90: 8f 5f subi r24, 0xFF ; 255 24b92: 80 93 17 05 sts 0x0517, r24 ; 0x800517 24b96: 8d cf rjmp .-230 ; 0x24ab2 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(); } 24b98: 1f 91 pop r17 24b9a: 0f 91 pop r16 24b9c: ff 90 pop r15 24b9e: ef 90 pop r14 24ba0: 08 95 ret 00024ba2 : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 24ba2: 8e ec ldi r24, 0xCE ; 206 24ba4: 9e e0 ldi r25, 0x0E ; 14 24ba6: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 24baa: 60 e0 ldi r22, 0x00 ; 0 24bac: 81 30 cpi r24, 0x01 ; 1 24bae: 09 f0 breq .+2 ; 0x24bb2 24bb0: 61 e0 ldi r22, 0x01 ; 1 24bb2: 8e ec ldi r24, 0xCE ; 206 24bb4: 9e e0 ldi r25, 0x0E ; 14 24bb6: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 00024bba : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 24bba: 60 91 38 02 lds r22, 0x0238 ; 0x800238 24bbe: 81 e0 ldi r24, 0x01 ; 1 24bc0: 68 27 eor r22, r24 24bc2: 60 93 38 02 sts 0x0238, r22 ; 0x800238 24bc6: 87 e8 ldi r24, 0x87 ; 135 24bc8: 9f e0 ldi r25, 0x0F ; 15 24bca: 0f 94 7f dd call 0x3bafe ; 0x3bafe 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. 24bce: 80 91 38 02 lds r24, 0x0238 ; 0x800238 24bd2: 81 11 cpse r24, r1 24bd4: 02 c0 rjmp .+4 ; 0x24bda 24bd6: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 #endif //FANCHECK } 24bda: 08 95 ret 00024bdc : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 24bdc: 86 ed ldi r24, 0xD6 ; 214 24bde: 9e e0 ldi r25, 0x0E ; 14 24be0: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 24be4: 61 e0 ldi r22, 0x01 ; 1 24be6: 82 30 cpi r24, 0x02 ; 2 24be8: 09 f0 breq .+2 ; 0x24bec 24bea: 62 e0 ldi r22, 0x02 ; 2 24bec: 86 ed ldi r24, 0xD6 ; 214 24bee: 9e e0 ldi r25, 0x0E ; 14 24bf0: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 00024bf4 : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 24bf4: cf 93 push r28 24bf6: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 24bf8: 80 91 ee 04 lds r24, 0x04EE ; 0x8004ee 24bfc: 8c 33 cpi r24, 0x3C ; 60 24bfe: e1 f0 breq .+56 ; 0x24c38 24c00: 80 35 cpi r24, 0x50 ; 80 24c02: 01 f1 breq .+64 ; 0x24c44 24c04: 88 32 cpi r24, 0x28 ; 40 24c06: 91 f0 breq .+36 ; 0x24c2c case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 24c08: 88 e2 ldi r24, 0x28 ; 40 24c0a: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee nDiameter=400; 24c0e: c0 e9 ldi r28, 0x90 ; 144 24c10: d1 e0 ldi r29, 0x01 ; 1 24c12: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 24c16: 87 ea ldi r24, 0xA7 ; 167 24c18: 9d e0 ldi r25, 0x0D ; 13 24c1a: 0f 94 7f dd call 0x3bafe ; 0x3bafe if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 24c1e: be 01 movw r22, r28 24c20: 85 ea ldi r24, 0xA5 ; 165 24c22: 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); } 24c24: df 91 pop r29 24c26: cf 91 pop r28 24c28: 0d 94 9d dd jmp 0x3bb3a ; 0x3bb3a case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 24c2c: 8c e3 ldi r24, 0x3C ; 60 24c2e: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee nDiameter=600; 24c32: c8 e5 ldi r28, 0x58 ; 88 24c34: d2 e0 ldi r29, 0x02 ; 2 24c36: ed cf rjmp .-38 ; 0x24c12 break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 24c38: 80 e5 ldi r24, 0x50 ; 80 24c3a: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee nDiameter=800; 24c3e: c0 e2 ldi r28, 0x20 ; 32 24c40: d3 e0 ldi r29, 0x03 ; 3 24c42: e7 cf rjmp .-50 ; 0x24c12 break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 24c44: 89 e1 ldi r24, 0x19 ; 25 24c46: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee nDiameter=250; 24c4a: ca ef ldi r28, 0xFA ; 250 24c4c: d0 e0 ldi r29, 0x00 ; 0 24c4e: e1 cf rjmp .-62 ; 0x24c12 00024c50 : #endif //SDCARD_SORT_ALPHA #ifdef TMC2130 static void lcd_crash_mode_info() { lcd_home(); 24c50: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_puts_P(_T(MSG_CRASH_DET_ONLY_IN_NORMAL)); 24c54: 8f eb ldi r24, 0xBF ; 191 24c56: 9e e4 ldi r25, 0x4E ; 78 24c58: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24c5c: 0e 94 00 70 call 0xe000 ; 0xe000 menu_back_if_clicked(); 24c60: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 00024c64 : } static void lcd_crash_mode_info2() { lcd_home(); 24c64: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_puts_P(_T(MSG_CRASH_DET_STEALTH_FORCE_OFF)); 24c68: 86 ef ldi r24, 0xF6 ; 246 24c6a: 9e e4 ldi r25, 0x4E ; 78 24c6c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24c70: 0e 94 00 70 call 0xe000 ; 0xe000 menu_back_if_clicked(); 24c74: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 00024c78 : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 24c78: 81 30 cpi r24, 0x01 ; 1 24c7a: 21 f4 brne .+8 ; 0x24c84 case STATE_ON: lcd_puts_P(_N(" 1")); 24c7c: 8f eb ldi r24, 0xBF ; 191 24c7e: 90 e7 ldi r25, 0x70 ; 112 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 24c80: 0c 94 00 70 jmp 0xe000 ; 0xe000 24c84: 8b eb ldi r24, 0xBB ; 187 24c86: 90 e7 ldi r25, 0x70 ; 112 24c88: fb cf rjmp .-10 ; 0x24c80 00024c8a : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 24c8a: 81 e0 ldi r24, 0x01 ; 1 24c8c: 90 91 88 17 lds r25, 0x1788 ; 0x801788 24c90: 91 11 cpse r25, r1 24c92: 80 e0 ldi r24, 0x00 ; 0 24c94: 0c 94 34 76 jmp 0xec68 ; 0xec68 00024c98 : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 24c98: 0d 94 3b 86 jmp 0x30c76 ; 0x30c76 00024c9c : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 24c9c: 0e 94 c1 70 call 0xe182 ; 0xe182 lcd_status_message_idx = 0; // Re-draw message from beginning 24ca0: 10 92 39 05 sts 0x0539, r1 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.462> } void lcd_return_to_status() { lcdui_refresh(); // to maybe revive the LCD if static electricity killed it. menu_goto(lcd_status_screen, 0, true); 24ca4: 20 e0 ldi r18, 0x00 ; 0 24ca6: 41 e0 ldi r20, 0x01 ; 1 24ca8: 70 e0 ldi r23, 0x00 ; 0 24caa: 60 e0 ldi r22, 0x00 ; 0 24cac: 84 e6 ldi r24, 0x64 ; 100 24cae: 9a e3 ldi r25, 0x3A ; 58 24cb0: 0f 94 04 cf call 0x39e08 ; 0x39e08 menu_depth = 0; 24cb4: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 24cb8: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 } 24cbc: 08 95 ret 00024cbe : } } #if (LANG_MODE != 0) void lcd_language() { 24cbe: cf 93 push r28 24cc0: df 93 push r29 lcd_update_enable(true); 24cc2: 81 e0 ldi r24, 0x01 ; 1 24cc4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 menu_goto(lcd_language_menu, 0, true, true); 24cc8: 21 e0 ldi r18, 0x01 ; 1 24cca: 41 e0 ldi r20, 0x01 ; 1 24ccc: 70 e0 ldi r23, 0x00 ; 0 24cce: 60 e0 ldi r22, 0x00 ; 0 24cd0: 84 e7 ldi r24, 0x74 ; 116 24cd2: 9a e3 ldi r25, 0x3A ; 58 24cd4: 0f 94 04 cf call 0x39e08 ; 0x39e08 24cd8: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 24cdc: c0 91 69 0e lds r28, 0x0E69 ; 0x800e69 24ce0: d0 91 6a 0e lds r29, 0x0E6A ; 0x800e6a 24ce4: 0e 94 52 72 call 0xe4a4 ; 0xe4a4 24ce8: c4 56 subi r28, 0x64 ; 100 24cea: da 43 sbci r29, 0x3A ; 58 24cec: 39 f0 breq .+14 ; 0x24cfc 24cee: 81 11 cpse r24, r1 24cf0: 07 c0 rjmp .+14 ; 0x24d00 { delay_keep_alive(50); 24cf2: 82 e3 ldi r24, 0x32 ; 50 24cf4: 90 e0 ldi r25, 0x00 ; 0 24cf6: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 24cfa: f0 cf rjmp .-32 ; 0x24cdc } if (lang_is_selected()) 24cfc: 88 23 and r24, r24 24cfe: 21 f0 breq .+8 ; 0x24d08 lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 24d00: df 91 pop r29 24d02: 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(); 24d04: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c else lang_select(LANG_ID_PRI); 24d08: 80 e0 ldi r24, 0x00 ; 0 } 24d0a: df 91 pop r29 24d0c: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 24d0e: 0c 94 69 73 jmp 0xe6d2 ; 0xe6d2 00024d12 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 24d12: 61 e0 ldi r22, 0x01 ; 1 24d14: 88 e4 ldi r24, 0x48 ; 72 24d16: 95 ea ldi r25, 0xA5 ; 165 24d18: 0e 94 cb 89 call 0x11396 ; 0x11396 lcd_return_to_status(); 24d1c: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 00024d20 : lcd_return_to_status(); } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 24d20: 61 e0 ldi r22, 0x01 ; 1 24d22: 82 e4 ldi r24, 0x42 ; 66 24d24: 95 ea ldi r25, 0xA5 ; 165 24d26: 0e 94 cb 89 call 0x11396 ; 0x11396 lcd_return_to_status(); 24d2a: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 00024d2e : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 24d2e: 61 e0 ldi r22, 0x01 ; 1 24d30: 8e e3 ldi r24, 0x3E ; 62 24d32: 95 ea ldi r25, 0xA5 ; 165 24d34: 0e 94 cb 89 call 0x11396 ; 0x11396 lcd_return_to_status(); 24d38: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 00024d3c : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 24d3c: 61 e0 ldi r22, 0x01 ; 1 24d3e: 8a e3 ldi r24, 0x3A ; 58 24d40: 95 ea ldi r25, 0xA5 ; 165 24d42: 0e 94 cb 89 call 0x11396 ; 0x11396 lcd_return_to_status(); 24d46: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 00024d4a : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 24d4a: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 24d4e: 8f e0 ldi r24, 0x0F ; 15 24d50: 9e e4 ldi r25, 0x4E ; 78 24d52: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24d56: ac 01 movw r20, r24 24d58: 60 e0 ldi r22, 0x00 ; 0 24d5a: 80 e0 ldi r24, 0x00 ; 0 24d5c: 0e 94 29 70 call 0xe052 ; 0xe052 pid_temp += lcd_encoder; 24d60: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.455> 24d64: 90 91 4c 02 lds r25, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.455+0x1> 24d68: 20 91 37 05 lds r18, 0x0537 ; 0x800537 24d6c: 30 91 38 05 lds r19, 0x0538 ; 0x800538 24d70: 82 0f add r24, r18 24d72: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 24d74: 82 33 cpi r24, 0x32 ; 50 24d76: 21 e0 ldi r18, 0x01 ; 1 24d78: 92 07 cpc r25, r18 24d7a: 50 f1 brcs .+84 ; 0x24dd0 24d7c: 81 e3 ldi r24, 0x31 ; 49 24d7e: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 24d80: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.455+0x1> 24d84: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.455> lcd_encoder = 0; 24d88: 10 92 38 05 sts 0x0538, r1 ; 0x800538 24d8c: 10 92 37 05 sts 0x0537, r1 ; 0x800537 lcd_set_cursor(1, 2); 24d90: 62 e0 ldi r22, 0x02 ; 2 24d92: 81 e0 ldi r24, 0x01 ; 1 24d94: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_printf_P(PSTR("%3u"), pid_temp); 24d98: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.455+0x1> 24d9c: 8f 93 push r24 24d9e: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.455> 24da2: 8f 93 push r24 24da4: 82 ec ldi r24, 0xC2 ; 194 24da6: 94 ea ldi r25, 0xA4 ; 164 24da8: 9f 93 push r25 24daa: 8f 93 push r24 24dac: 0e 94 ee 6f call 0xdfdc ; 0xdfdc if (lcd_clicked()) { 24db0: 0e 94 32 72 call 0xe464 ; 0xe464 24db4: 0f 90 pop r0 24db6: 0f 90 pop r0 24db8: 0f 90 pop r0 24dba: 0f 90 pop r0 24dbc: 88 23 and r24, r24 24dbe: 71 f0 breq .+28 ; 0x24ddc lcd_commands_type = LcdCommands::PidExtruder; 24dc0: 83 e0 ldi r24, 0x03 ; 3 24dc2: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 lcd_return_to_status(); 24dc6: 0f 94 4e 26 call 0x24c9c ; 0x24c9c lcd_update(2); 24dca: 82 e0 ldi r24, 0x02 ; 2 24dcc: 0c 94 dc 6f jmp 0xdfb8 ; 0xdfb8 { 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; 24dd0: 8a 30 cpi r24, 0x0A ; 10 24dd2: 91 05 cpc r25, r1 24dd4: a8 f6 brcc .-86 ; 0x24d80 24dd6: 8a e0 ldi r24, 0x0A ; 10 24dd8: 90 e0 ldi r25, 0x00 ; 0 24dda: d2 cf rjmp .-92 ; 0x24d80 lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 24ddc: 08 95 ret 00024dde : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 24dde: df 92 push r13 24de0: ef 92 push r14 24de2: ff 92 push r15 24de4: 0f 93 push r16 24de6: 1f 93 push r17 24de8: cf 93 push r28 24dea: df 93 push r29 24dec: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 24df0: 0e 94 41 70 call 0xe082 ; 0xe082 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] ); 24df4: c1 eb ldi r28, 0xB1 ; 177 24df6: d4 e0 ldi r29, 0x04 ; 4 24df8: 8a 81 ldd r24, Y+2 ; 0x02 24dfa: 9b 81 ldd r25, Y+3 ; 0x03 24dfc: 2c e3 ldi r18, 0x3C ; 60 24dfe: f2 2e mov r15, r18 24e00: f8 9e mul r15, r24 24e02: 80 01 movw r16, r0 24e04: f9 9e mul r15, r25 24e06: 10 0d add r17, r0 24e08: 11 24 eor r1, r1 24e0a: 82 eb ldi r24, 0xB2 ; 178 24e0c: 9f e3 ldi r25, 0x3F ; 63 24e0e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24e12: e8 2e mov r14, r24 24e14: d9 2e mov r13, r25 24e16: 88 81 ld r24, Y 24e18: 99 81 ldd r25, Y+1 ; 0x01 24e1a: f8 9e mul r15, r24 24e1c: e0 01 movw r28, r0 24e1e: f9 9e mul r15, r25 24e20: d0 0d add r29, r0 24e22: 11 24 eor r1, r1 24e24: 8f eb ldi r24, 0xBF ; 191 24e26: 9f e3 ldi r25, 0x3F ; 63 24e28: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24e2c: 1f 93 push r17 24e2e: 0f 93 push r16 24e30: df 92 push r13 24e32: ef 92 push r14 24e34: df 93 push r29 24e36: cf 93 push r28 24e38: 9f 93 push r25 24e3a: 8f 93 push r24 24e3c: 80 ed ldi r24, 0xD0 ; 208 24e3e: 91 ea ldi r25, 0xA1 ; 161 24e40: 9f 93 push r25 24e42: 8f 93 push r24 24e44: 0e 94 ee 6f call 0xdfdc ; 0xdfdc menu_back_if_clicked(); 24e48: 8d b7 in r24, 0x3d ; 61 24e4a: 9e b7 in r25, 0x3e ; 62 24e4c: 0a 96 adiw r24, 0x0a ; 10 24e4e: 0f b6 in r0, 0x3f ; 63 24e50: f8 94 cli 24e52: 9e bf out 0x3e, r25 ; 62 24e54: 0f be out 0x3f, r0 ; 63 24e56: 8d bf out 0x3d, r24 ; 61 } 24e58: df 91 pop r29 24e5a: cf 91 pop r28 24e5c: 1f 91 pop r17 24e5e: 0f 91 pop r16 24e60: ff 90 pop r15 24e62: ef 90 pop r14 24e64: 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(); 24e66: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 00024e6a : //! | Y: 000 | //! | | //! ---------------------- //! @endcode static void lcd_menu_belt_status() { 24e6a: 0f 93 push r16 24e6c: 1f 93 push r17 24e6e: cf 93 push r28 24e70: df 93 push r29 lcd_home(); 24e72: 0e 94 41 70 call 0xe082 ; 0xe082 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))); 24e76: 8b e5 ldi r24, 0x5B ; 91 24e78: 9f e0 ldi r25, 0x0F ; 15 24e7a: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 24e7e: 18 2f mov r17, r24 24e80: 09 2f mov r16, r25 24e82: 8d e5 ldi r24, 0x5D ; 93 24e84: 9f e0 ldi r25, 0x0F ; 15 24e86: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 24e8a: ec 01 movw r28, r24 24e8c: 89 e6 ldi r24, 0x69 ; 105 24e8e: 9b e4 ldi r25, 0x4B ; 75 24e90: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24e94: 0f 93 push r16 24e96: 1f 93 push r17 24e98: df 93 push r29 24e9a: cf 93 push r28 24e9c: 9f 93 push r25 24e9e: 8f 93 push r24 24ea0: 8e ea ldi r24, 0xAE ; 174 24ea2: 92 ea ldi r25, 0xA2 ; 162 24ea4: 9f 93 push r25 24ea6: 8f 93 push r24 24ea8: 0e 94 ee 6f call 0xdfdc ; 0xdfdc menu_back_if_clicked(); 24eac: 8d b7 in r24, 0x3d ; 61 24eae: 9e b7 in r25, 0x3e ; 62 24eb0: 08 96 adiw r24, 0x08 ; 8 24eb2: 0f b6 in r0, 0x3f ; 63 24eb4: f8 94 cli 24eb6: 9e bf out 0x3e, r25 ; 62 24eb8: 0f be out 0x3f, r0 ; 63 24eba: 8d bf out 0x3d, r24 ; 61 } 24ebc: df 91 pop r29 24ebe: cf 91 pop r28 24ec0: 1f 91 pop r17 24ec2: 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(); 24ec4: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 00024ec8 : #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){ 24ec8: cf 93 push r28 24eca: df 93 push r29 24ecc: cd b7 in r28, 0x3d ; 61 24ece: de b7 in r29, 0x3e ; 62 24ed0: 2f 97 sbiw r28, 0x0f ; 15 24ed2: 0f b6 in r0, 0x3f ; 63 24ed4: f8 94 cli 24ed6: de bf out 0x3e, r29 ; 62 24ed8: 0f be out 0x3f, r0 ; 63 24eda: cd bf out 0x3d, r28 ; 61 24edc: fc 01 movw r30, r24 24ede: de 01 movw r26, r28 24ee0: 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; 24ee2: 90 e0 ldi r25, 0x00 ; 0 24ee4: 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); 24ee6: 84 91 lpm r24, Z 24ee8: 41 e0 ldi r20, 0x01 ; 1 24eea: 49 0f add r20, r25 if( ! b ) 24eec: 88 23 and r24, r24 24eee: 29 f0 breq .+10 ; 0x24efa break; dst[i] = b; 24ef0: 8d 93 st X+, r24 24ef2: 31 96 adiw r30, 0x01 ; 1 24ef4: 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 24ef6: 4d 30 cpi r20, 0x0D ; 13 24ef8: b1 f7 brne .-20 ; 0x24ee6 uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 24efa: f9 01 movw r30, r18 24efc: e9 0f add r30, r25 24efe: f1 1d adc r31, r1 24f00: 8a e3 ldi r24, 0x3A ; 58 24f02: 80 83 st Z, r24 ++i; 24f04: 9f 5f subi r25, 0xFF ; 255 24f06: f9 01 movw r30, r18 24f08: e9 0f add r30, r25 24f0a: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 24f0c: 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 24f0e: 9e 30 cpi r25, 0x0E ; 14 24f10: 19 f0 breq .+6 ; 0x24f18 dst[i] = ' '; 24f12: 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 24f14: 9f 5f subi r25, 0xFF ; 255 24f16: fb cf rjmp .-10 ; 0x24f0e dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 24f18: 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 24f1a: 7f 93 push r23 24f1c: 6f 93 push r22 24f1e: 3f 93 push r19 24f20: 2f 93 push r18 24f22: 8c e6 ldi r24, 0x6C ; 108 24f24: 92 ea ldi r25, 0xA2 ; 162 24f26: 9f 93 push r25 24f28: 8f 93 push r24 24f2a: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 24f2e: 0f 90 pop r0 24f30: 0f 90 pop r0 24f32: 0f 90 pop r0 24f34: 0f 90 pop r0 24f36: 0f 90 pop r0 24f38: 0f 90 pop r0 } 24f3a: 2f 96 adiw r28, 0x0f ; 15 24f3c: 0f b6 in r0, 0x3f ; 63 24f3e: f8 94 cli 24f40: de bf out 0x3e, r29 ; 62 24f42: 0f be out 0x3f, r0 ; 63 24f44: cd bf out 0x3d, r28 ; 61 24f46: df 91 pop r29 24f48: cf 91 pop r28 24f4a: 08 95 ret 00024f4c : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 24f4c: cf 92 push r12 24f4e: df 92 push r13 24f50: ef 92 push r14 24f52: ff 92 push r15 24f54: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 24f58: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 24f5c: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 24f60: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 24f64: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 24f68: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 24f6c: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 24f70: 6b 01 movw r12, r22 24f72: 83 e0 ldi r24, 0x03 ; 3 24f74: 98 e5 ldi r25, 0x58 ; 88 24f76: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24f7a: b6 01 movw r22, r12 24f7c: 0f 94 64 27 call 0x24ec8 ; 0x24ec8 lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 24f80: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 24f84: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 24f88: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 24f8c: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 24f90: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 24f94: 6b 01 movw r12, r22 24f96: 88 ee ldi r24, 0xE8 ; 232 24f98: 97 e5 ldi r25, 0x57 ; 87 24f9a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24f9e: b6 01 movw r22, r12 24fa0: 0f 94 64 27 call 0x24ec8 ; 0x24ec8 #ifdef AMBIENT_THERMISTOR lcd_menu_temperatures_line( _T(MSG_AMBIENT), (int)current_temperature_ambient ); 24fa4: 60 91 53 06 lds r22, 0x0653 ; 0x800653 24fa8: 70 91 54 06 lds r23, 0x0654 ; 0x800654 24fac: 80 91 55 06 lds r24, 0x0655 ; 0x800655 24fb0: 90 91 56 06 lds r25, 0x0656 ; 0x800656 24fb4: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 24fb8: 6b 01 movw r12, r22 24fba: 85 e4 ldi r24, 0x45 ; 69 24fbc: 9b e4 ldi r25, 0x4B ; 75 24fbe: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 24fc2: b6 01 movw r22, r12 24fc4: 0f 94 64 27 call 0x24ec8 ; 0x24ec8 #endif //AMBIENT_THERMISTOR #ifdef PINDA_THERMISTOR lcd_menu_temperatures_line(MSG_PINDA, (int)current_temperature_pinda ); ////MSG_PINDA 24fc8: 60 91 99 03 lds r22, 0x0399 ; 0x800399 24fcc: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 24fd0: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 24fd4: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 24fd8: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 24fdc: 89 ec ldi r24, 0xC9 ; 201 24fde: 90 e7 ldi r25, 0x70 ; 112 24fe0: 0f 94 64 27 call 0x24ec8 ; 0x24ec8 #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 24fe4: ff 90 pop r15 24fe6: ef 90 pop r14 24fe8: df 90 pop r13 24fea: 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(); 24fec: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 00024ff0 : //! | 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() { 24ff0: af 92 push r10 24ff2: bf 92 push r11 24ff4: cf 92 push r12 24ff6: df 92 push r13 24ff8: ef 92 push r14 24ffa: ff 92 push r15 24ffc: 0f 93 push r16 24ffe: 1f 93 push r17 25000: cf 93 push r28 25002: df 93 push r29 25004: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout uint8_t power = eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT); 25008: 84 e6 ldi r24, 0x64 ; 100 2500a: 9f e0 ldi r25, 0x0F ; 15 2500c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 25010: 18 2f mov r17, r24 uint8_t filam = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 25012: 85 e6 ldi r24, 0x65 ; 101 25014: 9f e0 ldi r25, 0x0F ; 15 25016: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2501a: e8 2e mov r14, r24 uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 2501c: 86 e6 ldi r24, 0x66 ; 102 2501e: 9f e0 ldi r25, 0x0F ; 15 25020: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 25024: b8 2e mov r11, r24 uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 25026: 88 e6 ldi r24, 0x68 ; 104 25028: 9f e0 ldi r25, 0x0F ; 15 2502a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2502e: a8 2e mov r10, r24 lcd_home(); 25030: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_printf_P(failStatsFmt, 25034: 88 e2 ldi r24, 0x28 ; 40 25036: 9b e4 ldi r25, 0x4B ; 75 25038: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2503c: d8 2e mov r13, r24 2503e: c9 2e mov r12, r25 25040: 89 e1 ldi r24, 0x19 ; 25 25042: 9b e4 ldi r25, 0x4B ; 75 25044: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 25048: 08 2f mov r16, r24 2504a: f9 2e mov r15, r25 2504c: 88 e0 ldi r24, 0x08 ; 8 2504e: 9b e4 ldi r25, 0x4B ; 75 25050: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 25054: ec 01 movw r28, r24 25056: 82 ef ldi r24, 0xF2 ; 242 25058: 9a e4 ldi r25, 0x4A ; 74 2505a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2505e: 1f 92 push r1 25060: af 92 push r10 25062: 1f 92 push r1 25064: bf 92 push r11 25066: cf 92 push r12 25068: df 92 push r13 2506a: 1f 92 push r1 2506c: ef 92 push r14 2506e: ff 92 push r15 25070: 0f 93 push r16 25072: 1f 92 push r1 25074: 1f 93 push r17 25076: df 93 push r29 25078: cf 93 push r28 2507a: 9f 93 push r25 2507c: 8f 93 push r24 2507e: 87 e3 ldi r24, 0x37 ; 55 25080: 92 ea ldi r25, 0xA2 ; 162 25082: 9f 93 push r25 25084: 8f 93 push r24 25086: 0e 94 ee 6f call 0xdfdc ; 0xdfdc _T(MSG_LAST_PRINT_FAILURES), _T(MSG_POWER_FAILURES), power, _T(MSG_FIL_RUNOUTS), filam, _T(MSG_CRASH), crashX, crashY); menu_back_if_clicked(); 2508a: 8d b7 in r24, 0x3d ; 61 2508c: 9e b7 in r25, 0x3e ; 62 2508e: 42 96 adiw r24, 0x12 ; 18 25090: 0f b6 in r0, 0x3f ; 63 25092: f8 94 cli 25094: 9e bf out 0x3e, r25 ; 62 25096: 0f be out 0x3f, r0 ; 63 25098: 8d bf out 0x3d, r24 ; 61 } 2509a: df 91 pop r29 2509c: cf 91 pop r28 2509e: 1f 91 pop r17 250a0: 0f 91 pop r16 250a2: ff 90 pop r15 250a4: ef 90 pop r14 250a6: df 90 pop r13 250a8: cf 90 pop r12 250aa: bf 90 pop r11 250ac: 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(); 250ae: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 000250b2 : //! | 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() { 250b2: 6f 92 push r6 250b4: 7f 92 push r7 250b6: 8f 92 push r8 250b8: 9f 92 push r9 250ba: af 92 push r10 250bc: bf 92 push r11 250be: cf 92 push r12 250c0: df 92 push r13 250c2: ef 92 push r14 250c4: ff 92 push r15 250c6: 0f 93 push r16 250c8: 1f 93 push r17 250ca: cf 93 push r28 250cc: df 93 push r29 250ce: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 250d2: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_printf_P(failStatsFmt, 250d6: 83 e0 ldi r24, 0x03 ; 3 250d8: 9f e0 ldi r25, 0x0F ; 15 250da: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 250de: 0f 94 70 1d call 0x23ae0 ; 0x23ae0 250e2: 78 2e mov r7, r24 250e4: 69 2e mov r6, r25 250e6: 85 e0 ldi r24, 0x05 ; 5 250e8: 9f e0 ldi r25, 0x0F ; 15 250ea: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 250ee: 0f 94 70 1d call 0x23ae0 ; 0x23ae0 250f2: 98 2e mov r9, r24 250f4: 89 2e mov r8, r25 250f6: 88 e2 ldi r24, 0x28 ; 40 250f8: 9b e4 ldi r25, 0x4B ; 75 250fa: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 250fe: b8 2e mov r11, r24 25100: a9 2e mov r10, r25 25102: 81 e0 ldi r24, 0x01 ; 1 25104: 9f e0 ldi r25, 0x0F ; 15 25106: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 2510a: 0f 94 70 1d call 0x23ae0 ; 0x23ae0 2510e: d8 2e mov r13, r24 25110: c9 2e mov r12, r25 25112: 89 e1 ldi r24, 0x19 ; 25 25114: 9b e4 ldi r25, 0x4B ; 75 25116: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2511a: f8 2e mov r15, r24 2511c: e9 2e mov r14, r25 2511e: 8f ef ldi r24, 0xFF ; 255 25120: 9e e0 ldi r25, 0x0E ; 14 25122: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 25126: 0f 94 70 1d call 0x23ae0 ; 0x23ae0 2512a: 18 2f mov r17, r24 2512c: 09 2f mov r16, r25 2512e: 88 e0 ldi r24, 0x08 ; 8 25130: 9b e4 ldi r25, 0x4B ; 75 25132: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 25136: ec 01 movw r28, r24 25138: 81 ee ldi r24, 0xE1 ; 225 2513a: 9a e4 ldi r25, 0x4A ; 74 2513c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 25140: 6f 92 push r6 25142: 7f 92 push r7 25144: 8f 92 push r8 25146: 9f 92 push r9 25148: af 92 push r10 2514a: bf 92 push r11 2514c: cf 92 push r12 2514e: df 92 push r13 25150: ef 92 push r14 25152: ff 92 push r15 25154: 0f 93 push r16 25156: 1f 93 push r17 25158: df 93 push r29 2515a: cf 93 push r28 2515c: 9f 93 push r25 2515e: 8f 93 push r24 25160: 87 e3 ldi r24, 0x37 ; 55 25162: 92 ea ldi r25, 0xA2 ; 162 25164: 9f 93 push r25 25166: 8f 93 push r24 25168: 0e 94 ee 6f call 0xdfdc ; 0xdfdc _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(); 2516c: 8d b7 in r24, 0x3d ; 61 2516e: 9e b7 in r25, 0x3e ; 62 25170: 42 96 adiw r24, 0x12 ; 18 25172: 0f b6 in r0, 0x3f ; 63 25174: f8 94 cli 25176: 9e bf out 0x3e, r25 ; 62 25178: 0f be out 0x3f, r0 ; 63 2517a: 8d bf out 0x3d, r24 ; 61 } 2517c: df 91 pop r29 2517e: cf 91 pop r28 25180: 1f 91 pop r17 25182: 0f 91 pop r16 25184: ff 90 pop r15 25186: ef 90 pop r14 25188: df 90 pop r13 2518a: cf 90 pop r12 2518c: bf 90 pop r11 2518e: af 90 pop r10 25190: 9f 90 pop r9 25192: 8f 90 pop r8 25194: 7f 90 pop r7 25196: 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(); 25198: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 0002519c : //! | 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() { 2519c: 8f 92 push r8 2519e: 9f 92 push r9 251a0: af 92 push r10 251a2: bf 92 push r11 251a4: cf 92 push r12 251a6: df 92 push r13 251a8: ef 92 push r14 251aa: ff 92 push r15 251ac: 0f 93 push r16 251ae: 1f 93 push r17 251b0: cf 93 push r28 251b2: df 93 push r29 251b4: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 251b8: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_printf_P( 251bc: 80 91 9e 13 lds r24, 0x139E ; 0x80139e 251c0: 90 91 9f 13 lds r25, 0x139F ; 0x80139f 251c4: 0f 94 70 1d call 0x23ae0 ; 0x23ae0 251c8: 98 2e mov r9, r24 251ca: 89 2e mov r8, r25 251cc: 8c eb ldi r24, 0xBC ; 188 251ce: 9a e4 ldi r25, 0x4A ; 74 251d0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 251d4: b8 2e mov r11, r24 251d6: a9 2e mov r10, r25 251d8: 80 ed ldi r24, 0xD0 ; 208 251da: 9e e0 ldi r25, 0x0E ; 14 251dc: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 251e0: 0f 94 70 1d call 0x23ae0 ; 0x23ae0 251e4: d8 2e mov r13, r24 251e6: c9 2e mov r12, r25 251e8: 8b ea ldi r24, 0xAB ; 171 251ea: 9a e4 ldi r25, 0x4A ; 74 251ec: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 251f0: f8 2e mov r15, r24 251f2: e9 2e mov r14, r25 251f4: 83 ed ldi r24, 0xD3 ; 211 251f6: 9e e0 ldi r25, 0x0E ; 14 251f8: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 251fc: 0f 94 70 1d call 0x23ae0 ; 0x23ae0 25200: 18 2f mov r17, r24 25202: 09 2f mov r16, r25 25204: 8f e9 ldi r24, 0x9F ; 159 25206: 9a e4 ldi r25, 0x4A ; 74 25208: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2520c: ec 01 movw r28, r24 2520e: 81 ee ldi r24, 0xE1 ; 225 25210: 9a e4 ldi r25, 0x4A ; 74 25212: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 25216: 8f 92 push r8 25218: 9f 92 push r9 2521a: af 92 push r10 2521c: bf 92 push r11 2521e: cf 92 push r12 25220: df 92 push r13 25222: ef 92 push r14 25224: ff 92 push r15 25226: 0f 93 push r16 25228: 1f 93 push r17 2522a: df 93 push r29 2522c: cf 93 push r28 2522e: 9f 93 push r25 25230: 8f 93 push r24 25232: 8a e0 ldi r24, 0x0A ; 10 25234: 92 ea ldi r25, 0xA2 ; 162 25236: 9f 93 push r25 25238: 8f 93 push r24 2523a: 0e 94 ee 6f call 0xdfdc ; 0xdfdc ), _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(); 2523e: 8d b7 in r24, 0x3d ; 61 25240: 9e b7 in r25, 0x3e ; 62 25242: 40 96 adiw r24, 0x10 ; 16 25244: 0f b6 in r0, 0x3f ; 63 25246: f8 94 cli 25248: 9e bf out 0x3e, r25 ; 62 2524a: 0f be out 0x3f, r0 ; 63 2524c: 8d bf out 0x3d, r24 ; 61 } 2524e: df 91 pop r29 25250: cf 91 pop r28 25252: 1f 91 pop r17 25254: 0f 91 pop r16 25256: ff 90 pop r15 25258: ef 90 pop r14 2525a: df 90 pop r13 2525c: cf 90 pop r12 2525e: bf 90 pop r11 25260: af 90 pop r10 25262: 9f 90 pop r9 25264: 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(); 25266: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 0002526a : //! | 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() { 2526a: cf 92 push r12 2526c: df 92 push r13 2526e: ef 92 push r14 25270: ff 92 push r15 25272: 0f 93 push r16 25274: 1f 93 push r17 25276: cf 93 push r28 25278: df 93 push r29 2527a: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 2527e: 0e 94 41 70 call 0xe082 ; 0xe082 " %-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) )); 25282: 8f ec ldi r24, 0xCF ; 207 25284: 9e e0 ldi r25, 0x0E ; 14 25286: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 2528a: 90 e0 ldi r25, 0x00 ; 0 2528c: 0f 94 70 1d call 0x23ae0 ; 0x23ae0 25290: d8 2e mov r13, r24 25292: c9 2e mov r12, r25 25294: 8b ea ldi r24, 0xAB ; 171 25296: 9a e4 ldi r25, 0x4A ; 74 25298: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2529c: f8 2e mov r15, r24 2529e: 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) ), 252a0: 82 ed ldi r24, 0xD2 ; 210 252a2: 9e e0 ldi r25, 0x0E ; 14 252a4: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 252a8: 90 e0 ldi r25, 0x00 ; 0 252aa: 0f 94 70 1d call 0x23ae0 ; 0x23ae0 252ae: 18 2f mov r17, r24 252b0: 09 2f mov r16, r25 252b2: 8f e9 ldi r24, 0x9F ; 159 252b4: 9a e4 ldi r25, 0x4A ; 74 252b6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 252ba: ec 01 movw r28, r24 252bc: 82 ef ldi r24, 0xF2 ; 242 252be: 9a e4 ldi r25, 0x4A ; 74 252c0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 252c4: cf 92 push r12 252c6: df 92 push r13 252c8: ef 92 push r14 252ca: ff 92 push r15 252cc: 0f 93 push r16 252ce: 1f 93 push r17 252d0: df 93 push r29 252d2: cf 93 push r28 252d4: 9f 93 push r25 252d6: 8f 93 push r24 252d8: 8b ee ldi r24, 0xEB ; 235 252da: 91 ea ldi r25, 0xA1 ; 161 252dc: 9f 93 push r25 252de: 8f 93 push r24 252e0: 0e 94 ee 6f call 0xdfdc ; 0xdfdc " %-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(); 252e4: 8d b7 in r24, 0x3d ; 61 252e6: 9e b7 in r25, 0x3e ; 62 252e8: 0c 96 adiw r24, 0x0c ; 12 252ea: 0f b6 in r0, 0x3f ; 63 252ec: f8 94 cli 252ee: 9e bf out 0x3e, r25 ; 62 252f0: 0f be out 0x3f, r0 ; 63 252f2: 8d bf out 0x3d, r24 ; 61 } 252f4: df 91 pop r29 252f6: cf 91 pop r28 252f8: 1f 91 pop r17 252fa: 0f 91 pop r16 252fc: ff 90 pop r15 252fe: ef 90 pop r14 25300: df 90 pop r13 25302: 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(); 25304: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 00025308 : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 25308: af 92 push r10 2530a: bf 92 push r11 2530c: cf 92 push r12 2530e: df 92 push r13 25310: ef 92 push r14 25312: ff 92 push r15 25314: 0f 93 push r16 25316: 1f 93 push r17 25318: cf 93 push r28 2531a: df 93 push r29 2531c: 00 d0 rcall .+0 ; 0x2531e 2531e: 00 d0 rcall .+0 ; 0x25320 25320: 1f 92 push r1 25322: cd b7 in r28, 0x3d ; 61 25324: 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)) || 25326: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 2532a: 81 11 cpse r24, r1 2532c: 18 c0 rjmp .+48 ; 0x2535e 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))) || 2532e: 81 ea ldi r24, 0xA1 ; 161 25330: 9d e0 ldi r25, 0x0D ; 13 25332: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 25336: 18 2f mov r17, r24 25338: 0e 94 4c 78 call 0xf098 ; 0xf098 2533c: 88 23 and r24, r24 2533e: 79 f0 breq .+30 ; 0x2535e (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 25340: 80 e1 ldi r24, 0x10 ; 16 25342: 0e 94 6d f8 call 0x1f0da ; 0x1f0da 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))) || 25346: 88 23 and r24, r24 25348: 51 f0 breq .+20 ; 0x2535e (!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))))) 2534a: 2b e0 ldi r18, 0x0B ; 11 2534c: 12 9f mul r17, r18 2534e: c0 01 movw r24, r0 25350: 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 25352: 80 5b subi r24, 0xB0 ; 176 25354: 92 4f sbci r25, 0xF2 ; 242 25356: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 } 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)) || 2535a: 89 2b or r24, r25 2535c: f1 f4 brne .+60 ; 0x2539a (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) 2535e: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 25362: 88 23 and r24, r24 25364: 71 f0 breq .+28 ; 0x25382 { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 25366: 81 ea ldi r24, 0xA1 ; 161 25368: 9d e0 ldi r25, 0x0D ; 13 2536a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2536e: 2b e0 ldi r18, 0x0B ; 11 25370: 82 9f mul r24, r18 25372: c0 01 movw r24, r0 25374: 11 24 eor r1, r1 25376: 6f ef ldi r22, 0xFF ; 255 25378: 7f ef ldi r23, 0xFF ; 255 2537a: 80 5b subi r24, 0xB0 ; 176 2537c: 92 4f sbci r25, 0xF2 ; 242 2537e: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a } // 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()); 25382: 0e 94 32 72 call 0xe464 ; 0xe464 25386: 21 e0 ldi r18, 0x01 ; 1 25388: 81 11 cpse r24, r1 2538a: 20 e0 ldi r18, 0x00 ; 0 2538c: 41 e0 ldi r20, 0x01 ; 1 2538e: 70 e0 ldi r23, 0x00 ; 0 25390: 60 e0 ldi r22, 0x00 ; 0 25392: 82 ef ldi r24, 0xF2 ; 242 25394: 9a e3 ldi r25, 0x3A ; 58 25396: 0f 94 04 cf call 0x39e08 ; 0x39e08 } if (lcd_encoder) { 2539a: 20 91 37 05 lds r18, 0x0537 ; 0x800537 2539e: 30 91 38 05 lds r19, 0x0538 ; 0x800538 253a2: 21 15 cp r18, r1 253a4: 31 05 cpc r19, r1 253a6: 59 f0 breq .+22 ; 0x253be menuData->reset = lcd_encoder > 0; 253a8: 81 e0 ldi r24, 0x01 ; 1 253aa: 12 16 cp r1, r18 253ac: 13 06 cpc r1, r19 253ae: 0c f0 brlt .+2 ; 0x253b2 253b0: 80 e0 ldi r24, 0x00 ; 0 253b2: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 lcd_encoder = 0; // Reset 253b6: 10 92 38 05 sts 0x0538, r1 ; 0x800538 253ba: 10 92 37 05 sts 0x0537, r1 ; 0x800537 } 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)); 253be: 81 ea ldi r24, 0xA1 ; 161 253c0: 9d e0 ldi r25, 0x0D ; 13 253c2: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 253c6: 1b e0 ldi r17, 0x0B ; 11 253c8: 81 9f mul r24, r17 253ca: b0 01 movw r22, r0 253cc: 11 24 eor r1, r1 253ce: 67 5b subi r22, 0xB7 ; 183 253d0: 72 4f sbci r23, 0xF2 ; 242 253d2: 47 e0 ldi r20, 0x07 ; 7 253d4: 50 e0 ldi r21, 0x00 ; 0 253d6: ce 01 movw r24, r28 253d8: 01 96 adiw r24, 0x01 ; 1 253da: 7c 01 movw r14, r24 253dc: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 lcd_home(); 253e0: 0e 94 41 70 call 0xe082 ; 0xe082 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]; 253e4: 81 ea ldi r24, 0xA1 ; 161 253e6: 9d e0 ldi r25, 0x0D ; 13 253e8: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 253ec: 81 9f mul r24, r17 253ee: c0 01 movw r24, r0 253f0: 11 24 eor r1, r1 253f2: 80 5b subi r24, 0xB0 ; 176 253f4: 92 4f sbci r25, 0xF2 ; 242 253f6: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 253fa: bc 01 movw r22, r24 253fc: 99 0f add r25, r25 253fe: 88 0b sbc r24, r24 25400: 99 0b sbc r25, r25 25402: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 25406: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 2540a: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 2540e: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 25412: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 25416: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 2541a: d6 2e mov r13, r22 2541c: c7 2e mov r12, r23 2541e: b8 2e mov r11, r24 25420: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 25422: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 25426: 0e e3 ldi r16, 0x3E ; 62 25428: 10 e2 ldi r17, 0x20 ; 32 2542a: 81 11 cpse r24, r1 2542c: 02 c0 rjmp .+4 ; 0x25432 2542e: 00 e2 ldi r16, 0x20 ; 32 25430: 1e e3 ldi r17, 0x3E ; 62 25432: 82 e7 ldi r24, 0x72 ; 114 25434: 9f e4 ldi r25, 0x4F ; 79 25436: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2543a: 1f 92 push r1 2543c: 0f 93 push r16 2543e: 1f 92 push r1 25440: 1f 93 push r17 25442: af 92 push r10 25444: bf 92 push r11 25446: cf 92 push r12 25448: df 92 push r13 2544a: ff 92 push r15 2544c: ef 92 push r14 2544e: 9f 93 push r25 25450: 8f 93 push r24 25452: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 25456: 0f b6 in r0, 0x3f ; 63 25458: f8 94 cli 2545a: de bf out 0x3e, r29 ; 62 2545c: 0f be out 0x3f, r0 ; 63 2545e: 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. } 25460: 27 96 adiw r28, 0x07 ; 7 25462: 0f b6 in r0, 0x3f ; 63 25464: f8 94 cli 25466: de bf out 0x3e, r29 ; 62 25468: 0f be out 0x3f, r0 ; 63 2546a: cd bf out 0x3d, r28 ; 61 2546c: df 91 pop r29 2546e: cf 91 pop r28 25470: 1f 91 pop r17 25472: 0f 91 pop r16 25474: ff 90 pop r15 25476: ef 90 pop r14 25478: df 90 pop r13 2547a: cf 90 pop r12 2547c: bf 90 pop r11 2547e: af 90 pop r10 25480: 08 95 ret 00025482 : //! |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() { 25482: 2f 92 push r2 25484: 3f 92 push r3 25486: 4f 92 push r4 25488: 5f 92 push r5 2548a: 6f 92 push r6 2548c: 7f 92 push r7 2548e: 8f 92 push r8 25490: 9f 92 push r9 25492: af 92 push r10 25494: bf 92 push r11 25496: cf 92 push r12 25498: df 92 push r13 2549a: ef 92 push r14 2549c: ff 92 push r15 2549e: 0f 93 push r16 254a0: 1f 93 push r17 254a2: cf 93 push r28 254a4: df 93 push r29 254a6: cd b7 in r28, 0x3d ; 61 254a8: de b7 in r29, 0x3e ; 62 254aa: a8 97 sbiw r28, 0x28 ; 40 254ac: 0f b6 in r0, 0x3f ; 63 254ae: f8 94 cli 254b0: de bf out 0x3e, r29 ; 62 254b2: 0f be out 0x3f, r0 ; 63 254b4: 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); 254b6: 48 e0 ldi r20, 0x08 ; 8 254b8: 50 e0 ldi r21, 0x00 ; 0 254ba: 65 ee ldi r22, 0xE5 ; 229 254bc: 7f e0 ldi r23, 0x0F ; 15 254be: ce 01 movw r24, r28 254c0: 41 96 adiw r24, 0x11 ; 17 254c2: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 254c6: 48 e0 ldi r20, 0x08 ; 8 254c8: 50 e0 ldi r21, 0x00 ; 0 254ca: 6d ed ldi r22, 0xDD ; 221 254cc: 7f e0 ldi r23, 0x0F ; 15 254ce: ce 01 movw r24, r28 254d0: 09 96 adiw r24, 0x09 ; 9 254d2: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 254d6: 48 e0 ldi r20, 0x08 ; 8 254d8: 50 e0 ldi r21, 0x00 ; 0 254da: 65 ed ldi r22, 0xD5 ; 213 254dc: 7f e0 ldi r23, 0x0F ; 15 254de: ce 01 movw r24, r28 254e0: 01 96 adiw r24, 0x01 ; 1 254e2: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 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]; 254e6: 8d 84 ldd r8, Y+13 ; 0x0d 254e8: 9e 84 ldd r9, Y+14 ; 0x0e 254ea: af 84 ldd r10, Y+15 ; 0x0f 254ec: b8 88 ldd r11, Y+16 ; 0x10 254ee: ec e0 ldi r30, 0x0C ; 12 254f0: f3 e9 ldi r31, 0x93 ; 147 254f2: 25 91 lpm r18, Z+ 254f4: 35 91 lpm r19, Z+ 254f6: 45 91 lpm r20, Z+ 254f8: 54 91 lpm r21, Z 254fa: cd 80 ldd r12, Y+5 ; 0x05 254fc: de 80 ldd r13, Y+6 ; 0x06 254fe: ef 80 ldd r14, Y+7 ; 0x07 25500: f8 84 ldd r15, Y+8 ; 0x08 25502: e0 e1 ldi r30, 0x10 ; 16 25504: f3 e9 ldi r31, 0x93 ; 147 25506: 85 91 lpm r24, Z+ 25508: 95 91 lpm r25, Z+ 2550a: a5 91 lpm r26, Z+ 2550c: b4 91 lpm r27, Z 2550e: 8d a3 std Y+37, r24 ; 0x25 25510: 9e a3 std Y+38, r25 ; 0x26 25512: af a3 std Y+39, r26 ; 0x27 25514: b8 a7 std Y+40, r27 ; 0x28 25516: 8d 89 ldd r24, Y+21 ; 0x15 25518: 9e 89 ldd r25, Y+22 ; 0x16 2551a: af 89 ldd r26, Y+23 ; 0x17 2551c: b8 8d ldd r27, Y+24 ; 0x18 2551e: 89 a3 std Y+33, r24 ; 0x21 25520: 9a a3 std Y+34, r25 ; 0x22 25522: ab a3 std Y+35, r26 ; 0x23 25524: bc a3 std Y+36, r27 ; 0x24 25526: c5 01 movw r24, r10 25528: b4 01 movw r22, r8 2552a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2552e: 2b 01 movw r4, r22 25530: 3c 01 movw r6, r24 25532: 2d a1 ldd r18, Y+37 ; 0x25 25534: 3e a1 ldd r19, Y+38 ; 0x26 25536: 4f a1 ldd r20, Y+39 ; 0x27 25538: 58 a5 ldd r21, Y+40 ; 0x28 2553a: c7 01 movw r24, r14 2553c: b6 01 movw r22, r12 2553e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 25542: 9b 01 movw r18, r22 25544: ac 01 movw r20, r24 25546: c3 01 movw r24, r6 25548: b2 01 movw r22, r4 2554a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 2554e: 29 a1 ldd r18, Y+33 ; 0x21 25550: 3a a1 ldd r19, Y+34 ; 0x22 25552: 4b a1 ldd r20, Y+35 ; 0x23 25554: 5c a1 ldd r21, Y+36 ; 0x24 25556: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 2555a: 20 e0 ldi r18, 0x00 ; 0 2555c: 30 e0 ldi r19, 0x00 ; 0 2555e: 40 e9 ldi r20, 0x90 ; 144 25560: 50 e4 ldi r21, 0x40 ; 64 25562: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 25566: 1b 01 movw r2, r22 25568: 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]; 2556a: e4 e1 ldi r30, 0x14 ; 20 2556c: f3 e9 ldi r31, 0x93 ; 147 2556e: 25 91 lpm r18, Z+ 25570: 35 91 lpm r19, Z+ 25572: 45 91 lpm r20, Z+ 25574: 54 91 lpm r21, Z 25576: e8 e1 ldi r30, 0x18 ; 24 25578: f3 e9 ldi r31, 0x93 ; 147 2557a: 45 90 lpm r4, Z+ 2557c: 55 90 lpm r5, Z+ 2557e: 65 90 lpm r6, Z+ 25580: 74 90 lpm r7, Z 25582: c5 01 movw r24, r10 25584: b4 01 movw r22, r8 25586: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2558a: 4b 01 movw r8, r22 2558c: 5c 01 movw r10, r24 2558e: a3 01 movw r20, r6 25590: 92 01 movw r18, r4 25592: c7 01 movw r24, r14 25594: b6 01 movw r22, r12 25596: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2559a: 9b 01 movw r18, r22 2559c: ac 01 movw r20, r24 2559e: c5 01 movw r24, r10 255a0: b4 01 movw r22, r8 255a2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 255a6: 29 a1 ldd r18, Y+33 ; 0x21 255a8: 3a a1 ldd r19, Y+34 ; 0x22 255aa: 4b a1 ldd r20, Y+35 ; 0x23 255ac: 5c a1 ldd r21, Y+36 ; 0x24 255ae: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 255b2: 20 e0 ldi r18, 0x00 ; 0 255b4: 30 e0 ldi r19, 0x00 ; 0 255b6: 40 e9 ldi r20, 0x90 ; 144 255b8: 50 e4 ldi r21, 0x40 ; 64 255ba: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 255be: 6d 8f std Y+29, r22 ; 0x1d 255c0: 7e 8f std Y+30, r23 ; 0x1e 255c2: 8f 8f std Y+31, r24 ; 0x1f 255c4: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 255c6: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_printf_P(_N( 255ca: 84 e7 ldi r24, 0x74 ; 116 255cc: 9d e4 ldi r25, 0x4D ; 77 255ce: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 255d2: d8 2e mov r13, r24 255d4: c9 2e mov r12, r25 255d6: 8d e6 ldi r24, 0x6D ; 109 255d8: 9d e4 ldi r25, 0x4D ; 77 255da: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 255de: f8 2e mov r15, r24 255e0: e9 2e mov r14, r25 255e2: 87 e5 ldi r24, 0x57 ; 87 255e4: 9d e4 ldi r25, 0x4D ; 77 255e6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 255ea: cf 92 push r12 255ec: df 92 push r13 255ee: ef 92 push r14 255f0: ff 92 push r15 255f2: 29 ee ldi r18, 0xE9 ; 233 255f4: 3c e8 ldi r19, 0x8C ; 140 255f6: 3f 93 push r19 255f8: 2f 93 push r18 255fa: 9f 93 push r25 255fc: 8f 93 push r24 255fe: 89 e7 ldi r24, 0x79 ; 121 25600: 90 e7 ldi r25, 0x70 ; 112 25602: 9f 93 push r25 25604: 8f 93 push r24 25606: 0e 94 ee 6f call 0xdfdc ; 0xdfdc _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 2560a: 62 e0 ldi r22, 0x02 ; 2 2560c: 8b e0 ldi r24, 0x0B ; 11 2560e: 0e 94 15 70 call 0xe02a ; 0xe02a if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 25612: 0f b6 in r0, 0x3f ; 63 25614: f8 94 cli 25616: de bf out 0x3e, r29 ; 62 25618: 0f be out 0x3f, r0 ; 63 2561a: cd bf out 0x3d, r28 ; 61 2561c: 20 e0 ldi r18, 0x00 ; 0 2561e: 30 e0 ldi r19, 0x00 ; 0 25620: 48 e4 ldi r20, 0x48 ; 72 25622: 53 e4 ldi r21, 0x43 ; 67 25624: 62 2d mov r22, r2 25626: 73 2d mov r23, r3 25628: 80 2f mov r24, r16 2562a: 91 2f mov r25, r17 2562c: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 25630: 87 ff sbrs r24, 7 25632: 51 c0 rjmp .+162 ; 0x256d6 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 25634: 1f 93 push r17 25636: 0f 93 push r16 25638: 3f 92 push r3 2563a: 2f 92 push r2 2563c: 81 e7 ldi r24, 0x71 ; 113 2563e: 90 e7 ldi r25, 0x70 ; 112 25640: 9f 93 push r25 25642: 8f 93 push r24 25644: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 25648: 0f 90 pop r0 2564a: 0f 90 pop r0 2564c: 0f 90 pop r0 2564e: 0f 90 pop r0 25650: 0f 90 pop r0 25652: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 25654: 63 e0 ldi r22, 0x03 ; 3 25656: 8b e0 ldi r24, 0x0B ; 11 25658: 0e 94 15 70 call 0xe02a ; 0xe02a if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 2565c: 1d 8d ldd r17, Y+29 ; 0x1d 2565e: 0e 8d ldd r16, Y+30 ; 0x1e 25660: ff 8c ldd r15, Y+31 ; 0x1f 25662: e8 a0 ldd r14, Y+32 ; 0x20 25664: 20 e0 ldi r18, 0x00 ; 0 25666: 30 e0 ldi r19, 0x00 ; 0 25668: 48 e4 ldi r20, 0x48 ; 72 2566a: 53 e4 ldi r21, 0x43 ; 67 2566c: d8 01 movw r26, r16 2566e: f7 01 movw r30, r14 25670: 6b 2f mov r22, r27 25672: 7a 2f mov r23, r26 25674: 8f 2f mov r24, r31 25676: 9e 2f mov r25, r30 25678: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 2567c: 87 fd sbrc r24, 7 2567e: 32 c0 rjmp .+100 ; 0x256e4 25680: 88 e5 ldi r24, 0x58 ; 88 25682: 9d e3 ldi r25, 0x3D ; 61 25684: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 25688: 0e 94 00 70 call 0xe000 ; 0xe000 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 2568c: 0e 94 32 72 call 0xe464 ; 0xe464 25690: 88 23 and r24, r24 25692: 41 f0 breq .+16 ; 0x256a4 menu_goto(lcd_menu_xyz_skew, 0, true); 25694: 20 e0 ldi r18, 0x00 ; 0 25696: 41 e0 ldi r20, 0x01 ; 1 25698: 70 e0 ldi r23, 0x00 ; 0 2569a: 60 e0 ldi r22, 0x00 ; 0 2569c: 8c ef ldi r24, 0xFC ; 252 2569e: 99 e3 ldi r25, 0x39 ; 57 256a0: 0f 94 04 cf call 0x39e08 ; 0x39e08 } 256a4: a8 96 adiw r28, 0x28 ; 40 256a6: 0f b6 in r0, 0x3f ; 63 256a8: f8 94 cli 256aa: de bf out 0x3e, r29 ; 62 256ac: 0f be out 0x3f, r0 ; 63 256ae: cd bf out 0x3d, r28 ; 61 256b0: df 91 pop r29 256b2: cf 91 pop r28 256b4: 1f 91 pop r17 256b6: 0f 91 pop r16 256b8: ff 90 pop r15 256ba: ef 90 pop r14 256bc: df 90 pop r13 256be: cf 90 pop r12 256c0: bf 90 pop r11 256c2: af 90 pop r10 256c4: 9f 90 pop r9 256c6: 8f 90 pop r8 256c8: 7f 90 pop r7 256ca: 6f 90 pop r6 256cc: 5f 90 pop r5 256ce: 4f 90 pop r4 256d0: 3f 90 pop r3 256d2: 2f 90 pop r2 256d4: 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)); 256d6: 88 e5 ldi r24, 0x58 ; 88 256d8: 9d e3 ldi r25, 0x3D ; 61 256da: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 256de: 0e 94 00 70 call 0xe000 ; 0xe000 256e2: b8 cf rjmp .-144 ; 0x25654 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 256e4: ef 92 push r14 256e6: ff 92 push r15 256e8: 0f 93 push r16 256ea: 1f 93 push r17 256ec: 81 e7 ldi r24, 0x71 ; 113 256ee: 90 e7 ldi r25, 0x70 ; 112 256f0: 9f 93 push r25 256f2: 8f 93 push r24 256f4: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 256f8: 0f 90 pop r0 256fa: 0f 90 pop r0 256fc: 0f 90 pop r0 256fe: 0f 90 pop r0 25700: 0f 90 pop r0 25702: 0f 90 pop r0 25704: c3 cf rjmp .-122 ; 0x2568c 00025706 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 25706: 8a ed ldi r24, 0xDA ; 218 25708: 9f e6 ldi r25, 0x6F ; 111 2570a: 0c 94 86 7b jmp 0xf70c ; 0xf70c 0002570e : * 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) { 2570e: af 92 push r10 25710: bf 92 push r11 25712: cf 92 push r12 25714: df 92 push r13 25716: ef 92 push r14 25718: ff 92 push r15 2571a: 0f 93 push r16 2571c: 1f 93 push r17 2571e: cf 93 push r28 25720: df 93 push r29 25722: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 25724: 0e 94 c9 6f call 0xdf92 ; 0xdf92 * @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; 25728: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 2572a: 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; 2572c: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 2572e: 6f 2d mov r22, r15 25730: 80 e0 ldi r24, 0x00 ; 0 25732: 0e 94 15 70 call 0xe02a ; 0xe02a // 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) 25736: c6 01 movw r24, r12 25738: 0f 94 61 1d call 0x23ac2 ; 0x23ac2 2573c: 88 23 and r24, r24 2573e: 29 f0 breq .+10 ; 0x2574a 25740: 8f ef ldi r24, 0xFF ; 255 25742: c8 1a sub r12, r24 25744: d8 0a sbc r13, r24 25746: 09 f4 brne .+2 ; 0x2574a 25748: 49 c0 rjmp .+146 ; 0x257dc 2574a: c6 01 movw r24, r12 2574c: 0f 94 19 db call 0x3b632 ; 0x3b632 <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 25750: 84 31 cpi r24, 0x14 ; 20 25752: 91 05 cpc r25, r1 25754: 10 f0 brcs .+4 ; 0x2575a 25756: 84 e1 ldi r24, 0x14 ; 20 25758: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 2575a: e6 01 movw r28, r12 2575c: c8 0f add r28, r24 2575e: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 25760: e3 e0 ldi r30, 0x03 ; 3 25762: fe 12 cpse r15, r30 25764: 0a c0 rjmp .+20 ; 0x2577a 25766: 84 31 cpi r24, 0x14 ; 20 25768: 41 f4 brne .+16 ; 0x2577a // 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; 2576a: fe 01 movw r30, r28 2576c: 84 91 lpm r24, Z 2576e: e1 2c mov r14, r1 if (multi_screen) 25770: 88 23 and r24, r24 25772: 19 f0 breq .+6 ; 0x2577a msgend = (msgend2 -= 2); 25774: 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; 25776: ee 24 eor r14, r14 25778: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 2577a: fe 01 movw r30, r28 2577c: 84 91 lpm r24, Z 2577e: 88 23 and r24, r24 25780: 09 f4 brne .+2 ; 0x25784 25782: 40 c0 rjmp .+128 ; 0x25804 25784: ce 01 movw r24, r28 25786: 0f 94 61 1d call 0x23ac2 ; 0x23ac2 2578a: 81 11 cpse r24, r1 2578c: 3b c0 rjmp .+118 ; 0x25804 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); 2578e: fe 01 movw r30, r28 25790: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 25792: 92 ed ldi r25, 0xD2 ; 210 25794: 98 0f add r25, r24 25796: 92 30 cpi r25, 0x02 ; 2 25798: a8 f1 brcs .+106 ; 0x25804 2579a: 8c 32 cpi r24, 0x2C ; 44 2579c: 99 f1 breq .+102 ; 0x25804 2579e: 96 ec ldi r25, 0xC6 ; 198 257a0: 98 0f add r25, r24 257a2: 92 30 cpi r25, 0x02 ; 2 257a4: 78 f1 brcs .+94 ; 0x25804 257a6: 8f 33 cpi r24, 0x3F ; 63 257a8: 69 f1 breq .+90 ; 0x25804 257aa: 81 32 cpi r24, 0x21 ; 33 257ac: 59 f1 breq .+86 ; 0x25804 257ae: 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)) 257b0: c0 16 cp r12, r16 257b2: d1 06 cpc r13, r17 257b4: 58 f4 brcc .+22 ; 0x257cc 257b6: 58 01 movw r10, r16 257b8: f1 e0 ldi r31, 0x01 ; 1 257ba: af 1a sub r10, r31 257bc: b1 08 sbc r11, r1 257be: c5 01 movw r24, r10 257c0: 0f 94 61 1d call 0x23ac2 ; 0x23ac2 257c4: 81 11 cpse r24, r1 257c6: 1d c0 rjmp .+58 ; 0x25802 -- msgend; 257c8: 85 01 movw r16, r10 257ca: f2 cf rjmp .-28 ; 0x257b0 if (msgend == msg) 257cc: c0 16 cp r12, r16 257ce: d1 06 cpc r13, r17 257d0: c9 f0 breq .+50 ; 0x25804 257d2: 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) { 257d4: f3 94 inc r15 257d6: 84 e0 ldi r24, 0x04 ; 4 257d8: f8 12 cpse r15, r24 257da: a9 cf rjmp .-174 ; 0x2572e } lcd_print(c); } } if (multi_screen) { 257dc: ee 20 and r14, r14 257de: f9 f0 breq .+62 ; 0x2581e // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 257e0: 48 e8 ldi r20, 0x88 ; 136 257e2: 63 e0 ldi r22, 0x03 ; 3 257e4: 83 e1 ldi r24, 0x13 ; 19 257e6: 0e 94 35 70 call 0xe06a ; 0xe06a } return multi_screen ? msgend : NULL; } 257ea: ce 01 movw r24, r28 257ec: df 91 pop r29 257ee: cf 91 pop r28 257f0: 1f 91 pop r17 257f2: 0f 91 pop r16 257f4: ff 90 pop r15 257f6: ef 90 pop r14 257f8: df 90 pop r13 257fa: cf 90 pop r12 257fc: bf 90 pop r11 257fe: af 90 pop r10 25800: 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)) 25802: 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) { 25804: cc 16 cp r12, r28 25806: dd 06 cpc r13, r29 25808: 28 f7 brcc .-54 ; 0x257d4 char c = char(pgm_read_byte(msg)); 2580a: f6 01 movw r30, r12 2580c: 84 91 lpm r24, Z if (c == '\n') { 2580e: 8a 30 cpi r24, 0x0A ; 10 25810: 09 f3 breq .-62 ; 0x257d4 25812: 0e 94 c4 70 call 0xe188 ; 0xe188 -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 25816: ff ef ldi r31, 0xFF ; 255 25818: cf 1a sub r12, r31 2581a: df 0a sbc r13, r31 2581c: f3 cf rjmp .-26 ; 0x25804 if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 2581e: d0 e0 ldi r29, 0x00 ; 0 25820: c0 e0 ldi r28, 0x00 ; 0 25822: e3 cf rjmp .-58 ; 0x257ea 00025824 : } #ifdef FILAMENT_SENSOR static void lcd_menu_AutoLoadFilament() { lcd_display_message_fullscreen_nonBlocking_P(_T(MSG_AUTOLOADING_ENABLED)); 25824: 8a ea ldi r24, 0xAA ; 170 25826: 9c e4 ldi r25, 0x4C ; 76 25828: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2582c: 0f 94 87 2b call 0x2570e ; 0x2570e menu_back_if_clicked(); 25830: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 00025834 : } _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(); 25834: 0e 94 a3 78 call 0xf146 ; 0xf146 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 25838: 10 92 b6 03 sts 0x03B6, r1 ; 0x8003b6 } 2583c: 08 95 ret 0002583e : //! |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() { 2583e: cf 93 push r28 25840: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 25842: 88 ea ldi r24, 0xA8 ; 168 25844: 9d e4 ldi r25, 0x4D ; 77 25846: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2584a: ac 01 movw r20, r24 2584c: 60 e0 ldi r22, 0x00 ; 0 2584e: 80 e0 ldi r24, 0x00 ; 0 25850: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(0, 1, STR_SEPARATOR); 25854: 49 ee ldi r20, 0xE9 ; 233 25856: 5c e8 ldi r21, 0x8C ; 140 25858: 61 e0 ldi r22, 0x01 ; 1 2585a: 80 e0 ldi r24, 0x00 ; 0 2585c: 0e 94 29 70 call 0xe052 ; 0xe052 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 25860: 62 e0 ldi r22, 0x02 ; 2 25862: 80 e0 ldi r24, 0x00 ; 0 25864: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 25868: 85 ee ldi r24, 0xE5 ; 229 2586a: 9f e0 ldi r25, 0x0F ; 15 2586c: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 25870: 9f 93 push r25 25872: 8f 93 push r24 25874: 7f 93 push r23 25876: 6f 93 push r22 25878: 1f 92 push r1 2587a: 88 e5 ldi r24, 0x58 ; 88 2587c: 8f 93 push r24 2587e: cd e9 ldi r28, 0x9D ; 157 25880: d4 ea ldi r29, 0xA4 ; 164 25882: df 93 push r29 25884: cf 93 push r28 25886: 0e 94 ee 6f call 0xdfdc ; 0xdfdc { 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); 2588a: 63 e0 ldi r22, 0x03 ; 3 2588c: 80 e0 ldi r24, 0x00 ; 0 2588e: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 25892: 89 ee ldi r24, 0xE9 ; 233 25894: 9f e0 ldi r25, 0x0F ; 15 25896: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 2589a: 9f 93 push r25 2589c: 8f 93 push r24 2589e: 7f 93 push r23 258a0: 6f 93 push r22 258a2: 1f 92 push r1 258a4: 89 e5 ldi r24, 0x59 ; 89 258a6: 8f 93 push r24 258a8: df 93 push r29 258aa: cf 93 push r28 258ac: 0e 94 ee 6f call 0xdfdc ; 0xdfdc } menu_back_if_clicked(); 258b0: 8d b7 in r24, 0x3d ; 61 258b2: 9e b7 in r25, 0x3e ; 62 258b4: 40 96 adiw r24, 0x10 ; 16 258b6: 0f b6 in r0, 0x3f ; 63 258b8: f8 94 cli 258ba: 9e bf out 0x3e, r25 ; 62 258bc: 0f be out 0x3f, r0 ; 63 258be: 8d bf out 0x3d, r24 ; 61 } 258c0: df 91 pop r29 258c2: 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(); 258c4: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 000258c8 : //! ---------------------- //! 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() { 258c8: cf 92 push r12 258ca: df 92 push r13 258cc: ef 92 push r14 258ce: ff 92 push r15 258d0: 0f 93 push r16 258d2: 1f 93 push r17 258d4: cf 93 push r28 258d6: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 258d8: 80 e6 ldi r24, 0x60 ; 96 258da: 9f e0 ldi r25, 0x0F ; 15 258dc: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 258e0: 6b 01 movw r12, r22 258e2: 7c 01 movw r14, r24 lcd_home(); 258e4: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_printf_P(_N( 258e8: 8a e9 ldi r24, 0x9A ; 154 258ea: 9d e4 ldi r25, 0x4D ; 77 258ec: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 258f0: 18 2f mov r17, r24 258f2: 09 2f mov r16, r25 258f4: 8c e8 ldi r24, 0x8C ; 140 258f6: 9d e4 ldi r25, 0x4D ; 77 258f8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 258fc: ec 01 movw r28, r24 258fe: 8c e7 ldi r24, 0x7C ; 124 25900: 9d e4 ldi r25, 0x4D ; 77 25902: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 25906: 2e e3 ldi r18, 0x3E ; 62 25908: 2f 93 push r18 2590a: 20 e8 ldi r18, 0x80 ; 128 2590c: 2f 93 push r18 2590e: 1f 92 push r1 25910: 1f 92 push r1 25912: 0f 93 push r16 25914: 1f 93 push r17 25916: 2d e3 ldi r18, 0x3D ; 61 25918: 2f 93 push r18 2591a: 25 ef ldi r18, 0xF5 ; 245 2591c: 2f 93 push r18 2591e: 22 ec ldi r18, 0xC2 ; 194 25920: 2f 93 push r18 25922: 20 e9 ldi r18, 0x90 ; 144 25924: 2f 93 push r18 25926: df 93 push r29 25928: cf 93 push r28 2592a: 29 ee ldi r18, 0xE9 ; 233 2592c: 3c e8 ldi r19, 0x8C ; 140 2592e: 3f 93 push r19 25930: 2f 93 push r18 25932: 9f 93 push r25 25934: 8f 93 push r24 25936: 8e e8 ldi r24, 0x8E ; 142 25938: 90 e7 ldi r25, 0x70 ; 112 2593a: 9f 93 push r25 2593c: 8f 93 push r24 2593e: 0e 94 ee 6f call 0xdfdc ; 0xdfdc _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); 25942: 60 e0 ldi r22, 0x00 ; 0 25944: 8f e0 ldi r24, 0x0F ; 15 25946: 0e 94 15 70 call 0xe02a ; 0xe02a if (angleDiff < 100){ 2594a: 8d b7 in r24, 0x3d ; 61 2594c: 9e b7 in r25, 0x3e ; 62 2594e: 42 96 adiw r24, 0x12 ; 18 25950: 0f b6 in r0, 0x3f ; 63 25952: f8 94 cli 25954: 9e bf out 0x3e, r25 ; 62 25956: 0f be out 0x3f, r0 ; 63 25958: 8d bf out 0x3d, r24 ; 61 2595a: 20 e0 ldi r18, 0x00 ; 0 2595c: 30 e0 ldi r19, 0x00 ; 0 2595e: 48 ec ldi r20, 0xC8 ; 200 25960: 52 e4 ldi r21, 0x42 ; 66 25962: c7 01 movw r24, r14 25964: b6 01 movw r22, r12 25966: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 2596a: 87 ff sbrs r24, 7 2596c: 32 c0 rjmp .+100 ; 0x259d2 } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 2596e: 20 e0 ldi r18, 0x00 ; 0 25970: 30 e0 ldi r19, 0x00 ; 0 25972: 44 e3 ldi r20, 0x34 ; 52 25974: 53 e4 ldi r21, 0x43 ; 67 25976: c7 01 movw r24, r14 25978: b6 01 movw r22, r12 2597a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2597e: 2b ed ldi r18, 0xDB ; 219 25980: 3f e0 ldi r19, 0x0F ; 15 25982: 49 e4 ldi r20, 0x49 ; 73 25984: 50 e4 ldi r21, 0x40 ; 64 25986: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__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)); 2598a: 9f 93 push r25 2598c: 8f 93 push r24 2598e: 7f 93 push r23 25990: 6f 93 push r22 25992: 87 e8 ldi r24, 0x87 ; 135 25994: 90 e7 ldi r25, 0x70 ; 112 25996: 9f 93 push r25 25998: 8f 93 push r24 2599a: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 2599e: 0f 90 pop r0 259a0: 0f 90 pop r0 259a2: 0f 90 pop r0 259a4: 0f 90 pop r0 259a6: 0f 90 pop r0 259a8: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 259aa: 0e 94 32 72 call 0xe464 ; 0xe464 259ae: 88 23 and r24, r24 259b0: b9 f0 breq .+46 ; 0x259e0 menu_goto(lcd_menu_xyz_offset, 0, true); 259b2: 20 e0 ldi r18, 0x00 ; 0 259b4: 41 e0 ldi r20, 0x01 ; 1 259b6: 70 e0 ldi r23, 0x00 ; 0 259b8: 60 e0 ldi r22, 0x00 ; 0 259ba: 80 ea ldi r24, 0xA0 ; 160 259bc: 9a e3 ldi r25, 0x3A ; 58 } 259be: df 91 pop r29 259c0: cf 91 pop r28 259c2: 1f 91 pop r17 259c4: 0f 91 pop r16 259c6: ff 90 pop r15 259c8: ef 90 pop r14 259ca: df 90 pop r13 259cc: 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); 259ce: 0d 94 04 cf jmp 0x39e08 ; 0x39e08 ); 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)); 259d2: 88 e5 ldi r24, 0x58 ; 88 259d4: 9d e3 ldi r25, 0x3D ; 61 259d6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 259da: 0e 94 00 70 call 0xe000 ; 0xe000 259de: e5 cf rjmp .-54 ; 0x259aa } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 259e0: df 91 pop r29 259e2: cf 91 pop r28 259e4: 1f 91 pop r17 259e6: 0f 91 pop r16 259e8: ff 90 pop r15 259ea: ef 90 pop r14 259ec: df 90 pop r13 259ee: cf 90 pop r12 259f0: 08 95 ret 000259f2 <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 259f2: 2f 92 push r2 259f4: 3f 92 push r3 259f6: 4f 92 push r4 259f8: 5f 92 push r5 259fa: 6f 92 push r6 259fc: 7f 92 push r7 259fe: 9f 92 push r9 25a00: af 92 push r10 25a02: bf 92 push r11 25a04: cf 92 push r12 25a06: df 92 push r13 25a08: ef 92 push r14 25a0a: ff 92 push r15 25a0c: 0f 93 push r16 25a0e: 1f 93 push r17 25a10: cf 93 push r28 25a12: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 25a14: 70 91 58 0e lds r23, 0x0E58 ; 0x800e58 25a18: 71 11 cpse r23, r1 25a1a: 04 c0 rjmp .+8 ; 0x25a24 <_lcd_move(char const*, unsigned char, int, int)+0x32> 25a1c: 70 91 59 0e lds r23, 0x0E59 ; 0x800e59 25a20: 77 23 and r23, r23 25a22: 99 f0 breq .+38 ; 0x25a4a <_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(); } 25a24: df 91 pop r29 25a26: cf 91 pop r28 25a28: 1f 91 pop r17 25a2a: 0f 91 pop r16 25a2c: ff 90 pop r15 25a2e: ef 90 pop r14 25a30: df 90 pop r13 25a32: cf 90 pop r12 25a34: bf 90 pop r11 25a36: af 90 pop r10 25a38: 9f 90 pop r9 25a3a: 7f 90 pop r7 25a3c: 6f 90 pop r6 25a3e: 5f 90 pop r5 25a40: 4f 90 pop r4 25a42: 3f 90 pop r3 25a44: 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(); 25a46: 0d 94 a2 d1 jmp 0x3a344 ; 0x3a344 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) 25a4a: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 25a4e: 71 11 cpse r23, r1 25a50: 09 c0 rjmp .+18 ; 0x25a64 <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 25a52: 70 91 8f 02 lds r23, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; 25a56: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> { _md->endstopsEnabledPrevious = enable_endstops(false); 25a5a: 70 93 aa 03 sts 0x03AA, r23 ; 0x8003aa _md->initialized = true; 25a5e: 71 e0 ldi r23, 0x01 ; 1 25a60: 70 93 a9 03 sts 0x03A9, r23 ; 0x8003a9 25a64: 19 01 movw r2, r18 25a66: 6a 01 movw r12, r20 25a68: c6 2f mov r28, r22 25a6a: d9 2f mov r29, r25 25a6c: 98 2e mov r9, r24 } if (lcd_encoder != 0) 25a6e: 80 91 37 05 lds r24, 0x0537 ; 0x800537 25a72: 90 91 38 05 lds r25, 0x0538 ; 0x800538 25a76: 89 2b or r24, r25 25a78: 09 f4 brne .+2 ; 0x25a7c <_lcd_move(char const*, unsigned char, int, int)+0x8a> 25a7a: 71 c0 rjmp .+226 ; 0x25b5e <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 25a7c: 0e 94 f8 67 call 0xcff0 ; 0xcff0 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; 25a80: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 if (++ next_block_index == BLOCK_BUFFER_SIZE) 25a84: 8f 5f subi r24, 0xFF ; 255 25a86: 80 31 cpi r24, 0x10 ; 16 25a88: 09 f4 brne .+2 ; 0x25a8c <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 25a8a: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 25a8c: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 if (! planner_queue_full()) 25a90: 98 17 cp r25, r24 25a92: 09 f4 brne .+2 ; 0x25a96 <_lcd_move(char const*, unsigned char, int, int)+0xa4> 25a94: 64 c0 rjmp .+200 ; 0x25b5e <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 25a96: 84 e0 ldi r24, 0x04 ; 4 25a98: c8 9f mul r28, r24 25a9a: 80 01 movw r16, r0 25a9c: 11 24 eor r1, r1 25a9e: f8 01 movw r30, r16 25aa0: ed 5b subi r30, 0xBD ; 189 25aa2: f8 4f sbci r31, 0xF8 ; 248 25aa4: 5f 01 movw r10, r30 25aa6: 60 91 37 05 lds r22, 0x0537 ; 0x800537 25aaa: 70 91 38 05 lds r23, 0x0538 ; 0x800538 25aae: 07 2e mov r0, r23 25ab0: 00 0c add r0, r0 25ab2: 88 0b sbc r24, r24 25ab4: 99 0b sbc r25, r25 25ab6: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 25aba: f5 01 movw r30, r10 25abc: 20 81 ld r18, Z 25abe: 31 81 ldd r19, Z+1 ; 0x01 25ac0: 42 81 ldd r20, Z+2 ; 0x02 25ac2: 53 81 ldd r21, Z+3 ; 0x03 25ac4: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 25ac8: 2b 01 movw r4, r22 25aca: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 25acc: b6 01 movw r22, r12 25ace: dd 0c add r13, r13 25ad0: 88 0b sbc r24, r24 25ad2: 99 0b sbc r25, r25 25ad4: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 25ad8: 6b 01 movw r12, r22 25ada: 7c 01 movw r14, r24 25adc: ac 01 movw r20, r24 25ade: 9b 01 movw r18, r22 25ae0: c3 01 movw r24, r6 25ae2: b2 01 movw r22, r4 25ae4: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 25ae8: f5 01 movw r30, r10 25aea: 87 fd sbrc r24, 7 25aec: 7d c0 rjmp .+250 ; 0x25be8 <_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; 25aee: 40 82 st Z, r4 25af0: 51 82 std Z+1, r5 ; 0x01 25af2: 62 82 std Z+2, r6 ; 0x02 25af4: 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; 25af6: b1 01 movw r22, r2 25af8: 33 0c add r3, r3 25afa: 88 0b sbc r24, r24 25afc: 99 0b sbc r25, r25 25afe: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 25b02: 2b 01 movw r4, r22 25b04: 3c 01 movw r6, r24 25b06: c8 01 movw r24, r16 25b08: 8d 5b subi r24, 0xBD ; 189 25b0a: 98 4f sbci r25, 0xF8 ; 248 25b0c: 7c 01 movw r14, r24 25b0e: a3 01 movw r20, r6 25b10: 92 01 movw r18, r4 25b12: fc 01 movw r30, r24 25b14: 60 81 ld r22, Z 25b16: 71 81 ldd r23, Z+1 ; 0x01 25b18: 82 81 ldd r24, Z+2 ; 0x02 25b1a: 93 81 ldd r25, Z+3 ; 0x03 25b1c: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 25b20: 18 16 cp r1, r24 25b22: 2c f4 brge .+10 ; 0x25b2e <_lcd_move(char const*, unsigned char, int, int)+0x13c> 25b24: f7 01 movw r30, r14 25b26: 40 82 st Z, r4 25b28: 51 82 std Z+1, r5 ; 0x01 25b2a: 62 82 std Z+2, r6 ; 0x02 25b2c: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 25b2e: 10 92 38 05 sts 0x0538, r1 ; 0x800538 25b32: 10 92 37 05 sts 0x0537, r1 ; 0x800537 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 25b36: 67 e4 ldi r22, 0x47 ; 71 25b38: 77 e0 ldi r23, 0x07 ; 7 25b3a: 83 e4 ldi r24, 0x43 ; 67 25b3c: 97 e0 ldi r25, 0x07 ; 7 25b3e: 0e 94 df 6b call 0xd7be ; 0xd7be plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 25b42: f8 01 movw r30, r16 25b44: e5 50 subi r30, 0x05 ; 5 25b46: fd 4f sbci r31, 0xFD ; 253 25b48: 60 81 ld r22, Z 25b4a: 71 81 ldd r23, Z+1 ; 0x01 25b4c: 82 81 ldd r24, Z+2 ; 0x02 25b4e: 93 81 ldd r25, Z+3 ; 0x03 25b50: 0e 94 fc 67 call 0xcff8 ; 0xcff8 25b54: 0f 94 5d ba call 0x374ba ; 0x374ba lcd_draw_update = 1; 25b58: 81 e0 ldi r24, 0x01 ; 1 25b5a: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 25b5e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 25b62: 88 23 and r24, r24 25b64: 11 f1 breq .+68 ; 0x25baa <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 25b66: 61 e0 ldi r22, 0x01 ; 1 25b68: 80 e0 ldi r24, 0x00 ; 0 25b6a: 0e 94 15 70 call 0xe02a ; 0xe02a menu_draw_float31(name, current_position[axis]); 25b6e: 84 e0 ldi r24, 0x04 ; 4 25b70: c8 9f mul r28, r24 25b72: f0 01 movw r30, r0 25b74: 11 24 eor r1, r1 25b76: ed 5b subi r30, 0xBD ; 189 25b78: f8 4f sbci r31, 0xF8 ; 248 //! 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); 25b7a: 83 81 ldd r24, Z+3 ; 0x03 25b7c: 8f 93 push r24 25b7e: 82 81 ldd r24, Z+2 ; 0x02 25b80: 8f 93 push r24 25b82: 81 81 ldd r24, Z+1 ; 0x01 25b84: 8f 93 push r24 25b86: 80 81 ld r24, Z 25b88: 8f 93 push r24 25b8a: df 93 push r29 25b8c: 9f 92 push r9 25b8e: 84 e8 ldi r24, 0x84 ; 132 25b90: 94 ea ldi r25, 0xA4 ; 164 25b92: 9f 93 push r25 25b94: 8f 93 push r24 25b96: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 25b9a: ed b7 in r30, 0x3d ; 61 25b9c: fe b7 in r31, 0x3e ; 62 25b9e: 38 96 adiw r30, 0x08 ; 8 25ba0: 0f b6 in r0, 0x3f ; 63 25ba2: f8 94 cli 25ba4: fe bf out 0x3e, r31 ; 62 25ba6: 0f be out 0x3f, r0 ; 63 25ba8: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 25baa: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 25bae: 81 11 cpse r24, r1 25bb0: 04 c0 rjmp .+8 ; 0x25bba <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 25bb2: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 25bb6: 88 23 and r24, r24 25bb8: 21 f0 breq .+8 ; 0x25bc2 <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 25bba: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 25bbe: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> menu_back_if_clicked(); } 25bc2: df 91 pop r29 25bc4: cf 91 pop r28 25bc6: 1f 91 pop r17 25bc8: 0f 91 pop r16 25bca: ff 90 pop r15 25bcc: ef 90 pop r14 25bce: df 90 pop r13 25bd0: cf 90 pop r12 25bd2: bf 90 pop r11 25bd4: af 90 pop r10 25bd6: 9f 90 pop r9 25bd8: 7f 90 pop r7 25bda: 6f 90 pop r6 25bdc: 5f 90 pop r5 25bde: 4f 90 pop r4 25be0: 3f 90 pop r3 25be2: 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(); 25be4: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 25be8: c0 82 st Z, r12 25bea: d1 82 std Z+1, r13 ; 0x01 25bec: e2 82 std Z+2, r14 ; 0x02 25bee: f3 82 std Z+3, r15 ; 0x03 25bf0: 82 cf rjmp .-252 ; 0x25af6 <_lcd_move(char const*, unsigned char, int, int)+0x104> 00025bf2 : } // 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); 25bf2: 2f ef ldi r18, 0xFF ; 255 25bf4: 30 e0 ldi r19, 0x00 ; 0 25bf6: 50 e0 ldi r21, 0x00 ; 0 25bf8: 40 e0 ldi r20, 0x00 ; 0 25bfa: 60 e0 ldi r22, 0x00 ; 0 25bfc: 88 ea ldi r24, 0xA8 ; 168 25bfe: 94 ea ldi r25, 0xA4 ; 164 25c00: 0d 94 f9 2c jmp 0x259f2 ; 0x259f2 <_lcd_move(char const*, unsigned char, int, int)> 00025c04 : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 25c04: 24 ed ldi r18, 0xD4 ; 212 25c06: 30 e0 ldi r19, 0x00 ; 0 25c08: 4c ef ldi r20, 0xFC ; 252 25c0a: 5f ef ldi r21, 0xFF ; 255 25c0c: 61 e0 ldi r22, 0x01 ; 1 25c0e: 8b ea ldi r24, 0xAB ; 171 25c10: 94 ea ldi r25, 0xA4 ; 164 25c12: 0d 94 f9 2c jmp 0x259f2 ; 0x259f2 <_lcd_move(char const*, unsigned char, int, int)> 00025c16 : } static void lcd_move_z() { _lcd_move(PSTR("Z:"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); 25c16: 22 ed ldi r18, 0xD2 ; 210 25c18: 30 e0 ldi r19, 0x00 ; 0 25c1a: 50 e0 ldi r21, 0x00 ; 0 25c1c: 40 e0 ldi r20, 0x00 ; 0 25c1e: 62 e0 ldi r22, 0x02 ; 2 25c20: 8e ea ldi r24, 0xAE ; 174 25c22: 94 ea ldi r25, 0xA4 ; 164 25c24: 0d 94 f9 2c jmp 0x259f2 ; 0x259f2 <_lcd_move(char const*, unsigned char, int, int)> 00025c28 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 25c28: 80 91 60 06 lds r24, 0x0660 ; 0x800660 25c2c: 81 11 cpse r24, r1 25c2e: 03 c0 rjmp .+6 ; 0x25c36 25c30: 82 e0 ldi r24, 0x02 ; 2 25c32: 0d 94 86 d1 jmp 0x3a30c ; 0x3a30c 25c36: 81 e0 ldi r24, 0x01 ; 1 25c38: fc cf rjmp .-8 ; 0x25c32 00025c3a : } // 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); 25c3a: 5f 93 push r21 25c3c: 4f 93 push r20 25c3e: 7f 93 push r23 25c40: 6f 93 push r22 25c42: 28 2f mov r18, r24 25c44: 08 2e mov r0, r24 25c46: 00 0c add r0, r0 25c48: 33 0b sbc r19, r19 25c4a: 3f 93 push r19 25c4c: 8f 93 push r24 25c4e: 85 e7 ldi r24, 0x75 ; 117 25c50: 9f e6 ldi r25, 0x6F ; 111 25c52: 9f 93 push r25 25c54: 8f 93 push r24 25c56: 0e 94 ee 6f call 0xdfdc ; 0xdfdc lcd_space(9 - chars); 25c5a: 2d b7 in r18, 0x3d ; 61 25c5c: 3e b7 in r19, 0x3e ; 62 25c5e: 28 5f subi r18, 0xF8 ; 248 25c60: 3f 4f sbci r19, 0xFF ; 255 25c62: 0f b6 in r0, 0x3f ; 63 25c64: f8 94 cli 25c66: 3e bf out 0x3e, r19 ; 62 25c68: 0f be out 0x3f, r0 ; 63 25c6a: 2d bf out 0x3d, r18 ; 61 25c6c: 99 e0 ldi r25, 0x09 ; 9 25c6e: 98 1b sub r25, r24 25c70: 89 2f mov r24, r25 25c72: 0c 94 0b 70 jmp 0xe016 ; 0xe016 00025c76 : default: return false; } } void lcd_print_target_temps_first_line() { 25c76: cf 93 push r28 25c78: df 93 push r29 lcd_home(); 25c7a: 0e 94 41 70 call 0xe082 ; 0xe082 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 25c7e: c0 91 6d 0e lds r28, 0x0E6D ; 0x800e6d 25c82: d0 91 6e 0e lds r29, 0x0E6E ; 0x800e6e 25c86: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 25c8a: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 25c8e: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 25c92: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 25c96: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 25c9a: ae 01 movw r20, r28 25c9c: 82 e8 ldi r24, 0x82 ; 130 25c9e: 0f 94 1d 2e call 0x25c3a ; 0x25c3a lcd_set_cursor(10, 0); 25ca2: 60 e0 ldi r22, 0x00 ; 0 25ca4: 8a e0 ldi r24, 0x0A ; 10 25ca6: 0e 94 15 70 call 0xe02a ; 0xe02a FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 25caa: c0 91 6b 0e lds r28, 0x0E6B ; 0x800e6b 25cae: d0 91 6c 0e lds r29, 0x0E6C ; 0x800e6c int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 25cb2: 20 97 sbiw r28, 0x00 ; 0 25cb4: 81 f0 breq .+32 ; 0x25cd6 lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 25cb6: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 25cba: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 25cbe: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 25cc2: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 25cc6: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 25cca: ae 01 movw r20, r28 25ccc: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 25cce: df 91 pop r29 25cd0: 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); 25cd2: 0d 94 1d 2e jmp 0x25c3a ; 0x25c3a } else { lcd_space(10); 25cd6: 8a e0 ldi r24, 0x0A ; 10 } } 25cd8: df 91 pop r29 25cda: 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); 25cdc: 0c 94 0b 70 jmp 0xe016 ; 0xe016 00025ce0 : 25ce0: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 25ce4: 0f 94 3b 2e call 0x25c76 ; 0x25c76 lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 25ce8: 85 e0 ldi r24, 0x05 ; 5 25cea: 9c e4 ldi r25, 0x4C ; 76 25cec: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 25cf0: ac 01 movw r20, r24 25cf2: 61 e0 ldi r22, 0x01 ; 1 25cf4: 80 e0 ldi r24, 0x00 ; 0 25cf6: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(0,2); 25cfa: 62 e0 ldi r22, 0x02 ; 2 25cfc: 80 e0 ldi r24, 0x00 ; 0 25cfe: 0e 94 15 70 call 0xe02a ; 0xe02a switch(eFilamentAction) { 25d02: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 25d06: 83 30 cpi r24, 0x03 ; 3 25d08: 81 f1 breq .+96 ; 0x25d6a 25d0a: 48 f4 brcc .+18 ; 0x25d1e 25d0c: 81 30 cpi r24, 0x01 ; 1 25d0e: 60 f0 brcs .+24 ; 0x25d28 case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 25d10: 82 ef ldi r24, 0xF2 ; 242 25d12: 9b e4 ldi r25, 0x4B ; 75 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 25d14: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 25d18: 0e 94 00 70 call 0xe000 ; 0xe000 25d1c: 05 c0 rjmp .+10 ; 0x25d28 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) { 25d1e: 85 30 cpi r24, 0x05 ; 5 25d20: 21 f1 breq .+72 ; 0x25d6a 25d22: b0 f3 brcs .-20 ; 0x25d10 25d24: 88 30 cpi r24, 0x08 ; 8 25d26: a1 f3 breq .-24 ; 0x25d10 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 25d28: 0e 94 32 72 call 0xe464 ; 0xe464 #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 25d2c: 81 11 cpse r24, r1 25d2e: 09 c0 rjmp .+18 ; 0x25d42 25d30: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 25d34: 81 50 subi r24, 0x01 ; 1 25d36: 82 30 cpi r24, 0x02 ; 2 25d38: 28 f5 brcc .+74 ; 0x25d84 25d3a: 80 91 8c 17 lds r24, 0x178C ; 0x80178c 25d3e: 88 23 and r24, r24 25d40: 09 f1 breq .+66 ; 0x25d84 #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 25d42: 80 91 60 06 lds r24, 0x0660 ; 0x800660 25d46: 81 11 cpse r24, r1 25d48: 13 c0 rjmp .+38 ; 0x25d70 25d4a: 83 e0 ldi r24, 0x03 ; 3 25d4c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c switch(eFilamentAction) { 25d50: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 25d54: 82 30 cpi r24, 0x02 ; 2 25d56: 71 f0 breq .+28 ; 0x25d74 25d58: 83 30 cpi r24, 0x03 ; 3 25d5a: 81 f0 breq .+32 ; 0x25d7c 25d5c: 81 30 cpi r24, 0x01 ; 1 25d5e: 91 f4 brne .+36 ; 0x25d84 case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 25d60: 61 e0 ldi r22, 0x01 ; 1 25d62: 84 e2 ldi r24, 0x24 ; 36 25d64: 90 e7 ldi r25, 0x70 ; 112 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 25d66: 0c 94 cb 89 jmp 0x11396 ; 0x11396 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)); 25d6a: 8d ed ldi r24, 0xDD ; 221 25d6c: 9b e4 ldi r25, 0x4B ; 75 25d6e: d2 cf rjmp .-92 ; 0x25d14 #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); 25d70: 82 e0 ldi r24, 0x02 ; 2 25d72: ec cf rjmp .-40 ; 0x25d4c switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 25d74: 81 e0 ldi r24, 0x01 ; 1 25d76: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 25d7a: f2 cf rjmp .-28 ; 0x25d60 [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 25d7c: 61 e0 ldi r22, 0x01 ; 1 25d7e: 8c eb ldi r24, 0xBC ; 188 25d80: 9c e6 ldi r25, 0x6C ; 108 25d82: f1 cf rjmp .-30 ; 0x25d66 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 25d84: 08 95 ret 00025d86 : //! | Bed: 00.0V | c=12 //! | IR : 00.0V | c=12 optional //! ---------------------- //! @endcode static void lcd_menu_voltages() { 25d86: cf 92 push r12 25d88: df 92 push r13 25d8a: ef 92 push r14 25d8c: ff 92 push r15 25d8e: 0f 93 push r16 25d90: 1f 93 push r17 25d92: cf 93 push r28 25d94: df 93 push r29 25d96: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout float volt_pwr = VOLT_DIV_REF * ((float)current_voltage_raw_pwr / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 25d9a: 60 91 59 06 lds r22, 0x0659 ; 0x800659 25d9e: 70 91 5a 06 lds r23, 0x065A ; 0x80065a 25da2: 07 2e mov r0, r23 25da4: 00 0c add r0, r0 25da6: 88 0b sbc r24, r24 25da8: 99 0b sbc r25, r25 25daa: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 25dae: 20 e0 ldi r18, 0x00 ; 0 25db0: 30 ec ldi r19, 0xC0 ; 192 25db2: 4f e7 ldi r20, 0x7F ; 127 25db4: 56 e4 ldi r21, 0x46 ; 70 25db6: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 25dba: 20 e0 ldi r18, 0x00 ; 0 25dbc: 30 e0 ldi r19, 0x00 ; 0 25dbe: 40 ea ldi r20, 0xA0 ; 160 25dc0: 50 e4 ldi r21, 0x40 ; 64 25dc2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 25dc6: 27 ed ldi r18, 0xD7 ; 215 25dc8: 30 e3 ldi r19, 0x30 ; 48 25dca: 44 e4 ldi r20, 0x44 ; 68 25dcc: 5e e3 ldi r21, 0x3E ; 62 25dce: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 25dd2: eb 01 movw r28, r22 25dd4: 18 2f mov r17, r24 25dd6: 09 2f mov r16, r25 float volt_bed = VOLT_DIV_REF * ((float)current_voltage_raw_bed / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 25dd8: 60 91 57 06 lds r22, 0x0657 ; 0x800657 25ddc: 70 91 58 06 lds r23, 0x0658 ; 0x800658 25de0: 07 2e mov r0, r23 25de2: 00 0c add r0, r0 25de4: 88 0b sbc r24, r24 25de6: 99 0b sbc r25, r25 25de8: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 25dec: 20 e0 ldi r18, 0x00 ; 0 25dee: 30 ec ldi r19, 0xC0 ; 192 25df0: 4f e7 ldi r20, 0x7F ; 127 25df2: 56 e4 ldi r21, 0x46 ; 70 25df4: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 25df8: 20 e0 ldi r18, 0x00 ; 0 25dfa: 30 e0 ldi r19, 0x00 ; 0 25dfc: 40 ea ldi r20, 0xA0 ; 160 25dfe: 50 e4 ldi r21, 0x40 ; 64 25e00: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 25e04: 27 ed ldi r18, 0xD7 ; 215 25e06: 30 e3 ldi r19, 0x30 ; 48 25e08: 44 e4 ldi r20, 0x44 ; 68 25e0a: 5e e3 ldi r21, 0x3E ; 62 25e0c: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 25e10: f6 2e mov r15, r22 25e12: e7 2e mov r14, r23 25e14: d8 2e mov r13, r24 25e16: c9 2e mov r12, r25 lcd_home(); 25e18: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_printf_P(PSTR(" PWR: %4.1fV\n" " BED: %4.1fV"), volt_pwr, volt_bed); 25e1c: cf 92 push r12 25e1e: df 92 push r13 25e20: ef 92 push r14 25e22: ff 92 push r15 25e24: 0f 93 push r16 25e26: 1f 93 push r17 25e28: df 93 push r29 25e2a: cf 93 push r28 25e2c: 8a e8 ldi r24, 0x8A ; 138 25e2e: 92 ea ldi r25, 0xA2 ; 162 25e30: 9f 93 push r25 25e32: 8f 93 push r24 25e34: 0e 94 ee 6f call 0xdfdc ; 0xdfdc #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) lcd_printf_P(PSTR("\n IR : %3.1fV"), Raw2Voltage(fsensor.getVoltRaw())); 25e38: 0f 94 ae 7b call 0x2f75c ; 0x2f75c 25e3c: bc 01 movw r22, r24 25e3e: 90 e0 ldi r25, 0x00 ; 0 25e40: 80 e0 ldi r24, 0x00 ; 0 25e42: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 25e46: 20 e0 ldi r18, 0x00 ; 0 25e48: 30 ec ldi r19, 0xC0 ; 192 25e4a: 4f e7 ldi r20, 0x7F ; 127 25e4c: 56 e4 ldi r21, 0x46 ; 70 25e4e: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 25e52: 20 e0 ldi r18, 0x00 ; 0 25e54: 30 e0 ldi r19, 0x00 ; 0 25e56: 40 ea ldi r20, 0xA0 ; 160 25e58: 50 e4 ldi r21, 0x40 ; 64 25e5a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 25e5e: 9f 93 push r25 25e60: 8f 93 push r24 25e62: 7f 93 push r23 25e64: 6f 93 push r22 25e66: 86 e7 ldi r24, 0x76 ; 118 25e68: 92 ea ldi r25, 0xA2 ; 162 25e6a: 9f 93 push r25 25e6c: 8f 93 push r24 25e6e: 0e 94 ee 6f call 0xdfdc ; 0xdfdc #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) menu_back_if_clicked(); 25e72: 8d b7 in r24, 0x3d ; 61 25e74: 9e b7 in r25, 0x3e ; 62 25e76: 40 96 adiw r24, 0x10 ; 16 25e78: 0f b6 in r0, 0x3f ; 63 25e7a: f8 94 cli 25e7c: 9e bf out 0x3e, r25 ; 62 25e7e: 0f be out 0x3f, r0 ; 63 25e80: 8d bf out 0x3d, r24 ; 61 } 25e82: df 91 pop r29 25e84: cf 91 pop r28 25e86: 1f 91 pop r17 25e88: 0f 91 pop r16 25e8a: ff 90 pop r15 25e8c: ef 90 pop r14 25e8e: df 90 pop r13 25e90: 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(); 25e92: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 00025e96 : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 25e96: ef 92 push r14 25e98: ff 92 push r15 25e9a: 0f 93 push r16 25e9c: 1f 93 push r17 25e9e: cf 93 push r28 25ea0: 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) 25ea2: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 25ea6: 88 23 and r24, r24 25ea8: 29 f0 breq .+10 ; 0x25eb4 25eaa: 90 91 6d 02 lds r25, 0x026D ; 0x80026d 25eae: 92 30 cpi r25, 0x02 ; 2 25eb0: 09 f0 breq .+2 ; 0x25eb4 25eb2: 8c c1 rjmp .+792 ; 0x261cc { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 25eb4: 81 e0 ldi r24, 0x01 ; 1 25eb6: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 25eba: 80 91 df 16 lds r24, 0x16DF ; 0x8016df _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 25ebe: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa if (_md->is_flash_air) { 25ec2: 88 23 and r24, r24 25ec4: 21 f0 breq .+8 ; 0x25ece card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 25ec6: 8b ea ldi r24, 0xAB ; 171 25ec8: 93 e0 ldi r25, 0x03 ; 3 25eca: 0f 94 4b 85 call 0x30a96 ; 0x30a96 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 25ece: 0f 94 da ce call 0x39db4 ; 0x39db4 25ed2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 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); 25ed6: 8e ee ldi r24, 0xEE ; 238 25ed8: e8 2e mov r14, r24 25eda: 82 ea ldi r24, 0xA2 ; 162 25edc: 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]); 25ede: cd eb ldi r28, 0xBD ; 189 25ee0: d2 ea ldi r29, 0xA2 ; 162 25ee2: 0f ea ldi r16, 0xAF ; 175 25ee4: 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(); 25ee6: 80 91 15 05 lds r24, 0x0515 ; 0x800515 25eea: 84 30 cpi r24, 0x04 ; 4 25eec: 08 f0 brcs .+2 ; 0x25ef0 25eee: 95 c1 rjmp .+810 ; 0x2621a 25ef0: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 25ef4: 8a e1 ldi r24, 0x1A ; 26 25ef6: 9e e3 ldi r25, 0x3E ; 62 25ef8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 25efc: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR("Firmware:")); 25f00: 87 e6 ldi r24, 0x67 ; 103 25f02: 93 ea ldi r25, 0xA3 ; 163 25f04: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 25f08: 8a e5 ldi r24, 0x5A ; 90 25f0a: 93 ea ldi r25, 0xA3 ; 163 25f0c: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 25f10: 8c e4 ldi r24, 0x4C ; 76 25f12: 93 ea ldi r25, 0xA3 ; 163 25f14: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 25f18: 8c e3 ldi r24, 0x3C ; 60 25f1a: 93 ea ldi r25, 0xA3 ; 163 25f1c: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 25f20: 88 e1 ldi r24, 0x18 ; 24 25f22: 90 e7 ldi r25, 0x70 ; 112 25f24: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 25f28: 86 e0 ldi r24, 0x06 ; 6 25f2a: 90 e7 ldi r25, 0x70 ; 112 25f2c: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 25f30: 85 ef ldi r24, 0xF5 ; 245 25f32: 9f e6 ldi r25, 0x6F ; 111 25f34: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(STR_SEPARATOR); 25f38: 89 ee ldi r24, 0xE9 ; 233 25f3a: 9c e8 ldi r25, 0x8C ; 140 25f3c: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 25f40: 80 e3 ldi r24, 0x30 ; 48 25f42: 93 ea ldi r25, 0xA3 ; 163 25f44: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 25f48: 86 e2 ldi r24, 0x26 ; 38 25f4a: 93 ea ldi r25, 0xA3 ; 163 25f4c: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 25f50: 87 e1 ldi r24, 0x17 ; 23 25f52: 93 ea ldi r25, 0xA3 ; 163 25f54: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(STR_SEPARATOR); 25f58: 89 ee ldi r24, 0xE9 ; 233 25f5a: 9c e8 ldi r25, 0x8C ; 140 25f5c: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(_T(MSG_DATE)); 25f60: 85 ed ldi r24, 0xD5 ; 213 25f62: 9b e4 ldi r25, 0x4B ; 75 25f64: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 25f68: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 25f6c: 8c e0 ldi r24, 0x0C ; 12 25f6e: 93 ea ldi r25, 0xA3 ; 163 25f70: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) MENU_ITEM_BACK_P(STR_SEPARATOR); 25f74: 89 ee ldi r24, 0xE9 ; 233 25f76: 9c e8 ldi r25, 0x8C ; 140 25f78: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR("Fil. sensor v.:")); 25f7c: 8c ef ldi r24, 0xFC ; 252 25f7e: 92 ea ldi r25, 0xA2 ; 162 25f80: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(fsensor.getIRVersionText()); 25f84: 0f 94 b6 7b call 0x2f76c ; 0x2f76c 25f88: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) MENU_ITEM_BACK_P(STR_SEPARATOR); 25f8c: 89 ee ldi r24, 0xE9 ; 233 25f8e: 9c e8 ldi r25, 0x8C ; 140 25f90: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a if (MMU2::mmu2.Enabled()) 25f94: 80 91 98 13 lds r24, 0x1398 ; 0x801398 25f98: 81 30 cpi r24, 0x01 ; 1 25f9a: 09 f0 breq .+2 ; 0x25f9e 25f9c: 39 c1 rjmp .+626 ; 0x26210 { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 25f9e: 85 ec ldi r24, 0xC5 ; 197 25fa0: 9b e4 ldi r25, 0x4B ; 75 25fa2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 25fa6: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 25faa: 87 ef ldi r24, 0xF7 ; 247 25fac: 92 ea ldi r25, 0xA2 ; 162 25fae: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a if (((menu_item - 1) == menu_line) && lcd_draw_update) 25fb2: 80 91 18 05 lds r24, 0x0518 ; 0x800518 25fb6: 81 50 subi r24, 0x01 ; 1 25fb8: 99 0b sbc r25, r25 25fba: 20 91 17 05 lds r18, 0x0517 ; 0x800517 25fbe: 28 17 cp r18, r24 25fc0: 19 06 cpc r1, r25 25fc2: 49 f5 brne .+82 ; 0x26016 25fc4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 25fc8: 88 23 and r24, r24 25fca: 29 f1 breq .+74 ; 0x26016 { lcd_set_cursor(6, menu_row); 25fcc: 60 91 15 05 lds r22, 0x0515 ; 0x800515 25fd0: 86 e0 ldi r24, 0x06 ; 6 25fd2: 0e 94 15 70 call 0xe02a ; 0xe02a 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) { 25fd6: 80 91 98 13 lds r24, 0x1398 ; 0x801398 25fda: 81 30 cpi r24, 0x01 ; 1 25fdc: 09 f0 breq .+2 ; 0x25fe0 25fde: 11 c1 rjmp .+546 ; 0x26202 25fe0: 80 91 78 13 lds r24, 0x1378 ; 0x801378 25fe4: 90 91 79 13 lds r25, 0x1379 ; 0x801379 25fe8: 20 91 7a 13 lds r18, 0x137A ; 0x80137a MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 25fec: 88 23 and r24, r24 25fee: 09 f4 brne .+2 ; 0x25ff2 25ff0: 08 c1 rjmp .+528 ; 0x26202 lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 25ff2: 1f 92 push r1 25ff4: 2f 93 push r18 25ff6: 1f 92 push r1 25ff8: 9f 93 push r25 25ffa: 1f 92 push r1 25ffc: 8f 93 push r24 25ffe: ff 92 push r15 26000: ef 92 push r14 26002: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 26006: 8d b7 in r24, 0x3d ; 61 26008: 9e b7 in r25, 0x3e ; 62 2600a: 08 96 adiw r24, 0x08 ; 8 2600c: 0f b6 in r0, 0x3f ; 63 2600e: f8 94 cli 26010: 9e bf out 0x3e, r25 ; 62 26012: 0f be out 0x3f, r0 ; 63 26014: 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) { 26016: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 2601a: 88 23 and r24, r24 2601c: 09 f4 brne .+2 ; 0x26020 2601e: 40 c0 rjmp .+128 ; 0x260a0 MENU_ITEM_BACK_P(STR_SEPARATOR); 26020: 89 ee ldi r24, 0xE9 ; 233 26022: 9c e8 ldi r25, 0x8C ; 140 26024: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 26028: 8d ec ldi r24, 0xCD ; 205 2602a: 92 ea ldi r25, 0xA2 ; 162 2602c: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR(" ")); 26030: 8b ec ldi r24, 0xCB ; 203 26032: 92 ea ldi r25, 0xA2 ; 162 26034: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a if (((menu_item - 1) == menu_line) && lcd_draw_update) { 26038: 80 91 18 05 lds r24, 0x0518 ; 0x800518 2603c: 81 50 subi r24, 0x01 ; 1 2603e: 99 0b sbc r25, r25 26040: 20 91 17 05 lds r18, 0x0517 ; 0x800517 26044: 28 17 cp r18, r24 26046: 19 06 cpc r1, r25 26048: 59 f5 brne .+86 ; 0x260a0 2604a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2604e: 88 23 and r24, r24 26050: 39 f1 breq .+78 ; 0x260a0 lcd_set_cursor(2, menu_row); 26052: 60 91 15 05 lds r22, 0x0515 ; 0x800515 26056: 82 e0 ldi r24, 0x02 ; 2 26058: 0e 94 15 70 call 0xe02a ; 0xe02a 2605c: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 26060: 1f 92 push r1 26062: 8f 93 push r24 26064: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 26068: 1f 92 push r1 2606a: 8f 93 push r24 2606c: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 26070: 1f 92 push r1 26072: 8f 93 push r24 26074: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 26078: 1f 92 push r1 2607a: 8f 93 push r24 2607c: df 93 push r29 2607e: cf 93 push r28 26080: 1f 93 push r17 26082: 0f 93 push r16 26084: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 26088: 8f ea ldi r24, 0xAF ; 175 2608a: 93 e0 ldi r25, 0x03 ; 3 2608c: 0e 94 1c 72 call 0xe438 ; 0xe438 26090: 8d b7 in r24, 0x3d ; 61 26092: 9e b7 in r25, 0x3e ; 62 26094: 0c 96 adiw r24, 0x0c ; 12 26096: 0f b6 in r0, 0x3f ; 63 26098: f8 94 cli 2609a: 9e bf out 0x3e, r25 ; 62 2609c: 0f be out 0x3f, r0 ; 63 2609e: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 260a0: 80 91 5b 06 lds r24, 0x065B ; 0x80065b 260a4: 90 91 5c 06 lds r25, 0x065C ; 0x80065c 260a8: a0 91 5d 06 lds r26, 0x065D ; 0x80065d 260ac: b0 91 5e 06 lds r27, 0x065E ; 0x80065e 260b0: 89 2b or r24, r25 260b2: 8a 2b or r24, r26 260b4: 8b 2b or r24, r27 260b6: 09 f4 brne .+2 ; 0x260ba 260b8: 42 c0 rjmp .+132 ; 0x2613e MENU_ITEM_BACK_P(STR_SEPARATOR); 260ba: 89 ee ldi r24, 0xE9 ; 233 260bc: 9c e8 ldi r25, 0x8C ; 140 260be: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 260c2: 88 ea ldi r24, 0xA8 ; 168 260c4: 9b e4 ldi r25, 0x4B ; 75 260c6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 260ca: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_BACK_P(PSTR(" ")); 260ce: 89 ec ldi r24, 0xC9 ; 201 260d0: 92 ea ldi r25, 0xA2 ; 162 260d2: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a if (((menu_item - 1) == menu_line) && lcd_draw_update) { 260d6: 80 91 18 05 lds r24, 0x0518 ; 0x800518 260da: 81 50 subi r24, 0x01 ; 1 260dc: 99 0b sbc r25, r25 260de: 20 91 17 05 lds r18, 0x0517 ; 0x800517 260e2: 28 17 cp r18, r24 260e4: 19 06 cpc r1, r25 260e6: 59 f5 brne .+86 ; 0x2613e 260e8: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 260ec: 88 23 and r24, r24 260ee: 39 f1 breq .+78 ; 0x2613e lcd_set_cursor(2, menu_row); 260f0: 60 91 15 05 lds r22, 0x0515 ; 0x800515 260f4: 82 e0 ldi r24, 0x02 ; 2 260f6: 0e 94 15 70 call 0xe02a ; 0xe02a 260fa: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 260fe: 1f 92 push r1 26100: 8f 93 push r24 26102: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 26106: 1f 92 push r1 26108: 8f 93 push r24 2610a: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 2610e: 1f 92 push r1 26110: 8f 93 push r24 26112: 80 91 5b 06 lds r24, 0x065B ; 0x80065b 26116: 1f 92 push r1 26118: 8f 93 push r24 2611a: df 93 push r29 2611c: cf 93 push r28 2611e: 1f 93 push r17 26120: 0f 93 push r16 26122: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 26126: 8f ea ldi r24, 0xAF ; 175 26128: 93 e0 ldi r25, 0x03 ; 3 2612a: 0e 94 1c 72 call 0xe438 ; 0xe438 2612e: 8d b7 in r24, 0x3d ; 61 26130: 9e b7 in r25, 0x3e ; 62 26132: 0c 96 adiw r24, 0x0c ; 12 26134: 0f b6 in r0, 0x3f ; 63 26136: f8 94 cli 26138: 9e bf out 0x3e, r25 ; 62 2613a: 0f be out 0x3f, r0 ; 63 2613c: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 2613e: 89 ee ldi r24, 0xE9 ; 233 26140: 9c e8 ldi r25, 0x8C ; 140 26142: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 26146: 85 e9 ldi r24, 0x95 ; 149 26148: 9b e4 ldi r25, 0x4B ; 75 2614a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2614e: 6c e3 ldi r22, 0x3C ; 60 26150: 7a e3 ldi r23, 0x3A ; 58 26152: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 26156: 85 e8 ldi r24, 0x85 ; 133 26158: 9b e4 ldi r25, 0x4B ; 75 2615a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2615e: 64 e0 ldi r22, 0x04 ; 4 26160: 7b e3 ldi r23, 0x3B ; 59 26162: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 26166: 87 e7 ldi r24, 0x77 ; 119 26168: 9b e4 ldi r25, 0x4B ; 75 2616a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2616e: 66 e2 ldi r22, 0x26 ; 38 26170: 7b e3 ldi r23, 0x3B ; 59 26172: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #ifdef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_BELT_STATUS), lcd_menu_belt_status); 26176: 89 e6 ldi r24, 0x69 ; 105 26178: 9b e4 ldi r25, 0x4B ; 75 2617a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2617e: 6e ee ldi r22, 0xEE ; 238 26180: 7a e3 ldi r23, 0x3A ; 58 26182: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #endif //TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_MENU_TEMPERATURES), lcd_menu_temperatures); 26186: 8a e5 ldi r24, 0x5A ; 90 26188: 9b e4 ldi r25, 0x4B ; 75 2618a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2618e: 6c e0 ldi r22, 0x0C ; 12 26190: 7b e3 ldi r23, 0x3B ; 59 26192: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #if defined (VOLT_BED_PIN) || defined (VOLT_PWR_PIN) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_VOLTAGES), lcd_menu_voltages); 26196: 8f e4 ldi r24, 0x4F ; 79 26198: 9b e4 ldi r25, 0x4B ; 75 2619a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2619e: 66 e3 ldi r22, 0x36 ; 54 261a0: 7b e3 ldi r23, 0x3B ; 59 261a2: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); 261a6: 64 eb ldi r22, 0xB4 ; 180 261a8: 7b e3 ldi r23, 0x3B ; 59 261aa: 89 ee ldi r24, 0xE9 ; 233 261ac: 9f e6 ldi r25, 0x6F ; 111 261ae: 0f 94 57 ce call 0x39cae ; 0x39cae 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(); 261b2: 0f 94 ae ce call 0x39d5c ; 0x39d5c { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 261b6: 80 91 15 05 lds r24, 0x0515 ; 0x800515 261ba: 8f 5f subi r24, 0xFF ; 255 261bc: 80 93 15 05 sts 0x0515, r24 ; 0x800515 261c0: 80 91 17 05 lds r24, 0x0517 ; 0x800517 261c4: 8f 5f subi r24, 0xFF ; 255 261c6: 80 93 17 05 sts 0x0517, r24 ; 0x800517 261ca: 8d ce rjmp .-742 ; 0x25ee6 _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) 261cc: 90 91 aa 03 lds r25, 0x03AA ; 0x8003aa 261d0: 99 23 and r25, r25 261d2: 09 f4 brne .+2 ; 0x261d6 261d4: 7c ce rjmp .-776 ; 0x25ece 261d6: 40 91 ab 03 lds r20, 0x03AB ; 0x8003ab 261da: 50 91 ac 03 lds r21, 0x03AC ; 0x8003ac 261de: 60 91 ad 03 lds r22, 0x03AD ; 0x8003ad 261e2: 70 91 ae 03 lds r23, 0x03AE ; 0x8003ae 261e6: 45 2b or r20, r21 261e8: 46 2b or r20, r22 261ea: 47 2b or r20, r23 261ec: 09 f0 breq .+2 ; 0x261f0 261ee: 6f ce rjmp .-802 ; 0x25ece 261f0: 8f 5f subi r24, 0xFF ; 255 261f2: 80 31 cpi r24, 0x10 ; 16 261f4: 19 f0 breq .+6 ; 0x261fc 261f6: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 261fa: 69 ce rjmp .-814 ; 0x25ece { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 261fc: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 26200: 66 ce rjmp .-820 ; 0x25ece 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)); 26202: 8b eb ldi r24, 0xBB ; 187 26204: 9b e4 ldi r25, 0x4B ; 75 26206: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2620a: 0e 94 00 70 call 0xe000 ; 0xe000 2620e: 03 cf rjmp .-506 ; 0x26016 } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 26210: 8f ed ldi r24, 0xDF ; 223 26212: 92 ea ldi r25, 0xA2 ; 162 26214: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a 26218: fe ce rjmp .-516 ; 0x26016 #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 2621a: df 91 pop r29 2621c: cf 91 pop r28 2621e: 1f 91 pop r17 26220: 0f 91 pop r16 26222: ff 90 pop r15 26224: ef 90 pop r14 26226: 08 95 ret 00026228 : { 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) { 26228: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 2622c: 81 11 cpse r24, r1 2622e: 19 c0 rjmp .+50 ; 0x26262 lcd_clear(); 26230: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 26234: 8e ec ldi r24, 0xCE ; 206 26236: 9a e4 ldi r25, 0x4A ; 74 26238: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2623c: 0e 94 00 70 call 0xe000 ; 0xe000 lcd_putc(':'); 26240: 8a e3 ldi r24, 0x3A ; 58 26242: 0e 94 04 70 call 0xe008 ; 0xe008 lcd_set_cursor(10, 1); 26246: 61 e0 ldi r22, 0x01 ; 1 26248: 8a e0 ldi r24, 0x0A ; 10 2624a: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 2624e: 88 ea ldi r24, 0xA8 ; 168 26250: 9c e0 ldi r25, 0x0C ; 12 26252: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 26256: 4a e0 ldi r20, 0x0A ; 10 26258: 0e 94 69 71 call 0xe2d2 ; 0xe2d2 _md->initialized = true; 2625c: 81 e0 ldi r24, 0x01 ; 1 2625e: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 } menu_back_if_clicked(); 26262: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 00026266 : } 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){ 26266: 0f 93 push r16 26268: 1f 93 push r17 2626a: cf 93 push r28 2626c: df 93 push r29 2626e: ec 01 movw r28, r24 26270: cb 01 movw r24, r22 26272: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 26274: 4a 81 ldd r20, Y+2 ; 0x02 26276: 41 30 cpi r20, 0x01 ; 1 26278: 29 f0 breq .+10 ; 0x26284 2627a: 88 f0 brcs .+34 ; 0x2629e 2627c: 42 30 cpi r20, 0x02 ; 2 2627e: 09 f1 breq .+66 ; 0x262c2 26280: 43 30 cpi r20, 0x03 ; 3 26282: d1 f4 brne .+52 ; 0x262b8 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 ){ 26284: 8b 81 ldd r24, Y+3 ; 0x03 26286: 81 11 cpse r24, r1 26288: 25 c0 rjmp .+74 ; 0x262d4 state = next_state; // advance to the next state 2628a: 82 e0 ldi r24, 0x02 ; 2 2628c: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 2628e: 63 e0 ldi r22, 0x03 ; 3 26290: 89 ec ldi r24, 0xC9 ; 201 26292: 9f e9 ldi r25, 0x9F ; 159 26294: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 26298: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 2629a: 8b 83 std Y+3, r24 ; 0x03 2629c: 0d c0 rjmp .+26 ; 0x262b8 //! @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 ){ 2629e: a9 01 movw r20, r18 262a0: 98 01 movw r18, r16 262a2: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 262a6: 18 16 cp r1, r24 262a8: 3c f4 brge .+14 ; 0x262b8 lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 262aa: 63 e0 ldi r22, 0x03 ; 3 262ac: 88 81 ld r24, Y 262ae: 99 81 ldd r25, Y+1 ; 0x01 262b0: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 state = States::TempAboveMintemp; 262b4: 81 e0 ldi r24, 0x01 ; 1 262b6: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 262b8: df 91 pop r29 262ba: cf 91 pop r28 262bc: 1f 91 pop r17 262be: 0f 91 pop r16 262c0: 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 ){ 262c2: 8b 81 ldd r24, Y+3 ; 0x03 262c4: 81 11 cpse r24, r1 262c6: 06 c0 rjmp .+12 ; 0x262d4 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); 262c8: 88 81 ld r24, Y 262ca: 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 262cc: 23 e0 ldi r18, 0x03 ; 3 262ce: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 262d0: 63 e0 ldi r22, 0x03 ; 3 262d2: e0 cf rjmp .-64 ; 0x26294 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 262d4: 81 50 subi r24, 0x01 ; 1 262d6: e1 cf rjmp .-62 ; 0x2629a 000262d8 : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 262d8: cf 93 push r28 if(IsStopped() == false) { 262da: 90 91 14 05 lds r25, 0x0514 ; 0x800514 262de: 91 11 cpse r25, r1 262e0: 18 c0 rjmp .+48 ; 0x26312 262e2: c6 2f mov r28, r22 if (isPreheat) { 262e4: 88 23 and r24, r24 262e6: c9 f0 breq .+50 ; 0x2631a lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 262e8: 8d e6 ldi r24, 0x6D ; 109 262ea: 9f e9 ldi r25, 0x9F ; 159 262ec: 66 23 and r22, r22 262ee: 11 f0 breq .+4 ; 0x262f4 262f0: 8b e7 ldi r24, 0x7B ; 123 262f2: 9f e9 ldi r25, 0x9F ; 159 262f4: 63 e0 ldi r22, 0x03 ; 3 262f6: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 SERIAL_ERROR_START; 262fa: 8a ec ldi r24, 0xCA ; 202 262fc: 9a ea ldi r25, 0xAA ; 170 262fe: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 26302: 8a e4 ldi r24, 0x4A ; 74 26304: 9f e9 ldi r25, 0x9F ; 159 { if(IsStopped() == false) { if (isPreheat) { lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { 26306: c1 11 cpse r28, r1 26308: 02 c0 rjmp .+4 ; 0x2630e SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 2630a: 88 e2 ldi r24, 0x28 ; 40 2630c: 9f e9 ldi r25, 0x9F ; 159 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"); 2630e: 0e 94 86 7b call 0xf70c ; 0xf70c } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 26312: 80 e0 ldi r24, 0x00 ; 0 } 26314: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 26316: 0c 94 b7 7b jmp 0xf76e ; 0xf76e 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); 2631a: 84 e0 ldi r24, 0x04 ; 4 2631c: 9f e9 ldi r25, 0x9F ; 159 2631e: 66 23 and r22, r22 26320: 11 f0 breq .+4 ; 0x26326 26322: 84 e1 ldi r24, 0x14 ; 20 26324: 9f e9 ldi r25, 0x9F ; 159 26326: 63 e0 ldi r22, 0x03 ; 3 26328: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 SERIAL_ERROR_START; 2632c: 8a ec ldi r24, 0xCA ; 202 2632e: 9a ea ldi r25, 0xAA ; 170 26330: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 26334: 8b ee ldi r24, 0xEB ; 235 26336: 9e e9 ldi r25, 0x9E ; 158 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) { 26338: c1 11 cpse r28, r1 2633a: e9 cf rjmp .-46 ; 0x2630e SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 2633c: 83 ed ldi r24, 0xD3 ; 211 2633e: 9e e9 ldi r25, 0x9E ; 158 26340: e6 cf rjmp .-52 ; 0x2630e 00026342 : } } static void Sound_DoSound_Prompt(void) { backlight_wake(2); 26342: 82 e0 ldi r24, 0x02 ; 2 26344: 0e 94 18 8c call 0x11830 ; 0x11830 WRITE(BEEPER,HIGH); 26348: 9f b7 in r25, 0x3f ; 63 2634a: f8 94 cli 2634c: e2 e0 ldi r30, 0x02 ; 2 2634e: f1 e0 ldi r31, 0x01 ; 1 26350: 80 81 ld r24, Z 26352: 84 60 ori r24, 0x04 ; 4 26354: 80 83 st Z, r24 26356: 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); 26358: 2f ef ldi r18, 0xFF ; 255 2635a: 89 e6 ldi r24, 0x69 ; 105 2635c: 98 e1 ldi r25, 0x18 ; 24 2635e: 21 50 subi r18, 0x01 ; 1 26360: 80 40 sbci r24, 0x00 ; 0 26362: 90 40 sbci r25, 0x00 ; 0 26364: e1 f7 brne .-8 ; 0x2635e 26366: 00 c0 rjmp .+0 ; 0x26368 26368: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 2636a: 9f b7 in r25, 0x3f ; 63 2636c: f8 94 cli 2636e: 80 81 ld r24, Z 26370: 8b 7f andi r24, 0xFB ; 251 26372: 80 83 st Z, r24 26374: 9f bf out 0x3f, r25 ; 63 } 26376: 08 95 ret 00026378 : 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() { 26378: cf 93 push r28 2637a: 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); 2637c: 80 91 38 02 lds r24, 0x0238 ; 0x800238 26380: 88 23 and r24, r24 26382: 89 f0 breq .+34 ; 0x263a6 26384: 8a e0 ldi r24, 0x0A ; 10 26386: 9e e5 ldi r25, 0x5E ; 94 26388: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2638c: ec 01 movw r28, r24 2638e: 8e ee ldi r24, 0xEE ; 238 26390: 97 e5 ldi r25, 0x57 ; 87 26392: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26396: 22 e0 ldi r18, 0x02 ; 2 26398: 4c e8 ldi r20, 0x8C ; 140 2639a: 5b e3 ldi r21, 0x3B ; 59 2639c: be 01 movw r22, r28 } 2639e: df 91 pop r29 263a0: 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); 263a2: 0d 94 69 d0 jmp 0x3a0d2 ; 0x3a0d2 263a6: 84 e0 ldi r24, 0x04 ; 4 263a8: 9e e5 ldi r25, 0x5E ; 94 263aa: ee cf rjmp .-36 ; 0x26388 000263ac : } #endif // TMC2130 } } static void menuitems_temperature_common() { 263ac: ef 92 push r14 263ae: ff 92 push r15 263b0: 0f 93 push r16 263b2: 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); 263b4: 83 e0 ldi r24, 0x03 ; 3 263b6: 98 e5 ldi r25, 0x58 ; 88 263b8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 263bc: 28 ec ldi r18, 0xC8 ; 200 263be: e2 2e mov r14, r18 263c0: f1 2c mov r15, r1 263c2: 07 e2 ldi r16, 0x27 ; 39 263c4: 11 e0 ldi r17, 0x01 ; 1 263c6: 30 e0 ldi r19, 0x00 ; 0 263c8: 20 e0 ldi r18, 0x00 ; 0 263ca: 40 e1 ldi r20, 0x10 ; 16 263cc: 6d e6 ldi r22, 0x6D ; 109 263ce: 7e e0 ldi r23, 0x0E ; 14 263d0: 0f 94 2a cf call 0x39e54 ; 0x39e54 #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); 263d4: 88 ee ldi r24, 0xE8 ; 232 263d6: 97 e5 ldi r25, 0x57 ; 87 263d8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 263dc: 32 e3 ldi r19, 0x32 ; 50 263de: e3 2e mov r14, r19 263e0: f1 2c mov r15, r1 263e2: 08 e7 ldi r16, 0x78 ; 120 263e4: 10 e0 ldi r17, 0x00 ; 0 263e6: 30 e0 ldi r19, 0x00 ; 0 263e8: 20 e0 ldi r18, 0x00 ; 0 263ea: 40 e1 ldi r20, 0x10 ; 16 263ec: 6b e6 ldi r22, 0x6B ; 107 263ee: 7e e0 ldi r23, 0x0E ; 14 263f0: 0f 94 2a cf call 0x39e54 ; 0x39e54 #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 263f4: 8c ed ldi r24, 0xDC ; 220 263f6: 97 e5 ldi r25, 0x57 ; 87 263f8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 263fc: 4f e7 ldi r20, 0x7F ; 127 263fe: e4 2e mov r14, r20 26400: f1 2c mov r15, r1 26402: 0f ef ldi r16, 0xFF ; 255 26404: 10 e0 ldi r17, 0x00 ; 0 26406: 30 e0 ldi r19, 0x00 ; 0 26408: 20 e0 ldi r18, 0x00 ; 0 2640a: 48 e0 ldi r20, 0x08 ; 8 2640c: 63 ee ldi r22, 0xE3 ; 227 2640e: 73 e0 ldi r23, 0x03 ; 3 26410: 0f 94 2a cf call 0x39e54 ; 0x39e54 } 26414: 1f 91 pop r17 26416: 0f 91 pop r16 26418: ff 90 pop r15 2641a: ef 90 pop r14 2641c: 08 95 ret 0002641e : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { 2641e: cf 93 push r28 26420: 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); 26422: 8f ef ldi r24, 0xFF ; 255 26424: 9f e0 ldi r25, 0x0F ; 15 26426: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 bool bDesync = tmc2130_mode ^ eeprom_mode; 2642a: 90 91 6c 06 lds r25, 0x066C ; 0x80066c if (eeprom_mode == SILENT_MODE_NORMAL) 2642e: 81 11 cpse r24, r1 26430: 35 c0 rjmp .+106 ; 0x2649c { if (bDesync) 26432: 99 23 and r25, r25 26434: 11 f1 breq .+68 ; 0x2647a { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M915"), lcd_silent_mode_set); 26436: 8d e7 ldi r24, 0x7D ; 125 26438: 9d e3 ldi r25, 0x3D ; 61 2643a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2643e: 22 e0 ldi r18, 0x02 ; 2 26440: 42 eb ldi r20, 0xB2 ; 178 26442: 5a e3 ldi r21, 0x3A ; 58 26444: 6b e6 ldi r22, 0x6B ; 107 26446: 75 ea ldi r23, 0xA5 ; 165 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set); 26448: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 2644c: 89 e6 ldi r24, 0x69 ; 105 2644e: 9f e0 ldi r25, 0x0F ; 15 26450: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 26454: 88 23 and r24, r24 26456: f9 f0 breq .+62 ; 0x26496 26458: 8a e0 ldi r24, 0x0A ; 10 2645a: 9e e5 ldi r25, 0x5E ; 94 2645c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26460: ec 01 movw r28, r24 26462: 8f ec ldi r24, 0xCF ; 207 26464: 97 e5 ldi r25, 0x57 ; 87 26466: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2646a: 22 e0 ldi r18, 0x02 ; 2 2646c: 42 e3 ldi r20, 0x32 ; 50 2646e: 5a e3 ldi r21, 0x3A ; 58 26470: 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 } } 26472: df 91 pop r29 26474: 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); 26476: 0d 94 69 d0 jmp 0x3a0d2 ; 0x3a0d2 { 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); 2647a: 8e e3 ldi r24, 0x3E ; 62 2647c: 98 e5 ldi r25, 0x58 ; 88 2647e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26482: ec 01 movw r28, r24 26484: 8d e7 ldi r24, 0x7D ; 125 26486: 9d e3 ldi r25, 0x3D ; 61 26488: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2648c: 22 e0 ldi r18, 0x02 ; 2 2648e: 42 eb ldi r20, 0xB2 ; 178 26490: 5a e3 ldi r21, 0x3A ; 58 26492: be 01 movw r22, r28 26494: d9 cf rjmp .-78 ; 0x26448 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 26496: 84 e0 ldi r24, 0x04 ; 4 26498: 9e e5 ldi r25, 0x5E ; 94 2649a: e0 cf rjmp .-64 ; 0x2645c } else { if (bDesync) 2649c: 98 17 cp r25, r24 2649e: a9 f0 breq .+42 ; 0x264ca { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M914") , lcd_silent_mode_set); 264a0: 8d e7 ldi r24, 0x7D ; 125 264a2: 9d e3 ldi r25, 0x3D ; 61 264a4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 264a8: 22 e0 ldi r18, 0x02 ; 2 264aa: 42 eb ldi r20, 0xB2 ; 178 264ac: 5a e3 ldi r21, 0x3A ; 58 264ae: 66 e6 ldi r22, 0x66 ; 102 264b0: 75 ea ldi r23, 0xA5 ; 165 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set); 264b2: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), NULL, lcd_crash_mode_info); 264b6: 8f ec ldi r24, 0xCF ; 207 264b8: 97 e5 ldi r25, 0x57 ; 87 264ba: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 264be: 22 e0 ldi r18, 0x02 ; 2 264c0: 4c e4 ldi r20, 0x4C ; 76 264c2: 5a e3 ldi r21, 0x3A ; 58 264c4: 70 e0 ldi r23, 0x00 ; 0 264c6: 60 e0 ldi r22, 0x00 ; 0 264c8: d4 cf rjmp .-88 ; 0x26472 { 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); 264ca: 85 ec ldi r24, 0xC5 ; 197 264cc: 97 e5 ldi r25, 0x57 ; 87 264ce: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 264d2: ec 01 movw r28, r24 264d4: 8d e7 ldi r24, 0x7D ; 125 264d6: 9d e3 ldi r25, 0x3D ; 61 264d8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 264dc: 22 e0 ldi r18, 0x02 ; 2 264de: 42 eb ldi r20, 0xB2 ; 178 264e0: 5a e3 ldi r21, 0x3A ; 58 264e2: be 01 movw r22, r28 264e4: e6 cf rjmp .-52 ; 0x264b2 000264e6 : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 264e6: cf 93 push r28 264e8: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 264ea: 86 ed ldi r24, 0xD6 ; 214 264ec: 9e e0 ldi r25, 0x0E ; 14 264ee: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 264f2: 81 30 cpi r24, 0x01 ; 1 264f4: c1 f5 brne .+112 ; 0x26566 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 264f6: 8a e0 ldi r24, 0x0A ; 10 264f8: 9e e5 ldi r25, 0x5E ; 94 264fa: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 264fe: 22 e0 ldi r18, 0x02 ; 2 26500: 46 e0 ldi r20, 0x06 ; 6 26502: 5a e3 ldi r21, 0x3A ; 58 26504: bc 01 movw r22, r24 26506: 85 ee ldi r24, 0xE5 ; 229 26508: 90 e7 ldi r25, 0x70 ; 112 2650a: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 2650e: 8e ec ldi r24, 0xCE ; 206 26510: 9e e0 ldi r25, 0x0E ; 14 26512: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 26516: 81 30 cpi r24, 0x01 ; 1 26518: 49 f5 brne .+82 ; 0x2656c { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 2651a: 8a e0 ldi r24, 0x0A ; 10 2651c: 9e e5 ldi r25, 0x5E ; 94 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); 2651e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26522: ec 01 movw r28, r24 26524: 8c eb ldi r24, 0xBC ; 188 26526: 97 e5 ldi r25, 0x57 ; 87 26528: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2652c: 22 e0 ldi r18, 0x02 ; 2 2652e: 46 e9 ldi r20, 0x96 ; 150 26530: 5a e3 ldi r21, 0x3A ; 58 26532: be 01 movw r22, r28 26534: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 } #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); 26538: 89 ea ldi r24, 0xA9 ; 169 2653a: 9d e0 ldi r25, 0x0D ; 13 2653c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 26540: 88 23 and r24, r24 26542: b9 f0 breq .+46 ; 0x26572 26544: 85 ec ldi r24, 0xC5 ; 197 26546: 97 e5 ldi r25, 0x57 ; 87 26548: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2654c: ec 01 movw r28, r24 2654e: 81 eb ldi r24, 0xB1 ; 177 26550: 97 e5 ldi r25, 0x57 ; 87 26552: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26556: 22 e0 ldi r18, 0x02 ; 2 26558: 40 e8 ldi r20, 0x80 ; 128 2655a: 5a e3 ldi r21, 0x3A ; 58 2655c: be 01 movw r22, r28 #endif // MMU_FORCE_STEALTH_MODE } 2655e: df 91 pop r29 26560: 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); 26562: 0d 94 69 d0 jmp 0x3a0d2 ; 0x3a0d2 #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); 26566: 84 e0 ldi r24, 0x04 ; 4 26568: 9e e5 ldi r25, 0x5E ; 94 2656a: c7 cf rjmp .-114 ; 0x264fa 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); 2656c: 84 e0 ldi r24, 0x04 ; 4 2656e: 9e e5 ldi r25, 0x5E ; 94 26570: d6 cf rjmp .-84 ; 0x2651e } #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); 26572: 8e e3 ldi r24, 0x3E ; 62 26574: 98 e5 ldi r25, 0x58 ; 88 26576: e8 cf rjmp .-48 ; 0x26548 00026578 : MENU_END(); } static void lcd_settings_menu() { 26578: 1f 93 push r17 2657a: cf 93 push r28 2657c: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 2657e: 8f ef ldi r24, 0xFF ; 255 26580: 9f e0 ldi r25, 0x0F ; 15 26582: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 26586: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 MENU_BEGIN(); 2658a: 0f 94 da ce call 0x39db4 ; 0x39db4 2658e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 26592: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 26594: 80 91 15 05 lds r24, 0x0515 ; 0x800515 26598: 84 30 cpi r24, 0x04 ; 4 2659a: 08 f0 brcs .+2 ; 0x2659e 2659c: 5c c1 rjmp .+696 ; 0x26856 2659e: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 265a2: 8a e1 ldi r24, 0x1A ; 26 265a4: 9e e3 ldi r25, 0x3E ; 62 265a6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 265aa: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 265ae: 89 eb ldi r24, 0xB9 ; 185 265b0: 98 e5 ldi r25, 0x58 ; 88 265b2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 265b6: 6e ee ldi r22, 0xEE ; 238 265b8: 73 ed ldi r23, 0xD3 ; 211 265ba: 0f 94 08 d1 call 0x3a210 ; 0x3a210 if (!printer_active() || printingIsPaused()) 265be: 0e 94 16 69 call 0xd22c ; 0xd22c 265c2: 88 23 and r24, r24 265c4: 21 f0 breq .+8 ; 0x265ce 265c6: 0e 94 ba 68 call 0xd174 ; 0xd174 265ca: 88 23 and r24, r24 265cc: 81 f0 breq .+32 ; 0x265ee { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 265ce: 8d ea ldi r24, 0xAD ; 173 265d0: 98 e5 ldi r25, 0x58 ; 88 265d2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 265d6: 6a eb ldi r22, 0xBA ; 186 265d8: 7a e3 ldi r23, 0x3A ; 58 265da: 0f 94 08 d1 call 0x3a210 ; 0x3a210 MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 265de: 8a e9 ldi r24, 0x9A ; 154 265e0: 98 e5 ldi r25, 0x58 ; 88 265e2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 265e6: 68 eb ldi r22, 0xB8 ; 184 265e8: 7c e6 ldi r23, 0x6C ; 108 265ea: 0f 94 d0 cd call 0x39ba0 ; 0x39ba0 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 265ee: 89 e1 ldi r24, 0x19 ; 25 265f0: 9d e3 ldi r25, 0x3D ; 61 265f2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 265f6: 66 eb ldi r22, 0xB6 ; 182 265f8: 79 e3 ldi r23, 0x39 ; 57 265fa: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #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); 265fe: 8c ea ldi r24, 0xAC ; 172 26600: 9c e0 ldi r25, 0x0C ; 12 26602: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 26606: 88 23 and r24, r24 26608: 09 f4 brne .+2 ; 0x2660c 2660a: ac c0 rjmp .+344 ; 0x26764 2660c: 8a e0 ldi r24, 0x0A ; 10 2660e: 9e e5 ldi r25, 0x5E ; 94 26610: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26614: 22 e0 ldi r18, 0x02 ; 2 26616: 46 ec ldi r20, 0xC6 ; 198 26618: 5a e3 ldi r21, 0x3A ; 58 2661a: bc 01 movw r22, r24 2661c: 8d ea ldi r24, 0xAD ; 173 2661e: 95 ea ldi r25, 0xA5 ; 165 26620: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 26624: 8c ea ldi r24, 0xAC ; 172 26626: 9c e0 ldi r25, 0x0C ; 12 26628: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2662c: 88 23 and r24, r24 2662e: 31 f0 breq .+12 ; 0x2663c { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 26630: 6a ed ldi r22, 0xDA ; 218 26632: 79 e3 ldi r23, 0x39 ; 57 26634: 83 ea ldi r24, 0xA3 ; 163 26636: 95 ea ldi r25, 0xA5 ; 165 26638: 0f 94 57 ce call 0x39cae ; 0x39cae } if (MMU2::mmu2.Enabled()) 2663c: 80 91 98 13 lds r24, 0x1398 ; 0x801398 26640: 81 30 cpi r24, 0x01 ; 1 26642: 51 f4 brne .+20 ; 0x26658 { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 26644: 0f 94 73 32 call 0x264e6 ; 0x264e6 MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 26648: 8b e8 ldi r24, 0x8B ; 139 2664a: 98 e5 ldi r25, 0x58 ; 88 2664c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26650: 6b e1 ldi r22, 0x1B ; 27 26652: 78 ed ldi r23, 0xD8 ; 216 26654: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } SETTINGS_FANS_CHECK(); 26658: 0f 94 bc 31 call 0x26378 ; 0x26378 SETTINGS_SILENT_MODE(); 2665c: 0f 94 0f 32 call 0x2641e ; 0x2641e if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 26660: 10 93 f8 03 sts 0x03F8, r17 ; 0x8003f8 MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 26664: 80 e8 ldi r24, 0x80 ; 128 26666: 98 e5 ldi r25, 0x58 ; 88 26668: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2666c: 64 ef ldi r22, 0xF4 ; 244 2666e: 79 e3 ldi r23, 0x39 ; 57 26670: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } 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); 26674: 8a ec ldi r24, 0xCA ; 202 26676: 9a e3 ldi r25, 0x3A ; 58 26678: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2667c: 67 e4 ldi r22, 0x47 ; 71 2667e: 77 ed ldi r23, 0xD7 ; 215 26680: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_T(MSG_LIN_CORRECTION), lcd_settings_linearity_correction_menu); 26684: 8e e6 ldi r24, 0x6E ; 110 26686: 98 e5 ldi r25, 0x58 ; 88 26688: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2668c: 68 e1 ldi r22, 0x18 ; 24 2668e: 7b e3 ldi r23, 0x3B ; 59 26690: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #endif //LINEARITY_CORRECTION && TMC2130 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 26694: 20 e0 ldi r18, 0x00 ; 0 26696: 30 e0 ldi r19, 0x00 ; 0 26698: 40 e2 ldi r20, 0x20 ; 32 2669a: 51 e4 ldi r21, 0x41 ; 65 2669c: 60 91 99 03 lds r22, 0x0399 ; 0x800399 266a0: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 266a4: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 266a8: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 266ac: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 266b0: 87 fd sbrc r24, 7 266b2: 16 c0 rjmp .+44 ; 0x266e0 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); 266b4: 8f ea ldi r24, 0xAF ; 175 266b6: 9f e0 ldi r25, 0x0F ; 15 266b8: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 266bc: 88 23 and r24, r24 266be: 09 f4 brne .+2 ; 0x266c2 266c0: 54 c0 rjmp .+168 ; 0x2676a 266c2: 8a e0 ldi r24, 0x0A ; 10 266c4: 9e e5 ldi r25, 0x5E ; 94 266c6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 266ca: ec 01 movw r28, r24 266cc: 83 e8 ldi r24, 0x83 ; 131 266ce: 9a e3 ldi r25, 0x3A ; 58 266d0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 266d4: 22 e0 ldi r18, 0x02 ; 2 266d6: 46 e1 ldi r20, 0x16 ; 22 266d8: 5b e3 ldi r21, 0x3B ; 59 266da: be 01 movw r22, r28 266dc: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 #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); 266e0: 80 91 21 05 lds r24, 0x0521 ; 0x800521 266e4: 81 11 cpse r24, r1 266e6: 44 c0 rjmp .+136 ; 0x26770 266e8: 84 e0 ldi r24, 0x04 ; 4 266ea: 9e e5 ldi r25, 0x5E ; 94 266ec: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 266f0: ec 01 movw r28, r24 266f2: 83 e6 ldi r24, 0x63 ; 99 266f4: 98 e5 ldi r25, 0x58 ; 88 266f6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 266fa: 22 e0 ldi r18, 0x02 ; 2 266fc: 44 ed ldi r20, 0xD4 ; 212 266fe: 5a e3 ldi r21, 0x3A ; 58 26700: be 01 movw r22, r28 26702: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 #endif //HAS_SECOND_SERIAL if (!printingIsPaused()) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); 26706: 0e 94 ba 68 call 0xd174 ; 0xd174 2670a: 81 11 cpse r24, r1 2670c: 08 c0 rjmp .+16 ; 0x2671e 2670e: 8c eb ldi r24, 0xBC ; 188 26710: 9c e3 ldi r25, 0x3C ; 60 26712: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26716: 68 ea ldi r22, 0xA8 ; 168 26718: 7a e3 ldi r23, 0x3A ; 58 2671a: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 2671e: 81 e5 ldi r24, 0x51 ; 81 26720: 98 e5 ldi r25, 0x58 ; 88 26722: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26726: 64 e7 ldi r22, 0x74 ; 116 26728: 7a e3 ldi r23, 0x3A ; 58 2672a: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode if (card.ToshibaFlashAir_isEnabled()) 2672e: 80 91 df 16 lds r24, 0x16DF ; 0x8016df 26732: 88 23 and r24, r24 26734: 01 f1 breq .+64 ; 0x26776 MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 26736: 87 e4 ldi r24, 0x47 ; 71 26738: 98 e5 ldi r25, 0x58 ; 88 2673a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2673e: 22 e0 ldi r18, 0x02 ; 2 26740: 4a e6 ldi r20, 0x6A ; 106 26742: 5b e3 ldi r21, 0x3B ; 59 26744: 65 e0 ldi r22, 0x05 ; 5 26746: 71 e7 ldi r23, 0x71 ; 113 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 26748: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 2674c: 89 e0 ldi r24, 0x09 ; 9 2674e: 9f e0 ldi r25, 0x0F ; 15 26750: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 26754: 88 23 and r24, r24 26756: e9 f0 breq .+58 ; 0x26792 26758: 81 30 cpi r24, 0x01 ; 1 2675a: 09 f4 brne .+2 ; 0x2675e 2675c: 6d c0 rjmp .+218 ; 0x26838 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); 2675e: 82 e9 ldi r24, 0x92 ; 146 26760: 90 e4 ldi r25, 0x40 ; 64 26762: 19 c0 rjmp .+50 ; 0x26796 #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); 26764: 84 e0 ldi r24, 0x04 ; 4 26766: 9e e5 ldi r25, 0x5E ; 94 26768: 53 cf rjmp .-346 ; 0x26610 #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); 2676a: 84 e0 ldi r24, 0x04 ; 4 2676c: 9e e5 ldi r25, 0x5E ; 94 2676e: ab cf rjmp .-170 ; 0x266c6 #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); 26770: 8a e0 ldi r24, 0x0A ; 10 26772: 9e e5 ldi r25, 0x5E ; 94 26774: bb cf rjmp .-138 ; 0x266ec 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); 26776: 8e e3 ldi r24, 0x3E ; 62 26778: 98 e5 ldi r25, 0x58 ; 88 2677a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2677e: ec 01 movw r28, r24 26780: 87 e4 ldi r24, 0x47 ; 71 26782: 98 e5 ldi r25, 0x58 ; 88 26784: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26788: 22 e0 ldi r18, 0x02 ; 2 2678a: 4a e6 ldi r20, 0x6A ; 106 2678c: 5b e3 ldi r21, 0x3B ; 59 2678e: be 01 movw r22, r28 26790: db cf rjmp .-74 ; 0x26748 #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; 26792: 87 e3 ldi r24, 0x37 ; 55 26794: 98 e5 ldi r25, 0x58 ; 88 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); 26796: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2679a: ec 01 movw r28, r24 2679c: 80 e3 ldi r24, 0x30 ; 48 2679e: 98 e5 ldi r25, 0x58 ; 88 267a0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 267a4: 22 e0 ldi r18, 0x02 ; 2 267a6: 4c ea ldi r20, 0xAC ; 172 267a8: 5a e3 ldi r21, 0x3A ; 58 267aa: be 01 movw r22, r28 267ac: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 267b0: 80 91 e1 04 lds r24, 0x04E1 ; 0x8004e1 267b4: 82 30 cpi r24, 0x02 ; 2 267b6: 09 f4 brne .+2 ; 0x267ba 267b8: 45 c0 rjmp .+138 ; 0x26844 267ba: 83 30 cpi r24, 0x03 ; 3 267bc: 09 f4 brne .+2 ; 0x267c0 267be: 45 c0 rjmp .+138 ; 0x2684a 267c0: 81 30 cpi r24, 0x01 ; 1 267c2: e9 f1 breq .+122 ; 0x2683e 267c4: 82 e1 ldi r24, 0x12 ; 18 267c6: 9d e3 ldi r25, 0x3D ; 61 267c8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 267cc: ec 01 movw r28, r24 267ce: 8a e0 ldi r24, 0x0A ; 10 267d0: 9d e3 ldi r25, 0x3D ; 61 267d2: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 267d6: 22 e0 ldi r18, 0x02 ; 2 267d8: 48 eb ldi r20, 0xB8 ; 184 267da: 5b e3 ldi r21, 0x3B ; 59 267dc: be 01 movw r22, r28 267de: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 #ifdef LCD_BL_PIN if (backlightSupport) 267e2: 80 91 fe 03 lds r24, 0x03FE ; 0x8003fe 267e6: 88 23 and r24, r24 267e8: 41 f0 breq .+16 ; 0x267fa { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 267ea: 84 ee ldi r24, 0xE4 ; 228 267ec: 9c e3 ldi r25, 0x3C ; 60 267ee: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 267f2: 6e eb ldi r22, 0xBE ; 190 267f4: 76 ed ldi r23, 0xD6 ; 214 267f6: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } #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 267fa: 87 ea ldi r24, 0xA7 ; 167 267fc: 9c e0 ldi r25, 0x0C ; 12 267fe: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 26802: 88 23 and r24, r24 26804: 29 f1 breq .+74 ; 0x26850 26806: 83 ec ldi r24, 0xC3 ; 195 26808: 9d e3 ldi r25, 0x3D ; 61 2680a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2680e: 22 e0 ldi r18, 0x02 ; 2 26810: 44 e8 ldi r20, 0x84 ; 132 26812: 51 ed ldi r21, 0xD1 ; 209 26814: bc 01 movw r22, r24 26816: 88 ef ldi r24, 0xF8 ; 248 26818: 90 e7 ldi r25, 0x70 ; 112 2681a: 0f 94 69 d0 call 0x3a0d2 ; 0x3a0d2 if (farm_mode) { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); 2681e: 0f 94 ae ce call 0x39d5c ; 0x39d5c } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 26822: 80 91 15 05 lds r24, 0x0515 ; 0x800515 26826: 8f 5f subi r24, 0xFF ; 255 26828: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2682c: 80 91 17 05 lds r24, 0x0517 ; 0x800517 26830: 8f 5f subi r24, 0xFF ; 255 26832: 80 93 17 05 sts 0x0517, r24 ; 0x800517 26836: ae ce rjmp .-676 ; 0x26594 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; 26838: 85 e2 ldi r24, 0x25 ; 37 2683a: 98 e5 ldi r25, 0x58 ; 88 2683c: ac cf rjmp .-168 ; 0x26796 default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 2683e: 83 e0 ldi r24, 0x03 ; 3 26840: 9d e3 ldi r25, 0x3D ; 61 26842: c2 cf rjmp .-124 ; 0x267c8 26844: 8a ef ldi r24, 0xFA ; 250 26846: 9c e3 ldi r25, 0x3C ; 60 26848: bf cf rjmp .-130 ; 0x267c8 2684a: 81 ef ldi r24, 0xF1 ; 241 2684c: 9c e3 ldi r25, 0x3C ; 60 2684e: bc cf rjmp .-136 ; 0x267c8 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 26850: 89 ec ldi r24, 0xC9 ; 201 26852: 9d e3 ldi r25, 0x3D ; 61 26854: da cf rjmp .-76 ; 0x2680a { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 26856: df 91 pop r29 26858: cf 91 pop r28 2685a: 1f 91 pop r17 2685c: 08 95 ret 0002685e : //! @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) { 2685e: cf 92 push r12 26860: df 92 push r13 26862: ef 92 push r14 26864: ff 92 push r15 26866: 0f 93 push r16 26868: 1f 93 push r17 2686a: cf 93 push r28 2686c: df 93 push r29 2686e: d8 2f mov r29, r24 26870: 6b 01 movw r12, r22 26872: 7a 01 movw r14, r20 26874: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 26876: 40 e2 ldi r20, 0x20 ; 32 26878: 81 11 cpse r24, r1 2687a: 01 c0 rjmp .+2 ; 0x2687e 2687c: 4e e3 ldi r20, 0x3E ; 62 2687e: 63 e0 ldi r22, 0x03 ; 3 26880: 80 e0 ldi r24, 0x00 ; 0 26882: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_puts_P(first_choice); 26886: c6 01 movw r24, r12 26888: 0e 94 00 70 call 0xe000 ; 0xe000 lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 2688c: 40 e2 ldi r20, 0x20 ; 32 2688e: d1 30 cpi r29, 0x01 ; 1 26890: 09 f4 brne .+2 ; 0x26894 26892: 4e e3 ldi r20, 0x3E ; 62 26894: 63 e0 ldi r22, 0x03 ; 3 26896: 8c 2f mov r24, r28 26898: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_puts_P(second_choice); 2689c: c7 01 movw r24, r14 2689e: 0e 94 00 70 call 0xe000 ; 0xe000 if (third_choice) { 268a2: 01 15 cp r16, r1 268a4: 11 05 cpc r17, r1 268a6: 19 f1 breq .+70 ; 0x268ee 268a8: c8 01 movw r24, r16 268aa: 0f 94 19 db call 0x3b632 ; 0x3b632 <__strlen_P> 268ae: d8 2e mov r13, r24 268b0: c7 01 movw r24, r14 268b2: 0f 94 19 db call 0x3b632 ; 0x3b632 <__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; 268b6: 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;} 268b8: 93 e1 ldi r25, 0x13 ; 19 268ba: 9d 19 sub r25, r13 268bc: 8c 0f add r24, r28 268be: 89 17 cp r24, r25 268c0: 08 f4 brcc .+2 ; 0x268c4 268c2: 89 2f mov r24, r25 268c4: 83 31 cpi r24, 0x13 ; 19 268c6: 08 f0 brcs .+2 ; 0x268ca 268c8: 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 ? '>': ' '); 268ca: 40 e2 ldi r20, 0x20 ; 32 268cc: d2 30 cpi r29, 0x02 ; 2 268ce: 09 f4 brne .+2 ; 0x268d2 268d0: 4e e3 ldi r20, 0x3E ; 62 268d2: 63 e0 ldi r22, 0x03 ; 3 268d4: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_puts_P(third_choice); 268d8: c8 01 movw r24, r16 } } 268da: df 91 pop r29 268dc: cf 91 pop r28 268de: 1f 91 pop r17 268e0: 0f 91 pop r16 268e2: ff 90 pop r15 268e4: ef 90 pop r14 268e6: df 90 pop r13 268e8: 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); 268ea: 0c 94 00 70 jmp 0xe000 ; 0xe000 } } 268ee: df 91 pop r29 268f0: cf 91 pop r28 268f2: 1f 91 pop r17 268f4: 0f 91 pop r16 268f6: ff 90 pop r15 268f8: ef 90 pop r14 268fa: df 90 pop r13 268fc: cf 90 pop r12 268fe: 08 95 ret 00026900 : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 26900: cf 93 push r28 26902: df 93 push r29 26904: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 26906: 80 e0 ldi r24, 0x00 ; 0 26908: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_clear(); 2690c: 0e 94 48 70 call 0xe090 ; 0xe090 return lcd_display_message_fullscreen_nonBlocking_P(msg); 26910: ce 01 movw r24, r28 } 26912: df 91 pop r29 26914: 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); 26916: 0d 94 87 2b jmp 0x2570e ; 0x2570e 0002691a : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 2691a: cf 92 push r12 2691c: df 92 push r13 2691e: ef 92 push r14 26920: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 26922: 80 e0 ldi r24, 0x00 ; 0 26924: 90 e0 ldi r25, 0x00 ; 0 26926: a8 ec ldi r26, 0xC8 ; 200 26928: b2 e4 ldi r27, 0x42 ; 66 2692a: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 2692e: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 26932: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 26936: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 2693a: 65 e5 ldi r22, 0x55 ; 85 2693c: 75 e5 ldi r23, 0x55 ; 85 2693e: 85 e5 ldi r24, 0x55 ; 85 26940: 91 e4 ldi r25, 0x41 ; 65 26942: 0f 94 5d ba call 0x374ba ; 0x374ba delay_keep_alive(2000); 26946: 80 ed ldi r24, 0xD0 ; 208 26948: 97 e0 ldi r25, 0x07 ; 7 2694a: 0e 94 ff 8e call 0x11dfe ; 0x11dfe lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 2694e: 8e e2 ldi r24, 0x2E ; 46 26950: 90 e5 ldi r25, 0x50 ; 80 26952: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26956: 0f 94 80 34 call 0x26900 ; 0x26900 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 2695a: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 2695e: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 26962: 07 2e mov r0, r23 26964: 00 0c add r0, r0 26966: 88 0b sbc r24, r24 26968: 99 0b sbc r25, r25 2696a: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 2696e: 9b 01 movw r18, r22 26970: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 26972: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 26976: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 2697a: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 2697e: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 26982: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 26986: 9f 77 andi r25, 0x7F ; 127 26988: 20 e0 ldi r18, 0x00 ; 0 2698a: 30 e0 ldi r19, 0x00 ; 0 2698c: 40 ea ldi r20, 0xA0 ; 160 2698e: 50 e4 ldi r21, 0x40 ; 64 26990: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 26994: 18 16 cp r1, r24 26996: b4 f5 brge .+108 ; 0x26a04 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 26998: 8e e2 ldi r24, 0x2E ; 46 2699a: 90 e5 ldi r25, 0x50 ; 80 2699c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 269a0: 0f 94 80 34 call 0x26900 ; 0x26900 lcd_set_cursor(0, 4); 269a4: 64 e0 ldi r22, 0x04 ; 4 269a6: 80 e0 ldi r24, 0x00 ; 0 269a8: 0e 94 15 70 call 0xe02a ; 0xe02a 269ac: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 269b0: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 269b4: 07 2e mov r0, r23 269b6: 00 0c add r0, r0 269b8: 88 0b sbc r24, r24 269ba: 99 0b sbc r25, r25 269bc: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__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)); 269c0: 20 e0 ldi r18, 0x00 ; 0 269c2: 30 e0 ldi r19, 0x00 ; 0 269c4: 40 e0 ldi r20, 0x00 ; 0 269c6: 5f e3 ldi r21, 0x3F ; 63 269c8: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 269cc: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 269d0: 6b 01 movw r12, r22 269d2: 20 e0 ldi r18, 0x00 ; 0 269d4: 30 e0 ldi r19, 0x00 ; 0 269d6: 40 e0 ldi r20, 0x00 ; 0 269d8: 5f e3 ldi r21, 0x3F ; 63 269da: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 269de: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 269e2: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 269e6: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 269ea: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 269ee: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 269f2: a6 01 movw r20, r12 269f4: 82 e8 ldi r24, 0x82 ; 130 269f6: 0f 94 1d 2e call 0x25c3a ; 0x25c3a delay_keep_alive(1000); 269fa: 88 ee ldi r24, 0xE8 ; 232 269fc: 93 e0 ldi r25, 0x03 ; 3 269fe: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 26a02: ab cf rjmp .-170 ; 0x2695a } } 26a04: ff 90 pop r15 26a06: ef 90 pop r14 26a08: df 90 pop r13 26a0a: cf 90 pop r12 26a0c: 08 95 ret 00026a0e : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 26a0e: cf 92 push r12 26a10: df 92 push r13 26a12: ef 92 push r14 26a14: ff 92 push r15 26a16: 0f 93 push r16 26a18: 1f 93 push r17 26a1a: cf 93 push r28 26a1c: df 93 push r29 26a1e: d8 2e mov r13, r24 26a20: 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) 26a22: 01 e0 ldi r16, 0x01 ; 1 26a24: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 26a28: 81 11 cpse r24, r1 26a2a: 01 c0 rjmp .+2 ; 0x26a2e 26a2c: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 26a2e: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 26a32: 8d 2d mov r24, r13 26a34: 9c 2d mov r25, r12 26a36: 0f 94 80 34 call 0x26900 ; 0x26900 26a3a: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 26a3c: 0e 94 2d 72 call 0xe45a ; 0xe45a KEEPALIVE_STATE(PAUSED_FOR_USER); 26a40: 84 e0 ldi r24, 0x04 ; 4 26a42: 80 93 96 02 sts 0x0296, r24 ; 0x800296 * @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); 26a46: 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) { 26a48: 20 97 sbiw r28, 0x00 ; 0 26a4a: 29 f4 brne .+10 ; 0x26a56 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 26a4c: 49 e8 ldi r20, 0x89 ; 137 26a4e: 63 e0 ldi r22, 0x03 ; 3 26a50: 83 e1 ldi r24, 0x13 ; 19 26a52: 0e 94 35 70 call 0xe06a ; 0xe06a * @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); 26a56: 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); 26a58: 82 e3 ldi r24, 0x32 ; 50 26a5a: 90 e0 ldi r25, 0x00 ; 0 26a5c: 0e 94 ff 8e call 0x11dfe ; 0x11dfe if (lcd_clicked()) { 26a60: 0e 94 32 72 call 0xe464 ; 0xe464 26a64: 88 23 and r24, r24 26a66: 81 f0 breq .+32 ; 0x26a88 if (msg_next == NULL) { 26a68: 20 97 sbiw r28, 0x00 ; 0 26a6a: 81 f4 brne .+32 ; 0x26a8c KEEPALIVE_STATE(IN_HANDLER); 26a6c: 82 e0 ldi r24, 0x02 ; 2 26a6e: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 26a72: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 26a76: df 91 pop r29 26a78: cf 91 pop r28 26a7a: 1f 91 pop r17 26a7c: 0f 91 pop r16 26a7e: ff 90 pop r15 26a80: ef 90 pop r14 26a82: df 90 pop r13 26a84: cf 90 pop r12 26a86: 08 95 ret 26a88: 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) { 26a8a: 31 f7 brne .-52 ; 0x26a58 else { break; } } } if (multi_screen) { 26a8c: e1 14 cp r14, r1 26a8e: f1 04 cpc r15, r1 26a90: d9 f2 breq .-74 ; 0x26a48 if (msg_next == NULL) 26a92: 20 97 sbiw r28, 0x00 ; 0 26a94: 11 f4 brne .+4 ; 0x26a9a msg_next = msg; 26a96: cd 2d mov r28, r13 26a98: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 26a9a: ce 01 movw r24, r28 26a9c: 0f 94 80 34 call 0x26900 ; 0x26900 26aa0: ec 01 movw r28, r24 26aa2: d2 cf rjmp .-92 ; 0x26a48 00026aa4 : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 26aa4: cf 93 push r28 26aa6: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 26aa8: 80 e2 ldi r24, 0x20 ; 32 26aaa: 92 e5 ldi r25, 0x52 ; 82 26aac: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26ab0: 0f 94 07 35 call 0x26a0e ; 0x26a0e _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 26ab4: 80 91 98 13 lds r24, 0x1398 ; 0x801398 26ab8: 81 30 cpi r24, 0x01 ; 1 26aba: 69 f4 brne .+26 ; 0x26ad6 { lcd_show_fullscreen_message_and_wait_P( 26abc: 87 ec ldi r24, 0xC7 ; 199 26abe: 91 e5 ldi r25, 0x51 ; 81 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 26ac0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26ac4: 0f 94 07 35 call 0x26a0e ; 0x26a0e _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 26ac8: 85 ef ldi r24, 0xF5 ; 245 26aca: 90 e5 ldi r25, 0x50 ; 80 26acc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 _T(MSG_WIZARD_V2_CAL_2)); } 26ad0: 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( 26ad2: 0d 94 07 35 jmp 0x26a0e ; 0x26a0e if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 26ad6: cc 23 and r28, r28 26ad8: b9 f3 breq .-18 ; 0x26ac8 { lcd_show_fullscreen_message_and_wait_P( 26ada: 85 e9 ldi r24, 0x95 ; 149 26adc: 91 e5 ldi r25, 0x51 ; 81 26ade: f0 cf rjmp .-32 ; 0x26ac0 00026ae0 : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 26ae0: 80 91 98 13 lds r24, 0x1398 ; 0x801398 26ae4: 81 30 cpi r24, 0x01 ; 1 26ae6: 71 f4 brne .+28 ; 0x26b04 lcd_show_fullscreen_message_and_wait_P( 26ae8: 8c e9 ldi r24, 0x9C ; 156 26aea: 90 e5 ldi r25, 0x50 ; 80 26aec: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26af0: 0f 94 07 35 call 0x26a0e ; 0x26a0e _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; 26af4: 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; 26af6: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 26afa: 61 e0 ldi r22, 0x01 ; 1 26afc: 8c e4 ldi r24, 0x4C ; 76 26afe: 95 ea ldi r25, 0xA5 ; 165 26b00: 0c 94 cb 89 jmp 0x11396 ; 0x11396 // 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( 26b04: 80 e5 ldi r24, 0x50 ; 80 26b06: 90 e5 ldi r25, 0x50 ; 80 26b08: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26b0c: 0f 94 07 35 call 0x26a0e ; 0x26a0e _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 26b10: 80 e0 ldi r24, 0x00 ; 0 26b12: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_clear(); 26b16: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 26b1a: 88 e3 ldi r24, 0x38 ; 56 26b1c: 9d e5 ldi r25, 0x5D ; 93 26b1e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26b22: ac 01 movw r20, r24 26b24: 62 e0 ldi r22, 0x02 ; 2 26b26: 80 e0 ldi r24, 0x00 ; 0 26b28: 0e 94 29 70 call 0xe052 ; 0xe052 eFilamentAction = FilamentAction::Load; 26b2c: 81 e0 ldi r24, 0x01 ; 1 26b2e: e3 cf rjmp .-58 ; 0x26af6 00026b30 : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 26b30: cf 93 push r28 26b32: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 26b34: 10 92 75 07 sts 0x0775, r1 ; 0x800775 disable_x(); 26b38: 17 9a sbi 0x02, 7 ; 2 26b3a: 10 92 40 07 sts 0x0740, r1 ; 0x800740 disable_y(); 26b3e: 16 9a sbi 0x02, 6 ; 2 26b40: 10 92 41 07 sts 0x0741, r1 ; 0x800741 disable_z(); disable_e0(); 26b44: 14 9a sbi 0x02, 4 ; 2 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 26b46: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 26b4a: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 26b4e: 68 2f mov r22, r24 26b50: 86 ea ldi r24, 0xA6 ; 166 26b52: 9f e0 ldi r25, 0x0F ; 15 26b54: 0f 94 7f dd call 0x3bafe ; 0x3bafe 26b58: 6c 2f mov r22, r28 26b5a: 8f ea ldi r24, 0xAF ; 175 26b5c: 9f e0 ldi r25, 0x0F ; 15 26b5e: 0f 94 7f dd call 0x3bafe ; 0x3bafe // 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) { 26b62: cc 23 and r28, r28 26b64: 89 f0 breq .+34 ; 0x26b88 SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 26b66: 81 e0 ldi r24, 0x01 ; 1 26b68: 95 ea ldi r25, 0xA5 ; 165 26b6a: 0e 94 86 7b call 0xf70c ; 0xf70c lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 26b6e: 8d e3 ldi r24, 0x3D ; 61 26b70: 9e e4 ldi r25, 0x4E ; 78 } else { SERIAL_ECHOLNPGM("PINDA calibration failed. Continue with pressing the knob."); lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 26b72: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26b76: 0f 94 07 35 call 0x26a0e ; 0x26a0e } lcd_update_enable(true); 26b7a: 81 e0 ldi r24, 0x01 ; 1 26b7c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_update(2); 26b80: 82 e0 ldi r24, 0x02 ; 2 } 26b82: 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); 26b84: 0c 94 dc 6f jmp 0xdfb8 ; 0xdfb8 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."); 26b88: 86 ec ldi r24, 0xC6 ; 198 26b8a: 94 ea ldi r25, 0xA4 ; 164 26b8c: 0e 94 86 7b call 0xf70c ; 0xf70c lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 26b90: 82 e2 ldi r24, 0x22 ; 34 26b92: 9e e4 ldi r25, 0x4E ; 78 26b94: ee cf rjmp .-36 ; 0x26b72 00026b96 : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 26b96: 1f 93 push r17 26b98: cf 93 push r28 26b9a: 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); 26b9c: 64 e6 ldi r22, 0x64 ; 100 26b9e: 70 e0 ldi r23, 0x00 ; 0 26ba0: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 26ba4: 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++) { 26ba6: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 26ba8: 4e e2 ldi r20, 0x2E ; 46 26baa: 63 e0 ldi r22, 0x03 ; 3 26bac: 81 2f mov r24, r17 26bae: 0e 94 35 70 call 0xe06a ; 0xe06a //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 26bb2: ce 01 movw r24, r28 26bb4: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 26bb8: ce 01 movw r24, r28 26bba: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 26bbe: ce 01 movw r24, r28 26bc0: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 26bc4: ce 01 movw r24, r28 26bc6: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 26bca: ce 01 movw r24, r28 26bcc: 0e 94 ff 8e call 0x11dfe ; 0x11dfe } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 26bd0: 1f 5f subi r17, 0xFF ; 255 26bd2: 14 31 cpi r17, 0x14 ; 20 26bd4: 49 f7 brne .-46 ; 0x26ba8 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 26bd6: df 91 pop r29 26bd8: cf 91 pop r28 26bda: 1f 91 pop r17 26bdc: 08 95 ret 00026bde : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 26bde: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 26be2: 08 95 ret 00026be4 : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 26be4: cf 93 push r28 MENU_BEGIN(); 26be6: 0f 94 da ce call 0x39db4 ; 0x39db4 26bea: 10 92 15 05 sts 0x0515, r1 ; 0x800515 26bee: 80 91 15 05 lds r24, 0x0515 ; 0x800515 26bf2: 84 30 cpi r24, 0x04 ; 4 26bf4: 08 f0 brcs .+2 ; 0x26bf8 26bf6: a1 c0 rjmp .+322 ; 0x26d3a 26bf8: 10 92 18 05 sts 0x0518, r1 ; 0x800518 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 26bfc: 8f e5 ldi r24, 0x5F ; 95 26bfe: 9f e0 ldi r25, 0x0F ; 15 26c00: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 26c04: 81 11 cpse r24, r1 26c06: 10 c0 rjmp .+32 ; 0x26c28 { ON_MENU_LEAVE( 26c08: 0f 94 5a cd call 0x39ab4 ; 0x39ab4 26c0c: 81 11 cpse r24, r1 26c0e: 0f 94 ef 35 call 0x26bde ; 0x26bde clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 26c12: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 26c16: 8a 30 cpi r24, 0x0A ; 10 26c18: 09 f4 brne .+2 ; 0x26c1c 26c1a: 8c c0 rjmp .+280 ; 0x26d34 26c1c: 8a e1 ldi r24, 0x1A ; 26 26c1e: 9e e3 ldi r25, 0x3E ; 62 26c20: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26c24: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a 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(); 26c28: 0f 94 de 21 call 0x243bc ; 0x243bc 26c2c: 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); 26c2e: 89 e6 ldi r24, 0x69 ; 105 26c30: 94 ea ldi r25, 0xA4 ; 164 26c32: cc 23 and r28, r28 26c34: 11 f0 breq .+4 ; 0x26c3a 26c36: 88 e7 ldi r24, 0x78 ; 120 26c38: 94 ea ldi r25, 0xA4 ; 164 26c3a: 66 ef ldi r22, 0xF6 ; 246 26c3c: 79 e3 ldi r23, 0x39 ; 57 26c3e: 0f 94 08 d1 call 0x3a210 ; 0x3a210 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); 26c42: 8e e4 ldi r24, 0x4E ; 78 26c44: 94 ea ldi r25, 0xA4 ; 164 26c46: cc 23 and r28, r28 26c48: 11 f0 breq .+4 ; 0x26c4e 26c4a: 8d e5 ldi r24, 0x5D ; 93 26c4c: 94 ea ldi r25, 0xA4 ; 164 26c4e: 6e eb ldi r22, 0xBE ; 190 26c50: 7b e3 ldi r23, 0x3B ; 59 26c52: 0f 94 08 d1 call 0x3a210 ; 0x3a210 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); 26c56: 82 e3 ldi r24, 0x32 ; 50 26c58: 94 ea ldi r25, 0xA4 ; 164 26c5a: cc 23 and r28, r28 26c5c: 11 f0 breq .+4 ; 0x26c62 26c5e: 82 e4 ldi r24, 0x42 ; 66 26c60: 94 ea ldi r25, 0xA4 ; 164 26c62: 60 eb ldi r22, 0xB0 ; 176 26c64: 79 e3 ldi r23, 0x39 ; 57 26c66: 0f 94 08 d1 call 0x3a210 ; 0x3a210 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); 26c6a: 86 e1 ldi r24, 0x16 ; 22 26c6c: 94 ea ldi r25, 0xA4 ; 164 26c6e: cc 23 and r28, r28 26c70: 11 f0 breq .+4 ; 0x26c76 26c72: 86 e2 ldi r24, 0x26 ; 38 26c74: 94 ea ldi r25, 0xA4 ; 164 26c76: 6a e0 ldi r22, 0x0A ; 10 26c78: 7a e3 ldi r23, 0x3A ; 58 26c7a: 0f 94 08 d1 call 0x3a210 ; 0x3a210 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); 26c7e: 8b ef ldi r24, 0xFB ; 251 26c80: 93 ea ldi r25, 0xA3 ; 163 26c82: cc 23 and r28, r28 26c84: 11 f0 breq .+4 ; 0x26c8a 26c86: 8a e0 ldi r24, 0x0A ; 10 26c88: 94 ea ldi r25, 0xA4 ; 164 26c8a: 64 ef ldi r22, 0xF4 ; 244 26c8c: 7a e3 ldi r23, 0x3A ; 58 26c8e: 0f 94 08 d1 call 0x3a210 ; 0x3a210 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); 26c92: 80 ee ldi r24, 0xE0 ; 224 26c94: 93 ea ldi r25, 0xA3 ; 163 26c96: cc 23 and r28, r28 26c98: 11 f0 breq .+4 ; 0x26c9e 26c9a: 8f ee ldi r24, 0xEF ; 239 26c9c: 93 ea ldi r25, 0xA3 ; 163 26c9e: 60 ee ldi r22, 0xE0 ; 224 26ca0: 7a e3 ldi r23, 0x3A ; 58 26ca2: 0f 94 08 d1 call 0x3a210 ; 0x3a210 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); 26ca6: 84 ec ldi r24, 0xC4 ; 196 26ca8: 93 ea ldi r25, 0xA3 ; 163 26caa: cc 23 and r28, r28 26cac: 11 f0 breq .+4 ; 0x26cb2 26cae: 84 ed ldi r24, 0xD4 ; 212 26cb0: 93 ea ldi r25, 0xA3 ; 163 26cb2: 62 e6 ldi r22, 0x62 ; 98 26cb4: 7b e3 ldi r23, 0x3B ; 59 26cb6: 0f 94 08 d1 call 0x3a210 ; 0x3a210 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); 26cba: 88 ea ldi r24, 0xA8 ; 168 26cbc: 93 ea ldi r25, 0xA3 ; 163 26cbe: cc 23 and r28, r28 26cc0: 11 f0 breq .+4 ; 0x26cc6 26cc2: 88 eb ldi r24, 0xB8 ; 184 26cc4: 93 ea ldi r25, 0xA3 ; 163 26cc6: 62 e2 ldi r22, 0x22 ; 34 26cc8: 7b e3 ldi r23, 0x3B ; 59 26cca: 0f 94 08 d1 call 0x3a210 ; 0x3a210 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); 26cce: 8c e8 ldi r24, 0x8C ; 140 26cd0: 93 ea ldi r25, 0xA3 ; 163 26cd2: cc 23 and r28, r28 26cd4: 11 f0 breq .+4 ; 0x26cda 26cd6: 8c e9 ldi r24, 0x9C ; 156 26cd8: 93 ea ldi r25, 0xA3 ; 163 26cda: 64 e4 ldi r22, 0x44 ; 68 26cdc: 7b e3 ldi r23, 0x3B ; 59 26cde: 0f 94 08 d1 call 0x3a210 ; 0x3a210 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); 26ce2: 81 e7 ldi r24, 0x71 ; 113 26ce4: 93 ea ldi r25, 0xA3 ; 163 26ce6: cc 23 and r28, r28 26ce8: 11 f0 breq .+4 ; 0x26cee 26cea: 80 e8 ldi r24, 0x80 ; 128 26cec: 93 ea ldi r25, 0xA3 ; 163 26cee: 60 ea ldi r22, 0xA0 ; 160 26cf0: 7b e3 ldi r23, 0x3B ; 59 26cf2: 0f 94 08 d1 call 0x3a210 ; 0x3a210 } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); 26cf6: 8f e5 ldi r24, 0x5F ; 95 26cf8: 9f e0 ldi r25, 0x0F ; 15 26cfa: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 26cfe: 81 11 cpse r24, r1 26d00: 0c c0 rjmp .+24 ; 0x26d1a 26d02: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 26d06: 89 30 cpi r24, 0x09 ; 9 26d08: 41 f4 brne .+16 ; 0x26d1a 26d0a: 8c e6 ldi r24, 0x6C ; 108 26d0c: 9c e4 ldi r25, 0x4C ; 76 26d0e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 26d12: 6e e1 ldi r22, 0x1E ; 30 26d14: 7b e3 ldi r23, 0x3B ; 59 26d16: 0f 94 57 ce call 0x39cae ; 0x39cae MENU_END(); 26d1a: 0f 94 ae ce call 0x39d5c ; 0x39d5c mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 26d1e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 26d22: 8f 5f subi r24, 0xFF ; 255 26d24: 80 93 15 05 sts 0x0515, r24 ; 0x800515 26d28: 80 91 17 05 lds r24, 0x0517 ; 0x800517 26d2c: 8f 5f subi r24, 0xFF ; 255 26d2e: 80 93 17 05 sts 0x0517, r24 ; 0x800517 26d32: 5d cf rjmp .-326 ; 0x26bee 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)); 26d34: 8b e7 ldi r24, 0x7B ; 123 26d36: 90 e4 ldi r25, 0x40 ; 64 26d38: 73 cf rjmp .-282 ; 0x26c20 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(); } 26d3a: cf 91 pop r28 26d3c: 08 95 ret 00026d3e : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 26d3e: 89 e0 ldi r24, 0x09 ; 9 26d40: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 lcd_generic_preheat_menu(); 26d44: 0d 94 f2 35 jmp 0x26be4 ; 0x26be4 00026d48 : // 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); 26d48: 81 e0 ldi r24, 0x01 ; 1 26d4a: 0e 94 0b 70 call 0xe016 ; 0xe016 if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 26d4e: 0f 94 a4 75 call 0x2eb48 ; 0x2eb48 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; 26d52: 90 91 80 13 lds r25, 0x1380 ; 0x801380 26d56: 93 36 cpi r25, 0x63 ; 99 26d58: 09 f4 brne .+2 ; 0x26d5c 26d5a: 9f ef ldi r25, 0xFF ; 255 26d5c: 89 13 cpse r24, r25 26d5e: 0e c0 rjmp .+28 ; 0x26d7c lcd_putc('F'); 26d60: 86 e4 ldi r24, 0x46 ; 70 26d62: 0e 94 04 70 call 0xe008 ; 0xe008 lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 26d66: 0f 94 a4 75 call 0x2eb48 ; 0x2eb48 26d6a: 8f 3f cpi r24, 0xFF ; 255 26d6c: 29 f0 breq .+10 ; 0x26d78 26d6e: 8f 5c subi r24, 0xCF ; 207 26d70: 0e 94 04 70 call 0xe008 ; 0xe008 26d74: 83 e0 ldi r24, 0x03 ; 3 26d76: 08 95 ret 26d78: 8f e3 ldi r24, 0x3F ; 63 26d7a: fa cf rjmp .-12 ; 0x26d70 chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 26d7c: 8f 3f cpi r24, 0xFF ; 255 26d7e: 89 f0 breq .+34 ; 0x26da2 26d80: 8f 5c subi r24, 0xCF ; 207 26d82: 0e 94 04 70 call 0xe008 ; 0xe008 lcd_putc('>'); 26d86: 8e e3 ldi r24, 0x3E ; 62 26d88: 0e 94 04 70 call 0xe008 ; 0xe008 26d8c: 80 91 80 13 lds r24, 0x1380 ; 0x801380 26d90: 83 36 cpi r24, 0x63 ; 99 26d92: 49 f0 breq .+18 ; 0x26da6 lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 26d94: 8f 3f cpi r24, 0xFF ; 255 26d96: 39 f0 breq .+14 ; 0x26da6 26d98: 8f 5c subi r24, 0xCF ; 207 26d9a: 0e 94 04 70 call 0xe008 ; 0xe008 chars += 3; 26d9e: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 26da0: 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'); 26da2: 8f e3 ldi r24, 0x3F ; 63 26da4: ee cf rjmp .-36 ; 0x26d82 lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 26da6: 8f e3 ldi r24, 0x3F ; 63 26da8: f8 cf rjmp .-16 ; 0x26d9a 00026daa <__vector_51>: } return 1; //all characters match - return 1 } ISR(USART2_RX_vect) { 26daa: 1f 92 push r1 26dac: 0f 92 push r0 26dae: 0f b6 in r0, 0x3f ; 63 26db0: 0f 92 push r0 26db2: 11 24 eor r1, r1 26db4: 0b b6 in r0, 0x3b ; 59 26db6: 0f 92 push r0 26db8: 2f 93 push r18 26dba: 3f 93 push r19 26dbc: 4f 93 push r20 26dbe: 5f 93 push r21 26dc0: 6f 93 push r22 26dc2: 7f 93 push r23 26dc4: 8f 93 push r24 26dc6: 9f 93 push r25 26dc8: af 93 push r26 26dca: bf 93 push r27 26dcc: ef 93 push r30 26dce: ff 93 push r31 //printf_P(PSTR("USART2_RX_vect \n") ); if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 26dd0: 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 26dd4: 80 91 23 05 lds r24, 0x0523 ; 0x800523 uint8_t buf_r = ptr[2]; //get read index 26dd8: 90 91 24 05 lds r25, 0x0524 ; 0x800524 _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 26ddc: e8 2f mov r30, r24 26dde: f0 e0 ldi r31, 0x00 ; 0 26de0: ea 5d subi r30, 0xDA ; 218 26de2: fa 4f sbci r31, 0xFA ; 250 26de4: 20 83 st Z, r18 buf_w++; //incerment write index 26de6: 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 26de8: 20 91 22 05 lds r18, 0x0522 ; 0x800522 26dec: 82 17 cp r24, r18 26dee: 08 f0 brcs .+2 ; 0x26df2 <__vector_51+0x48> 26df0: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 26df2: 98 13 cpse r25, r24 26df4: 17 c0 rjmp .+46 ; 0x26e24 <__vector_51+0x7a> { //rx buffer full //uart2_rx_clr(); //for sure, clear input buffer puts_P(PSTR("USART2 rx Full!!!")); 26df6: 8d e8 ldi r24, 0x8D ; 141 26df8: 91 ea ldi r25, 0xA1 ; 161 26dfa: 0f 94 44 dc call 0x3b888 ; 0x3b888 } } 26dfe: ff 91 pop r31 26e00: ef 91 pop r30 26e02: bf 91 pop r27 26e04: af 91 pop r26 26e06: 9f 91 pop r25 26e08: 8f 91 pop r24 26e0a: 7f 91 pop r23 26e0c: 6f 91 pop r22 26e0e: 5f 91 pop r21 26e10: 4f 91 pop r20 26e12: 3f 91 pop r19 26e14: 2f 91 pop r18 26e16: 0f 90 pop r0 26e18: 0b be out 0x3b, r0 ; 59 26e1a: 0f 90 pop r0 26e1c: 0f be out 0x3f, r0 ; 63 26e1e: 0f 90 pop r0 26e20: 1f 90 pop r1 26e22: 18 95 reti ptr[1] = buf_w; //store write index 26e24: 80 93 23 05 sts 0x0523, r24 ; 0x800523 26e28: ea cf rjmp .-44 ; 0x26dfe <__vector_51+0x54> 00026e2a <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 26e2a: 1f 92 push r1 26e2c: 0f 92 push r0 26e2e: 0f b6 in r0, 0x3f ; 63 26e30: 0f 92 push r0 26e32: 11 24 eor r1, r1 26e34: 0b b6 in r0, 0x3b ; 59 26e36: 0f 92 push r0 26e38: 8f 93 push r24 26e3a: 9f 93 push r25 26e3c: ef 93 push r30 26e3e: ff 93 push r31 WRITE(BEEPER, 0); 26e40: 9f b7 in r25, 0x3f ; 63 26e42: f8 94 cli 26e44: e2 e0 ldi r30, 0x02 ; 2 26e46: f1 e0 ldi r31, 0x01 ; 1 26e48: 80 81 ld r24, Z 26e4a: 8b 7f andi r24, 0xFB ; 251 26e4c: 80 83 st Z, r24 26e4e: 9f bf out 0x3f, r25 ; 63 } 26e50: ff 91 pop r31 26e52: ef 91 pop r30 26e54: 9f 91 pop r25 26e56: 8f 91 pop r24 26e58: 0f 90 pop r0 26e5a: 0b be out 0x3b, r0 ; 59 26e5c: 0f 90 pop r0 26e5e: 0f be out 0x3f, r0 ; 63 26e60: 0f 90 pop r0 26e62: 1f 90 pop r1 26e64: 18 95 reti 00026e66 <__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) { 26e66: 1f 92 push r1 26e68: 0f 92 push r0 26e6a: 0f b6 in r0, 0x3f ; 63 26e6c: 0f 92 push r0 26e6e: 11 24 eor r1, r1 26e70: 0b b6 in r0, 0x3b ; 59 26e72: 0f 92 push r0 26e74: 8f 93 push r24 26e76: 9f 93 push r25 26e78: ef 93 push r30 26e7a: ff 93 push r31 WRITE(BEEPER, 1); 26e7c: 9f b7 in r25, 0x3f ; 63 26e7e: f8 94 cli 26e80: e2 e0 ldi r30, 0x02 ; 2 26e82: f1 e0 ldi r31, 0x01 ; 1 26e84: 80 81 ld r24, Z 26e86: 84 60 ori r24, 0x04 ; 4 26e88: 80 83 st Z, r24 26e8a: 9f bf out 0x3f, r25 ; 63 } 26e8c: ff 91 pop r31 26e8e: ef 91 pop r30 26e90: 9f 91 pop r25 26e92: 8f 91 pop r24 26e94: 0f 90 pop r0 26e96: 0b be out 0x3b, r0 ; 59 26e98: 0f 90 pop r0 26e9a: 0f be out 0x3f, r0 ; 63 26e9c: 0f 90 pop r0 26e9e: 1f 90 pop r1 26ea0: 18 95 reti 00026ea2 : if (cval) cval[cl] = sum / cnt; return ++cl; } bool tmc2130_home_calibrate(uint8_t axis) { 26ea2: 6f 92 push r6 26ea4: 7f 92 push r7 26ea6: 8f 92 push r8 26ea8: 9f 92 push r9 26eaa: af 92 push r10 26eac: bf 92 push r11 26eae: df 92 push r13 26eb0: ef 92 push r14 26eb2: ff 92 push r15 26eb4: 0f 93 push r16 26eb6: 1f 93 push r17 26eb8: cf 93 push r28 26eba: df 93 push r29 26ebc: cd b7 in r28, 0x3d ; 61 26ebe: de b7 in r29, 0x3e ; 62 26ec0: e0 97 sbiw r28, 0x30 ; 48 26ec2: 0f b6 in r0, 0x3f ; 63 26ec4: f8 94 cli 26ec6: de bf out 0x3e, r29 ; 62 26ec8: 0f be out 0x3f, r0 ; 63 26eca: cd bf out 0x3d, r28 ; 61 26ecc: d8 2e mov r13, r24 uint8_t step[16]; uint8_t cnt[16]; uint8_t val[16]; homeaxis(axis, 16, step); 26ece: ae 01 movw r20, r28 26ed0: 4f 5f subi r20, 0xFF ; 255 26ed2: 5f 4f sbci r21, 0xFF ; 255 26ed4: 60 e1 ldi r22, 0x10 ; 16 26ed6: 0e 94 76 7c call 0xf8ec ; 0xf8ec bubblesort_uint8(step, 16, 0); 26eda: 50 e0 ldi r21, 0x00 ; 0 26edc: 40 e0 ldi r20, 0x00 ; 0 26ede: 60 e1 ldi r22, 0x10 ; 16 26ee0: ce 01 movw r24, r28 26ee2: 01 96 adiw r24, 0x01 ; 1 26ee4: 0f 94 98 1d call 0x23b30 ; 0x23b30 puts_P(PSTR("sorted samples:")); 26ee8: 8d e7 ldi r24, 0x7D ; 125 26eea: 91 ea ldi r25, 0xA1 ; 161 26eec: 0f 94 44 dc call 0x3b888 ; 0x3b888 26ef0: 9e 01 movw r18, r28 26ef2: 2f 5f subi r18, 0xFF ; 255 26ef4: 3f 4f sbci r19, 0xFF ; 255 26ef6: 59 01 movw r10, r18 26ef8: 10 e0 ldi r17, 0x00 ; 0 26efa: 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]); 26efc: 2c e6 ldi r18, 0x6C ; 108 26efe: e2 2e mov r14, r18 26f00: 21 ea ldi r18, 0xA1 ; 161 26f02: f2 2e mov r15, r18 26f04: d5 01 movw r26, r10 26f06: 8d 91 ld r24, X+ 26f08: 5d 01 movw r10, r26 26f0a: 1f 92 push r1 26f0c: 8f 93 push r24 26f0e: 1f 93 push r17 26f10: 0f 93 push r16 26f12: ff 92 push r15 26f14: ef 92 push r14 26f16: 0f 94 1d dc call 0x3b83a ; 0x3b83a 26f1a: 0f 5f subi r16, 0xFF ; 255 26f1c: 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++) 26f1e: 0f 90 pop r0 26f20: 0f 90 pop r0 26f22: 0f 90 pop r0 26f24: 0f 90 pop r0 26f26: 0f 90 pop r0 26f28: 0f 90 pop r0 26f2a: 00 31 cpi r16, 0x10 ; 16 26f2c: 11 05 cpc r17, r1 26f2e: 51 f7 brne .-44 ; 0x26f04 } 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]; 26f30: 09 81 ldd r16, Y+1 ; 0x01 26f32: 10 e0 ldi r17, 0x00 ; 0 26f34: 5e 01 movw r10, r28 26f36: b2 e0 ldi r27, 0x02 ; 2 26f38: ab 0e add r10, r27 26f3a: b1 1c adc r11, r1 26f3c: ee 24 eor r14, r14 26f3e: e3 94 inc r14 26f40: f1 2c mov r15, r1 26f42: ec 0e add r14, r28 26f44: fd 1e adc r15, r29 26f46: e0 e1 ldi r30, 0x10 ; 16 26f48: ee 0e add r14, r30 26f4a: f1 1c adc r15, r1 uint8_t cl = 0; 26f4c: 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; 26f4e: 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]; 26f50: d5 01 movw r26, r10 26f52: 3d 91 ld r19, X+ 26f54: 5d 01 movw r10, r26 uint8_t val = sum / cnt; 26f56: 62 2f mov r22, r18 26f58: 70 e0 ldi r23, 0x00 ; 0 26f5a: c8 01 movw r24, r16 26f5c: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> uint8_t dif = 0; if (val > d) dif = val - d; 26f60: 46 2f mov r20, r22 26f62: 43 1b sub r20, r19 26f64: 36 17 cp r19, r22 26f66: 10 f0 brcs .+4 ; 0x26f6c else dif = d - val; 26f68: 43 2f mov r20, r19 26f6a: 46 1b sub r20, r22 26f6c: 83 2f mov r24, r19 26f6e: 90 e0 ldi r25, 0x00 ; 0 if (dif <= tol) 26f70: 42 30 cpi r20, 0x02 ; 2 26f72: 08 f0 brcs .+2 ; 0x26f76 26f74: 47 c0 rjmp .+142 ; 0x27004 { cnt += 1; 26f76: 2f 5f subi r18, 0xFF ; 255 sum += d; 26f78: 08 0f add r16, r24 26f7a: 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++) 26f7c: ae 14 cp r10, r14 26f7e: bf 04 cpc r11, r15 26f80: 39 f7 brne .-50 ; 0x26f50 cnt = 1; sum = d; cl += 1; } } if (ccnt) ccnt[cl] = cnt; 26f82: ae 2e mov r10, r30 26f84: b1 2c mov r11, r1 26f86: a1 e1 ldi r26, 0x11 ; 17 26f88: b0 e0 ldi r27, 0x00 ; 0 26f8a: ac 0f add r26, r28 26f8c: bd 1f adc r27, r29 26f8e: aa 0d add r26, r10 26f90: bb 1d adc r27, r11 26f92: 2c 93 st X, r18 if (cval) cval[cl] = sum / cnt; 26f94: 7e 01 movw r14, r28 26f96: b1 e2 ldi r27, 0x21 ; 33 26f98: eb 0e add r14, r27 26f9a: f1 1c adc r15, r1 26f9c: ae 0c add r10, r14 26f9e: bf 1c adc r11, r15 26fa0: 62 2f mov r22, r18 26fa2: 70 e0 ldi r23, 0x00 ; 0 26fa4: c8 01 movw r24, r16 26fa6: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 26faa: d5 01 movw r26, r10 26fac: 6c 93 st X, r22 return ++cl; 26fae: 11 e0 ldi r17, 0x01 ; 1 26fb0: 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:")); 26fb2: 82 e6 ldi r24, 0x62 ; 98 26fb4: 91 ea ldi r25, 0xA1 ; 161 26fb6: 0f 94 44 dc call 0x3b888 ; 0x3b888 26fba: fe 01 movw r30, r28 26fbc: 71 96 adiw r30, 0x11 ; 17 26fbe: 3f 01 movw r6, r30 26fc0: 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]); 26fc2: 8a e4 ldi r24, 0x4A ; 74 26fc4: 88 2e mov r8, r24 26fc6: 81 ea ldi r24, 0xA1 ; 161 26fc8: 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++) 26fca: 8a 2d mov r24, r10 26fcc: 8e 19 sub r24, r14 26fce: 81 17 cp r24, r17 26fd0: 70 f5 brcc .+92 ; 0x2702e 26fd2: c5 01 movw r24, r10 26fd4: 8e 19 sub r24, r14 26fd6: 9f 09 sbc r25, r15 printf_P(PSTR(" i=%2d cnt=%2d val=%2d\n"), i, cnt[i], val[i]); 26fd8: d5 01 movw r26, r10 26fda: 3d 91 ld r19, X+ 26fdc: 5d 01 movw r10, r26 26fde: f3 01 movw r30, r6 26fe0: 21 91 ld r18, Z+ 26fe2: 3f 01 movw r6, r30 26fe4: 1f 92 push r1 26fe6: 3f 93 push r19 26fe8: 1f 92 push r1 26fea: 2f 93 push r18 26fec: 9f 93 push r25 26fee: 8f 93 push r24 26ff0: 9f 92 push r9 26ff2: 8f 92 push r8 26ff4: 0f 94 1d dc call 0x3b83a ; 0x3b83a 26ff8: 0f b6 in r0, 0x3f ; 63 26ffa: f8 94 cli 26ffc: de bf out 0x3e, r29 ; 62 26ffe: 0f be out 0x3f, r0 ; 63 27000: cd bf out 0x3d, r28 ; 61 27002: e3 cf rjmp .-58 ; 0x26fca 27004: 4e 2f mov r20, r30 27006: 50 e0 ldi r21, 0x00 ; 0 cnt += 1; sum += d; } else { if (ccnt) ccnt[cl] = cnt; 27008: a1 e1 ldi r26, 0x11 ; 17 2700a: b0 e0 ldi r27, 0x00 ; 0 2700c: ac 0f add r26, r28 2700e: bd 1f adc r27, r29 27010: a4 0f add r26, r20 27012: b5 1f adc r27, r21 27014: ef 5f subi r30, 0xFF ; 255 27016: 2c 93 st X, r18 if (cval) cval[cl] = val; 27018: 21 e2 ldi r18, 0x21 ; 33 2701a: 30 e0 ldi r19, 0x00 ; 0 2701c: 2c 0f add r18, r28 2701e: 3d 1f adc r19, r29 27020: 42 0f add r20, r18 27022: 53 1f adc r21, r19 27024: da 01 movw r26, r20 27026: 6c 93 st X, r22 cnt = 1; sum = d; 27028: 8c 01 movw r16, r24 } else { if (ccnt) ccnt[cl] = cnt; if (cval) cval[cl] = val; cnt = 1; 2702a: 21 e0 ldi r18, 0x01 ; 1 2702c: a7 cf rjmp .-178 ; 0x26f7c 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); 2702e: a7 01 movw r20, r14 27030: 61 2f mov r22, r17 27032: ce 01 movw r24, r28 27034: 41 96 adiw r24, 0x11 ; 17 27036: 0f 94 98 1d call 0x23b30 ; 0x23b30 tmc2130_home_origin[axis] = val[cl-1]; 2703a: fe 01 movw r30, r28 2703c: e1 0f add r30, r17 2703e: f1 1d adc r31, r1 27040: 80 a1 ldd r24, Z+32 ; 0x20 27042: ed 2d mov r30, r13 27044: f0 e0 ldi r31, 0x00 ; 0 27046: ea 50 subi r30, 0x0A ; 10 27048: fb 4f sbci r31, 0xFB ; 251 2704a: 80 83 st Z, r24 printf_P(PSTR("result value: %d\n"), tmc2130_home_origin[axis]); 2704c: 1f 92 push r1 2704e: 8f 93 push r24 27050: 88 e3 ldi r24, 0x38 ; 56 27052: 91 ea ldi r25, 0xA1 ; 161 27054: 9f 93 push r25 27056: 8f 93 push r24 27058: 0f 94 1d dc call 0x3b83a ; 0x3b83a if (axis == X_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, tmc2130_home_origin[X_AXIS]); 2705c: 0f 90 pop r0 2705e: 0f 90 pop r0 27060: 0f 90 pop r0 27062: 0f 90 pop r0 27064: 60 91 f6 04 lds r22, 0x04F6 ; 0x8004f6 27068: 8e ef ldi r24, 0xFE ; 254 2706a: 9e e0 ldi r25, 0x0E ; 14 2706c: dd 20 and r13, r13 2706e: 21 f0 breq .+8 ; 0x27078 27070: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 27074: 8b ef ldi r24, 0xFB ; 251 27076: 9e e0 ldi r25, 0x0E ; 14 27078: 0f 94 7f dd call 0x3bafe ; 0x3bafe else if (axis == Y_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_Y_ORIGIN, tmc2130_home_origin[Y_AXIS]); return true; } 2707c: 81 e0 ldi r24, 0x01 ; 1 2707e: e0 96 adiw r28, 0x30 ; 48 27080: 0f b6 in r0, 0x3f ; 63 27082: f8 94 cli 27084: de bf out 0x3e, r29 ; 62 27086: 0f be out 0x3f, r0 ; 63 27088: cd bf out 0x3d, r28 ; 61 2708a: df 91 pop r29 2708c: cf 91 pop r28 2708e: 1f 91 pop r17 27090: 0f 91 pop r16 27092: ff 90 pop r15 27094: ef 90 pop r14 27096: df 90 pop r13 27098: bf 90 pop r11 2709a: af 90 pop r10 2709c: 9f 90 pop r9 2709e: 8f 90 pop r8 270a0: 7f 90 pop r7 270a2: 6f 90 pop r6 270a4: 08 95 ret 000270a6 : delayMicroseconds(TMC2130_SET_DIR_DELAY); } void tmc2130_do_step(uint8_t axis) { switch (axis) 270a6: 81 30 cpi r24, 0x01 ; 1 270a8: 49 f0 breq .+18 ; 0x270bc 270aa: 28 f0 brcs .+10 ; 0x270b6 270ac: 82 30 cpi r24, 0x02 ; 2 270ae: 41 f0 breq .+16 ; 0x270c0 270b0: 83 30 cpi r24, 0x03 ; 3 270b2: 41 f0 breq .+16 ; 0x270c4 270b4: 08 95 ret { case X_AXIS: _DO_STEP_X; break; 270b6: 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; 270b8: 86 b9 out 0x06, r24 ; 6 } } 270ba: 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; 270bc: 82 e0 ldi r24, 0x02 ; 2 270be: fc cf rjmp .-8 ; 0x270b8 case Z_AXIS: _DO_STEP_Z; break; 270c0: 84 e0 ldi r24, 0x04 ; 4 270c2: fa cf rjmp .-12 ; 0x270b8 case E_AXIS: _DO_STEP_E; break; 270c4: 88 e0 ldi r24, 0x08 ; 8 270c6: f8 cf rjmp .-16 ; 0x270b8 000270c8 : } void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 270c8: 81 30 cpi r24, 0x01 ; 1 270ca: d1 f0 breq .+52 ; 0x27100 270cc: 48 f0 brcs .+18 ; 0x270e0 270ce: 82 30 cpi r24, 0x02 ; 2 270d0: 21 f1 breq .+72 ; 0x2711a 270d2: 83 30 cpi r24, 0x03 ; 3 270d4: 79 f1 breq .+94 ; 0x27134 270d6: 8b e4 ldi r24, 0x4B ; 75 270d8: 90 e0 ldi r25, 0x00 ; 0 270da: 01 97 sbiw r24, 0x01 ; 1 270dc: f1 f7 brne .-4 ; 0x270da 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); } 270de: 08 95 ret void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 270e0: 9f b7 in r25, 0x3f ; 63 270e2: 66 23 and r22, r22 270e4: 41 f0 breq .+16 ; 0x270f6 270e6: f8 94 cli 270e8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 270ec: 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; 270ee: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 270f2: 9f bf out 0x3f, r25 ; 63 270f4: f0 cf rjmp .-32 ; 0x270d6 void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 270f6: f8 94 cli 270f8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 270fc: 8e 7f andi r24, 0xFE ; 254 270fe: f7 cf rjmp .-18 ; 0x270ee case Y_AXIS: _SET_DIR_Y(dir); break; 27100: 9f b7 in r25, 0x3f ; 63 27102: 61 11 cpse r22, r1 27104: 05 c0 rjmp .+10 ; 0x27110 27106: f8 94 cli 27108: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2710c: 82 60 ori r24, 0x02 ; 2 2710e: ef cf rjmp .-34 ; 0x270ee 27110: f8 94 cli 27112: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27116: 8d 7f andi r24, 0xFD ; 253 27118: ea cf rjmp .-44 ; 0x270ee case Z_AXIS: _SET_DIR_Z(dir); break; 2711a: 9f b7 in r25, 0x3f ; 63 2711c: 66 23 and r22, r22 2711e: 29 f0 breq .+10 ; 0x2712a 27120: f8 94 cli 27122: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27126: 84 60 ori r24, 0x04 ; 4 27128: e2 cf rjmp .-60 ; 0x270ee 2712a: f8 94 cli 2712c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27130: 8b 7f andi r24, 0xFB ; 251 27132: dd cf rjmp .-70 ; 0x270ee case E_AXIS: _SET_DIR_E(dir); break; 27134: 9f b7 in r25, 0x3f ; 63 27136: 61 11 cpse r22, r1 27138: 05 c0 rjmp .+10 ; 0x27144 2713a: f8 94 cli 2713c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27140: 80 64 ori r24, 0x40 ; 64 27142: d5 cf rjmp .-86 ; 0x270ee 27144: f8 94 cli 27146: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2714a: 8f 7b andi r24, 0xBF ; 191 2714c: d0 cf rjmp .-96 ; 0x270ee 0002714e : tmc2130_cs_high(axis); TMC2130_SPI_LEAVE(); } static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval) { 2714e: cf 92 push r12 27150: df 92 push r13 27152: ef 92 push r14 27154: ff 92 push r15 27156: 0f 93 push r16 27158: 1f 93 push r17 2715a: cf 93 push r28 2715c: df 93 push r29 2715e: 18 2f mov r17, r24 27160: f6 2e mov r15, r22 27162: ea 01 movw r28, r20 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 27164: 0c e5 ldi r16, 0x5C ; 92 27166: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 27168: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 2716a: 0f 94 f4 1d call 0x23be8 ; 0x23be8 TMC2130_SPI_TXRX(addr); // address 2716e: 8f 2d mov r24, r15 27170: 0f 94 0f 1e call 0x23c1e ; 0x23c1e TMC2130_SPI_TXRX(0); // MSB 27174: 80 e0 ldi r24, 0x00 ; 0 27176: 0f 94 0f 1e call 0x23c1e ; 0x23c1e TMC2130_SPI_TXRX(0); 2717a: 80 e0 ldi r24, 0x00 ; 0 2717c: 0f 94 0f 1e call 0x23c1e ; 0x23c1e TMC2130_SPI_TXRX(0); 27180: 80 e0 ldi r24, 0x00 ; 0 27182: 0f 94 0f 1e call 0x23c1e ; 0x23c1e TMC2130_SPI_TXRX(0); // LSB 27186: 80 e0 ldi r24, 0x00 ; 0 27188: 0f 94 0f 1e call 0x23c1e ; 0x23c1e tmc2130_cs_high(axis); 2718c: 81 2f mov r24, r17 2718e: 0f 94 d9 1d call 0x23bb2 ; 0x23bb2 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 27192: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 27194: 1d bc out 0x2d, r1 ; 45 TMC2130_SPI_LEAVE(); //datagram2 - response TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 27196: 81 2f mov r24, r17 27198: 0f 94 f4 1d call 0x23be8 ; 0x23be8 uint8_t stat = TMC2130_SPI_TXRX(0); // status 2719c: 80 e0 ldi r24, 0x00 ; 0 2719e: 0f 94 0f 1e call 0x23c1e ; 0x23c1e 271a2: 08 2f mov r16, r24 uint32_t val32 = 0; val32 = TMC2130_SPI_TXRX(0); // MSB 271a4: 80 e0 ldi r24, 0x00 ; 0 271a6: 0f 94 0f 1e call 0x23c1e ; 0x23c1e 271aa: 90 e0 ldi r25, 0x00 ; 0 271ac: b0 e0 ldi r27, 0x00 ; 0 271ae: a0 e0 ldi r26, 0x00 ; 0 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 271b0: cc 24 eor r12, r12 271b2: d8 2e mov r13, r24 271b4: e9 2e mov r14, r25 271b6: fa 2e mov r15, r26 271b8: 80 e0 ldi r24, 0x00 ; 0 271ba: 0f 94 0f 1e call 0x23c1e ; 0x23c1e 271be: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 271c0: fe 2c mov r15, r14 271c2: ed 2c mov r14, r13 271c4: dc 2c mov r13, r12 271c6: cc 24 eor r12, r12 271c8: 80 e0 ldi r24, 0x00 ; 0 271ca: 0f 94 0f 1e call 0x23c1e ; 0x23c1e 271ce: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); // LSB 271d0: fe 2c mov r15, r14 271d2: ed 2c mov r14, r13 271d4: dc 2c mov r13, r12 271d6: cc 24 eor r12, r12 271d8: 80 e0 ldi r24, 0x00 ; 0 271da: 0f 94 0f 1e call 0x23c1e ; 0x23c1e 271de: c8 2a or r12, r24 tmc2130_cs_high(axis); 271e0: 81 2f mov r24, r17 271e2: 0f 94 d9 1d call 0x23bb2 ; 0x23bb2 TMC2130_SPI_LEAVE(); if (rval != 0) *rval = val32; 271e6: c8 82 st Y, r12 271e8: d9 82 std Y+1, r13 ; 0x01 271ea: ea 82 std Y+2, r14 ; 0x02 271ec: fb 82 std Y+3, r15 ; 0x03 return stat; } 271ee: 80 2f mov r24, r16 271f0: df 91 pop r29 271f2: cf 91 pop r28 271f4: 1f 91 pop r17 271f6: 0f 91 pop r16 271f8: ff 90 pop r15 271fa: ef 90 pop r14 271fc: df 90 pop r13 271fe: cf 90 pop r12 27200: 08 95 ret 00027202 : #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) { 27202: ef 92 push r14 27204: ff 92 push r15 27206: 0f 93 push r16 27208: 1f 93 push r17 2720a: cf 93 push r28 2720c: df 93 push r29 2720e: c8 2f mov r28, r24 27210: e6 2e mov r14, r22 27212: d2 2f mov r29, r18 27214: 13 2f mov r17, r19 27216: 04 2f mov r16, r20 27218: f5 2e mov r15, r21 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 2721a: 8c e5 ldi r24, 0x5C ; 92 2721c: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 2721e: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 27220: 8c 2f mov r24, r28 27222: 0f 94 f4 1d call 0x23be8 ; 0x23be8 TMC2130_SPI_TXRX(addr); // address 27226: 8e 2d mov r24, r14 27228: 0f 94 0f 1e call 0x23c1e ; 0x23c1e TMC2130_SPI_TXRX((wval >> 24) & 0xff); // MSB 2722c: 8f 2d mov r24, r15 2722e: 0f 94 0f 1e call 0x23c1e ; 0x23c1e TMC2130_SPI_TXRX((wval >> 16) & 0xff); 27232: 80 2f mov r24, r16 27234: 0f 94 0f 1e call 0x23c1e ; 0x23c1e TMC2130_SPI_TXRX((wval >> 8) & 0xff); 27238: 81 2f mov r24, r17 2723a: 0f 94 0f 1e call 0x23c1e ; 0x23c1e TMC2130_SPI_TXRX(wval & 0xff); // LSB 2723e: 8d 2f mov r24, r29 27240: 0f 94 0f 1e call 0x23c1e ; 0x23c1e tmc2130_cs_high(axis); 27244: 8c 2f mov r24, r28 TMC2130_SPI_LEAVE(); } 27246: df 91 pop r29 27248: cf 91 pop r28 2724a: 1f 91 pop r17 2724c: 0f 91 pop r16 2724e: ff 90 pop r15 27250: 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); 27252: 0d 94 d9 1d jmp 0x23bb2 ; 0x23bb2 00027256 : if (val32 & 0x000f0000) return 0xffff; return val32 & 0xffff; } uint16_t tmc2130_rd_MSCNT(uint8_t axis) { 27256: cf 93 push r28 27258: df 93 push r29 2725a: 00 d0 rcall .+0 ; 0x2725c 2725c: 1f 92 push r1 2725e: cd b7 in r28, 0x3d ; 61 27260: de b7 in r29, 0x3e ; 62 uint32_t val32 = 0; 27262: 19 82 std Y+1, r1 ; 0x01 27264: 1a 82 std Y+2, r1 ; 0x02 27266: 1b 82 std Y+3, r1 ; 0x03 27268: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(axis, TMC2130_REG_MSCNT, &val32); 2726a: ae 01 movw r20, r28 2726c: 4f 5f subi r20, 0xFF ; 255 2726e: 5f 4f sbci r21, 0xFF ; 255 27270: 6a e6 ldi r22, 0x6A ; 106 27272: 0f 94 a7 38 call 0x2714e ; 0x2714e return val32 & 0x3ff; 27276: 89 81 ldd r24, Y+1 ; 0x01 27278: 9a 81 ldd r25, Y+2 ; 0x02 } 2727a: 93 70 andi r25, 0x03 ; 3 2727c: 0f 90 pop r0 2727e: 0f 90 pop r0 27280: 0f 90 pop r0 27282: 0f 90 pop r0 27284: df 91 pop r29 27286: cf 91 pop r28 27288: 08 95 ret 0002728a : #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 */) { 2728a: ff 92 push r15 2728c: 0f 93 push r16 2728e: 1f 93 push r17 27290: cf 93 push r28 27292: df 93 push r29 27294: f8 2e mov r15, r24 27296: ea 01 movw r28, r20 // Initialise the chopper configuration ChopConfU chopconf = ChopConfU(currents[axis].getvSense(), mres); 27298: e8 2f mov r30, r24 2729a: f0 e0 ldi r31, 0x00 ; 0 2729c: 83 e0 ldi r24, 0x03 ; 3 2729e: f8 9e mul r15, r24 272a0: 80 01 movw r16, r0 272a2: 11 24 eor r1, r1 272a4: 03 5a subi r16, 0xA3 ; 163 272a6: 1d 4f sbci r17, 0xFD ; 253 272a8: d8 01 movw r26, r16 272aa: 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) {} 272ac: 30 e0 ldi r19, 0x00 ; 0 272ae: 37 7f andi r19, 0xF7 ; 247 272b0: 3f 7e andi r19, 0xEF ; 239 272b2: 3f 7d andi r19, 0xDF ; 223 272b4: 3f 7b andi r19, 0xBF ; 191 272b6: 40 e0 ldi r20, 0x00 ; 0 272b8: 80 fb bst r24, 0 272ba: 41 f9 bld r20, 1 272bc: 43 70 andi r20, 0x03 ; 3 272be: 56 2f mov r21, r22 272c0: 5f 70 andi r21, 0x0F ; 15 272c2: 50 62 ori r21, 0x20 ; 32 272c4: 5f 7b andi r21, 0xBF ; 191 272c6: 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 272c8: 81 e0 ldi r24, 0x01 ; 1 272ca: 61 11 cpse r22, r1 272cc: 01 c0 rjmp .+2 ; 0x272d0 272ce: 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); 272d0: 80 fb bst r24, 0 272d2: 54 f9 bld r21, 4 chopconf.s.toff = tmc2130_chopper_config[axis].toff; // toff = 3 (fchop = 27.778kHz) 272d4: bf 01 movw r22, r30 272d6: 66 0f add r22, r22 272d8: 77 1f adc r23, r23 272da: fb 01 movw r30, r22 272dc: e3 58 subi r30, 0x83 ; 131 272de: fd 4f sbci r31, 0xFD ; 253 272e0: 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 272e2: 92 2f mov r25, r18 272e4: 99 1f adc r25, r25 272e6: 99 27 eor r25, r25 272e8: 99 1f adc r25, r25 272ea: 81 81 ldd r24, Z+1 ; 0x01 272ec: 87 70 andi r24, 0x07 ; 7 272ee: 88 0f add r24, r24 272f0: 89 2b or r24, r25 272f2: 80 fb bst r24, 0 272f4: 27 f9 bld r18, 7 272f6: 86 95 lsr r24 272f8: 87 70 andi r24, 0x07 ; 7 272fa: 38 7f andi r19, 0xF8 ; 248 272fc: 38 2b or r19, r24 chopconf.s.tbl = tmc2130_chopper_config[axis].tbl; //blanking time, original value = 2 272fe: 62 58 subi r22, 0x82 ; 130 27300: 7d 4f sbci r23, 0xFD ; 253 27302: fb 01 movw r30, r22 27304: 80 81 ld r24, Z 27306: 86 95 lsr r24 27308: 86 95 lsr r24 2730a: 86 95 lsr r24 2730c: 80 fb bst r24, 0 2730e: 37 f9 bld r19, 7 27310: 81 fb bst r24, 1 27312: 40 f9 bld r20, 0 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); 27314: 6c ee ldi r22, 0xEC ; 236 27316: 8f 2d mov r24, r15 27318: 0f 94 01 39 call 0x27202 ; 0x27202 if (curr == nullptr) { 2731c: 20 97 sbiw r28, 0x00 ; 0 2731e: 09 f4 brne .+2 ; 0x27322 curr = ¤ts[axis]; 27320: e8 01 movw r28, r16 27322: 19 81 ldd r17, Y+1 ; 0x01 27324: 8a 81 ldd r24, Y+2 ; 0x02 27326: c1 2f mov r28, r17 27328: 81 17 cp r24, r17 2732a: 08 f4 brcc .+2 ; 0x2732e 2732c: 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()) { 2732e: 18 17 cp r17, r24 27330: 40 f4 brcc .+16 ; 0x27342 // Let user know firmware modified the value SERIAL_ECHO_START; 27332: 82 ef ldi r24, 0xF2 ; 242 27334: 9a ea ldi r25, 0xAA ; 170 27336: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNRPGM(_n("Hold current truncated to Run current")); 2733a: 8f e4 ldi r24, 0x4F ; 79 2733c: 9f e6 ldi r25, 0x6F ; 111 2733e: 0e 94 86 7b call 0xf70c ; 0xf70c struct S { uint8_t iHold; uint8_t iRun; uint16_t iHoldDelay; constexpr S(uint8_t ih, uint8_t ir) : iHold(ih & 0x1F) 27342: 2c 2f mov r18, r28 27344: 2f 71 andi r18, 0x1F ; 31 , iRun(ir & 0x1F) 27346: 31 2f mov r19, r17 27348: 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); 2734a: 4f e0 ldi r20, 0x0F ; 15 2734c: 50 e0 ldi r21, 0x00 ; 0 2734e: 60 e9 ldi r22, 0x90 ; 144 27350: 8f 2d mov r24, r15 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); if (curr == nullptr) { curr = ¤ts[axis]; } SetCurrents(axis, *curr); } 27352: df 91 pop r29 27354: cf 91 pop r28 27356: 1f 91 pop r17 27358: 0f 91 pop r16 2735a: 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); 2735c: 0d 94 01 39 jmp 0x27202 ; 0x27202 00027360 : return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 27360: e8 2f mov r30, r24 27362: 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--; 27364: 98 e0 ldi r25, 0x08 ; 8 27366: 76 95 lsr r23 27368: 67 95 ror r22 2736a: 61 15 cp r22, r1 2736c: 71 05 cpc r23, r1 2736e: 11 f0 breq .+4 ; 0x27374 27370: 91 50 subi r25, 0x01 ; 1 27372: f9 cf rjmp .-14 ; 0x27366 return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 27374: e8 50 subi r30, 0x08 ; 8 27376: fb 4f sbci r31, 0xFB ; 251 27378: 90 83 st Z, r25 // uint32_t u = _micros(); tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 2737a: 50 e0 ldi r21, 0x00 ; 0 2737c: 40 e0 ldi r20, 0x00 ; 0 2737e: 69 2f mov r22, r25 27380: 0d 94 45 39 jmp 0x2728a ; 0x2728a 00027384 : } return 0; } static void tmc2130_XYZ_reg_init(uint8_t axis) { 27384: 0f 93 push r16 27386: 1f 93 push r17 27388: cf 93 push r28 2738a: df 93 push r29 2738c: c8 2f mov r28, r24 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 2738e: 08 2f mov r16, r24 27390: 10 e0 ldi r17, 0x00 ; 0 27392: f8 01 movw r30, r16 27394: e8 50 subi r30, 0x08 ; 8 27396: fb 4f sbci r31, 0xFB ; 251 27398: 50 e0 ldi r21, 0x00 ; 0 2739a: 40 e0 ldi r20, 0x00 ; 0 2739c: 60 81 ld r22, Z 2739e: 0f 94 45 39 call 0x2728a ; 0x2728a tmc2130_wr(axis, TMC2130_REG_TPOWERDOWN, 0x00000000); 273a2: 20 e0 ldi r18, 0x00 ; 0 273a4: 30 e0 ldi r19, 0x00 ; 0 273a6: a9 01 movw r20, r18 273a8: 61 e9 ldi r22, 0x91 ; 145 273aa: 8c 2f mov r24, r28 273ac: 0f 94 01 39 call 0x27202 ; 0x27202 const bool isStealth = (tmc2130_mode == TMC2130_MODE_SILENT); 273b0: d0 91 6c 06 lds r29, 0x066C ; 0x80066c if (axis == Z_AXIS) { 273b4: c2 30 cpi r28, 0x02 ; 2 273b6: e1 f5 brne .+120 ; 0x27430 #ifdef TMC2130_STEALTH_Z tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[axis]) << 16) | ((uint32_t)1 << 24)); 273b8: 20 e0 ldi r18, 0x00 ; 0 273ba: 30 e0 ldi r19, 0x00 ; 0 273bc: 44 e0 ldi r20, 0x04 ; 4 273be: 51 e0 ldi r21, 0x01 ; 1 273c0: 6d ee ldi r22, 0xED ; 237 273c2: 82 e0 ldi r24, 0x02 ; 2 273c4: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 273c8: 24 ef ldi r18, 0xF4 ; 244 273ca: 31 e0 ldi r19, 0x01 ; 1 273cc: 40 e0 ldi r20, 0x00 ; 0 273ce: 50 e0 ldi r21, 0x00 ; 0 273d0: d1 30 cpi r29, 0x01 ; 1 273d2: 19 f4 brne .+6 ; 0x273da 273d4: 20 e0 ldi r18, 0x00 ; 0 273d6: 30 e0 ldi r19, 0x00 ; 0 273d8: a9 01 movw r20, r18 273da: 64 e9 ldi r22, 0x94 ; 148 273dc: 82 e0 ldi r24, 0x02 ; 2 273de: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_DYNAMIC_SGSENS); 273e2: 24 e8 ldi r18, 0x84 ; 132 273e4: 31 e0 ldi r19, 0x01 ; 1 273e6: 40 e0 ldi r20, 0x00 ; 0 273e8: 50 e0 ldi r21, 0x00 ; 0 273ea: d1 30 cpi r29, 0x01 ; 1 273ec: 21 f4 brne .+8 ; 0x273f6 273ee: 24 e0 ldi r18, 0x04 ; 4 273f0: 30 e0 ldi r19, 0x00 ; 0 273f2: 40 e0 ldi r20, 0x00 ; 0 273f4: 50 e0 ldi r21, 0x00 ; 0 273f6: 60 e8 ldi r22, 0x80 ; 128 273f8: 82 e0 ldi r24, 0x02 ; 2 273fa: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 273fe: 28 ec ldi r18, 0xC8 ; 200 27400: 34 e0 ldi r19, 0x04 ; 4 27402: 46 e0 ldi r20, 0x06 ; 6 27404: 50 e0 ldi r21, 0x00 ; 0 27406: 60 ef ldi r22, 0xF0 ; 240 27408: 82 e0 ldi r24, 0x02 ; 2 2740a: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, isStealth ? 0 : 0xFFFF0); 2740e: 20 ef ldi r18, 0xF0 ; 240 27410: 3f ef ldi r19, 0xFF ; 255 27412: 4f e0 ldi r20, 0x0F ; 15 27414: 50 e0 ldi r21, 0x00 ; 0 27416: d1 30 cpi r29, 0x01 ; 1 27418: 19 f4 brne .+6 ; 0x27420 2741a: 20 e0 ldi r18, 0x00 ; 0 2741c: 30 e0 ldi r19, 0x00 ; 0 2741e: a9 01 movw r20, r18 27420: 63 e9 ldi r22, 0x93 ; 147 27422: 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); } } 27424: df 91 pop r29 27426: cf 91 pop r28 27428: 1f 91 pop r17 2742a: 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); 2742c: 0d 94 01 39 jmp 0x27202 ; 0x27202 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)); 27430: f8 01 movw r30, r16 27432: e5 5e subi r30, 0xE5 ; 229 27434: fc 4f sbci r31, 0xFC ; 252 27436: 20 81 ld r18, Z 27438: 30 e0 ldi r19, 0x00 ; 0 2743a: 50 e0 ldi r21, 0x00 ; 0 2743c: 40 e0 ldi r20, 0x00 ; 0 2743e: a9 01 movw r20, r18 27440: 33 27 eor r19, r19 27442: 22 27 eor r18, r18 27444: 51 60 ori r21, 0x01 ; 1 27446: 6d ee ldi r22, 0xED ; 237 27448: 8c 2f mov r24, r28 2744a: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 2744e: 20 e0 ldi r18, 0x00 ; 0 27450: 30 e0 ldi r19, 0x00 ; 0 27452: a9 01 movw r20, r18 27454: d1 30 cpi r29, 0x01 ; 1 27456: 61 f0 breq .+24 ; 0x27470 uint16_t __tcoolthrs(uint8_t axis) { switch (axis) { case X_AXIS: return TMC2130_TCOOLTHRS_X; 27458: 2e ea ldi r18, 0xAE ; 174 2745a: 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) 2745c: c2 30 cpi r28, 0x02 ; 2 2745e: 30 f0 brcs .+12 ; 0x2746c { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; 27460: 24 ef ldi r18, 0xF4 ; 244 27462: 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) 27464: c2 30 cpi r28, 0x02 ; 2 27466: 11 f0 breq .+4 ; 0x2746c { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; } return 0; 27468: 30 e0 ldi r19, 0x00 ; 0 2746a: 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)); 2746c: 50 e0 ldi r21, 0x00 ; 0 2746e: 40 e0 ldi r20, 0x00 ; 0 27470: 64 e9 ldi r22, 0x94 ; 148 27472: 8c 2f mov r24, r28 27474: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_SGSENS); 27478: 20 e8 ldi r18, 0x80 ; 128 2747a: 31 e0 ldi r19, 0x01 ; 1 2747c: 40 e0 ldi r20, 0x00 ; 0 2747e: 50 e0 ldi r21, 0x00 ; 0 27480: d1 30 cpi r29, 0x01 ; 1 27482: 21 f4 brne .+8 ; 0x2748c 27484: 24 e0 ldi r18, 0x04 ; 4 27486: 30 e0 ldi r19, 0x00 ; 0 27488: 40 e0 ldi r20, 0x00 ; 0 2748a: 50 e0 ldi r21, 0x00 ; 0 2748c: 60 e8 ldi r22, 0x80 ; 128 2748e: 8c 2f mov r24, r28 27490: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 27494: 00 0f add r16, r16 27496: 11 1f adc r17, r17 27498: 00 0f add r16, r16 2749a: 11 1f adc r17, r17 2749c: f8 01 movw r30, r16 2749e: e5 5f subi r30, 0xF5 ; 245 274a0: fc 4f sbci r31, 0xFC ; 252 274a2: 20 81 ld r18, Z 274a4: 31 81 ldd r19, Z+1 ; 0x01 274a6: 42 81 ldd r20, Z+2 ; 0x02 274a8: 53 81 ldd r21, Z+3 ; 0x03 274aa: 60 ef ldi r22, 0xF0 ; 240 274ac: 8c 2f mov r24, r28 274ae: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); 274b2: 20 e0 ldi r18, 0x00 ; 0 274b4: 30 e0 ldi r19, 0x00 ; 0 274b6: a9 01 movw r20, r18 274b8: 63 e9 ldi r22, 0x93 ; 147 274ba: 8c 2f mov r24, r28 274bc: b3 cf rjmp .-154 ; 0x27424 000274be : } #endif //TMC2130_SG_HOMING } void tmc2130_home_exit() { 274be: 1f 93 push r17 274c0: cf 93 push r28 274c2: df 93 push r29 printf_P(PSTR("tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x%02x\n"), tmc2130_sg_homing_axes_mask); 274c4: 80 91 40 06 lds r24, 0x0640 ; 0x800640 274c8: 1f 92 push r1 274ca: 8f 93 push r24 274cc: 82 e0 ldi r24, 0x02 ; 2 274ce: 91 ea ldi r25, 0xA1 ; 161 274d0: 9f 93 push r25 274d2: 8f 93 push r24 274d4: 0f 94 1d dc call 0x3b83a ; 0x3b83a #ifdef TMC2130_SG_HOMING if (tmc2130_sg_homing_axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) 274d8: 80 91 40 06 lds r24, 0x0640 ; 0x800640 274dc: 83 70 andi r24, 0x03 ; 3 274de: 0f 90 pop r0 274e0: 0f 90 pop r0 274e2: 0f 90 pop r0 274e4: 0f 90 pop r0 274e6: 11 f0 breq .+4 ; 0x274ec tmc2130_wait_standstill_xy(1000); 274e8: 0f 94 b4 87 call 0x30f68 ; 0x30f68 if (tmc2130_sg_homing_axes_mask) 274ec: 10 91 40 06 lds r17, 0x0640 ; 0x800640 274f0: 11 23 and r17, r17 274f2: 71 f0 breq .+28 ; 0x27510 { for (uint8_t axis = X_AXIS, mask = X_AXIS_MASK; axis <= Z_AXIS; axis++, mask <<= 1) //X Y and Z axes 274f4: d1 e0 ldi r29, 0x01 ; 1 274f6: c0 e0 ldi r28, 0x00 ; 0 { if (tmc2130_sg_homing_axes_mask & mask) { 274f8: 81 2f mov r24, r17 274fa: 8d 23 and r24, r29 274fc: 19 f0 breq .+6 ; 0x27504 tmc2130_XYZ_reg_init(axis); 274fe: 8c 2f mov r24, r28 27500: 0f 94 c2 39 call 0x27384 ; 0x27384 #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 27504: cf 5f subi r28, 0xFF ; 255 27506: dd 0f add r29, r29 27508: c3 30 cpi r28, 0x03 ; 3 2750a: b1 f7 brne .-20 ; 0x274f8 { if (tmc2130_sg_homing_axes_mask & mask) { tmc2130_XYZ_reg_init(axis); } } tmc2130_sg_homing_axes_mask = 0x00; 2750c: 10 92 40 06 sts 0x0640, r1 ; 0x800640 } tmc2130_sg_crash = false; 27510: 10 92 10 05 sts 0x0510, r1 ; 0x800510 #endif } 27514: df 91 pop r29 27516: cf 91 pop r28 27518: 1f 91 pop r17 2751a: 08 95 ret 0002751c : } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 2751c: df 92 push r13 2751e: ef 92 push r14 27520: ff 92 push r15 27522: 0f 93 push r16 27524: 1f 93 push r17 27526: cf 93 push r28 27528: df 93 push r29 2752a: 00 d0 rcall .+0 ; 0x2752c 2752c: cd b7 in r28, 0x3d ; 61 2752e: de b7 in r29, 0x3e ; 62 27530: d8 2e mov r13, r24 printf_P(PSTR("tmc2130_home_enter(axes_mask=0x%02x)\n"), axes_mask); 27532: 1f 92 push r1 27534: 8f 93 push r24 27536: 8c ed ldi r24, 0xDC ; 220 27538: 90 ea ldi r25, 0xA0 ; 160 2753a: 9f 93 push r25 2753c: 8f 93 push r24 2753e: 0f 94 1d dc call 0x3b83a ; 0x3b83a #ifdef TMC2130_SG_HOMING if (axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) //X or Y 27542: 8d 2d mov r24, r13 27544: 83 70 andi r24, 0x03 ; 3 27546: 0f 90 pop r0 27548: 0f 90 pop r0 2754a: 0f 90 pop r0 2754c: 0f 90 pop r0 2754e: 11 f0 breq .+4 ; 0x27554 tmc2130_wait_standstill_xy(1000); 27550: 0f 94 b4 87 call 0x30f68 ; 0x30f68 } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 27554: 10 e0 ldi r17, 0x00 ; 0 27556: 00 e0 ldi r16, 0x00 ; 0 27558: ff 24 eor r15, r15 2755a: f3 94 inc r15 2755c: 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) 2755e: 8d 2d mov r24, r13 27560: 8f 21 and r24, r15 27562: 09 f4 brne .+2 ; 0x27566 27564: 46 c0 rjmp .+140 ; 0x275f2 { tmc2130_sg_homing_axes_mask |= mask; 27566: 80 91 40 06 lds r24, 0x0640 ; 0x800640 2756a: 8f 29 or r24, r15 2756c: 80 93 40 06 sts 0x0640, r24 ; 0x800640 //Configuration to spreadCycle tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_NORMAL); 27570: 20 e0 ldi r18, 0x00 ; 0 27572: 30 e0 ldi r19, 0x00 ; 0 27574: a9 01 movw r20, r18 27576: 60 e8 ldi r22, 0x80 ; 128 27578: 80 2f mov r24, r16 2757a: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr_home[axis]) << 16)); 2757e: f8 01 movw r30, r16 27580: e5 5e subi r30, 0xE5 ; 229 27582: fc 4f sbci r31, 0xFC ; 252 27584: 20 81 ld r18, Z 27586: 30 e0 ldi r19, 0x00 ; 0 27588: 50 e0 ldi r21, 0x00 ; 0 2758a: 40 e0 ldi r20, 0x00 ; 0 2758c: a9 01 movw r20, r18 2758e: 33 27 eor r19, r19 27590: 22 27 eor r18, r18 27592: 6d ee ldi r22, 0xED ; 237 27594: 80 2f mov r24, r16 27596: 0f 94 01 39 call 0x27202 ; 0x27202 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) 2759a: 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; 2759c: 24 ef ldi r18, 0xF4 ; 244 2759e: 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) 275a0: 08 17 cp r16, r24 275a2: 11 f0 breq .+4 ; 0x275a8 { case X_AXIS: return TMC2130_TCOOLTHRS_X; 275a4: 2e ea ldi r18, 0xAE ; 174 275a6: 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)); 275a8: 50 e0 ldi r21, 0x00 ; 0 275aa: 40 e0 ldi r20, 0x00 ; 0 275ac: 64 e9 ldi r22, 0x94 ; 148 275ae: 8e 2d mov r24, r14 275b0: 0f 94 01 39 call 0x27202 ; 0x27202 iRun >>= 1; } } // PROGMEM initializer inline __attribute__((always_inline)) MotorCurrents(const MotorCurrents &curr_P) { memcpy_P(this, &curr_P, sizeof(*this)); } 275b4: b8 01 movw r22, r16 275b6: 66 0f add r22, r22 275b8: 77 1f adc r23, r23 275ba: 60 0f add r22, r16 275bc: 71 1f adc r23, r17 275be: 60 53 subi r22, 0x30 ; 48 275c0: 7f 45 sbci r23, 0x5F ; 95 275c2: 43 e0 ldi r20, 0x03 ; 3 275c4: 50 e0 ldi r21, 0x00 ; 0 275c6: ce 01 movw r24, r28 275c8: 01 96 adiw r24, 0x01 ; 1 275ca: 0f 94 f5 da call 0x3b5ea ; 0x3b5ea MotorCurrents curr(homing_currents_P[axis]); tmc2130_setup_chopper(axis, tmc2130_mres[axis], &curr); 275ce: ae 01 movw r20, r28 275d0: 4f 5f subi r20, 0xFF ; 255 275d2: 5f 4f sbci r21, 0xFF ; 255 275d4: f8 01 movw r30, r16 275d6: e8 50 subi r30, 0x08 ; 8 275d8: fb 4f sbci r31, 0xFB ; 251 275da: 60 81 ld r22, Z 275dc: 8e 2d mov r24, r14 275de: 0f 94 45 39 call 0x2728a ; 0x2728a tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); //stallguard output DIAG1, DIAG1 = pushpull 275e2: 20 e8 ldi r18, 0x80 ; 128 275e4: 31 e0 ldi r19, 0x01 ; 1 275e6: 40 e0 ldi r20, 0x00 ; 0 275e8: 50 e0 ldi r21, 0x00 ; 0 275ea: 60 e8 ldi r22, 0x80 ; 128 275ec: 8e 2d mov r24, r14 275ee: 0f 94 01 39 call 0x27202 ; 0x27202 { 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 275f2: ff 0c add r15, r15 275f4: 0f 5f subi r16, 0xFF ; 255 275f6: 1f 4f sbci r17, 0xFF ; 255 275f8: 03 30 cpi r16, 0x03 ; 3 275fa: 11 05 cpc r17, r1 275fc: 09 f0 breq .+2 ; 0x27600 275fe: ae cf rjmp .-164 ; 0x2755c 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 } 27600: 0f 90 pop r0 27602: 0f 90 pop r0 27604: 0f 90 pop r0 27606: df 91 pop r29 27608: cf 91 pop r28 2760a: 1f 91 pop r17 2760c: 0f 91 pop r16 2760e: ff 90 pop r15 27610: ef 90 pop r14 27612: df 90 pop r13 27614: 08 95 ret 00027616 : crashdet_stop_and_save_print(); } } void crashdet_use_eeprom_setting() { tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); 27616: 89 e6 ldi r24, 0x69 ; 105 27618: 9f e0 ldi r25, 0x0F ; 15 2761a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2761e: 91 e0 ldi r25, 0x01 ; 1 27620: 81 11 cpse r24, r1 27622: 01 c0 rjmp .+2 ; 0x27626 27624: 90 e0 ldi r25, 0x00 ; 0 27626: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c } 2762a: 08 95 ret 0002762c : } #ifdef TMC2130 static void crash_mode_switch() { eeprom_toggle((uint8_t*)EEPROM_CRASH_DET); 2762c: 89 e6 ldi r24, 0x69 ; 105 2762e: 9f e0 ldi r25, 0x0F ; 15 27630: 0e 94 3f 78 call 0xf07e ; 0xf07e crashdet_use_eeprom_setting(); 27634: 0d 94 0b 3b jmp 0x27616 ; 0x27616 00027638 : tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); } } void tmc2130_init(TMCInitParams params) { 27638: cf 93 push r28 2763a: c8 2f mov r28, r24 // DBG(_n("tmc2130_init(), mode=%S\n"), tmc2130_mode?_n("STEALTH"):_n("NORMAL")); WRITE(X_TMC2130_CS, HIGH); 2763c: a0 9a sbi 0x14, 0 ; 20 WRITE(Y_TMC2130_CS, HIGH); 2763e: a2 9a sbi 0x14, 2 ; 20 WRITE(Z_TMC2130_CS, HIGH); 27640: 9f b7 in r25, 0x3f ; 63 27642: f8 94 cli 27644: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27648: 80 62 ori r24, 0x20 ; 32 2764a: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2764e: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_CS, HIGH); 27650: 9f b7 in r25, 0x3f ; 63 27652: f8 94 cli 27654: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27658: 80 61 ori r24, 0x10 ; 16 2765a: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2765e: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(X_TMC2130_CS); 27660: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_TMC2130_CS); 27662: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_TMC2130_CS); 27664: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27668: 80 62 ori r24, 0x20 ; 32 2766a: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_TMC2130_CS); 2766e: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27672: 80 61 ori r24, 0x10 ; 16 27674: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(X_TMC2130_DIAG); 27678: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2767c: 8b 7f andi r24, 0xFB ; 251 2767e: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Y_TMC2130_DIAG); 27682: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27686: 8f 77 andi r24, 0x7F ; 127 27688: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Z_TMC2130_DIAG); 2768c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27690: 8f 7b andi r24, 0xBF ; 191 27692: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(E0_TMC2130_DIAG); 27696: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2769a: 87 7f andi r24, 0xF7 ; 247 2769c: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(X_TMC2130_DIAG,HIGH); 276a0: 9f b7 in r25, 0x3f ; 63 276a2: f8 94 cli 276a4: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 276a8: 84 60 ori r24, 0x04 ; 4 276aa: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 276ae: 9f bf out 0x3f, r25 ; 63 WRITE(Y_TMC2130_DIAG,HIGH); 276b0: 9f b7 in r25, 0x3f ; 63 276b2: f8 94 cli 276b4: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 276b8: 80 68 ori r24, 0x80 ; 128 276ba: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 276be: 9f bf out 0x3f, r25 ; 63 WRITE(Z_TMC2130_DIAG,HIGH); 276c0: 9f b7 in r25, 0x3f ; 63 276c2: f8 94 cli 276c4: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 276c8: 80 64 ori r24, 0x40 ; 64 276ca: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 276ce: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_DIAG,HIGH); 276d0: 9f b7 in r25, 0x3f ; 63 276d2: f8 94 cli 276d4: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 276d8: 88 60 ori r24, 0x08 ; 8 276da: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 276de: 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); 276e0: 80 e0 ldi r24, 0x00 ; 0 276e2: 0f 94 c2 39 call 0x27384 ; 0x27384 276e6: 81 e0 ldi r24, 0x01 ; 1 276e8: 0f 94 c2 39 call 0x27384 ; 0x27384 276ec: 82 e0 ldi r24, 0x02 ; 2 276ee: 0f 94 c2 39 call 0x27384 ; 0x27384 } // E axis tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 276f2: 50 e0 ldi r21, 0x00 ; 0 276f4: 40 e0 ldi r20, 0x00 ; 0 276f6: 60 91 fb 04 lds r22, 0x04FB ; 0x8004fb 276fa: 83 e0 ldi r24, 0x03 ; 3 276fc: 0f 94 45 39 call 0x2728a ; 0x2728a tmc2130_wr(E_AXIS, TMC2130_REG_TPOWERDOWN, 0x00000000); 27700: 20 e0 ldi r18, 0x00 ; 0 27702: 30 e0 ldi r19, 0x00 ; 0 27704: a9 01 movw r20, r18 27706: 61 e9 ldi r22, 0x91 ; 145 27708: 83 e0 ldi r24, 0x03 ; 3 2770a: 0f 94 01 39 call 0x27202 ; 0x27202 #ifndef TMC2130_STEALTH_E if( ! params.enableECool ){ 2770e: c1 fd sbrc r28, 1 27710: 1d c0 rjmp .+58 ; 0x2774c tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); 27712: 20 e8 ldi r18, 0x80 ; 128 27714: 31 e0 ldi r19, 0x01 ; 1 27716: 40 e0 ldi r20, 0x00 ; 0 27718: 50 e0 ldi r21, 0x00 ; 0 2771a: 60 e8 ldi r22, 0x80 ; 128 2771c: 83 e0 ldi r24, 0x03 ; 3 2771e: 0f 94 01 39 call 0x27202 ; 0x27202 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]); 27722: 60 91 fc 04 lds r22, 0x04FC ; 0x8004fc 27726: 80 e0 ldi r24, 0x00 ; 0 27728: 0f 94 28 88 call 0x31050 ; 0x31050 tmc2130_set_wave(Y_AXIS, 247, tmc2130_wave_fac[Y_AXIS]); 2772c: 60 91 fd 04 lds r22, 0x04FD ; 0x8004fd 27730: 81 e0 ldi r24, 0x01 ; 1 27732: 0f 94 28 88 call 0x31050 ; 0x31050 tmc2130_set_wave(Z_AXIS, 247, tmc2130_wave_fac[Z_AXIS]); 27736: 60 91 fe 04 lds r22, 0x04FE ; 0x8004fe 2773a: 82 e0 ldi r24, 0x02 ; 2 2773c: 0f 94 28 88 call 0x31050 ; 0x31050 #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_set_wave(E_AXIS, 247, tmc2130_wave_fac[E_AXIS]); 27740: 60 91 ff 04 lds r22, 0x04FF ; 0x8004ff 27744: 83 e0 ldi r24, 0x03 ; 3 #ifdef PSU_Delta if(!params.bSuppressFlag) check_force_z(); #endif // PSU_Delta } 27746: 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]); 27748: 0d 94 28 88 jmp 0x31050 ; 0x31050 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)); 2774c: 20 e0 ldi r18, 0x00 ; 0 2774e: 30 e0 ldi r19, 0x00 ; 0 27750: 43 e0 ldi r20, 0x03 ; 3 27752: 50 e0 ldi r21, 0x00 ; 0 27754: 6d ee ldi r22, 0xED ; 237 27756: 83 e0 ldi r24, 0x03 ; 3 27758: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(E_AXIS, TMC2130_REG_TCOOLTHRS, 0); 2775c: 20 e0 ldi r18, 0x00 ; 0 2775e: 30 e0 ldi r19, 0x00 ; 0 27760: a9 01 movw r20, r18 27762: 64 e9 ldi r22, 0x94 ; 148 27764: 83 e0 ldi r24, 0x03 ; 3 27766: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SILENT); 2776a: 24 e0 ldi r18, 0x04 ; 4 2776c: 30 e0 ldi r19, 0x00 ; 0 2776e: 40 e0 ldi r20, 0x00 ; 0 27770: 50 e0 ldi r21, 0x00 ; 0 27772: 60 e8 ldi r22, 0x80 ; 128 27774: 83 e0 ldi r24, 0x03 ; 3 27776: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(E_AXIS, TMC2130_REG_PWMCONF, pwmconf_Ecool.dw); 2777a: 2b e2 ldi r18, 0x2B ; 43 2777c: 34 e5 ldi r19, 0x54 ; 84 2777e: 42 e0 ldi r20, 0x02 ; 2 27780: 50 e0 ldi r21, 0x00 ; 0 27782: 60 ef ldi r22, 0xF0 ; 240 27784: 83 e0 ldi r24, 0x03 ; 3 27786: 0f 94 01 39 call 0x27202 ; 0x27202 tmc2130_wr(E_AXIS, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS_E); 2778a: 23 e9 ldi r18, 0x93 ; 147 2778c: 31 e0 ldi r19, 0x01 ; 1 2778e: 40 e0 ldi r20, 0x00 ; 0 27790: 50 e0 ldi r21, 0x00 ; 0 27792: 63 e9 ldi r22, 0x93 ; 147 27794: 83 e0 ldi r24, 0x03 ; 3 27796: 0f 94 01 39 call 0x27202 ; 0x27202 SERIAL_ECHOLNRPGM(eMotorCurrentScalingEnabled); 2779a: 80 eb ldi r24, 0xB0 ; 176 2779c: 90 ea ldi r25, 0xA0 ; 160 2779e: 0e 94 86 7b call 0xf70c ; 0xf70c 277a2: bf cf rjmp .-130 ; 0x27722 000277a4 : lcd_update(2); } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { 277a4: df 92 push r13 277a6: ef 92 push r14 277a8: ff 92 push r15 277aa: 0f 93 push r16 277ac: 1f 93 push r17 277ae: cf 93 push r28 277b0: df 93 push r29 MENU_BEGIN(); 277b2: 0f 94 da ce call 0x39db4 ; 0x39db4 277b6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 277ba: 80 91 15 05 lds r24, 0x0515 ; 0x800515 277be: 84 30 cpi r24, 0x04 ; 4 277c0: 08 f0 brcs .+2 ; 0x277c4 277c2: 66 c0 rjmp .+204 ; 0x27890 277c4: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 277c8: 0f 94 5a cd call 0x39ab4 ; 0x39ab4 277cc: 88 23 and r24, r24 277ce: e9 f0 breq .+58 ; 0x2780a 277d0: 0c ef ldi r16, 0xFC ; 252 277d2: 14 e0 ldi r17, 0x04 ; 4 277d4: c7 ef ldi r28, 0xF7 ; 247 277d6: 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) { 277d8: f8 01 movw r30, r16 277da: 80 81 ld r24, Z 277dc: 8e 31 cpi r24, 0x1E ; 30 277de: 08 f4 brcc .+2 ; 0x277e2 tmc2130_wave_fac[axis] = 0; 277e0: 10 82 st Z, r1 277e2: f8 01 movw r30, r16 277e4: 61 91 ld r22, Z+ 277e6: 8f 01 movw r16, r30 277e8: ce 01 movw r24, r28 277ea: 0f 94 7f dd call 0x3bafe ; 0x3bafe 277ee: 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++) { 277f0: c3 3f cpi r28, 0xF3 ; 243 277f2: fe e0 ldi r31, 0x0E ; 14 277f4: df 07 cpc r29, r31 277f6: 81 f7 brne .-32 ; 0x277d8 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(); 277f8: 0e 94 f8 f8 call 0x1f1f0 ; 0x1f1f0 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) { } 277fc: e8 94 clt 277fe: d0 f8 bld r13, 0 27800: 80 fb bst r24, 0 27802: 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())); 27804: 8d 2d mov r24, r13 27806: 0f 94 1c 3b call 0x27638 ; 0x27638 { MENU_BEGIN(); ON_MENU_LEAVE( lcd_settings_linearity_correction_menu_save(); ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 2780a: 88 eb ldi r24, 0xB8 ; 184 2780c: 9d e3 ldi r25, 0x3D ; 61 2780e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 27812: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a #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); 27816: 8f e6 ldi r24, 0x6F ; 111 27818: 97 e5 ldi r25, 0x57 ; 87 2781a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2781e: f1 2c mov r15, r1 27820: e1 2c mov r14, r1 27822: 08 ec ldi r16, 0xC8 ; 200 27824: 10 e0 ldi r17, 0x00 ; 0 27826: 2d e1 ldi r18, 0x1D ; 29 27828: 30 e0 ldi r19, 0x00 ; 0 2782a: 48 e0 ldi r20, 0x08 ; 8 2782c: 6c ef ldi r22, 0xFC ; 252 2782e: 74 e0 ldi r23, 0x04 ; 4 27830: 0f 94 2a cf call 0x39e54 ; 0x39e54 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); 27834: 83 e6 ldi r24, 0x63 ; 99 27836: 97 e5 ldi r25, 0x57 ; 87 27838: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2783c: 2d e1 ldi r18, 0x1D ; 29 2783e: 30 e0 ldi r19, 0x00 ; 0 27840: 48 e0 ldi r20, 0x08 ; 8 27842: 6d ef ldi r22, 0xFD ; 253 27844: 74 e0 ldi r23, 0x04 ; 4 27846: 0f 94 2a cf call 0x39e54 ; 0x39e54 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); 2784a: 87 e5 ldi r24, 0x57 ; 87 2784c: 97 e5 ldi r25, 0x57 ; 87 2784e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 27852: 2d e1 ldi r18, 0x1D ; 29 27854: 30 e0 ldi r19, 0x00 ; 0 27856: 48 e0 ldi r20, 0x08 ; 8 27858: 6e ef ldi r22, 0xFE ; 254 2785a: 74 e0 ldi r23, 0x04 ; 4 2785c: 0f 94 2a cf call 0x39e54 ; 0x39e54 #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); 27860: 8b e4 ldi r24, 0x4B ; 75 27862: 97 e5 ldi r25, 0x57 ; 87 27864: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 27868: 2d e1 ldi r18, 0x1D ; 29 2786a: 30 e0 ldi r19, 0x00 ; 0 2786c: 48 e0 ldi r20, 0x08 ; 8 2786e: 6f ef ldi r22, 0xFF ; 255 27870: 74 e0 ldi r23, 0x04 ; 4 27872: 0f 94 2a cf call 0x39e54 ; 0x39e54 MENU_END(); 27876: 0f 94 ae ce call 0x39d5c ; 0x39d5c } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { MENU_BEGIN(); 2787a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2787e: 8f 5f subi r24, 0xFF ; 255 27880: 80 93 15 05 sts 0x0515, r24 ; 0x800515 27884: 80 91 17 05 lds r24, 0x0517 ; 0x800517 27888: 8f 5f subi r24, 0xFF ; 255 2788a: 80 93 17 05 sts 0x0517, r24 ; 0x800517 2788e: 95 cf rjmp .-214 ; 0x277ba 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(); } 27890: df 91 pop r29 27892: cf 91 pop r28 27894: 1f 91 pop r17 27896: 0f 91 pop r16 27898: ff 90 pop r15 2789a: ef 90 pop r14 2789c: df 90 pop r13 2789e: 08 95 ret 000278a0 : , 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()); } 278a0: fc 01 movw r30, r24 278a2: 20 81 ld r18, Z 278a4: 92 81 ldd r25, Z+2 ; 0x02 278a6: 49 2f mov r20, r25 278a8: 50 e0 ldi r21, 0x00 ; 0 278aa: 21 11 cpse r18, r1 278ac: 02 c0 rjmp .+4 ; 0x278b2 278ae: 44 0f add r20, r20 278b0: 55 1f adc r21, r21 278b2: 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; } 278b4: 21 11 cpse r18, r1 278b6: 01 c0 rjmp .+2 ; 0x278ba 278b8: 88 0f add r24, r24 inline uint8_t getOriginaliHold() const { return min(vSense ? iHold : iHold << 1, getOriginaliRun()); } 278ba: 84 17 cp r24, r20 278bc: 15 06 cpc r1, r21 278be: 31 f0 breq .+12 ; 0x278cc 278c0: 2c f0 brlt .+10 ; 0x278cc 278c2: 89 2f mov r24, r25 278c4: 21 11 cpse r18, r1 278c6: 02 c0 rjmp .+4 ; 0x278cc 278c8: 88 0f add r24, r24 278ca: 08 95 ret 278cc: 08 95 ret 000278ce : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 278ce: 3f b7 in r19, 0x3f ; 63 cli(); 278d0: f8 94 cli m = timer2_overflow_count; 278d2: 80 91 3c 06 lds r24, 0x063C ; 0x80063c 278d6: 90 91 3d 06 lds r25, 0x063D ; 0x80063d 278da: a0 91 3e 06 lds r26, 0x063E ; 0x80063e 278de: b0 91 3f 06 lds r27, 0x063F ; 0x80063f #if defined(TCNT2) t = TCNT2; 278e2: 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)) 278e6: b8 9b sbis 0x17, 0 ; 23 278e8: 05 c0 rjmp .+10 ; 0x278f4 278ea: 2f 3f cpi r18, 0xFF ; 255 278ec: 19 f0 breq .+6 ; 0x278f4 m++; 278ee: 01 96 adiw r24, 0x01 ; 1 278f0: a1 1d adc r26, r1 278f2: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 278f4: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 278f6: ba 2f mov r27, r26 278f8: a9 2f mov r26, r25 278fa: 98 2f mov r25, r24 278fc: 88 27 eor r24, r24 278fe: bc 01 movw r22, r24 27900: cd 01 movw r24, r26 27902: 62 0f add r22, r18 27904: 71 1d adc r23, r1 27906: 81 1d adc r24, r1 27908: 91 1d adc r25, r1 2790a: 42 e0 ldi r20, 0x02 ; 2 2790c: 66 0f add r22, r22 2790e: 77 1f adc r23, r23 27910: 88 1f adc r24, r24 27912: 99 1f adc r25, r25 27914: 4a 95 dec r20 27916: d1 f7 brne .-12 ; 0x2790c } 27918: 08 95 ret 0002791a : void delay2(unsigned long ms) { 2791a: 8f 92 push r8 2791c: 9f 92 push r9 2791e: af 92 push r10 27920: bf 92 push r11 27922: cf 92 push r12 27924: df 92 push r13 27926: ef 92 push r14 27928: ff 92 push r15 2792a: 6b 01 movw r12, r22 2792c: 7c 01 movw r14, r24 uint32_t start = micros2(); 2792e: 0f 94 67 3c call 0x278ce ; 0x278ce 27932: 4b 01 movw r8, r22 27934: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 27936: c1 14 cp r12, r1 27938: d1 04 cpc r13, r1 2793a: e1 04 cpc r14, r1 2793c: f1 04 cpc r15, r1 2793e: b9 f0 breq .+46 ; 0x2796e 27940: 0f 94 67 3c call 0x278ce ; 0x278ce 27944: 68 19 sub r22, r8 27946: 79 09 sbc r23, r9 27948: 8a 09 sbc r24, r10 2794a: 9b 09 sbc r25, r11 2794c: 68 3e cpi r22, 0xE8 ; 232 2794e: 73 40 sbci r23, 0x03 ; 3 27950: 81 05 cpc r24, r1 27952: 91 05 cpc r25, r1 27954: 80 f3 brcs .-32 ; 0x27936 { ms--; 27956: 21 e0 ldi r18, 0x01 ; 1 27958: c2 1a sub r12, r18 2795a: d1 08 sbc r13, r1 2795c: e1 08 sbc r14, r1 2795e: f1 08 sbc r15, r1 start += 1000; 27960: 88 ee ldi r24, 0xE8 ; 232 27962: 88 0e add r8, r24 27964: 83 e0 ldi r24, 0x03 ; 3 27966: 98 1e adc r9, r24 27968: a1 1c adc r10, r1 2796a: b1 1c adc r11, r1 2796c: e4 cf rjmp .-56 ; 0x27936 } } } 2796e: ff 90 pop r15 27970: ef 90 pop r14 27972: df 90 pop r13 27974: cf 90 pop r12 27976: bf 90 pop r11 27978: af 90 pop r10 2797a: 9f 90 pop r9 2797c: 8f 90 pop r8 2797e: 08 95 ret 00027980 : * @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() { 27980: ef 92 push r14 27982: ff 92 push r15 27984: 0f 93 push r16 27986: 1f 93 push r17 27988: cf 93 push r28 2798a: df 93 push r29 2798c: cd b7 in r28, 0x3d ; 61 2798e: de b7 in r29, 0x3e ; 62 27990: 63 97 sbiw r28, 0x13 ; 19 27992: 0f b6 in r0, 0x3f ; 63 27994: f8 94 cli 27996: de bf out 0x3e, r29 ; 62 27998: 0f be out 0x3f, r0 ; 63 2799a: 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) 2799c: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 279a0: 81 11 cpse r24, r1 279a2: 3a c0 rjmp .+116 ; 0x27a18 { // Menu was entered. // Initialize its status. _md->status = 1; 279a4: 81 e0 ldi r24, 0x01 ; 1 279a6: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 check_babystep(); 279aa: 0e 94 8a 7b call 0xf714 ; 0xf714 if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 279ae: 81 ea ldi r24, 0xA1 ; 161 279b0: 9d e0 ldi r25, 0x0D ; 13 279b2: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 279b6: 18 2f mov r17, r24 279b8: 0e 94 4c 78 call 0xf098 ; 0xf098 279bc: 81 11 cpse r24, r1 279be: ee c0 rjmp .+476 ; 0x27b9c _md->babystepMemZ = 0; 279c0: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 279c4: 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)) 279c8: 80 e1 ldi r24, 0x10 ; 16 279ca: 0e 94 6d f8 call 0x1f0da ; 0x1f0da 279ce: 81 11 cpse r24, r1 279d0: 04 c0 rjmp .+8 ; 0x279da _md->babystepMemZ = 0; 279d2: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 279d6: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 279da: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 279de: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 279e2: 07 2e mov r0, r23 279e4: 00 0c add r0, r0 279e6: 88 0b sbc r24, r24 279e8: 99 0b sbc r25, r25 279ea: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 279ee: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 279f2: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 279f6: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 279fa: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 279fe: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 27a02: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac 27a06: 70 93 ad 03 sts 0x03AD, r23 ; 0x8003ad 27a0a: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae 27a0e: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af lcd_draw_update = 1; 27a12: 81 e0 ldi r24, 0x01 ; 1 27a14: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 27a18: 80 91 37 05 lds r24, 0x0537 ; 0x800537 27a1c: 90 91 38 05 lds r25, 0x0538 ; 0x800538 27a20: 00 97 sbiw r24, 0x00 ; 0 27a22: f1 f1 breq .+124 ; 0x27aa0 { _md->babystepMemZ += lcd_encoder; 27a24: 20 91 aa 03 lds r18, 0x03AA ; 0x8003aa 27a28: 30 91 ab 03 lds r19, 0x03AB ; 0x8003ab 27a2c: 28 0f add r18, r24 27a2e: 39 1f adc r19, r25 27a30: 30 93 ab 03 sts 0x03AB, r19 ; 0x8003ab 27a34: 20 93 aa 03 sts 0x03AA, r18 ; 0x8003aa if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 27a38: 21 36 cpi r18, 0x61 ; 97 27a3a: 40 ef ldi r20, 0xF0 ; 240 27a3c: 34 07 cpc r19, r20 27a3e: 0c f0 brlt .+2 ; 0x27a42 27a40: ba c0 rjmp .+372 ; 0x27bb6 27a42: 81 e6 ldi r24, 0x61 ; 97 27a44: 90 ef ldi r25, 0xF0 ; 240 27a46: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 27a4a: 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]; 27a4e: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 27a52: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 27a56: 07 2e mov r0, r23 27a58: 00 0c add r0, r0 27a5a: 88 0b sbc r24, r24 27a5c: 99 0b sbc r25, r25 27a5e: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 27a62: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 27a66: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 27a6a: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 27a6e: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 27a72: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 27a76: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac 27a7a: 70 93 ad 03 sts 0x03AD, r23 ; 0x8003ad 27a7e: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae 27a82: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af _delay(50); 27a86: 62 e3 ldi r22, 0x32 ; 50 27a88: 70 e0 ldi r23, 0x00 ; 0 27a8a: 80 e0 ldi r24, 0x00 ; 0 27a8c: 90 e0 ldi r25, 0x00 ; 0 27a8e: 0f 94 8d 3c call 0x2791a ; 0x2791a lcd_encoder = 0; 27a92: 10 92 38 05 sts 0x0538, r1 ; 0x800538 27a96: 10 92 37 05 sts 0x0537, r1 ; 0x800537 lcd_draw_update = 1; 27a9a: 81 e0 ldi r24, 0x01 ; 1 27a9c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update) 27aa0: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 27aa4: 88 23 and r24, r24 27aa6: c9 f1 breq .+114 ; 0x27b1a { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 27aa8: 81 ea ldi r24, 0xA1 ; 161 27aaa: 9d e0 ldi r25, 0x0D ; 13 27aac: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 27ab0: 2b e0 ldi r18, 0x0B ; 11 27ab2: 82 9f mul r24, r18 27ab4: c0 01 movw r24, r0 27ab6: 11 24 eor r1, r1 27ab8: be 01 movw r22, r28 27aba: 6f 5f subi r22, 0xFF ; 255 27abc: 7f 4f sbci r23, 0xFF ; 255 27abe: 87 5b subi r24, 0xB7 ; 183 27ac0: 92 4f sbci r25, 0xF2 ; 242 27ac2: 0f 94 74 cd call 0x39ae8 ; 0x39ae8 lcd_home(); 27ac6: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_print(buffer.c); 27aca: ce 01 movw r24, r28 27acc: 01 96 adiw r24, 0x01 ; 1 27ace: 0e 94 1c 72 call 0xe438 ; 0xe438 lcd_set_cursor(0, 1); 27ad2: 61 e0 ldi r22, 0x01 ; 1 27ad4: 80 e0 ldi r24, 0x00 ; 0 27ad6: 0e 94 15 70 call 0xe02a ; 0xe02a menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 27ada: 10 91 ac 03 lds r17, 0x03AC ; 0x8003ac 27ade: 00 91 ad 03 lds r16, 0x03AD ; 0x8003ad 27ae2: f0 90 ae 03 lds r15, 0x03AE ; 0x8003ae 27ae6: e0 90 af 03 lds r14, 0x03AF ; 0x8003af 27aea: 8d eb ldi r24, 0xBD ; 189 27aec: 9d e4 ldi r25, 0x4D ; 77 27aee: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 //! (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); 27af2: ef 92 push r14 27af4: ff 92 push r15 27af6: 0f 93 push r16 27af8: 1f 93 push r17 27afa: 9f 93 push r25 27afc: 8f 93 push r24 27afe: 1f 92 push r1 27b00: 80 e2 ldi r24, 0x20 ; 32 27b02: 8f 93 push r24 27b04: 81 eb ldi r24, 0xB1 ; 177 27b06: 94 ea ldi r25, 0xA4 ; 164 27b08: 9f 93 push r25 27b0a: 8f 93 push r24 27b0c: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 27b10: 0f b6 in r0, 0x3f ; 63 27b12: f8 94 cli 27b14: de bf out 0x3e, r29 ; 62 27b16: 0f be out 0x3f, r0 ; 63 27b18: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 27b1a: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 27b1e: 81 11 cpse r24, r1 27b20: 04 c0 rjmp .+8 ; 0x27b2a 27b22: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 27b26: 88 23 and r24, r24 27b28: 51 f1 breq .+84 ; 0x27b7e { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 27b2a: 81 ea ldi r24, 0xA1 ; 161 27b2c: 9d e0 ldi r25, 0x0D ; 13 27b2e: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 27b32: 9b e0 ldi r25, 0x0B ; 11 27b34: 89 9f mul r24, r25 27b36: 80 01 movw r16, r0 27b38: 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); 27b3a: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 27b3e: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 27b42: c8 01 movw r24, r16 27b44: 80 5b subi r24, 0xB0 ; 176 27b46: 92 4f sbci r25, 0xF2 ; 242 27b48: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 27b4c: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 27b50: c8 01 movw r24, r16 27b52: 8e 5a subi r24, 0xAE ; 174 27b54: 92 4f sbci r25, 0xF2 ; 242 27b56: 0f 94 7f dd call 0x3bafe ; 0x3bafe 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); 27b5a: 60 91 99 03 lds r22, 0x0399 ; 0x800399 27b5e: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 27b62: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 27b66: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 27b6a: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 27b6e: c8 01 movw r24, r16 27b70: 8d 5a subi r24, 0xAD ; 173 27b72: 92 4f sbci r25, 0xF2 ; 242 27b74: 0f 94 7f dd call 0x3bafe ; 0x3bafe #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 27b78: 80 e1 ldi r24, 0x10 ; 16 27b7a: 0e 94 88 e6 call 0x1cd10 ; 0x1cd10 } menu_back_if_clicked(); 27b7e: 0f 94 44 d2 call 0x3a488 ; 0x3a488 } 27b82: 63 96 adiw r28, 0x13 ; 19 27b84: 0f b6 in r0, 0x3f ; 63 27b86: f8 94 cli 27b88: de bf out 0x3e, r29 ; 62 27b8a: 0f be out 0x3f, r0 ; 63 27b8c: cd bf out 0x3d, r28 ; 61 27b8e: df 91 pop r29 27b90: cf 91 pop r28 27b92: 1f 91 pop r17 27b94: 0f 91 pop r16 27b96: ff 90 pop r15 27b98: ef 90 pop r14 27b9a: 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-> 27b9c: 2b e0 ldi r18, 0x0B ; 11 27b9e: 12 9f mul r17, r18 27ba0: c0 01 movw r24, r0 27ba2: 11 24 eor r1, r1 27ba4: 80 5b subi r24, 0xB0 ; 176 27ba6: 92 4f sbci r25, 0xF2 ; 242 27ba8: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 27bac: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 27bb0: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa 27bb4: 09 cf rjmp .-494 ; 0x279c8 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 27bb6: 12 16 cp r1, r18 27bb8: 13 06 cpc r1, r19 27bba: 2c f4 brge .+10 ; 0x27bc6 27bbc: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 27bc0: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa 27bc4: 44 cf rjmp .-376 ; 0x27a4e extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 27bc6: 2f b7 in r18, 0x3f ; 63 27bc8: f8 94 cli babystepsTodo[Z_AXIS] += n; 27bca: 40 91 6a 06 lds r20, 0x066A ; 0x80066a 27bce: 50 91 6b 06 lds r21, 0x066B ; 0x80066b 27bd2: 84 0f add r24, r20 27bd4: 95 1f adc r25, r21 27bd6: 90 93 6b 06 sts 0x066B, r25 ; 0x80066b 27bda: 80 93 6a 06 sts 0x066A, r24 ; 0x80066a CRITICAL_SECTION_END 27bde: 2f bf out 0x3f, r18 ; 63 27be0: 36 cf rjmp .-404 ; 0x27a4e 00027be2 : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 27be2: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 27be6: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 27bea: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 27bee: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 27bf2: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 27bf6: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 27bfa: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 27bfe: 26 17 cp r18, r22 27c00: 37 07 cpc r19, r23 27c02: 0c f0 brlt .+2 ; 0x27c06 27c04: 65 c0 rjmp .+202 ; 0x27cd0 { if (lcd_encoder != 0) 27c06: 80 91 37 05 lds r24, 0x0537 ; 0x800537 27c0a: 90 91 38 05 lds r25, 0x0538 ; 0x800538 27c0e: 89 2b or r24, r25 27c10: b9 f1 breq .+110 ; 0x27c80 { refresh_cmd_timeout(); 27c12: 0e 94 f8 67 call 0xcff0 ; 0xcff0 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; 27c16: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 if (++ next_block_index == BLOCK_BUFFER_SIZE) 27c1a: 8f 5f subi r24, 0xFF ; 255 27c1c: 80 31 cpi r24, 0x10 ; 16 27c1e: 09 f4 brne .+2 ; 0x27c22 next_block_index = 0; 27c20: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 27c22: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 if (! planner_queue_full()) 27c26: 98 17 cp r25, r24 27c28: 59 f1 breq .+86 ; 0x27c80 { current_position[E_AXIS] += lcd_encoder; 27c2a: 60 91 37 05 lds r22, 0x0537 ; 0x800537 27c2e: 70 91 38 05 lds r23, 0x0538 ; 0x800538 27c32: 07 2e mov r0, r23 27c34: 00 0c add r0, r0 27c36: 88 0b sbc r24, r24 27c38: 99 0b sbc r25, r25 27c3a: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 27c3e: 9b 01 movw r18, r22 27c40: ac 01 movw r20, r24 27c42: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 27c46: 70 91 50 07 lds r23, 0x0750 ; 0x800750 27c4a: 80 91 51 07 lds r24, 0x0751 ; 0x800751 27c4e: 90 91 52 07 lds r25, 0x0752 ; 0x800752 27c52: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 27c56: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 27c5a: 70 93 50 07 sts 0x0750, r23 ; 0x800750 27c5e: 80 93 51 07 sts 0x0751, r24 ; 0x800751 27c62: 90 93 52 07 sts 0x0752, r25 ; 0x800752 lcd_encoder = 0; 27c66: 10 92 38 05 sts 0x0538, r1 ; 0x800538 27c6a: 10 92 37 05 sts 0x0537, r1 ; 0x800537 plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 27c6e: 65 e5 ldi r22, 0x55 ; 85 27c70: 75 e5 ldi r23, 0x55 ; 85 27c72: 85 ed ldi r24, 0xD5 ; 213 27c74: 9f e3 ldi r25, 0x3F ; 63 27c76: 0f 94 5d ba call 0x374ba ; 0x374ba lcd_draw_update = 1; 27c7a: 81 e0 ldi r24, 0x01 ; 1 27c7c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 27c80: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 27c84: 88 23 and r24, r24 27c86: 11 f1 breq .+68 ; 0x27ccc { lcd_set_cursor(0, 1); 27c88: 61 e0 ldi r22, 0x01 ; 1 27c8a: 80 e0 ldi r24, 0x00 ; 0 27c8c: 0e 94 15 70 call 0xe02a ; 0xe02a //! 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); 27c90: 80 91 52 07 lds r24, 0x0752 ; 0x800752 27c94: 8f 93 push r24 27c96: 80 91 51 07 lds r24, 0x0751 ; 0x800751 27c9a: 8f 93 push r24 27c9c: 80 91 50 07 lds r24, 0x0750 ; 0x800750 27ca0: 8f 93 push r24 27ca2: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 27ca6: 8f 93 push r24 27ca8: 83 e9 ldi r24, 0x93 ; 147 27caa: 94 ea ldi r25, 0xA4 ; 164 27cac: 9f 93 push r25 27cae: 8f 93 push r24 27cb0: 84 e8 ldi r24, 0x84 ; 132 27cb2: 94 ea ldi r25, 0xA4 ; 164 27cb4: 9f 93 push r25 27cb6: 8f 93 push r24 27cb8: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 27cbc: 8d b7 in r24, 0x3d ; 61 27cbe: 9e b7 in r25, 0x3e ; 62 27cc0: 08 96 adiw r24, 0x08 ; 8 27cc2: 0f b6 in r0, 0x3f ; 63 27cc4: f8 94 cli 27cc6: 9e bf out 0x3e, r25 ; 62 27cc8: 0f be out 0x3f, r0 ; 63 27cca: 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(); 27ccc: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 }; } void show_preheat_nozzle_warning() { lcd_clear(); 27cd0: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 27cd4: 8e e4 ldi r24, 0x4E ; 78 27cd6: 9d e4 ldi r25, 0x4D ; 77 27cd8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 27cdc: ac 01 movw r20, r24 27cde: 60 e0 ldi r22, 0x00 ; 0 27ce0: 80 e0 ldi r24, 0x00 ; 0 27ce2: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 27ce6: 88 e3 ldi r24, 0x38 ; 56 27ce8: 9d e4 ldi r25, 0x4D ; 77 27cea: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 27cee: ac 01 movw r20, r24 27cf0: 62 e0 ldi r22, 0x02 ; 2 27cf2: 80 e0 ldi r24, 0x00 ; 0 27cf4: 0e 94 29 70 call 0xe052 ; 0xe052 _delay(2000); 27cf8: 60 ed ldi r22, 0xD0 ; 208 27cfa: 77 e0 ldi r23, 0x07 ; 7 27cfc: 80 e0 ldi r24, 0x00 ; 0 27cfe: 90 e0 ldi r25, 0x00 ; 0 27d00: 0f 94 8d 3c call 0x2791a ; 0x2791a lcd_clear(); 27d04: 0e 94 48 70 call 0xe090 ; 0xe090 menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 27d08: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 00027d0c : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 27d0c: 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(); 27d0e: f8 94 cli m = timer2_millis; 27d10: 60 91 38 06 lds r22, 0x0638 ; 0x800638 27d14: 70 91 39 06 lds r23, 0x0639 ; 0x800639 27d18: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 27d1c: 90 91 3b 06 lds r25, 0x063B ; 0x80063b SREG = oldSREG; 27d20: 2f bf out 0x3f, r18 ; 63 return m; } 27d22: 08 95 ret 00027d24 : } //! @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); 27d24: 20 e0 ldi r18, 0x00 ; 0 27d26: 30 e0 ldi r19, 0x00 ; 0 27d28: 40 e8 ldi r20, 0x80 ; 128 27d2a: 5f eb ldi r21, 0xBF ; 191 27d2c: 60 e0 ldi r22, 0x00 ; 0 27d2e: 70 e0 ldi r23, 0x00 ; 0 27d30: cb 01 movw r24, r22 27d32: 0e 94 e2 8a call 0x115c4 ; 0x115c4 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 27d36: 8a ec ldi r24, 0xCA ; 202 27d38: 9f e6 ldi r25, 0x6F ; 111 27d3a: 0e 94 86 7b call 0xf70c ; 0xf70c // Indicate that the printer is paused did_pause_print = true; 27d3e: 81 e0 ldi r24, 0x01 ; 1 27d40: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 } else return false; } bool Stopwatch::pause() { if (isRunning()) { 27d44: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 27d48: 81 30 cpi r24, 0x01 ; 1 27d4a: 69 f4 brne .+26 ; 0x27d66 state = PAUSED; 27d4c: 82 e0 ldi r24, 0x02 ; 2 27d4e: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d stopTimestamp = _millis(); 27d52: 0f 94 86 3e call 0x27d0c ; 0x27d0c 27d56: 60 93 4f 06 sts 0x064F, r22 ; 0x80064f 27d5a: 70 93 50 06 sts 0x0650, r23 ; 0x800650 27d5e: 80 93 51 06 sts 0x0651, r24 ; 0x800651 27d62: 90 93 52 06 sts 0x0652, r25 ; 0x800652 print_job_timer.pause(); // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::LongPause; 27d66: 82 e0 ldi r24, 0x02 ; 2 27d68: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 lcd_return_to_status(); 27d6c: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 00027d70 ::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) 27d70: ff 92 push r15 27d72: 0f 93 push r16 27d74: 1f 93 push r17 27d76: cf 93 push r28 27d78: df 93 push r29 { if (!m_isRunning) return false; 27d7a: fc 01 movw r30, r24 27d7c: f0 80 ld r15, Z 27d7e: f1 10 cpse r15, r1 27d80: 08 c0 rjmp .+16 ; 0x27d92 ::expired(unsigned short)+0x22> 27d82: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 27d84: 8f 2d mov r24, r15 27d86: df 91 pop r29 27d88: cf 91 pop r28 27d8a: 1f 91 pop r17 27d8c: 0f 91 pop r16 27d8e: ff 90 pop r15 27d90: 08 95 ret 27d92: 8b 01 movw r16, r22 27d94: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 27d96: 0f 94 86 3e call 0x27d0c ; 0x27d0c if (m_started <= m_started + msPeriod) 27d9a: 89 81 ldd r24, Y+1 ; 0x01 27d9c: 9a 81 ldd r25, Y+2 ; 0x02 27d9e: 08 0f add r16, r24 27da0: 19 1f adc r17, r25 27da2: 08 17 cp r16, r24 27da4: 19 07 cpc r17, r25 27da6: 40 f0 brcs .+16 ; 0x27db8 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 27da8: 60 17 cp r22, r16 27daa: 71 07 cpc r23, r17 27dac: 18 f4 brcc .+6 ; 0x27db4 ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27dae: 68 17 cp r22, r24 27db0: 79 07 cpc r23, r25 27db2: 38 f7 brcc .-50 ; 0x27d82 ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 27db4: 18 82 st Y, r1 27db6: e6 cf rjmp .-52 ; 0x27d84 ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27db8: 60 17 cp r22, r16 27dba: 71 07 cpc r23, r17 27dbc: c0 f7 brcc .-16 ; 0x27dae ::expired(unsigned short)+0x3e> 27dbe: e1 cf rjmp .-62 ; 0x27d82 ::expired(unsigned short)+0x12> 00027dc0 ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 27dc0: fc 01 movw r30, r24 27dc2: 20 81 ld r18, Z 27dc4: 21 11 cpse r18, r1 27dc6: 0d 94 b8 3e jmp 0x27d70 ; 0x27d70 ::expired(unsigned short)> } 27dca: 81 e0 ldi r24, 0x01 ; 1 27dcc: 08 95 ret 00027dce ::start()>: /** * @brief Start timer */ template void Timer::start() 27dce: cf 93 push r28 27dd0: df 93 push r29 27dd2: ec 01 movw r28, r24 { m_started = _millis(); 27dd4: 0f 94 86 3e call 0x27d0c ; 0x27d0c 27dd8: 7a 83 std Y+2, r23 ; 0x02 27dda: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 27ddc: 81 e0 ldi r24, 0x01 ; 1 27dde: 88 83 st Y, r24 } 27de0: df 91 pop r29 27de2: cf 91 pop r28 27de4: 08 95 ret 00027de6 : } static uint8_t twi_wait(uint8_t status) { 27de6: 1f 93 push r17 27de8: cf 93 push r28 27dea: df 93 push r29 27dec: 00 d0 rcall .+0 ; 0x27dee 27dee: cd b7 in r28, 0x3d ; 61 27df0: de b7 in r29, 0x3e ; 62 27df2: 18 2f mov r17, r24 ShortTimer timmy; 27df4: 19 82 std Y+1, r1 ; 0x01 27df6: 1b 82 std Y+3, r1 ; 0x03 27df8: 1a 82 std Y+2, r1 ; 0x02 timmy.start(); 27dfa: ce 01 movw r24, r28 27dfc: 01 96 adiw r24, 0x01 ; 1 27dfe: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> while(!(TWCR & _BV(TWINT))) { 27e02: 80 91 bc 00 lds r24, 0x00BC ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> 27e06: 87 fd sbrc r24, 7 27e08: 0a c0 rjmp .+20 ; 0x27e1e if (timmy.expired(TWI_TIMEOUT_MS)) { 27e0a: 6a e0 ldi r22, 0x0A ; 10 27e0c: 70 e0 ldi r23, 0x00 ; 0 27e0e: ce 01 movw r24, r28 27e10: 01 96 adiw r24, 0x01 ; 1 27e12: 0f 94 b8 3e call 0x27d70 ; 0x27d70 ::expired(unsigned short)> 27e16: 88 23 and r24, r24 27e18: a1 f3 breq .-24 ; 0x27e02 return 2; 27e1a: 82 e0 ldi r24, 0x02 ; 2 27e1c: 09 c0 rjmp .+18 ; 0x27e30 } } if(TW_STATUS != status) 27e1e: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 27e22: 88 7f andi r24, 0xF8 ; 248 27e24: 18 17 cp r17, r24 27e26: 59 f0 breq .+22 ; 0x27e3e } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 27e28: 84 e9 ldi r24, 0x94 ; 148 27e2a: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> } } if(TW_STATUS != status) { twi_stop(); return 1; 27e2e: 81 e0 ldi r24, 0x01 ; 1 } return 0; } 27e30: 0f 90 pop r0 27e32: 0f 90 pop r0 27e34: 0f 90 pop r0 27e36: df 91 pop r29 27e38: cf 91 pop r28 27e3a: 1f 91 pop r17 27e3c: 08 95 ret if(TW_STATUS != status) { twi_stop(); return 1; } return 0; 27e3e: 80 e0 ldi r24, 0x00 ; 0 27e40: f7 cf rjmp .-18 ; 0x27e30 00027e42 : } return standstill; } void tmc2130_check_overtemp() { 27e42: 1f 93 push r17 27e44: cf 93 push r28 27e46: df 93 push r29 27e48: 00 d0 rcall .+0 ; 0x27e4a 27e4a: 1f 92 push r1 27e4c: cd b7 in r28, 0x3d ; 61 27e4e: de b7 in r29, 0x3e ; 62 if (tmc2130_overtemp_timer.expired_cont(1000)) 27e50: 68 ee ldi r22, 0xE8 ; 232 27e52: 73 e0 ldi r23, 0x03 ; 3 27e54: 81 e4 ldi r24, 0x41 ; 65 27e56: 96 e0 ldi r25, 0x06 ; 6 27e58: 0f 94 e0 3e call 0x27dc0 ; 0x27dc0 ::expired_cont(unsigned short)> 27e5c: 88 23 and r24, r24 27e5e: 91 f1 breq .+100 ; 0x27ec4 { for (uint_least8_t i = 0; i < 4; i++) 27e60: 10 e0 ldi r17, 0x00 ; 0 { uint32_t drv_status = 0; 27e62: 19 82 std Y+1, r1 ; 0x01 27e64: 1a 82 std Y+2, r1 ; 0x02 27e66: 1b 82 std Y+3, r1 ; 0x03 27e68: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(i, TMC2130_REG_DRV_STATUS, &drv_status); 27e6a: ae 01 movw r20, r28 27e6c: 4f 5f subi r20, 0xFF ; 255 27e6e: 5f 4f sbci r21, 0xFF ; 255 27e70: 6f e6 ldi r22, 0x6F ; 111 27e72: 81 2f mov r24, r17 27e74: 0f 94 a7 38 call 0x2714e ; 0x2714e if (drv_status & ((uint32_t)1 << 26)) 27e78: 89 81 ldd r24, Y+1 ; 0x01 27e7a: 9a 81 ldd r25, Y+2 ; 0x02 27e7c: ab 81 ldd r26, Y+3 ; 0x03 27e7e: bc 81 ldd r27, Y+4 ; 0x04 27e80: b2 ff sbrs r27, 2 27e82: 19 c0 rjmp .+50 ; 0x27eb6 { // BIT 26 - over temp prewarning ~120C (+-20C) SERIAL_ERRORRPGM(MSG_TMC_OVERTEMP); 27e84: 8b e3 ldi r24, 0x3B ; 59 27e86: 9f e6 ldi r25, 0x6F ; 111 27e88: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 27e8c: 81 2f mov r24, r17 27e8e: 0e 94 42 79 call 0xf284 ; 0xf284 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 27e92: 0f 94 5d d6 call 0x3acba ; 0x3acba SERIAL_ECHOLN(i); for (uint_least8_t j = 0; j < 4; j++) 27e96: 10 e0 ldi r17, 0x00 ; 0 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); 27e98: 20 e0 ldi r18, 0x00 ; 0 27e9a: 30 e0 ldi r19, 0x00 ; 0 27e9c: 41 e0 ldi r20, 0x01 ; 1 27e9e: 50 e0 ldi r21, 0x00 ; 0 27ea0: 6c ee ldi r22, 0xEC ; 236 27ea2: 81 2f mov r24, r17 27ea4: 0f 94 01 39 call 0x27202 ; 0x27202 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++) 27ea8: 1f 5f subi r17, 0xFF ; 255 27eaa: 14 30 cpi r17, 0x04 ; 4 27eac: a9 f7 brne .-22 ; 0x27e98 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); 27eae: 8b e3 ldi r24, 0x3B ; 59 27eb0: 9f e6 ldi r25, 0x6F ; 111 27eb2: 0e 94 15 7c call 0xf82a ; 0xf82a void tmc2130_check_overtemp() { if (tmc2130_overtemp_timer.expired_cont(1000)) { for (uint_least8_t i = 0; i < 4; i++) 27eb6: 1f 5f subi r17, 0xFF ; 255 27eb8: 14 30 cpi r17, 0x04 ; 4 27eba: 99 f6 brne .-90 ; 0x27e62 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); } } tmc2130_overtemp_timer.start(); 27ebc: 81 e4 ldi r24, 0x41 ; 65 27ebe: 96 e0 ldi r25, 0x06 ; 6 27ec0: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> } } 27ec4: 0f 90 pop r0 27ec6: 0f 90 pop r0 27ec8: 0f 90 pop r0 27eca: 0f 90 pop r0 27ecc: df 91 pop r29 27ece: cf 91 pop r28 27ed0: 1f 91 pop r17 27ed2: 08 95 ret 00027ed4 ::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) 27ed4: 8f 92 push r8 27ed6: 9f 92 push r9 27ed8: af 92 push r10 27eda: bf 92 push r11 27edc: cf 92 push r12 27ede: df 92 push r13 27ee0: ef 92 push r14 27ee2: ff 92 push r15 27ee4: 1f 93 push r17 27ee6: cf 93 push r28 27ee8: df 93 push r29 { if (!m_isRunning) return false; 27eea: fc 01 movw r30, r24 27eec: 10 81 ld r17, Z 27eee: 11 11 cpse r17, r1 27ef0: 0e c0 rjmp .+28 ; 0x27f0e ::expired(unsigned long)+0x3a> 27ef2: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 27ef4: 81 2f mov r24, r17 27ef6: df 91 pop r29 27ef8: cf 91 pop r28 27efa: 1f 91 pop r17 27efc: ff 90 pop r15 27efe: ef 90 pop r14 27f00: df 90 pop r13 27f02: cf 90 pop r12 27f04: bf 90 pop r11 27f06: af 90 pop r10 27f08: 9f 90 pop r9 27f0a: 8f 90 pop r8 27f0c: 08 95 ret 27f0e: 6a 01 movw r12, r20 27f10: 7b 01 movw r14, r22 27f12: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 27f14: 0f 94 86 3e call 0x27d0c ; 0x27d0c 27f18: 4b 01 movw r8, r22 27f1a: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 27f1c: 89 81 ldd r24, Y+1 ; 0x01 27f1e: 9a 81 ldd r25, Y+2 ; 0x02 27f20: ab 81 ldd r26, Y+3 ; 0x03 27f22: bc 81 ldd r27, Y+4 ; 0x04 27f24: c8 0e add r12, r24 27f26: d9 1e adc r13, r25 27f28: ea 1e adc r14, r26 27f2a: fb 1e adc r15, r27 27f2c: c8 16 cp r12, r24 27f2e: d9 06 cpc r13, r25 27f30: ea 06 cpc r14, r26 27f32: fb 06 cpc r15, r27 27f34: 60 f0 brcs .+24 ; 0x27f4e ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 27f36: 8c 14 cp r8, r12 27f38: 9d 04 cpc r9, r13 27f3a: ae 04 cpc r10, r14 27f3c: bf 04 cpc r11, r15 27f3e: 28 f4 brcc .+10 ; 0x27f4a ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27f40: 88 16 cp r8, r24 27f42: 99 06 cpc r9, r25 27f44: aa 06 cpc r10, r26 27f46: bb 06 cpc r11, r27 27f48: a0 f6 brcc .-88 ; 0x27ef2 ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 27f4a: 18 82 st Y, r1 27f4c: d3 cf rjmp .-90 ; 0x27ef4 ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27f4e: 8c 14 cp r8, r12 27f50: 9d 04 cpc r9, r13 27f52: ae 04 cpc r10, r14 27f54: bf 04 cpc r11, r15 27f56: a0 f7 brcc .-24 ; 0x27f40 ::expired(unsigned long)+0x6c> 27f58: cc cf rjmp .-104 ; 0x27ef2 ::expired(unsigned long)+0x1e> 00027f5a : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 27f5a: 0f 93 push r16 27f5c: 1f 93 push r17 27f5e: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 27f60: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 27f64: 88 23 and r24, r24 27f66: 09 f4 brne .+2 ; 0x27f6a 27f68: 4d c0 rjmp .+154 ; 0x28004 heating_status_counter++; 27f6a: 80 91 48 06 lds r24, 0x0648 ; 0x800648 27f6e: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 27f70: 8e 30 cpi r24, 0x0E ; 14 27f72: b0 f4 brcc .+44 ; 0x27fa0 //! @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++; 27f74: 80 93 48 06 sts 0x0648, r24 ; 0x800648 if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 27f78: 63 e0 ldi r22, 0x03 ; 3 27f7a: 87 e0 ldi r24, 0x07 ; 7 27f7c: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_space(13); 27f80: 8d e0 ldi r24, 0x0D ; 13 27f82: 0e 94 0b 70 call 0xe016 ; 0xe016 for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 27f86: c0 e0 ldi r28, 0x00 ; 0 27f88: 80 91 48 06 lds r24, 0x0648 ; 0x800648 27f8c: c8 17 cp r28, r24 27f8e: 58 f4 brcc .+22 ; 0x27fa6 lcd_putc_at(7 + dots, 3, '.'); 27f90: 4e e2 ldi r20, 0x2E ; 46 27f92: 63 e0 ldi r22, 0x03 ; 3 27f94: 87 e0 ldi r24, 0x07 ; 7 27f96: 8c 0f add r24, r28 27f98: 0e 94 35 70 call 0xe06a ; 0xe06a heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 27f9c: cf 5f subi r28, 0xFF ; 255 27f9e: f4 cf rjmp .-24 ; 0x27f88 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; 27fa0: 10 92 48 06 sts 0x0648, r1 ; 0x800648 27fa4: e9 cf rjmp .-46 ; 0x27f78 lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 27fa6: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 27faa: 82 30 cpi r24, 0x02 ; 2 27fac: d1 f0 breq .+52 ; 0x27fe2 27fae: 30 f4 brcc .+12 ; 0x27fbc 27fb0: 81 30 cpi r24, 0x01 ; 1 27fb2: 59 f0 breq .+22 ; 0x27fca case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 27fb4: cf 91 pop r28 27fb6: 1f 91 pop r17 27fb8: 0f 91 pop r16 27fba: 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) { 27fbc: 83 30 cpi r24, 0x03 ; 3 27fbe: f9 f0 breq .+62 ; 0x27ffe 27fc0: 84 30 cpi r24, 0x04 ; 4 27fc2: c1 f7 brne .-16 ; 0x27fb4 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)); 27fc4: 8c e6 ldi r24, 0x6C ; 108 27fc6: 9a e4 ldi r25, 0x4A ; 74 27fc8: 0e c0 rjmp .+28 ; 0x27fe6 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)); 27fca: 85 e9 ldi r24, 0x95 ; 149 27fcc: 9a e4 ldi r25, 0x4A ; 74 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 27fce: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 27fd2: ac 01 movw r20, r24 27fd4: 63 e0 ldi r22, 0x03 ; 3 27fd6: 80 e0 ldi r24, 0x00 ; 0 break; } } } 27fd8: cf 91 pop r28 27fda: 1f 91 pop r17 27fdc: 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)); 27fde: 0c 94 29 70 jmp 0xe052 ; 0xe052 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)); 27fe2: 85 e8 ldi r24, 0x85 ; 133 27fe4: 9a e4 ldi r25, 0x4A ; 74 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)); 27fe6: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 27fea: ac 01 movw r20, r24 27fec: 63 e0 ldi r22, 0x03 ; 3 27fee: 80 e0 ldi r24, 0x00 ; 0 27ff0: 0e 94 29 70 call 0xe052 ; 0xe052 heating_status = HeatingStatus::NO_HEATING; 27ff4: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df heating_status_counter = 0; 27ff8: 10 92 48 06 sts 0x0648, r1 ; 0x800648 27ffc: db cf rjmp .-74 ; 0x27fb4 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)); 27ffe: 87 e7 ldi r24, 0x77 ; 119 28000: 9a e4 ldi r25, 0x4A ; 74 28002: e5 cf rjmp .-54 ; 0x27fce break; } } else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && 28004: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 28008: 88 23 and r24, r24 2800a: 61 f1 breq .+88 ; 0x28064 break; default: break; } } else if ((IS_SD_PRINTING) && 2800c: 80 91 75 07 lds r24, 0x0775 ; 0x800775 28010: 81 11 cpse r24, r1 28012: 28 c0 rjmp .+80 ; 0x28064 (custom_message_type == CustomMsg::Status) && 28014: 80 91 d1 03 lds r24, 0x03D1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.453> 28018: 82 30 cpi r24, 0x02 ; 2 2801a: 20 f5 brcc .+72 ; 0x28064 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 2801c: 80 91 4f 05 lds r24, 0x054F ; 0x80054f <_ZL26lcd_status_message_timeout.lto_priv.465> 28020: 81 11 cpse r24, r1 28022: 16 c0 rjmp .+44 ; 0x28050 (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); 28024: 80 91 85 14 lds r24, 0x1485 ; 0x801485 28028: 88 23 and r24, r24 2802a: 09 f4 brne .+2 ; 0x2802e 2802c: 35 c0 rjmp .+106 ; 0x28098 2802e: 85 e8 ldi r24, 0x85 ; 133 28030: 94 e1 ldi r25, 0x14 ; 20 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 28032: 20 91 68 0e lds r18, 0x0E68 ; 0x800e68 28036: 64 e1 ldi r22, 0x14 ; 20 28038: 82 0f add r24, r18 2803a: 91 1d adc r25, r1 2803c: 0e 94 04 72 call 0xe408 ; 0xe408 28040: 81 11 cpse r24, r1 28042: 2d c0 rjmp .+90 ; 0x2809e { scrollstuff++; 28044: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 28048: 8f 5f subi r24, 0xFF ; 255 2804a: 80 93 68 0e sts 0x0E68, r24 ; 0x800e68 2804e: b2 cf rjmp .-156 ; 0x27fb4 28050: 40 e2 ldi r20, 0x20 ; 32 28052: 5e e4 ldi r21, 0x4E ; 78 28054: 60 e0 ldi r22, 0x00 ; 0 28056: 70 e0 ldi r23, 0x00 ; 0 28058: 8f e4 ldi r24, 0x4F ; 79 2805a: 95 e0 ldi r25, 0x05 ; 5 2805c: 0f 94 6a 3f call 0x27ed4 ; 0x27ed4 ::expired(unsigned long)> 28060: 81 11 cpse r24, r1 28062: e0 cf rjmp .-64 ; 0x28024 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) 28064: 80 91 75 07 lds r24, 0x0775 ; 0x800775 28068: 81 11 cpse r24, r1 2806a: 1c c0 rjmp .+56 ; 0x280a4 { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 2806c: e0 91 75 07 lds r30, 0x0775 ; 0x800775 28070: ea 30 cpi r30, 0x0A ; 10 28072: 08 f0 brcs .+2 ; 0x28076 28074: 9f cf rjmp .-194 ; 0x27fb4 28076: f0 e0 ldi r31, 0x00 ; 0 28078: 88 27 eor r24, r24 2807a: ee 5b subi r30, 0xBE ; 190 2807c: ff 4b sbci r31, 0xBF ; 191 2807e: 8e 4f sbci r24, 0xFE ; 254 28080: 0d 94 6b de jmp 0x3bcd6 ; 0x3bcd6 <__tablejump2__> 28084: 72 3b cpi r23, 0xB2 ; 178 28086: 2c 3b cpi r18, 0xBC ; 188 28088: 72 3b cpi r23, 0xB2 ; 178 2808a: e2 3a cpi r30, 0xA2 ; 162 2808c: e8 3a cpi r30, 0xA8 ; 168 2808e: 90 3b cpi r25, 0xB0 ; 176 28090: 72 3b cpi r23, 0xB2 ; 178 28092: 72 3b cpi r23, 0xB2 ; 178 28094: 76 3b cpi r23, 0xB6 ; 182 28096: 72 3b cpi r23, 0xB2 ; 178 (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); 28098: 80 e7 ldi r24, 0x70 ; 112 2809a: 94 e1 ldi r25, 0x14 ; 20 2809c: ca cf rjmp .-108 ; 0x28032 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 2809e: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 280a2: 88 cf rjmp .-240 ; 0x27fb4 } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 280a4: 80 91 4f 05 lds r24, 0x054F ; 0x80054f <_ZL26lcd_status_message_timeout.lto_priv.465> 280a8: 88 23 and r24, r24 280aa: 01 f3 breq .-64 ; 0x2806c * 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; 280ac: 0f 94 86 3e call 0x27d0c ; 0x27d0c 280b0: 00 91 50 05 lds r16, 0x0550 ; 0x800550 <_ZL26lcd_status_message_timeout.lto_priv.465+0x1> 280b4: 10 91 51 05 lds r17, 0x0551 ; 0x800551 <_ZL26lcd_status_message_timeout.lto_priv.465+0x2> 280b8: 20 91 52 05 lds r18, 0x0552 ; 0x800552 <_ZL26lcd_status_message_timeout.lto_priv.465+0x3> 280bc: 30 91 53 05 lds r19, 0x0553 ; 0x800553 <_ZL26lcd_status_message_timeout.lto_priv.465+0x4> 280c0: 60 1b sub r22, r16 280c2: 71 0b sbc r23, r17 280c4: 82 0b sbc r24, r18 280c6: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 280c8: 60 3a cpi r22, 0xA0 ; 160 280ca: 7f 40 sbci r23, 0x0F ; 15 280cc: 81 05 cpc r24, r1 280ce: 91 05 cpc r25, r1 280d0: 68 f6 brcc .-102 ; 0x2806c 280d2: 70 cf rjmp .-288 ; 0x27fb4 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); 280d4: 63 e0 ldi r22, 0x03 ; 3 280d6: 80 91 39 05 lds r24, 0x0539 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.462> 280da: 0e 94 15 70 call 0xe02a ; 0xe02a const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 280de: 80 91 39 05 lds r24, 0x0539 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.462> 280e2: c4 e1 ldi r28, 0x14 ; 20 280e4: 6c 2f mov r22, r28 280e6: 68 1b sub r22, r24 280e8: 90 e0 ldi r25, 0x00 ; 0 280ea: 86 5c subi r24, 0xC6 ; 198 280ec: 9a 4f sbci r25, 0xFA ; 250 280ee: 0e 94 04 72 call 0xe408 ; 0xe408 lcd_status_message_idx = LCD_WIDTH - padding; 280f2: c8 1b sub r28, r24 280f4: c0 93 39 05 sts 0x0539, r28 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.462> 280f8: 5d cf rjmp .-326 ; 0x27fb4 } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 280fa: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 280fe: 8b 30 cpi r24, 0x0B ; 11 28100: 08 f1 brcs .+66 ; 0x28144 lcd_set_cursor(0, 3); 28102: 63 e0 ldi r22, 0x03 ; 3 28104: 80 e0 ldi r24, 0x00 ; 0 28106: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_space(LCD_WIDTH); 2810a: 84 e1 ldi r24, 0x14 ; 20 2810c: 0e 94 0b 70 call 0xe016 ; 0xe016 lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 28110: 8c e5 ldi r24, 0x5C ; 92 28112: 9a e4 ldi r25, 0x4A ; 74 28114: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 28118: ac 01 movw r20, r24 2811a: 63 e0 ldi r22, 0x03 ; 3 2811c: 80 e0 ldi r24, 0x00 ; 0 2811e: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_puts_P(PSTR(" : ")); 28122: 89 eb ldi r24, 0xB9 ; 185 28124: 91 ea ldi r25, 0xA1 ; 161 28126: 0e 94 00 70 call 0xe000 ; 0xe000 lcd_print(custom_message_state - 10); 2812a: 60 91 f3 03 lds r22, 0x03F3 ; 0x8003f3 2812e: 6a 50 subi r22, 0x0A ; 10 28130: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 28132: 07 2e mov r0, r23 28134: 00 0c add r0, r0 28136: 88 0b sbc r24, r24 28138: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 2813a: cf 91 pop r28 2813c: 1f 91 pop r17 2813e: 0f 91 pop r16 28140: 0c 94 ce 71 jmp 0xe39c ; 0xe39c 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) { 28144: 83 30 cpi r24, 0x03 ; 3 28146: 31 f4 brne .+12 ; 0x28154 lcd_setstatuspgm(MSG_WELCOME); 28148: 8e e0 ldi r24, 0x0E ; 14 2814a: 91 e7 ldi r25, 0x71 ; 113 2814c: 0f 94 0c 0b call 0x21618 ; 0x21618 custom_message_type = CustomMsg::Status; 28150: 10 92 75 07 sts 0x0775, r1 ; 0x800775 } if (custom_message_state > 3 && custom_message_state <= 10) { 28154: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 28158: 84 50 subi r24, 0x04 ; 4 2815a: 87 30 cpi r24, 0x07 ; 7 2815c: 08 f0 brcs .+2 ; 0x28160 2815e: 2a cf rjmp .-428 ; 0x27fb4 lcd_set_cursor(0, 3); 28160: 63 e0 ldi r22, 0x03 ; 3 28162: 80 e0 ldi r24, 0x00 ; 0 28164: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_space(19); 28168: 83 e1 ldi r24, 0x13 ; 19 2816a: 0e 94 0b 70 call 0xe016 ; 0xe016 lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 2816e: 89 e4 ldi r24, 0x49 ; 73 28170: 9a e4 ldi r25, 0x4A ; 74 28172: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 28176: ac 01 movw r20, r24 28178: 63 e0 ldi r22, 0x03 ; 3 2817a: 80 e0 ldi r24, 0x00 ; 0 2817c: 0e 94 29 70 call 0xe052 ; 0xe052 custom_message_state--; 28180: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 28184: 81 50 subi r24, 0x01 ; 1 28186: 80 93 f3 03 sts 0x03F3, r24 ; 0x8003f3 2818a: 14 cf rjmp .-472 ; 0x27fb4 } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 2818c: 64 e1 ldi r22, 0x14 ; 20 2818e: 8a e3 ldi r24, 0x3A ; 58 28190: 95 e0 ldi r25, 0x05 ; 5 28192: 0e 94 04 72 call 0xe408 ; 0xe408 if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 28196: 20 91 46 06 lds r18, 0x0646 ; 0x800646 2819a: 30 91 47 06 lds r19, 0x0647 ; 0x800647 2819e: 80 91 44 06 lds r24, 0x0644 ; 0x800644 281a2: 90 91 45 06 lds r25, 0x0645 ; 0x800645 281a6: 82 17 cp r24, r18 281a8: 93 07 cpc r25, r19 281aa: 0c f4 brge .+2 ; 0x281ae 281ac: 03 cf rjmp .-506 ; 0x27fb4 281ae: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 281b2: 88 23 and r24, r24 281b4: 09 f4 brne .+2 ; 0x281b8 281b6: fe ce rjmp .-516 ; 0x27fb4 lcd_set_cursor(10, 3); 281b8: 63 e0 ldi r22, 0x03 ; 3 281ba: 8a e0 ldi r24, 0x0A ; 10 281bc: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 281c0: 80 91 45 06 lds r24, 0x0645 ; 0x800645 281c4: 8f 93 push r24 281c6: 80 91 44 06 lds r24, 0x0644 ; 0x800644 281ca: 8f 93 push r24 281cc: 80 91 47 06 lds r24, 0x0647 ; 0x800647 281d0: 8f 93 push r24 281d2: 80 91 46 06 lds r24, 0x0646 ; 0x800646 281d6: 8f 93 push r24 281d8: 80 eb ldi r24, 0xB0 ; 176 281da: 91 ea ldi r25, 0xA1 ; 161 } 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); 281dc: 9f 93 push r25 281de: 8f 93 push r24 281e0: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 281e4: 0f 90 pop r0 281e6: 0f 90 pop r0 281e8: 0f 90 pop r0 281ea: 0f 90 pop r0 281ec: 0f 90 pop r0 281ee: 0f 90 pop r0 281f0: e1 ce rjmp .-574 ; 0x27fb4 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); 281f2: 63 e0 ldi r22, 0x03 ; 3 281f4: 80 e0 ldi r24, 0x00 ; 0 281f6: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 281fa: c0 91 f3 03 lds r28, 0x03F3 ; 0x8003f3 281fe: 83 e8 ldi r24, 0x83 ; 131 28200: 9a e3 ldi r25, 0x3A ; 58 28202: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 28206: 1f 92 push r1 28208: cf 93 push r28 2820a: 9f 93 push r25 2820c: 8f 93 push r24 2820e: 82 ea ldi r24, 0xA2 ; 162 28210: 91 ea ldi r25, 0xA1 ; 161 28212: e4 cf rjmp .-56 ; 0x281dc break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 28214: 89 e3 ldi r24, 0x39 ; 57 28216: 9a e4 ldi r25, 0x4A ; 74 28218: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2821c: ac 01 movw r20, r24 2821e: 63 e0 ldi r22, 0x03 ; 3 28220: 80 e0 ldi r24, 0x00 ; 0 28222: 0e 94 29 70 call 0xe052 ; 0xe052 if (custom_message_state <= PINDA_HEAT_T) { 28226: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 2822a: 89 37 cpi r24, 0x79 ; 121 2822c: 08 f0 brcs .+2 ; 0x28230 2822e: c2 ce rjmp .-636 ; 0x27fb4 lcd_puts_P(PSTR(": ")); 28230: 8f e9 ldi r24, 0x9F ; 159 28232: 91 ea ldi r25, 0xA1 ; 161 28234: 0e 94 00 70 call 0xe000 ; 0xe000 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 28238: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 2823c: 0e 94 c4 70 call 0xe188 ; 0xe188 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 28240: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 28242: cf 91 pop r28 28244: 1f 91 pop r17 28246: 0f 91 pop r16 28248: 0c 94 c4 70 jmp 0xe188 ; 0xe188 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 2824c: 88 e2 ldi r24, 0x28 ; 40 2824e: 9a e4 ldi r25, 0x4A ; 74 28250: be ce rjmp .-644 ; 0x27fce 00028252 ::start()>: /** * @brief Start timer */ template void Timer::start() 28252: cf 93 push r28 28254: df 93 push r29 28256: ec 01 movw r28, r24 { m_started = _millis(); 28258: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2825c: 69 83 std Y+1, r22 ; 0x01 2825e: 7a 83 std Y+2, r23 ; 0x02 28260: 8b 83 std Y+3, r24 ; 0x03 28262: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 28264: 81 e0 ldi r24, 0x01 ; 1 28266: 88 83 st Y, r24 } 28268: df 91 pop r29 2826a: cf 91 pop r28 2826c: 08 95 ret 0002826e : //! 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) { 2826e: cf 92 push r12 28270: df 92 push r13 28272: ff 92 push r15 28274: 0f 93 push r16 28276: 1f 93 push r17 28278: cf 93 push r28 2827a: df 93 push r29 2827c: cd b7 in r28, 0x3d ; 61 2827e: de b7 in r29, 0x3e ; 62 28280: 64 97 sbiw r28, 0x14 ; 20 28282: 0f b6 in r0, 0x3f ; 63 28284: f8 94 cli 28286: de bf out 0x3e, r29 ; 62 28288: 0f be out 0x3f, r0 ; 63 2828a: cd bf out 0x3d, r28 ; 61 2828c: 8c 01 movw r16, r24 2828e: f6 2e mov r15, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 28290: 63 eb ldi r22, 0xB3 ; 179 28292: 7f e9 ldi r23, 0x9F ; 159 28294: ce 01 movw r24, r28 28296: 01 96 adiw r24, 0x01 ; 1 28298: 0f 94 12 db call 0x3b624 ; 0x3b624 strcat_P(msg, type); 2829c: b8 01 movw r22, r16 2829e: ce 01 movw r24, r28 282a0: 01 96 adiw r24, 0x01 ; 1 282a2: 0f 94 fe da call 0x3b5fc ; 0x3b5fc lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 282a6: 83 e0 ldi r24, 0x03 ; 3 282a8: 0f 94 d3 05 call 0x20ba6 ; 0x20ba6 282ac: 88 23 and r24, r24 282ae: e1 f0 breq .+56 ; 0x282e8 bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 282b0: be 01 movw r22, r28 282b2: 6f 5f subi r22, 0xFF ; 255 282b4: 7f 4f sbci r23, 0xFF ; 255 282b6: 8a e3 ldi r24, 0x3A ; 58 282b8: 95 e0 ldi r25, 0x05 ; 5 282ba: 0f 94 bd e3 call 0x3c77a ; 0x3c77a 282be: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 282c0: 8f e4 ldi r24, 0x4F ; 79 282c2: 95 e0 ldi r25, 0x05 ; 5 282c4: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> lcd_status_message_level = severity; 282c8: 83 e0 ldi r24, 0x03 ; 3 282ca: 80 93 d1 03 sts 0x03D1, r24 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.453> custom_message_type = CustomMsg::Status; 282ce: 10 92 75 07 sts 0x0775, r1 ; 0x800775 custom_message_state = 0; 282d2: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 if (!same) { 282d6: cd 28 or r12, r13 282d8: 39 f0 breq .+14 ; 0x282e8 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 282da: 60 e0 ldi r22, 0x00 ; 0 282dc: ce 01 movw r24, r28 282de: 01 96 adiw r24, 0x01 ; 1 282e0: 0f 94 b8 05 call 0x20b70 ; 0x20b70 lcd_return_to_status(); 282e4: 0f 94 4e 26 call 0x24c9c ; 0x24c9c lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 282e8: 8a ec ldi r24, 0xCA ; 202 282ea: 9a ea ldi r25, 0xAA ; 170 282ec: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if(e != EXTRUDERS) { 282f0: 81 e0 ldi r24, 0x01 ; 1 282f2: f8 16 cp r15, r24 282f4: 49 f0 breq .+18 ; 0x28308 282f6: 60 e0 ldi r22, 0x00 ; 0 282f8: 70 e0 ldi r23, 0x00 ; 0 282fa: cb 01 movw r24, r22 282fc: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 28300: 80 eb ldi r24, 0xB0 ; 176 28302: 9f e9 ldi r25, 0x9F ; 159 28304: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 } SERIAL_ERRORPGM("Heaters switched off. "); 28308: 89 e9 ldi r24, 0x99 ; 153 2830a: 9f e9 ldi r25, 0x9F ; 159 2830c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ERRORRPGM(type); 28310: c8 01 movw r24, r16 28312: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ERRORLNPGM(" triggered!"); 28316: 8d e8 ldi r24, 0x8D ; 141 28318: 9f e9 ldi r25, 0x9F ; 159 2831a: 0e 94 86 7b call 0xf70c ; 0xf70c } 2831e: 64 96 adiw r28, 0x14 ; 20 28320: 0f b6 in r0, 0x3f ; 63 28322: f8 94 cli 28324: de bf out 0x3e, r29 ; 62 28326: 0f be out 0x3f, r0 ; 63 28328: cd bf out 0x3d, r28 ; 61 2832a: df 91 pop r29 2832c: cf 91 pop r28 2832e: 1f 91 pop r17 28330: 0f 91 pop r16 28332: ff 90 pop r15 28334: df 90 pop r13 28336: cf 90 pop r12 28338: 08 95 ret 0002833a <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 2833a: 1f 92 push r1 2833c: 0f 92 push r0 2833e: 0f b6 in r0, 0x3f ; 63 28340: 0f 92 push r0 28342: 11 24 eor r1, r1 28344: 2f 93 push r18 28346: 3f 93 push r19 28348: 8f 93 push r24 2834a: 9f 93 push r25 2834c: af 93 push r26 2834e: 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; 28350: 80 91 38 06 lds r24, 0x0638 ; 0x800638 28354: 90 91 39 06 lds r25, 0x0639 ; 0x800639 28358: a0 91 3a 06 lds r26, 0x063A ; 0x80063a 2835c: b0 91 3b 06 lds r27, 0x063B ; 0x80063b unsigned char f = timer2_fract; 28360: 30 91 37 06 lds r19, 0x0637 ; 0x800637 m += MILLIS_INC; f += FRACT_INC; 28364: 23 e0 ldi r18, 0x03 ; 3 28366: 23 0f add r18, r19 if (f >= FRACT_MAX) 28368: 2d 37 cpi r18, 0x7D ; 125 2836a: 58 f5 brcc .+86 ; 0x283c2 <__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; 2836c: 01 96 adiw r24, 0x01 ; 1 2836e: a1 1d adc r26, r1 28370: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 28372: 20 93 37 06 sts 0x0637, r18 ; 0x800637 timer2_millis = m; 28376: 80 93 38 06 sts 0x0638, r24 ; 0x800638 2837a: 90 93 39 06 sts 0x0639, r25 ; 0x800639 2837e: a0 93 3a 06 sts 0x063A, r26 ; 0x80063a 28382: b0 93 3b 06 sts 0x063B, r27 ; 0x80063b timer2_overflow_count++; 28386: 80 91 3c 06 lds r24, 0x063C ; 0x80063c 2838a: 90 91 3d 06 lds r25, 0x063D ; 0x80063d 2838e: a0 91 3e 06 lds r26, 0x063E ; 0x80063e 28392: b0 91 3f 06 lds r27, 0x063F ; 0x80063f 28396: 01 96 adiw r24, 0x01 ; 1 28398: a1 1d adc r26, r1 2839a: b1 1d adc r27, r1 2839c: 80 93 3c 06 sts 0x063C, r24 ; 0x80063c 283a0: 90 93 3d 06 sts 0x063D, r25 ; 0x80063d 283a4: a0 93 3e 06 sts 0x063E, r26 ; 0x80063e 283a8: b0 93 3f 06 sts 0x063F, r27 ; 0x80063f } 283ac: bf 91 pop r27 283ae: af 91 pop r26 283b0: 9f 91 pop r25 283b2: 8f 91 pop r24 283b4: 3f 91 pop r19 283b6: 2f 91 pop r18 283b8: 0f 90 pop r0 283ba: 0f be out 0x3f, r0 ; 63 283bc: 0f 90 pop r0 283be: 1f 90 pop r1 283c0: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 283c2: 26 e8 ldi r18, 0x86 ; 134 283c4: 23 0f add r18, r19 m += 1; 283c6: 02 96 adiw r24, 0x02 ; 2 283c8: a1 1d adc r26, r1 283ca: b1 1d adc r27, r1 283cc: d2 cf rjmp .-92 ; 0x28372 <__vector_15+0x38> 000283ce : return pos; } static float cost_fn(uint16_t samples, float* const var, float v, uint8_t fan_pwm, float ambient) { 283ce: 2f 92 push r2 283d0: 3f 92 push r3 283d2: 4f 92 push r4 283d4: 5f 92 push r5 283d6: 6f 92 push r6 283d8: 7f 92 push r7 283da: 8f 92 push r8 283dc: 9f 92 push r9 283de: af 92 push r10 283e0: bf 92 push r11 283e2: cf 92 push r12 283e4: df 92 push r13 283e6: ef 92 push r14 283e8: ff 92 push r15 283ea: 0f 93 push r16 283ec: 1f 93 push r17 283ee: cf 93 push r28 283f0: df 93 push r29 283f2: 00 d0 rcall .+0 ; 0x283f4 283f4: 00 d0 rcall .+0 ; 0x283f6 283f6: 1f 92 push r1 283f8: cd b7 in r28, 0x3d ; 61 283fa: de b7 in r29, 0x3e ; 62 283fc: 9c 83 std Y+4, r25 ; 0x04 283fe: 8b 83 std Y+3, r24 ; 0x03 28400: 0d 83 std Y+5, r16 ; 0x05 28402: 26 01 movw r4, r12 28404: 37 01 movw r6, r14 *var = v; 28406: fb 01 movw r30, r22 28408: 20 83 st Z, r18 2840a: 31 83 std Z+1, r19 ; 0x01 2840c: 42 83 std Z+2, r20 ; 0x02 2840e: 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); 28410: 20 91 c4 12 lds r18, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 28414: 30 91 c5 12 lds r19, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 28418: 40 91 c6 12 lds r20, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 2841c: 50 91 c7 12 lds r21, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> 28420: 61 e7 ldi r22, 0x71 ; 113 28422: 7d e3 ldi r23, 0x3D ; 61 28424: 8a e8 ldi r24, 0x8A ; 138 28426: 9e e3 ldi r25, 0x3E ; 62 28428: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 2842c: 60 93 1b 13 sts 0x131B, r22 ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.394+0x8d> 28430: 70 93 1c 13 sts 0x131C, r23 ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.394+0x8e> 28434: 80 93 1d 13 sts 0x131D, r24 ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.394+0x8f> 28438: 90 93 1e 13 sts 0x131E, r25 ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.394+0x90> warn_s = warn * TEMP_MGR_INTV; 2843c: 21 e7 ldi r18, 0x71 ; 113 2843e: 3d e3 ldi r19, 0x3D ; 61 28440: 4a e8 ldi r20, 0x8A ; 138 28442: 5e e3 ldi r21, 0x3E ; 62 28444: 60 91 12 13 lds r22, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 28448: 70 91 13 13 lds r23, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 2844c: 80 91 14 13 lds r24, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 28450: 90 91 15 13 lds r25, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> 28454: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 28458: 60 93 1f 13 sts 0x131F, r22 ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.394+0x91> 2845c: 70 93 20 13 sts 0x1320, r23 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.394+0x92> 28460: 80 93 21 13 sts 0x1321, r24 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.394+0x93> 28464: 90 93 22 13 sts 0x1322, r25 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.394+0x94> err_s = err * TEMP_MGR_INTV; 28468: 21 e7 ldi r18, 0x71 ; 113 2846a: 3d e3 ldi r19, 0x3D ; 61 2846c: 4a e8 ldi r20, 0x8A ; 138 2846e: 5e e3 ldi r21, 0x3E ; 62 28470: 60 91 16 13 lds r22, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 28474: 70 91 17 13 lds r23, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 28478: 80 91 18 13 lds r24, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 2847c: 90 91 19 13 lds r25, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> 28480: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 28484: 60 93 23 13 sts 0x1323, r22 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.394+0x95> 28488: 70 93 24 13 sts 0x1324, r23 ; 0x801324 <_ZN13thermal_modelL4dataE.lto_priv.394+0x96> 2848c: 80 93 25 13 sts 0x1325, r24 ; 0x801325 <_ZN13thermal_modelL4dataE.lto_priv.394+0x97> 28490: 90 93 26 13 sts 0x1326, r25 ; 0x801326 <_ZN13thermal_modelL4dataE.lto_priv.394+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 28494: 80 91 cc 12 lds r24, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.394+0x3e> 28498: 90 91 cd 12 lds r25, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.394+0x3f> 2849c: 6e e0 ldi r22, 0x0E ; 14 2849e: 71 e0 ldi r23, 0x01 ; 1 284a0: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 284a4: 60 93 ae 12 sts 0x12AE, r22 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.394+0x20> 284a8: ee e8 ldi r30, 0x8E ; 142 284aa: 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; 284ac: 80 e0 ldi r24, 0x00 ; 0 284ae: 90 e0 ldi r25, 0x00 ; 0 284b0: a0 ec ldi r26, 0xC0 ; 192 284b2: bf e7 ldi r27, 0x7F ; 127 284b4: 81 93 st Z+, r24 284b6: 91 93 st Z+, r25 284b8: a1 93 st Z+, r26 284ba: 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) 284bc: 22 e1 ldi r18, 0x12 ; 18 284be: ee 3a cpi r30, 0xAE ; 174 284c0: f2 07 cpc r31, r18 284c2: c1 f7 brne .-16 ; 0x284b4 dT_lag_buf[i] = NAN; dT_lag_idx = 0; 284c4: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.394+0x21> dT_err_prev = 0; 284c8: 10 92 b0 12 sts 0x12B0, r1 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x22> 284cc: 10 92 b1 12 sts 0x12B1, r1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x23> 284d0: 10 92 b2 12 sts 0x12B2, r1 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x24> 284d4: 10 92 b3 12 sts 0x12B3, r1 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x25> T_prev = NAN; 284d8: 80 93 b4 12 sts 0x12B4, r24 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x26> 284dc: 90 93 b5 12 sts 0x12B5, r25 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x27> 284e0: a0 93 b6 12 sts 0x12B6, r26 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x28> 284e4: b0 93 b7 12 sts 0x12B7, r27 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x29> // clear the initialization flag flag_bits.uninitialized = false; 284e8: 80 91 1a 13 lds r24, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 284ec: 8e 7f andi r24, 0xFE ; 254 284ee: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 284f2: 86 e7 ldi r24, 0x76 ; 118 284f4: 97 e0 ldi r25, 0x07 ; 7 284f6: 9f 83 std Y+7, r25 ; 0x07 284f8: 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) { 284fa: e1 e0 ldi r30, 0x01 ; 1 284fc: f0 e0 ldi r31, 0x00 ; 0 284fe: fa 83 std Y+2, r31 ; 0x02 28500: 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; 28502: 31 2c mov r3, r1 28504: 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; 28506: 81 2c mov r8, r1 28508: 91 2c mov r9, r1 2850a: 54 01 movw r10, r8 uint16_t cnt = 0; for(uint16_t i = 1; i < samples; ++i) { 2850c: 29 81 ldd r18, Y+1 ; 0x01 2850e: 3a 81 ldd r19, Y+2 ; 0x02 28510: 8b 81 ldd r24, Y+3 ; 0x03 28512: 9c 81 ldd r25, Y+4 ; 0x04 28514: 28 17 cp r18, r24 28516: 39 07 cpc r19, r25 28518: c8 f5 brcc .+114 ; 0x2858c thermal_model::data.step(rec_buffer[i].pwm, fan_pwm, rec_buffer[i].temp, ambient); 2851a: ee 81 ldd r30, Y+6 ; 0x06 2851c: ff 81 ldd r31, Y+7 ; 0x07 2851e: 25 81 ldd r18, Z+5 ; 0x05 28520: 36 81 ldd r19, Z+6 ; 0x06 28522: 47 81 ldd r20, Z+7 ; 0x07 28524: 50 85 ldd r21, Z+8 ; 0x08 28526: 83 01 movw r16, r6 28528: 72 01 movw r14, r4 2852a: 6d 81 ldd r22, Y+5 ; 0x05 2852c: 81 85 ldd r24, Z+9 ; 0x09 2852e: 0e 94 d5 da call 0x1b5aa ; 0x1b5aa float err_v = thermal_model::data.dT_err_prev; 28532: c0 90 b0 12 lds r12, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x22> 28536: d0 90 b1 12 lds r13, 0x12B1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x23> 2853a: e0 90 b2 12 lds r14, 0x12B2 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x24> 2853e: f0 90 b3 12 lds r15, 0x12B3 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x25> if(!isnan(err_v)) { 28542: a7 01 movw r20, r14 28544: 96 01 movw r18, r12 28546: c7 01 movw r24, r14 28548: b6 01 movw r22, r12 2854a: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 2854e: 81 11 cpse r24, r1 28550: 11 c0 rjmp .+34 ; 0x28574 err += err_v * err_v; 28552: a7 01 movw r20, r14 28554: 96 01 movw r18, r12 28556: c7 01 movw r24, r14 28558: b6 01 movw r22, r12 2855a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2855e: 9b 01 movw r18, r22 28560: ac 01 movw r20, r24 28562: c5 01 movw r24, r10 28564: b4 01 movw r22, r8 28566: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 2856a: 4b 01 movw r8, r22 2856c: 5c 01 movw r10, r24 ++cnt; 2856e: ff ef ldi r31, 0xFF ; 255 28570: 2f 1a sub r2, r31 28572: 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) { 28574: 29 81 ldd r18, Y+1 ; 0x01 28576: 3a 81 ldd r19, Y+2 ; 0x02 28578: 2f 5f subi r18, 0xFF ; 255 2857a: 3f 4f sbci r19, 0xFF ; 255 2857c: 3a 83 std Y+2, r19 ; 0x02 2857e: 29 83 std Y+1, r18 ; 0x01 28580: 8e 81 ldd r24, Y+6 ; 0x06 28582: 9f 81 ldd r25, Y+7 ; 0x07 28584: 05 96 adiw r24, 0x05 ; 5 28586: 9f 83 std Y+7, r25 ; 0x07 28588: 8e 83 std Y+6, r24 ; 0x06 2858a: c0 cf rjmp .-128 ; 0x2850c if(!isnan(err_v)) { err += err_v * err_v; ++cnt; } } return cnt ? (err / cnt) : NAN; 2858c: 60 e0 ldi r22, 0x00 ; 0 2858e: 70 e0 ldi r23, 0x00 ; 0 28590: 80 ec ldi r24, 0xC0 ; 192 28592: 9f e7 ldi r25, 0x7F ; 127 28594: 21 14 cp r2, r1 28596: 31 04 cpc r3, r1 28598: 59 f0 breq .+22 ; 0x285b0 2859a: b1 01 movw r22, r2 2859c: 90 e0 ldi r25, 0x00 ; 0 2859e: 80 e0 ldi r24, 0x00 ; 0 285a0: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 285a4: 9b 01 movw r18, r22 285a6: ac 01 movw r20, r24 285a8: c5 01 movw r24, r10 285aa: b4 01 movw r22, r8 285ac: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> } 285b0: 27 96 adiw r28, 0x07 ; 7 285b2: 0f b6 in r0, 0x3f ; 63 285b4: f8 94 cli 285b6: de bf out 0x3e, r29 ; 62 285b8: 0f be out 0x3f, r0 ; 63 285ba: cd bf out 0x3d, r28 ; 61 285bc: df 91 pop r29 285be: cf 91 pop r28 285c0: 1f 91 pop r17 285c2: 0f 91 pop r16 285c4: ff 90 pop r15 285c6: ef 90 pop r14 285c8: df 90 pop r13 285ca: cf 90 pop r12 285cc: bf 90 pop r11 285ce: af 90 pop r10 285d0: 9f 90 pop r9 285d2: 8f 90 pop r8 285d4: 7f 90 pop r7 285d6: 6f 90 pop r6 285d8: 5f 90 pop r5 285da: 4f 90 pop r4 285dc: 3f 90 pop r3 285de: 2f 90 pop r2 285e0: 08 95 ret 000285e2 : namespace thermal_model_cal { // set current fan speed for both front/backend static __attribute__((noinline)) void set_fan_speed(uint8_t fan_speed) { 285e2: cf 93 push r28 285e4: c8 2f mov r28, r24 // reset the fan measuring state due to missing hysteresis handling on the checking side resetFanCheck(); 285e6: 0e 94 43 76 call 0xec86 ; 0xec86 fanSpeed = fan_speed; 285ea: c0 93 e3 03 sts 0x03E3, r28 ; 0x8003e3 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = fan_speed; 285ee: c0 93 a0 04 sts 0x04A0, r28 ; 0x8004a0 #endif } 285f2: cf 91 pop r28 285f4: 08 95 ret 000285f6 : thermal_model::data.R[index] = R; thermal_model::setup(); } void thermal_model_report_settings() { 285f6: cf 92 push r12 285f8: df 92 push r13 285fa: ef 92 push r14 285fc: ff 92 push r15 285fe: 0f 93 push r16 28600: 1f 93 push r17 28602: cf 93 push r28 28604: df 93 push r29 SERIAL_ECHO_START; 28606: 82 ef ldi r24, 0xF2 ; 242 28608: 9a ea ldi r25, 0xAA ; 170 2860a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNPGM("Thermal Model settings:"); 2860e: 88 e5 ldi r24, 0x58 ; 88 28610: 90 ea ldi r25, 0xA0 ; 160 28612: 0e 94 86 7b call 0xf70c ; 0xf70c 28616: ce ec ldi r28, 0xCE ; 206 28618: d2 e1 ldi r29, 0x12 ; 18 2861a: 10 e0 ldi r17, 0x00 ; 0 2861c: 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]); 2861e: 82 ef ldi r24, 0xF2 ; 242 28620: e8 2e mov r14, r24 28622: 8a ea ldi r24, 0xAA ; 170 28624: f8 2e mov r15, r24 28626: 94 e4 ldi r25, 0x44 ; 68 28628: c9 2e mov r12, r25 2862a: 90 ea ldi r25, 0xA0 ; 160 2862c: d9 2e mov r13, r25 2862e: 88 81 ld r24, Y 28630: 99 81 ldd r25, Y+1 ; 0x01 28632: 2a 81 ldd r18, Y+2 ; 0x02 28634: 3b 81 ldd r19, Y+3 ; 0x03 28636: 24 96 adiw r28, 0x04 ; 4 28638: 3f 93 push r19 2863a: 2f 93 push r18 2863c: 9f 93 push r25 2863e: 8f 93 push r24 28640: 1f 93 push r17 28642: 0f 93 push r16 28644: ff 92 push r15 28646: ef 92 push r14 28648: df 92 push r13 2864a: cf 92 push r12 2864c: 0f 94 1d dc call 0x3b83a ; 0x3b83a 28650: 0f 5f subi r16, 0xFF ; 255 28652: 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) 28654: 8d b7 in r24, 0x3d ; 61 28656: 9e b7 in r25, 0x3e ; 62 28658: 0a 96 adiw r24, 0x0a ; 10 2865a: 0f b6 in r0, 0x3f ; 63 2865c: f8 94 cli 2865e: 9e bf out 0x3e, r25 ; 62 28660: 0f be out 0x3f, r0 ; 63 28662: 8d bf out 0x3d, r24 ; 61 28664: 00 31 cpi r16, 0x10 ; 16 28666: 11 05 cpc r17, r1 28668: 11 f7 brne .-60 ; 0x2862e 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"), 2866a: 80 91 11 13 lds r24, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> 2866e: 8f 93 push r24 28670: 80 91 10 13 lds r24, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 28674: 8f 93 push r24 28676: 80 91 0f 13 lds r24, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 2867a: 8f 93 push r24 2867c: 80 91 0e 13 lds r24, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 28680: 8f 93 push r24 28682: 80 91 15 13 lds r24, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> 28686: 8f 93 push r24 28688: 80 91 14 13 lds r24, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 2868c: 8f 93 push r24 2868e: 80 91 13 13 lds r24, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 28692: 8f 93 push r24 28694: 80 91 12 13 lds r24, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 28698: 8f 93 push r24 2869a: 80 91 19 13 lds r24, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> 2869e: 8f 93 push r24 286a0: 80 91 18 13 lds r24, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 286a4: 8f 93 push r24 286a6: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 286aa: 8f 93 push r24 286ac: 80 91 16 13 lds r24, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 286b0: 8f 93 push r24 286b2: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.468> 286b6: 1f 92 push r1 286b8: 8f 93 push r24 286ba: 80 91 20 05 lds r24, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> 286be: 1f 92 push r1 286c0: 8f 93 push r24 286c2: 80 91 cd 12 lds r24, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.394+0x3f> 286c6: 8f 93 push r24 286c8: 80 91 cc 12 lds r24, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.394+0x3e> 286cc: 8f 93 push r24 286ce: 80 91 cb 12 lds r24, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.394+0x3d> 286d2: 8f 93 push r24 286d4: 80 91 ca 12 lds r24, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.394+0x3c> 286d8: 8f 93 push r24 286da: 80 91 c9 12 lds r24, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3b> 286de: 8f 93 push r24 286e0: 80 91 c8 12 lds r24, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3a> 286e4: 8f 93 push r24 286e6: 80 91 c7 12 lds r24, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> 286ea: 8f 93 push r24 286ec: 80 91 c6 12 lds r24, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 286f0: 8f 93 push r24 286f2: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 286f6: 8f 93 push r24 286f8: 80 91 c4 12 lds r24, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 286fc: 8f 93 push r24 286fe: 80 91 c3 12 lds r24, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x35> 28702: 8f 93 push r24 28704: 80 91 c2 12 lds r24, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x34> 28708: 8f 93 push r24 2870a: 80 91 c1 12 lds r24, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x33> 2870e: 8f 93 push r24 28710: 80 91 c0 12 lds r24, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x32> 28714: 8f 93 push r24 28716: 80 91 bf 12 lds r24, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.394+0x31> 2871a: 8f 93 push r24 2871c: 80 91 be 12 lds r24, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.394+0x30> 28720: 8f 93 push r24 28722: 80 91 bd 12 lds r24, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.394+0x2f> 28726: 8f 93 push r24 28728: 80 91 bc 12 lds r24, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.394+0x2e> 2872c: 8f 93 push r24 2872e: 80 91 bb 12 lds r24, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.394+0x2d> 28732: 8f 93 push r24 28734: 80 91 ba 12 lds r24, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.394+0x2c> 28738: 8f 93 push r24 2873a: 80 91 b9 12 lds r24, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2b> 2873e: 8f 93 push r24 28740: 80 91 b8 12 lds r24, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2a> 28744: 8f 93 push r24 28746: ff 92 push r15 28748: ef 92 push r14 2874a: 8e ef ldi r24, 0xFE ; 254 2874c: 9f e9 ldi r25, 0x9F ; 159 2874e: 9f 93 push r25 28750: 8f 93 push r24 28752: 0f 94 1d dc call 0x3b83a ; 0x3b83a 28756: 8d b7 in r24, 0x3d ; 61 28758: 9e b7 in r25, 0x3e ; 62 2875a: 8a 96 adiw r24, 0x2a ; 42 2875c: 0f b6 in r0, 0x3f ; 63 2875e: f8 94 cli 28760: 9e bf out 0x3e, r25 ; 62 28762: 0f be out 0x3f, r0 ; 63 28764: 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); } 28766: df 91 pop r29 28768: cf 91 pop r28 2876a: 1f 91 pop r17 2876c: 0f 91 pop r16 2876e: ff 90 pop r15 28770: ef 90 pop r14 28772: df 90 pop r13 28774: cf 90 pop r12 28776: 08 95 ret 00028778 : // 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); 28778: 89 57 subi r24, 0x79 ; 121 2877a: 9f 4f sbci r25, 0xFF ; 255 2877c: 6e e0 ldi r22, 0x0E ; 14 2877e: 71 e0 ldi r23, 0x01 ; 1 28780: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> // ensure we do not exceed the maximum lag buffer and have at least one lag sample for filtering if(samples < 1) 28784: 61 15 cp r22, r1 28786: 71 05 cpc r23, r1 28788: 99 f0 breq .+38 ; 0x287b0 2878a: 69 30 cpi r22, 0x09 ; 9 2878c: 71 05 cpc r23, r1 2878e: 10 f0 brcs .+4 ; 0x28794 28790: 68 e0 ldi r22, 0x08 ; 8 28792: 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; 28794: 2e e0 ldi r18, 0x0E ; 14 28796: 31 e0 ldi r19, 0x01 ; 1 28798: 62 9f mul r22, r18 2879a: c0 01 movw r24, r0 2879c: 63 9f mul r22, r19 2879e: 90 0d add r25, r0 287a0: 72 9f mul r23, r18 287a2: 90 0d add r25, r0 287a4: 11 24 eor r1, r1 287a6: 90 93 cd 12 sts 0x12CD, r25 ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.394+0x3f> 287aa: 80 93 cc 12 sts 0x12CC, r24 ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.394+0x3e> } 287ae: 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; 287b0: 61 e0 ldi r22, 0x01 ; 1 287b2: 70 e0 ldi r23, 0x00 ; 0 287b4: ef cf rjmp .-34 ; 0x28794 000287b6 : if(!calibrated()) enabled = false; reinitialize(); } static bool calibrated() { 287b6: cf 93 push r28 287b8: df 93 push r29 if(!(data.P > 0)) return false; 287ba: 20 e0 ldi r18, 0x00 ; 0 287bc: 30 e0 ldi r19, 0x00 ; 0 287be: a9 01 movw r20, r18 287c0: 60 91 b8 12 lds r22, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2a> 287c4: 70 91 b9 12 lds r23, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2b> 287c8: 80 91 ba 12 lds r24, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.394+0x2c> 287cc: 90 91 bb 12 lds r25, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.394+0x2d> 287d0: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 287d4: 18 16 cp r1, r24 287d6: 0c f0 brlt .+2 ; 0x287da 287d8: 54 c0 rjmp .+168 ; 0x28882 if(isnan(data.U)) return false; 287da: 60 91 bc 12 lds r22, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.394+0x2e> 287de: 70 91 bd 12 lds r23, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.394+0x2f> 287e2: 80 91 be 12 lds r24, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.394+0x30> 287e6: 90 91 bf 12 lds r25, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.394+0x31> 287ea: 9b 01 movw r18, r22 287ec: ac 01 movw r20, r24 287ee: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 287f2: 81 11 cpse r24, r1 287f4: 46 c0 rjmp .+140 ; 0x28882 if(isnan(data.V)) return false; 287f6: 60 91 c0 12 lds r22, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x32> 287fa: 70 91 c1 12 lds r23, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x33> 287fe: 80 91 c2 12 lds r24, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x34> 28802: 90 91 c3 12 lds r25, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x35> 28806: 9b 01 movw r18, r22 28808: ac 01 movw r20, r24 2880a: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 2880e: 81 11 cpse r24, r1 28810: 38 c0 rjmp .+112 ; 0x28882 if(!(data.C > 0)) return false; 28812: 20 e0 ldi r18, 0x00 ; 0 28814: 30 e0 ldi r19, 0x00 ; 0 28816: a9 01 movw r20, r18 28818: 60 91 c4 12 lds r22, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 2881c: 70 91 c5 12 lds r23, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 28820: 80 91 c6 12 lds r24, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 28824: 90 91 c7 12 lds r25, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> 28828: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 2882c: 18 16 cp r1, r24 2882e: 4c f5 brge .+82 ; 0x28882 if(isnan(data.fS)) return false; 28830: 60 91 c8 12 lds r22, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3a> 28834: 70 91 c9 12 lds r23, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3b> 28838: 80 91 ca 12 lds r24, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.394+0x3c> 2883c: 90 91 cb 12 lds r25, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.394+0x3d> 28840: 9b 01 movw r18, r22 28842: ac 01 movw r20, r24 28844: 0f 94 91 e2 call 0x3c522 ; 0x3c522 <__unordsf2> 28848: 81 11 cpse r24, r1 2884a: 1b c0 rjmp .+54 ; 0x28882 if(!(data.L > 0)) return false; 2884c: 80 91 cc 12 lds r24, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.394+0x3e> 28850: 90 91 cd 12 lds r25, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.394+0x3f> 28854: 89 2b or r24, r25 28856: a9 f0 breq .+42 ; 0x28882 28858: ce ec ldi r28, 0xCE ; 206 2885a: 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)) 2885c: 69 91 ld r22, Y+ 2885e: 79 91 ld r23, Y+ 28860: 89 91 ld r24, Y+ 28862: 99 91 ld r25, Y+ 28864: 20 e0 ldi r18, 0x00 ; 0 28866: 30 e0 ldi r19, 0x00 ; 0 28868: a9 01 movw r20, r18 2886a: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 2886e: 87 fd sbrc r24, 7 28870: 08 c0 rjmp .+16 ; 0x28882 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) { 28872: 83 e1 ldi r24, 0x13 ; 19 28874: ce 30 cpi r28, 0x0E ; 14 28876: d8 07 cpc r29, r24 28878: 89 f7 brne .-30 ; 0x2885c if(!(thermal_model::data.R[i] >= 0)) return false; } if(!(data.warn != NAN)) return false; if(!(data.err != NAN)) return false; return true; 2887a: 81 e0 ldi r24, 0x01 ; 1 } 2887c: df 91 pop r29 2887e: cf 91 pop r28 28880: 08 95 ret reinitialize(); } static bool calibrated() { if(!(data.P > 0)) return false; 28882: 80 e0 ldi r24, 0x00 ; 0 28884: fb cf rjmp .-10 ; 0x2887c 00028886 : } // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; 28886: 0f 94 db 43 call 0x287b6 ; 0x287b6 2888a: 81 11 cpse r24, r1 2888c: 02 c0 rjmp .+4 ; 0x28892 2888e: 10 92 20 05 sts 0x0520, r1 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 28892: 81 e0 ldi r24, 0x01 ; 1 28894: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> warning_state.assert = false; // explicitly clear assertions 28898: 80 91 36 06 lds r24, 0x0636 ; 0x800636 2889c: 8d 7f andi r24, 0xFD ; 253 2889e: 80 93 36 06 sts 0x0636, r24 ; 0x800636 // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; reinitialize(); } 288a2: 08 95 ret 000288a4 : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 288a4: 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; 288a6: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 288aa: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 288ae: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 288b2: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 288b6: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 288b8: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 288ba: 0f 94 d8 20 call 0x241b0 ; 0x241b0 temp_mgr_pid(); 288be: 0f 94 15 1e call 0x23c2a ; 0x23c2a // 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); 288c2: 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; 288c4: 10 92 6d 06 sts 0x066D, r1 ; 0x80066d (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 288c8: cf bf out 0x3f, r28 ; 63 #endif } } 288ca: cf 91 pop r28 288cc: 08 95 ret 000288ce : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 288ce: 0f 94 52 44 call 0x288a4 ; 0x288a4 fanSpeed = 0; 288d2: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_return_to_status(); 288d6: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 000288da : // 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) { 288da: 1f 93 push r17 288dc: cf 93 push r28 288de: df 93 push r29 288e0: c8 2f mov r28, r24 288e2: 16 2f mov r17, r22 288e4: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 288e6: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 288ea: 80 fd sbrc r24, 0 288ec: 18 c0 rjmp .+48 ; 0x2891e 288ee: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 288f2: 81 11 cpse r24, r1 288f4: 14 c0 rjmp .+40 ; 0x2891e saved_bed_temperature = target_temperature_bed; 288f6: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 288fa: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af saved_extruder_temperature = target_temperature[index]; 288fe: e6 2f mov r30, r22 28900: f0 e0 ldi r31, 0x00 ; 0 28902: ee 0f add r30, r30 28904: ff 1f adc r31, r31 28906: e3 59 subi r30, 0x93 ; 147 28908: f1 4f sbci r31, 0xF1 ; 241 2890a: 80 81 ld r24, Z 2890c: 91 81 ldd r25, Z+1 ; 0x01 2890e: 90 93 ae 05 sts 0x05AE, r25 ; 0x8005ae 28912: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_fan_speed = fanSpeed; 28916: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 2891a: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 2891e: 0f 94 52 44 call 0x288a4 ; 0x288a4 void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed 28922: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> 28926: 82 60 ori r24, 0x02 ; 2 28928: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.486> #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 2892c: 0e 94 43 76 call 0xec86 ; 0xec86 setExtruderAutoFanState(3); 28930: 83 e0 ldi r24, 0x03 ; 3 28932: 0e 94 51 77 call 0xeea2 ; 0xeea2 SET_OUTPUT(FAN_PIN); 28936: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 2893a: 88 60 ori r24, 0x08 ; 8 2893c: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 28940: 8f ef ldi r24, 0xFF ; 255 28942: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 28946: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 hotendFanSetFullSpeed(); // set the initial error source to the highest priority error if(!temp_error_state.error || (uint8_t)type < temp_error_state.type) { 2894a: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 2894e: 80 ff sbrs r24, 0 28950: 07 c0 rjmp .+14 ; 0x28960 28952: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 28956: 82 95 swap r24 28958: 86 95 lsr r24 2895a: 87 70 andi r24, 0x07 ; 7 2895c: d8 17 cp r29, r24 2895e: c0 f4 brcc .+48 ; 0x28990 temp_error_state.source = (uint8_t)source; 28960: c3 70 andi r28, 0x03 ; 3 28962: cc 0f add r28, r28 28964: cc 0f add r28, r28 28966: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 2896a: 83 7f andi r24, 0xF3 ; 243 2896c: 8c 2b or r24, r28 2896e: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e <_ZL16temp_error_state.lto_priv.467> temp_error_state.index = index; 28972: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 28976: 10 fb bst r17, 0 28978: 84 f9 bld r24, 4 2897a: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e <_ZL16temp_error_state.lto_priv.467> temp_error_state.type = (uint8_t)type; 2897e: d2 95 swap r29 28980: dd 0f add r29, r29 28982: d0 7e andi r29, 0xE0 ; 224 28984: 40 91 1e 05 lds r20, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 28988: 4f 71 andi r20, 0x1F ; 31 2898a: 4d 2b or r20, r29 2898c: 40 93 1e 05 sts 0x051E, r20 ; 0x80051e <_ZL16temp_error_state.lto_priv.467> } // always set the error state temp_error_state.error = true; 28990: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 28994: 81 60 ori r24, 0x01 ; 1 28996: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e <_ZL16temp_error_state.lto_priv.467> temp_error_state.assert = true; 2899a: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 2899e: 82 60 ori r24, 0x02 ; 2 289a0: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e <_ZL16temp_error_state.lto_priv.467> } 289a4: df 91 pop r29 289a6: cf 91 pop r28 289a8: 1f 91 pop r17 289aa: 08 95 ret 000289ac : } void check_min_temp_bed() { #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw >= bed_minttemp_raw) { 289ac: 20 91 06 06 lds r18, 0x0606 ; 0x800606 289b0: 30 91 07 06 lds r19, 0x0607 ; 0x800607 289b4: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.484> 289b8: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.484+0x1> 289bc: 28 17 cp r18, r24 289be: 39 07 cpc r19, r25 289c0: 2c f0 brlt .+10 ; 0x289cc #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 289c2: 41 e0 ldi r20, 0x01 ; 1 289c4: 60 e0 ldi r22, 0x00 ; 0 289c6: 81 e0 ldi r24, 0x01 ; 1 289c8: 0d 94 6d 44 jmp 0x288da ; 0x288da } } 289cc: 08 95 ret 000289ce : 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]) { 289ce: 20 91 08 06 lds r18, 0x0608 ; 0x800608 289d2: 30 91 09 06 lds r19, 0x0609 ; 0x800609 289d6: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.485> 289da: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.485+0x1> 289de: 28 17 cp r18, r24 289e0: 39 07 cpc r19, r25 289e2: 2c f0 brlt .+10 ; 0x289ee #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 289e4: 41 e0 ldi r20, 0x01 ; 1 289e6: 60 e0 ldi r22, 0x00 ; 0 289e8: 80 e0 ldi r24, 0x00 ; 0 289ea: 0d 94 6d 44 jmp 0x288da ; 0x288da } } 289ee: 08 95 ret 000289f0 : 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) { 289f0: 2f 92 push r2 289f2: 3f 92 push r3 289f4: 4f 92 push r4 289f6: 5f 92 push r5 289f8: 6f 92 push r6 289fa: 7f 92 push r7 289fc: 8f 92 push r8 289fe: 9f 92 push r9 28a00: af 92 push r10 28a02: bf 92 push r11 28a04: cf 92 push r12 28a06: df 92 push r13 28a08: ef 92 push r14 28a0a: ff 92 push r15 28a0c: 0f 93 push r16 28a0e: 1f 93 push r17 28a10: cf 93 push r28 28a12: df 93 push r29 28a14: cd b7 in r28, 0x3d ; 61 28a16: de b7 in r29, 0x3e ; 62 28a18: 2c 97 sbiw r28, 0x0c ; 12 28a1a: 0f b6 in r0, 0x3f ; 63 28a1c: f8 94 cli 28a1e: de bf out 0x3e, r29 ; 62 28a20: 0f be out 0x3f, r0 ; 63 28a22: cd bf out 0x3d, r28 ; 61 28a24: 28 2e mov r2, r24 28a26: 49 83 std Y+1, r20 ; 0x01 28a28: 5a 83 std Y+2, r21 ; 0x02 28a2a: 6b 83 std Y+3, r22 ; 0x03 28a2c: 7c 83 std Y+4, r23 ; 0x04 28a2e: 28 01 movw r4, r16 28a30: 39 01 movw r6, r18 28a32: 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) 28a34: 0f 94 86 3e call 0x27d0c ; 0x27d0c 28a38: 02 2d mov r16, r2 28a3a: 10 e0 ldi r17, 0x00 ; 0 28a3c: 98 01 movw r18, r16 28a3e: 22 0f add r18, r18 28a40: 33 1f adc r19, r19 28a42: 22 0f add r18, r18 28a44: 33 1f adc r19, r19 28a46: 3c 87 std Y+12, r19 ; 0x0c 28a48: 2b 87 std Y+11, r18 ; 0x0b 28a4a: f9 01 movw r30, r18 28a4c: e6 53 subi r30, 0x36 ; 54 28a4e: fa 4f sbci r31, 0xFA ; 250 28a50: 80 80 ld r8, Z 28a52: 91 80 ldd r9, Z+1 ; 0x01 28a54: a2 80 ldd r10, Z+2 ; 0x02 28a56: b3 80 ldd r11, Z+3 ; 0x03 28a58: 68 19 sub r22, r8 28a5a: 79 09 sbc r23, r9 28a5c: 8a 09 sbc r24, r10 28a5e: 9b 09 sbc r25, r11 28a60: 61 3d cpi r22, 0xD1 ; 209 28a62: 77 40 sbci r23, 0x07 ; 7 28a64: 81 05 cpc r24, r1 28a66: 91 05 cpc r25, r1 28a68: 08 f4 brcc .+2 ; 0x28a6c 28a6a: ea c0 rjmp .+468 ; 0x28c40 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 28a6c: 33 20 and r3, r3 28a6e: 09 f4 brne .+2 ; 0x28a72 28a70: 75 c0 rjmp .+234 ; 0x28b5c { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 28a72: 88 e6 ldi r24, 0x68 ; 104 28a74: 91 e0 ldi r25, 0x01 ; 1 28a76: 9a 87 std Y+10, r25 ; 0x0a 28a78: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 28a7a: 80 e0 ldi r24, 0x00 ; 0 28a7c: 90 e0 ldi r25, 0x00 ; 0 28a7e: a0 ea ldi r26, 0xA0 ; 160 28a80: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 28a82: 8d 83 std Y+5, r24 ; 0x05 28a84: 9e 83 std Y+6, r25 ; 0x06 28a86: af 83 std Y+7, r26 ; 0x07 28a88: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 28a8a: 0f 94 86 3e call 0x27d0c ; 0x27d0c 28a8e: eb 85 ldd r30, Y+11 ; 0x0b 28a90: fc 85 ldd r31, Y+12 ; 0x0c 28a92: e6 53 subi r30, 0x36 ; 54 28a94: fa 4f sbci r31, 0xFA ; 250 28a96: 60 83 st Z, r22 28a98: 71 83 std Z+1, r23 ; 0x01 28a9a: 82 83 std Z+2, r24 ; 0x02 28a9c: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 28a9e: 20 e0 ldi r18, 0x00 ; 0 28aa0: 30 e0 ldi r19, 0x00 ; 0 28aa2: a9 01 movw r20, r18 28aa4: c7 01 movw r24, r14 28aa6: b6 01 movw r22, r12 28aa8: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 28aac: 81 11 cpse r24, r1 28aae: 07 c0 rjmp .+14 ; 0x28abe { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28ab0: f8 01 movw r30, r16 28ab2: ee 0f add r30, r30 28ab4: ff 1f adc r31, r31 28ab6: ea 53 subi r30, 0x3A ; 58 28ab8: fa 4f sbci r31, 0xFA ; 250 28aba: 11 82 std Z+1, r1 ; 0x01 28abc: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 28abe: ab 85 ldd r26, Y+11 ; 0x0b 28ac0: bc 85 ldd r27, Y+12 ; 0x0c 28ac2: a2 54 subi r26, 0x42 ; 66 28ac4: ba 4f sbci r27, 0xFA ; 250 28ac6: 5d 01 movw r10, r26 28ac8: 29 81 ldd r18, Y+1 ; 0x01 28aca: 3a 81 ldd r19, Y+2 ; 0x02 28acc: 4b 81 ldd r20, Y+3 ; 0x03 28ace: 5c 81 ldd r21, Y+4 ; 0x04 28ad0: 6d 91 ld r22, X+ 28ad2: 7d 91 ld r23, X+ 28ad4: 8d 91 ld r24, X+ 28ad6: 9c 91 ld r25, X 28ad8: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 28adc: 88 23 and r24, r24 28ade: 09 f4 brne .+2 ; 0x28ae2 28ae0: 91 c0 rjmp .+290 ; 0x28c04 { if (_target_temperature > 0) 28ae2: 20 e0 ldi r18, 0x00 ; 0 28ae4: 30 e0 ldi r19, 0x00 ; 0 28ae6: a9 01 movw r20, r18 28ae8: 69 81 ldd r22, Y+1 ; 0x01 28aea: 7a 81 ldd r23, Y+2 ; 0x02 28aec: 8b 81 ldd r24, Y+3 ; 0x03 28aee: 9c 81 ldd r25, Y+4 ; 0x04 28af0: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 28af4: f8 01 movw r30, r16 28af6: e4 54 subi r30, 0x44 ; 68 28af8: fa 4f sbci r31, 0xFA ; 250 28afa: 18 16 cp r1, r24 28afc: c4 f5 brge .+112 ; 0x28b6e { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 28afe: 81 e0 ldi r24, 0x01 ; 1 28b00: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 28b02: 89 81 ldd r24, Y+1 ; 0x01 28b04: 9a 81 ldd r25, Y+2 ; 0x02 28b06: ab 81 ldd r26, Y+3 ; 0x03 28b08: bc 81 ldd r27, Y+4 ; 0x04 28b0a: f5 01 movw r30, r10 28b0c: 80 83 st Z, r24 28b0e: 91 83 std Z+1, r25 ; 0x01 28b10: a2 83 std Z+2, r26 ; 0x02 28b12: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 28b14: eb 85 ldd r30, Y+11 ; 0x0b 28b16: fc 85 ldd r31, Y+12 ; 0x0c 28b18: ec 54 subi r30, 0x4C ; 76 28b1a: fa 4f sbci r31, 0xFA ; 250 28b1c: 40 82 st Z, r4 28b1e: 51 82 std Z+1, r5 ; 0x01 28b20: 62 82 std Z+2, r6 ; 0x02 28b22: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 28b24: f8 01 movw r30, r16 28b26: ee 54 subi r30, 0x4E ; 78 28b28: fa 4f sbci r31, 0xFA ; 250 28b2a: 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)) 28b2c: a3 01 movw r20, r6 28b2e: 92 01 movw r18, r4 28b30: bc 01 movw r22, r24 28b32: cd 01 movw r24, r26 28b34: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 28b38: 18 16 cp r1, r24 28b3a: 1c f5 brge .+70 ; 0x28b82 { __preheat_counter[_heater_id]++; 28b3c: f8 01 movw r30, r16 28b3e: ee 54 subi r30, 0x4E ; 78 28b40: fa 4f sbci r31, 0xFA ; 250 28b42: 80 81 ld r24, Z 28b44: 8f 5f subi r24, 0xFF ; 255 28b46: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 28b48: 31 10 cpse r3, r1 28b4a: c7 c0 rjmp .+398 ; 0x28cda 28b4c: 89 30 cpi r24, 0x09 ; 9 28b4e: c8 f0 brcs .+50 ; 0x28b82 { __delta=2.0; 28b50: 81 2c mov r8, r1 28b52: 91 2c mov r9, r1 28b54: a1 2c mov r10, r1 28b56: 50 e4 ldi r21, 0x40 ; 64 28b58: b5 2e mov r11, r21 28b5a: e8 c0 rjmp .+464 ; 0x28d2c #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 28b5c: ad e2 ldi r26, 0x2D ; 45 28b5e: b0 e0 ldi r27, 0x00 ; 0 28b60: ba 87 std Y+10, r27 ; 0x0a 28b62: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 28b64: 80 e0 ldi r24, 0x00 ; 0 28b66: 90 e0 ldi r25, 0x00 ; 0 28b68: a0 e7 ldi r26, 0x70 ; 112 28b6a: b1 e4 ldi r27, 0x41 ; 65 28b6c: 8a cf rjmp .-236 ; 0x28a82 __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 28b6e: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 28b70: 89 81 ldd r24, Y+1 ; 0x01 28b72: 9a 81 ldd r25, Y+2 ; 0x02 28b74: ab 81 ldd r26, Y+3 ; 0x03 28b76: bc 81 ldd r27, Y+4 ; 0x04 28b78: f5 01 movw r30, r10 28b7a: 80 83 st Z, r24 28b7c: 91 83 std Z+1, r25 ; 0x01 28b7e: a2 83 std Z+2, r26 ; 0x02 28b80: 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) 28b82: 2d 81 ldd r18, Y+5 ; 0x05 28b84: 3e 81 ldd r19, Y+6 ; 0x06 28b86: 4f 81 ldd r20, Y+7 ; 0x07 28b88: 58 85 ldd r21, Y+8 ; 0x08 28b8a: 69 81 ldd r22, Y+1 ; 0x01 28b8c: 7a 81 ldd r23, Y+2 ; 0x02 28b8e: 8b 81 ldd r24, Y+3 ; 0x03 28b90: 9c 81 ldd r25, Y+4 ; 0x04 28b92: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 28b96: a3 01 movw r20, r6 28b98: 92 01 movw r18, r4 28b9a: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 28b9e: 87 ff sbrs r24, 7 28ba0: 46 c0 rjmp .+140 ; 0x28c2e 28ba2: f8 01 movw r30, r16 28ba4: e4 54 subi r30, 0x44 ; 68 28ba6: fa 4f sbci r31, 0xFA ; 250 28ba8: 80 81 ld r24, Z 28baa: 81 30 cpi r24, 0x01 ; 1 28bac: 49 f4 brne .+18 ; 0x28bc0 { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 28bae: 82 e0 ldi r24, 0x02 ; 2 28bb0: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28bb2: f8 01 movw r30, r16 28bb4: ee 0f add r30, r30 28bb6: ff 1f adc r31, r31 28bb8: ea 53 subi r30, 0x3A ; 58 28bba: fa 4f sbci r31, 0xFA ; 250 28bbc: 11 82 std Z+1, r1 ; 0x01 28bbe: 10 82 st Z, r1 } if (_output > 0) 28bc0: 20 e0 ldi r18, 0x00 ; 0 28bc2: 30 e0 ldi r19, 0x00 ; 0 28bc4: a9 01 movw r20, r18 28bc6: c7 01 movw r24, r14 28bc8: b6 01 movw r22, r12 28bca: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 28bce: 18 16 cp r1, r24 28bd0: bc f5 brge .+110 ; 0x28c40 if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 28bd2: 29 81 ldd r18, Y+1 ; 0x01 28bd4: 3a 81 ldd r19, Y+2 ; 0x02 28bd6: 4b 81 ldd r20, Y+3 ; 0x03 28bd8: 5c 81 ldd r21, Y+4 ; 0x04 28bda: 6d 81 ldd r22, Y+5 ; 0x05 28bdc: 7e 81 ldd r23, Y+6 ; 0x06 28bde: 8f 81 ldd r24, Y+7 ; 0x07 28be0: 98 85 ldd r25, Y+8 ; 0x08 28be2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 28be6: a3 01 movw r20, r6 28be8: 92 01 movw r18, r4 28bea: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 28bee: 18 16 cp r1, r24 28bf0: 0c f0 brlt .+2 ; 0x28bf4 28bf2: 3f c0 rjmp .+126 ; 0x28c72 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28bf4: 00 0f add r16, r16 28bf6: 11 1f adc r17, r17 28bf8: f8 01 movw r30, r16 28bfa: ea 53 subi r30, 0x3A ; 58 28bfc: fa 4f sbci r31, 0xFA ; 250 28bfe: 11 82 std Z+1, r1 ; 0x01 28c00: 10 82 st Z, r1 28c02: 1e c0 rjmp .+60 ; 0x28c40 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)) 28c04: a3 01 movw r20, r6 28c06: 92 01 movw r18, r4 28c08: 69 81 ldd r22, Y+1 ; 0x01 28c0a: 7a 81 ldd r23, Y+2 ; 0x02 28c0c: 8b 81 ldd r24, Y+3 ; 0x03 28c0e: 9c 81 ldd r25, Y+4 ; 0x04 28c10: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 28c14: 18 16 cp r1, r24 28c16: 0c f0 brlt .+2 ; 0x28c1a 28c18: b4 cf rjmp .-152 ; 0x28b82 28c1a: f8 01 movw r30, r16 28c1c: e4 54 subi r30, 0x44 ; 68 28c1e: fa 4f sbci r31, 0xFA ; 250 28c20: 80 81 ld r24, Z 28c22: 81 30 cpi r24, 0x01 ; 1 28c24: 09 f0 breq .+2 ; 0x28c28 28c26: ad cf rjmp .-166 ; 0x28b82 28c28: 89 cf rjmp .-238 ; 0x28b3c 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; 28c2a: 10 82 st Z, r1 28c2c: 97 c0 rjmp .+302 ; 0x28d5c temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 28c2e: 20 e0 ldi r18, 0x00 ; 0 28c30: 30 e0 ldi r19, 0x00 ; 0 28c32: a9 01 movw r20, r18 28c34: c7 01 movw r24, r14 28c36: b6 01 movw r22, r12 28c38: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 28c3c: 18 16 cp r1, r24 28c3e: cc f0 brlt .+50 ; 0x28c72 } } } } } 28c40: 2c 96 adiw r28, 0x0c ; 12 28c42: 0f b6 in r0, 0x3f ; 63 28c44: f8 94 cli 28c46: de bf out 0x3e, r29 ; 62 28c48: 0f be out 0x3f, r0 ; 63 28c4a: cd bf out 0x3d, r28 ; 61 28c4c: df 91 pop r29 28c4e: cf 91 pop r28 28c50: 1f 91 pop r17 28c52: 0f 91 pop r16 28c54: ff 90 pop r15 28c56: ef 90 pop r14 28c58: df 90 pop r13 28c5a: cf 90 pop r12 28c5c: bf 90 pop r11 28c5e: af 90 pop r10 28c60: 9f 90 pop r9 28c62: 8f 90 pop r8 28c64: 7f 90 pop r7 28c66: 6f 90 pop r6 28c68: 5f 90 pop r5 28c6a: 4f 90 pop r4 28c6c: 3f 90 pop r3 28c6e: 2f 90 pop r2 28c70: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 28c72: f8 01 movw r30, r16 28c74: e4 54 subi r30, 0x44 ; 68 28c76: fa 4f sbci r31, 0xFA ; 250 28c78: 80 81 ld r24, Z 28c7a: 82 30 cpi r24, 0x02 ; 2 28c7c: 08 f3 brcs .-62 ; 0x28c40 { temp_runaway_error_counter[_heater_id]++; 28c7e: 00 0f add r16, r16 28c80: 11 1f adc r17, r17 28c82: f8 01 movw r30, r16 28c84: ea 53 subi r30, 0x3A ; 58 28c86: fa 4f sbci r31, 0xFA ; 250 28c88: 80 81 ld r24, Z 28c8a: 91 81 ldd r25, Z+1 ; 0x01 28c8c: 01 96 adiw r24, 0x01 ; 1 28c8e: 91 83 std Z+1, r25 ; 0x01 28c90: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 28c92: 88 0f add r24, r24 28c94: 99 1f adc r25, r25 28c96: e9 85 ldd r30, Y+9 ; 0x09 28c98: fa 85 ldd r31, Y+10 ; 0x0a 28c9a: e8 17 cp r30, r24 28c9c: f9 07 cpc r31, r25 28c9e: 80 f6 brcc .-96 ; 0x28c40 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 28ca0: 43 e0 ldi r20, 0x03 ; 3 28ca2: 62 2d mov r22, r2 28ca4: 83 2d mov r24, r3 } } } } } 28ca6: 2c 96 adiw r28, 0x0c ; 12 28ca8: 0f b6 in r0, 0x3f ; 63 28caa: f8 94 cli 28cac: de bf out 0x3e, r29 ; 62 28cae: 0f be out 0x3f, r0 ; 63 28cb0: cd bf out 0x3d, r28 ; 61 28cb2: df 91 pop r29 28cb4: cf 91 pop r28 28cb6: 1f 91 pop r17 28cb8: 0f 91 pop r16 28cba: ff 90 pop r15 28cbc: ef 90 pop r14 28cbe: df 90 pop r13 28cc0: cf 90 pop r12 28cc2: bf 90 pop r11 28cc4: af 90 pop r10 28cc6: 9f 90 pop r9 28cc8: 8f 90 pop r8 28cca: 7f 90 pop r7 28ccc: 6f 90 pop r6 28cce: 5f 90 pop r5 28cd0: 4f 90 pop r4 28cd2: 3f 90 pop r3 28cd4: 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); 28cd6: 0d 94 6d 44 jmp 0x288da ; 0x288da } 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 28cda: 81 31 cpi r24, 0x11 ; 17 28cdc: 08 f4 brcc .+2 ; 0x28ce0 28cde: 51 cf rjmp .-350 ; 0x28b82 { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 28ce0: 20 e0 ldi r18, 0x00 ; 0 28ce2: 30 e0 ldi r19, 0x00 ; 0 28ce4: 44 eb ldi r20, 0xB4 ; 180 28ce6: 52 e4 ldi r21, 0x42 ; 66 28ce8: c3 01 movw r24, r6 28cea: b2 01 movw r22, r4 28cec: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 28cf0: 81 2c mov r8, r1 28cf2: 91 2c mov r9, r1 28cf4: e0 e4 ldi r30, 0x40 ; 64 28cf6: ae 2e mov r10, r30 28cf8: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 28cfa: 18 16 cp r1, r24 28cfc: 2c f4 brge .+10 ; 0x28d08 28cfe: 81 2c mov r8, r1 28d00: 91 2c mov r9, r1 28d02: a1 2c mov r10, r1 28d04: 70 e4 ldi r23, 0x40 ; 64 28d06: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 28d08: 20 e0 ldi r18, 0x00 ; 0 28d0a: 30 e0 ldi r19, 0x00 ; 0 28d0c: 42 ed ldi r20, 0xD2 ; 210 28d0e: 52 e4 ldi r21, 0x42 ; 66 28d10: c3 01 movw r24, r6 28d12: b2 01 movw r22, r4 28d14: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 28d18: 18 16 cp r1, r24 28d1a: 44 f4 brge .+16 ; 0x28d2c 28d1c: 6a e9 ldi r22, 0x9A ; 154 28d1e: 86 2e mov r8, r22 28d20: 69 e9 ldi r22, 0x99 ; 153 28d22: 96 2e mov r9, r22 28d24: 69 e1 ldi r22, 0x19 ; 25 28d26: a6 2e mov r10, r22 28d28: 6f e3 ldi r22, 0x3F ; 63 28d2a: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 28d2c: eb 85 ldd r30, Y+11 ; 0x0b 28d2e: fc 85 ldd r31, Y+12 ; 0x0c 28d30: ec 54 subi r30, 0x4C ; 76 28d32: fa 4f sbci r31, 0xFA ; 250 28d34: 20 81 ld r18, Z 28d36: 31 81 ldd r19, Z+1 ; 0x01 28d38: 42 81 ldd r20, Z+2 ; 0x02 28d3a: 53 81 ldd r21, Z+3 ; 0x03 28d3c: c3 01 movw r24, r6 28d3e: b2 01 movw r22, r4 28d40: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 28d44: a5 01 movw r20, r10 28d46: 94 01 movw r18, r8 28d48: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 28d4c: f8 01 movw r30, r16 28d4e: e0 55 subi r30, 0x50 ; 80 28d50: fa 4f sbci r31, 0xFA ; 250 28d52: 87 ff sbrs r24, 7 28d54: 6a cf rjmp .-300 ; 0x28c2a __preheat_errors[_heater_id]++; 28d56: 80 81 ld r24, Z 28d58: 8f 5f subi r24, 0xFF ; 255 28d5a: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 28d5c: 80 81 ld r24, Z 28d5e: 90 e0 ldi r25, 0x00 ; 0 28d60: 31 10 cpse r3, r1 28d62: 04 c0 rjmp .+8 ; 0x28d6c 28d64: 06 97 sbiw r24, 0x06 ; 6 28d66: 4c f0 brlt .+18 ; 0x28d7a set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 28d68: 80 e0 ldi r24, 0x00 ; 0 28d6a: 03 c0 rjmp .+6 ; 0x28d72 __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 28d6c: 04 97 sbiw r24, 0x04 ; 4 28d6e: 2c f0 brlt .+10 ; 0x28d7a set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 28d70: 81 e0 ldi r24, 0x01 ; 1 28d72: 42 e0 ldi r20, 0x02 ; 2 28d74: 62 2d mov r22, r2 28d76: 0f 94 6d 44 call 0x288da ; 0x288da __preheat_start[_heater_id] = _current_temperature; 28d7a: 2b 85 ldd r18, Y+11 ; 0x0b 28d7c: 3c 85 ldd r19, Y+12 ; 0x0c 28d7e: 2c 54 subi r18, 0x4C ; 76 28d80: 3a 4f sbci r19, 0xFA ; 250 28d82: d9 01 movw r26, r18 28d84: 4d 92 st X+, r4 28d86: 5d 92 st X+, r5 28d88: 6d 92 st X+, r6 28d8a: 7c 92 st X, r7 28d8c: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 28d8e: f8 01 movw r30, r16 28d90: ee 54 subi r30, 0x4E ; 78 28d92: fa 4f sbci r31, 0xFA ; 250 28d94: 10 82 st Z, r1 28d96: f5 ce rjmp .-534 ; 0x28b82 00028d98 : temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { 28d98: fc 01 movw r30, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28d9a: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28d9c: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 28d9e: 80 81 ld r24, Z 28da0: 88 23 and r24, r24 28da2: 29 f0 breq .+10 ; 0x28dae 28da4: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 28da8: 82 60 ori r24, 0x02 ; 2 28daa: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28dae: 9f bf out 0x3f, r25 ; 63 } } 28db0: 08 95 ret 00028db2 : class TempMgrGuard { bool temp_mgr_state; public: TempMgrGuard() { 28db2: dc 01 movw r26, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28db4: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28db6: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 28db8: e3 e7 ldi r30, 0x73 ; 115 28dba: f0 e0 ldi r31, 0x00 ; 0 28dbc: 90 81 ld r25, Z 28dbe: 96 95 lsr r25 28dc0: 91 70 andi r25, 0x01 ; 1 28dc2: 9c 93 st X, r25 DISABLE_TEMP_MGR_INTERRUPT(); 28dc4: 80 81 ld r24, Z 28dc6: 8d 7f andi r24, 0xFD ; 253 28dc8: 80 83 st Z, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28dca: 2f bf out 0x3f, r18 ; 63 } } 28dcc: 08 95 ret 00028dce : (double)thermal_model::data.err, (double)thermal_model::data.warn, (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { 28dce: cf 93 push r28 28dd0: df 93 push r29 28dd2: 1f 92 push r1 28dd4: cd b7 in r28, 0x3d ; 61 28dd6: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 28dd8: ce 01 movw r24, r28 28dda: 01 96 adiw r24, 0x01 ; 1 28ddc: 0f 94 d9 46 call 0x28db2 ; 0x28db2 thermal_model::data.P = THERMAL_MODEL_DEF(P); 28de0: 80 e0 ldi r24, 0x00 ; 0 28de2: 90 e0 ldi r25, 0x00 ; 0 28de4: a0 e7 ldi r26, 0x70 ; 112 28de6: b2 e4 ldi r27, 0x42 ; 66 28de8: 80 93 b8 12 sts 0x12B8, r24 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2a> 28dec: 90 93 b9 12 sts 0x12B9, r25 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2b> 28df0: a0 93 ba 12 sts 0x12BA, r26 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.394+0x2c> 28df4: b0 93 bb 12 sts 0x12BB, r27 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.394+0x2d> thermal_model::data.U = THERMAL_MODEL_DEF(U); 28df8: 84 e3 ldi r24, 0x34 ; 52 28dfa: 90 e8 ldi r25, 0x80 ; 128 28dfc: a7 eb ldi r26, 0xB7 ; 183 28dfe: ba eb ldi r27, 0xBA ; 186 28e00: 80 93 bc 12 sts 0x12BC, r24 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.394+0x2e> 28e04: 90 93 bd 12 sts 0x12BD, r25 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.394+0x2f> 28e08: a0 93 be 12 sts 0x12BE, r26 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.394+0x30> 28e0c: b0 93 bf 12 sts 0x12BF, r27 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.394+0x31> thermal_model::data.V = THERMAL_MODEL_DEF(V); 28e10: 86 e6 ldi r24, 0x66 ; 102 28e12: 96 e6 ldi r25, 0x66 ; 102 28e14: a6 e8 ldi r26, 0x86 ; 134 28e16: bf e3 ldi r27, 0x3F ; 63 28e18: 80 93 c0 12 sts 0x12C0, r24 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x32> 28e1c: 90 93 c1 12 sts 0x12C1, r25 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x33> 28e20: a0 93 c2 12 sts 0x12C2, r26 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x34> 28e24: b0 93 c3 12 sts 0x12C3, r27 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x35> thermal_model::data.C = THERMAL_MODEL_DEF(C); 28e28: 8a e9 ldi r24, 0x9A ; 154 28e2a: 99 e9 ldi r25, 0x99 ; 153 28e2c: a1 e1 ldi r26, 0x11 ; 17 28e2e: b1 e4 ldi r27, 0x41 ; 65 28e30: 80 93 c4 12 sts 0x12C4, r24 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 28e34: 90 93 c5 12 sts 0x12C5, r25 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 28e38: a0 93 c6 12 sts 0x12C6, r26 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 28e3c: b0 93 c7 12 sts 0x12C7, r27 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> thermal_model::data.fS = THERMAL_MODEL_DEF(fS); 28e40: 8a e9 ldi r24, 0x9A ; 154 28e42: 99 e9 ldi r25, 0x99 ; 153 28e44: a9 e1 ldi r26, 0x19 ; 25 28e46: be e3 ldi r27, 0x3E ; 62 28e48: 80 93 c8 12 sts 0x12C8, r24 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3a> 28e4c: 90 93 c9 12 sts 0x12C9, r25 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3b> 28e50: a0 93 ca 12 sts 0x12CA, r26 ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.394+0x3c> 28e54: b0 93 cb 12 sts 0x12CB, r27 ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.394+0x3d> thermal_model::data.L = (uint16_t)(THERMAL_MODEL_DEF(LAG) / (TEMP_MGR_INTV * 1000) + 0.5) * (uint16_t)(TEMP_MGR_INTV * 1000); 28e58: 8e e0 ldi r24, 0x0E ; 14 28e5a: 91 e0 ldi r25, 0x01 ; 1 28e5c: 90 93 cd 12 sts 0x12CD, r25 ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.394+0x3f> 28e60: 80 93 cc 12 sts 0x12CC, r24 ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.394+0x3e> 28e64: 80 e7 ldi r24, 0x70 ; 112 28e66: 90 ea ldi r25, 0xA0 ; 160 28e68: ae ec ldi r26, 0xCE ; 206 28e6a: 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); 28e6c: fc 01 movw r30, r24 28e6e: 45 91 lpm r20, Z+ 28e70: 55 91 lpm r21, Z+ 28e72: 65 91 lpm r22, Z+ 28e74: 74 91 lpm r23, Z 28e76: 4d 93 st X+, r20 28e78: 5d 93 st X+, r21 28e7a: 6d 93 st X+, r22 28e7c: 7d 93 st X+, r23 28e7e: 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) 28e80: 23 e1 ldi r18, 0x13 ; 19 28e82: ae 30 cpi r26, 0x0E ; 14 28e84: b2 07 cpc r27, r18 28e86: 91 f7 brne .-28 ; 0x28e6c thermal_model::data.R[i] = pgm_read_float(THERMAL_MODEL_R_DEFAULT + i); thermal_model::data.Ta_corr = THERMAL_MODEL_Ta_corr; 28e88: 80 e0 ldi r24, 0x00 ; 0 28e8a: 90 e0 ldi r25, 0x00 ; 0 28e8c: a0 ee ldi r26, 0xE0 ; 224 28e8e: b0 ec ldi r27, 0xC0 ; 192 28e90: 80 93 0e 13 sts 0x130E, r24 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 28e94: 90 93 0f 13 sts 0x130F, r25 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 28e98: a0 93 10 13 sts 0x1310, r26 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 28e9c: b0 93 11 13 sts 0x1311, r27 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> thermal_model::data.warn = THERMAL_MODEL_DEF(W); 28ea0: 8a e9 ldi r24, 0x9A ; 154 28ea2: 99 e9 ldi r25, 0x99 ; 153 28ea4: a9 e5 ldi r26, 0x59 ; 89 28ea6: bf e3 ldi r27, 0x3F ; 63 28ea8: 80 93 12 13 sts 0x1312, r24 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 28eac: 90 93 13 13 sts 0x1313, r25 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 28eb0: a0 93 14 13 sts 0x1314, r26 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 28eb4: b0 93 15 13 sts 0x1315, r27 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> thermal_model::data.err = THERMAL_MODEL_DEF(E); 28eb8: 84 ea ldi r24, 0xA4 ; 164 28eba: 90 e7 ldi r25, 0x70 ; 112 28ebc: ad e9 ldi r26, 0x9D ; 157 28ebe: bf e3 ldi r27, 0x3F ; 63 28ec0: 80 93 16 13 sts 0x1316, r24 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 28ec4: 90 93 17 13 sts 0x1317, r25 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 28ec8: a0 93 18 13 sts 0x1318, r26 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 28ecc: b0 93 19 13 sts 0x1319, r27 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> thermal_model::warn_beep = true; 28ed0: 81 e0 ldi r24, 0x01 ; 1 28ed2: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.468> thermal_model::enabled = true; 28ed6: 80 93 20 05 sts 0x0520, r24 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 28eda: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> warning_state.assert = false; // explicitly clear assertions 28ede: 80 91 36 06 lds r24, 0x0636 ; 0x800636 28ee2: 8d 7f andi r24, 0xFD ; 253 28ee4: 80 93 36 06 sts 0x0636, r24 ; 0x800636 (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { TempMgrGuard temp_mgr_guard; 28ee8: ce 01 movw r24, r28 28eea: 01 96 adiw r24, 0x01 ; 1 28eec: 0f 94 cc 46 call 0x28d98 ; 0x28d98 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(); } 28ef0: 0f 90 pop r0 28ef2: df 91 pop r29 28ef4: cf 91 pop r28 28ef6: 08 95 ret 00028ef8 : { return thermal_model::enabled; } void thermal_model_set_enabled(bool enabled) { 28ef8: 1f 93 push r17 28efa: cf 93 push r28 28efc: df 93 push r29 28efe: 1f 92 push r1 28f00: cd b7 in r28, 0x3d ; 61 28f02: de b7 in r29, 0x3e ; 62 28f04: 18 2f mov r17, r24 // set the enabled flag { TempMgrGuard temp_mgr_guard; 28f06: ce 01 movw r24, r28 28f08: 01 96 adiw r24, 0x01 ; 1 28f0a: 0f 94 d9 46 call 0x28db2 ; 0x28db2 thermal_model::enabled = enabled; 28f0e: 10 93 20 05 sts 0x0520, r17 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> thermal_model::setup(); 28f12: 0f 94 43 44 call 0x28886 ; 0x28886 void thermal_model_set_enabled(bool enabled) { // set the enabled flag { TempMgrGuard temp_mgr_guard; 28f16: ce 01 movw r24, r28 28f18: 01 96 adiw r24, 0x01 ; 1 28f1a: 0f 94 cc 46 call 0x28d98 ; 0x28d98 thermal_model::enabled = enabled; thermal_model::setup(); } // verify that the model has been enabled if(enabled && !thermal_model::enabled) 28f1e: 11 23 and r17, r17 28f20: 41 f0 breq .+16 ; 0x28f32 28f22: 80 91 20 05 lds r24, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> 28f26: 81 11 cpse r24, r1 28f28: 04 c0 rjmp .+8 ; 0x28f32 SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); 28f2a: 88 ed ldi r24, 0xD8 ; 216 28f2c: 9f e9 ldi r25, 0x9F ; 159 28f2e: 0e 94 86 7b call 0xf70c ; 0xf70c } 28f32: 0f 90 pop r0 28f34: df 91 pop r29 28f36: cf 91 pop r28 28f38: 1f 91 pop r17 28f3a: 08 95 ret 00028f3c : #endif } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { 28f3c: 1f 93 push r17 28f3e: cf 93 push r28 28f40: df 93 push r29 28f42: 1f 92 push r1 28f44: cd b7 in r28, 0x3d ; 61 28f46: de b7 in r29, 0x3e ; 62 28f48: 18 2f mov r17, r24 TempMgrGuard temp_mgr_guard; 28f4a: ce 01 movw r24, r28 28f4c: 01 96 adiw r24, 0x01 ; 1 28f4e: 0f 94 d9 46 call 0x28db2 ; 0x28db2 thermal_model::enabled = enabled; 28f52: 10 93 20 05 sts 0x0520, r17 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 28f56: 81 e0 ldi r24, 0x01 ; 1 28f58: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> warning_state.assert = false; // explicitly clear assertions 28f5c: e6 e3 ldi r30, 0x36 ; 54 28f5e: f6 e0 ldi r31, 0x06 ; 6 28f60: 80 81 ld r24, Z 28f62: 8d 7f andi r24, 0xFD ; 253 28f64: 80 83 st Z, r24 } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { TempMgrGuard temp_mgr_guard; 28f66: ce 01 movw r24, r28 28f68: 01 96 adiw r24, 0x01 ; 1 28f6a: 0f 94 cc 46 call 0x28d98 ; 0x28d98 thermal_model::enabled = enabled; thermal_model::reinitialize(); } 28f6e: 0f 90 pop r0 28f70: df 91 pop r29 28f72: cf 91 pop r28 28f74: 1f 91 pop r17 28f76: 08 95 ret 00028f78 : /* 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() { 28f78: cf 93 push r28 28f7a: df 93 push r29 28f7c: 1f 92 push r1 28f7e: cd b7 in r28, 0x3d ; 61 28f80: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 28f82: ce 01 movw r24, r28 28f84: 01 96 adiw r24, 0x01 ; 1 28f86: 0f 94 d9 46 call 0x28db2 ; 0x28db2 } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 28f8e: 90 91 1b 05 lds r25, 0x051B ; 0x80051b 28f92: a0 91 1c 05 lds r26, 0x051C ; 0x80051c 28f96: b0 91 1d 05 lds r27, 0x051D ; 0x80051d 28f9a: 80 93 61 0e sts 0x0E61, r24 ; 0x800e61 28f9e: 90 93 62 0e sts 0x0E62, r25 ; 0x800e62 28fa2: a0 93 63 0e sts 0x0E63, r26 ; 0x800e63 28fa6: b0 93 64 0e sts 0x0E64, r27 ; 0x800e64 current_temperature_bed = current_temperature_bed_isr; 28faa: 80 91 16 06 lds r24, 0x0616 ; 0x800616 28fae: 90 91 17 06 lds r25, 0x0617 ; 0x800617 28fb2: a0 91 18 06 lds r26, 0x0618 ; 0x800618 28fb6: b0 91 19 06 lds r27, 0x0619 ; 0x800619 28fba: 80 93 f1 04 sts 0x04F1, r24 ; 0x8004f1 28fbe: 90 93 f2 04 sts 0x04F2, r25 ; 0x8004f2 28fc2: a0 93 f3 04 sts 0x04F3, r26 ; 0x8004f3 28fc6: b0 93 f4 04 sts 0x04F4, r27 ; 0x8004f4 #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 28fca: 80 91 00 06 lds r24, 0x0600 ; 0x800600 28fce: 90 91 01 06 lds r25, 0x0601 ; 0x800601 28fd2: a0 91 02 06 lds r26, 0x0602 ; 0x800602 28fd6: b0 91 03 06 lds r27, 0x0603 ; 0x800603 28fda: 80 93 99 03 sts 0x0399, r24 ; 0x800399 28fde: 90 93 9a 03 sts 0x039A, r25 ; 0x80039a 28fe2: a0 93 9b 03 sts 0x039B, r26 ; 0x80039b 28fe6: b0 93 9c 03 sts 0x039C, r27 ; 0x80039c #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient = current_temperature_ambient_isr; 28fea: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 28fee: 90 91 1e 06 lds r25, 0x061E ; 0x80061e 28ff2: a0 91 1f 06 lds r26, 0x061F ; 0x80061f 28ff6: b0 91 20 06 lds r27, 0x0620 ; 0x800620 28ffa: 80 93 53 06 sts 0x0653, r24 ; 0x800653 28ffe: 90 93 54 06 sts 0x0654, r25 ; 0x800654 29002: a0 93 55 06 sts 0x0655, r26 ; 0x800655 29006: b0 93 56 06 sts 0x0656, r27 ; 0x800656 This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { TempMgrGuard temp_mgr_guard; setCurrentTemperaturesFromIsr(); if(!temp_error_state.v) { 2900a: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 2900e: 81 11 cpse r24, r1 29010: 02 c0 rjmp .+4 ; 0x29016 // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 29012: 0f 94 d8 20 call 0x241b0 ; 0x241b0 } temp_meas_ready = false; 29016: 10 92 ff 05 sts 0x05FF, r1 ; 0x8005ff - 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; 2901a: ce 01 movw r24, r28 2901c: 01 96 adiw r24, 0x01 ; 1 2901e: 0f 94 cc 46 call 0x28d98 ; 0x28d98 if(!temp_error_state.v) { // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); } temp_meas_ready = false; } 29022: 0f 90 pop r0 29024: df 91 pop r29 29026: cf 91 pop r28 29028: 08 95 ret 0002902a <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 2902a: 1f 92 push r1 2902c: 0f 92 push r0 2902e: 0f b6 in r0, 0x3f ; 63 29030: 0f 92 push r0 29032: 11 24 eor r1, r1 29034: 0b b6 in r0, 0x3b ; 59 29036: 0f 92 push r0 29038: ff 92 push r15 2903a: 0f 93 push r16 2903c: 1f 93 push r17 2903e: 2f 93 push r18 29040: 3f 93 push r19 29042: 4f 93 push r20 29044: 5f 93 push r21 29046: 6f 93 push r22 29048: 7f 93 push r23 2904a: 8f 93 push r24 2904c: 9f 93 push r25 2904e: af 93 push r26 29050: bf 93 push r27 29052: cf 93 push r28 29054: df 93 push r29 29056: ef 93 push r30 29058: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 2905a: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 2905e: 8b 7f andi r24, 0xFB ; 251 29060: 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(); 29064: 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) 29066: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 2906a: 86 fd sbrc r24, 6 2906c: c8 c0 rjmp .+400 ; 0x291fe <__vector_14+0x1d4> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 2906e: 68 ec ldi r22, 0xC8 ; 200 29070: 70 e0 ldi r23, 0x00 ; 0 29072: 80 ee ldi r24, 0xE0 ; 224 29074: 95 e0 ldi r25, 0x05 ; 5 29076: 0f 94 e0 3e call 0x27dc0 ; 0x27dc0 ::expired_cont(unsigned short)> 2907a: 88 23 and r24, r24 2907c: b9 f0 breq .+46 ; 0x290ac <__vector_14+0x82> buttonBlanking.start(); 2907e: 80 ee ldi r24, 0xE0 ; 224 29080: 95 e0 ldi r25, 0x05 ; 5 29082: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> safetyTimer.start(); 29086: 8b ed ldi r24, 0xDB ; 219 29088: 95 e0 ldi r25, 0x05 ; 5 2908a: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 2908e: 80 91 da 05 lds r24, 0x05DA ; 0x8005da 29092: 81 11 cpse r24, r1 29094: a5 c0 rjmp .+330 ; 0x291e0 <__vector_14+0x1b6> 29096: 80 91 d9 05 lds r24, 0x05D9 ; 0x8005d9 2909a: 81 11 cpse r24, r1 2909c: a1 c0 rjmp .+322 ; 0x291e0 <__vector_14+0x1b6> { longPressTimer.start(); 2909e: 86 ed ldi r24, 0xD6 ; 214 290a0: 95 e0 ldi r25, 0x05 ; 5 290a2: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> lcd_button_pressed = 1; 290a6: 81 e0 ldi r24, 0x01 ; 1 290a8: 80 93 da 05 sts 0x05DA, r24 ; 0x8005da -2, 1, -1, 0, }; static uint8_t enc_bits_old = 0; uint8_t enc_bits = 0; if (!READ(BTN_EN1)) enc_bits |= _BV(0); 290ac: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 290b0: 82 fb bst r24, 2 290b2: 88 27 eor r24, r24 290b4: 80 f9 bld r24, 0 290b6: 91 e0 ldi r25, 0x01 ; 1 290b8: 89 27 eor r24, r25 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 290ba: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 290be: 91 ff sbrs r25, 1 290c0: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 290c2: e0 91 d3 05 lds r30, 0x05D3 ; 0x8005d3 290c6: e8 17 cp r30, r24 290c8: e1 f0 breq .+56 ; 0x29102 <__vector_14+0xd8> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 290ca: 24 e0 ldi r18, 0x04 ; 4 290cc: e2 9f mul r30, r18 290ce: f0 01 movw r30, r0 290d0: 11 24 eor r1, r1 290d2: e8 2b or r30, r24 290d4: e7 54 subi r30, 0x47 ; 71 290d6: f0 46 sbci r31, 0x60 ; 96 290d8: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 290da: 90 91 d2 05 lds r25, 0x05D2 ; 0x8005d2 <_ZL16lcd_encoder_diff.lto_priv.558> 290de: e9 0f add r30, r25 290e0: e0 93 d2 05 sts 0x05D2, r30 ; 0x8005d2 <_ZL16lcd_encoder_diff.lto_priv.558> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 290e4: 0e 2e mov r0, r30 290e6: 00 0c add r0, r0 290e8: ff 0b sbc r31, r31 290ea: f7 ff sbrs r31, 7 290ec: 03 c0 rjmp .+6 ; 0x290f4 <__vector_14+0xca> 290ee: f1 95 neg r31 290f0: e1 95 neg r30 290f2: f1 09 sbc r31, r1 290f4: 34 97 sbiw r30, 0x04 ; 4 290f6: 1c f0 brlt .+6 ; 0x290fe <__vector_14+0xd4> lcd_backlight_wake_trigger = true; // flag event, knob rotated 290f8: 91 e0 ldi r25, 0x01 ; 1 290fa: 90 93 d4 05 sts 0x05D4, r25 ; 0x8005d4 <_ZL26lcd_backlight_wake_trigger.lto_priv.557> } enc_bits_old = enc_bits; 290fe: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 29102: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 29106: 81 11 cpse r24, r1 29108: 08 c0 rjmp .+16 ; 0x2911a <__vector_14+0xf0> { soft_pwm_0 = soft_pwm[0]; 2910a: 80 91 19 05 lds r24, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.472> 2910e: 80 93 e5 05 sts 0x05E5, r24 ; 0x8005e5 if(soft_pwm_0 > 0) 29112: 88 23 and r24, r24 29114: 09 f4 brne .+2 ; 0x29118 <__vector_14+0xee> 29116: 87 c0 rjmp .+270 ; 0x29226 <__vector_14+0x1fc> { WRITE(HEATER_0_PIN,1); 29118: 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) 2911a: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2911e: 8f 70 andi r24, 0x0F ; 15 29120: a9 f4 brne .+42 ; 0x2914c <__vector_14+0x122> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 29122: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 29126: 90 e0 ldi r25, 0x00 ; 0 29128: 24 e0 ldi r18, 0x04 ; 4 2912a: 95 95 asr r25 2912c: 87 95 ror r24 2912e: 2a 95 dec r18 29130: e1 f7 brne .-8 ; 0x2912a <__vector_14+0x100> 29132: 80 93 9f 04 sts 0x049F, r24 ; 0x80049f <_ZL12soft_pwm_fan.lto_priv.473> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 29136: 89 2b or r24, r25 29138: 09 f4 brne .+2 ; 0x2913c <__vector_14+0x112> 2913a: 77 c0 rjmp .+238 ; 0x2922a <__vector_14+0x200> 2913c: 9f b7 in r25, 0x3f ; 63 2913e: f8 94 cli 29140: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29144: 88 60 ori r24, 0x08 ; 8 29146: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2914a: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 2914c: 90 91 e5 05 lds r25, 0x05E5 ; 0x8005e5 29150: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 29154: 98 17 cp r25, r24 29156: 08 f4 brcc .+2 ; 0x2915a <__vector_14+0x130> { WRITE(HEATER_0_PIN,0); 29158: 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); 2915a: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2915e: 8f 70 andi r24, 0x0F ; 15 29160: 90 91 9f 04 lds r25, 0x049F ; 0x80049f <_ZL12soft_pwm_fan.lto_priv.473> 29164: 98 17 cp r25, r24 29166: 40 f4 brcc .+16 ; 0x29178 <__vector_14+0x14e> 29168: 9f b7 in r25, 0x3f ; 63 2916a: f8 94 cli 2916c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29170: 87 7f andi r24, 0xF7 ; 247 29172: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29176: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 29178: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2917c: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 2917e: 8f 77 andi r24, 0x7F ; 127 29180: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 29184: 10 e0 ldi r17, 0x00 ; 0 29186: 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 29188: e8 01 movw r28, r16 2918a: cc 0f add r28, r28 2918c: dd 1f adc r29, r29 2918e: ca 59 subi r28, 0x9A ; 154 29190: d9 4f sbci r29, 0xF9 ; 249 29192: 88 81 ld r24, Y 29194: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 29196: 18 16 cp r1, r24 29198: 19 06 cpc r1, r25 2919a: 0c f0 brlt .+2 ; 0x2919e <__vector_14+0x174> 2919c: 4c c0 rjmp .+152 ; 0x29236 <__vector_14+0x20c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2919e: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 291a0: f8 94 cli babystep(axis,/*fwd*/true); 291a2: 61 e0 ldi r22, 0x01 ; 1 291a4: 80 2f mov r24, r16 291a6: 0f 94 e9 20 call 0x241d2 ; 0x241d2 babystepsTodo[axis]--; //less to do next time 291aa: 88 81 ld r24, Y 291ac: 99 81 ldd r25, Y+1 ; 0x01 291ae: 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 291b0: 99 83 std Y+1, r25 ; 0x01 291b2: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 291b4: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 291b6: 0f 5f subi r16, 0xFF ; 255 291b8: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 291ba: 03 30 cpi r16, 0x03 ; 3 291bc: 11 05 cpc r17, r1 291be: 21 f7 brne .-56 ; 0x29188 <__vector_14+0x15e> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 291c0: 80 91 39 18 lds r24, 0x1839 ; 0x801839 <__bss_end+0x20> 291c4: 90 91 3a 18 lds r25, 0x183A ; 0x80183a <__bss_end+0x21> 291c8: a0 91 3b 18 lds r26, 0x183B ; 0x80183b <__bss_end+0x22> 291cc: b0 91 3c 18 lds r27, 0x183C ; 0x80183c <__bss_end+0x23> 291d0: 82 3a cpi r24, 0xA2 ; 162 291d2: 92 4a sbci r25, 0xA2 ; 162 291d4: a1 05 cpc r26, r1 291d6: b1 05 cpc r27, r1 291d8: d9 f1 breq .+118 ; 0x29250 <__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); 291da: 81 e0 ldi r24, 0x01 ; 1 291dc: 0e 94 8d 68 call 0xd11a ; 0xd11a if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 291e0: 68 ee ldi r22, 0xE8 ; 232 291e2: 73 e0 ldi r23, 0x03 ; 3 291e4: 86 ed ldi r24, 0xD6 ; 214 291e6: 95 e0 ldi r25, 0x05 ; 5 291e8: 0f 94 b8 3e call 0x27d70 ; 0x27d70 ::expired(unsigned short)> 291ec: 88 23 and r24, r24 291ee: 09 f4 brne .+2 ; 0x291f2 <__vector_14+0x1c8> 291f0: 5d cf rjmp .-326 ; 0x290ac <__vector_14+0x82> { lcd_long_press_active = 1; 291f2: 81 e0 ldi r24, 0x01 ; 1 291f4: 80 93 d9 05 sts 0x05D9, r24 ; 0x8005d9 lcd_longpress_trigger = 1; 291f8: 80 93 d5 05 sts 0x05D5, r24 ; 0x8005d5 291fc: 57 cf rjmp .-338 ; 0x290ac <__vector_14+0x82> } } } else { //button not pressed if (lcd_button_pressed) 291fe: 80 91 da 05 lds r24, 0x05DA ; 0x8005da 29202: 88 23 and r24, r24 29204: 09 f4 brne .+2 ; 0x29208 <__vector_14+0x1de> 29206: 52 cf rjmp .-348 ; 0x290ac <__vector_14+0x82> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 29208: 10 92 da 05 sts 0x05DA, r1 ; 0x8005da if (!lcd_long_press_active) 2920c: 80 91 d9 05 lds r24, 0x05D9 ; 0x8005d9 29210: 81 11 cpse r24, r1 29212: 03 c0 rjmp .+6 ; 0x2921a <__vector_14+0x1f0> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 29214: 81 e0 ldi r24, 0x01 ; 1 29216: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 2921a: 81 e0 ldi r24, 0x01 ; 1 2921c: 80 93 d4 05 sts 0x05D4, r24 ; 0x8005d4 <_ZL26lcd_backlight_wake_trigger.lto_priv.557> lcd_long_press_active = 0; 29220: 10 92 d9 05 sts 0x05D9, r1 ; 0x8005d9 29224: 43 cf rjmp .-378 ; 0x290ac <__vector_14+0x82> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 29226: 75 98 cbi 0x0e, 5 ; 14 29228: 78 cf rjmp .-272 ; 0x2911a <__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); 2922a: 9f b7 in r25, 0x3f ; 63 2922c: f8 94 cli 2922e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29232: 87 7f andi r24, 0xF7 ; 247 29234: 88 cf rjmp .-240 ; 0x29146 <__vector_14+0x11c> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 29236: 89 2b or r24, r25 29238: 09 f4 brne .+2 ; 0x2923c <__vector_14+0x212> 2923a: bd cf rjmp .-134 ; 0x291b6 <__vector_14+0x18c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2923c: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2923e: f8 94 cli babystep(axis,/*fwd*/false); 29240: 60 e0 ldi r22, 0x00 ; 0 29242: 80 2f mov r24, r16 29244: 0f 94 e9 20 call 0x241d2 ; 0x241d2 babystepsTodo[axis]++; //less to do next time 29248: 88 81 ld r24, Y 2924a: 99 81 ldd r25, Y+1 ; 0x01 2924c: 01 96 adiw r24, 0x01 ; 1 2924e: b0 cf rjmp .-160 ; 0x291b0 <__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]) { 29250: 9c b1 in r25, 0x0c ; 12 29252: 80 91 e3 05 lds r24, 0x05E3 ; 0x8005e3 29256: 96 fb bst r25, 6 29258: 99 27 eor r25, r25 2925a: 90 f9 bld r25, 0 2925c: 98 17 cp r25, r24 2925e: 91 f0 breq .+36 ; 0x29284 <__vector_14+0x25a> if(fan_measuring) fan_edge_counter[0] ++; 29260: 90 91 36 05 lds r25, 0x0536 ; 0x800536 29264: 99 23 and r25, r25 29266: 51 f0 breq .+20 ; 0x2927c <__vector_14+0x252> 29268: 20 91 b5 04 lds r18, 0x04B5 ; 0x8004b5 2926c: 30 91 b6 04 lds r19, 0x04B6 ; 0x8004b6 29270: 2f 5f subi r18, 0xFF ; 255 29272: 3f 4f sbci r19, 0xFF ; 255 29274: 30 93 b6 04 sts 0x04B6, r19 ; 0x8004b6 29278: 20 93 b5 04 sts 0x04B5, r18 ; 0x8004b5 fan_state[0] = !fan_state[0]; 2927c: 91 e0 ldi r25, 0x01 ; 1 2927e: 89 27 eor r24, r25 29280: 80 93 e3 05 sts 0x05E3, r24 ; 0x8005e3 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 29284: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 29286: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 2928a: 84 60 ori r24, 0x04 ; 4 2928c: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 29290: ff 91 pop r31 29292: ef 91 pop r30 29294: df 91 pop r29 29296: cf 91 pop r28 29298: bf 91 pop r27 2929a: af 91 pop r26 2929c: 9f 91 pop r25 2929e: 8f 91 pop r24 292a0: 7f 91 pop r23 292a2: 6f 91 pop r22 292a4: 5f 91 pop r21 292a6: 4f 91 pop r20 292a8: 3f 91 pop r19 292aa: 2f 91 pop r18 292ac: 1f 91 pop r17 292ae: 0f 91 pop r16 292b0: ff 90 pop r15 292b2: 0f 90 pop r0 292b4: 0b be out 0x3b, r0 ; 59 292b6: 0f 90 pop r0 292b8: 0f be out 0x3f, r0 ; 63 292ba: 0f 90 pop r0 292bc: 1f 90 pop r1 292be: 18 95 reti 000292c0 : #endif } #ifdef AMBIENT_THERMISTOR static float analog2tempAmbient(int raw) { 292c0: 4f 92 push r4 292c2: 5f 92 push r5 292c4: 6f 92 push r6 292c6: 7f 92 push r7 292c8: af 92 push r10 292ca: bf 92 push r11 292cc: cf 92 push r12 292ce: df 92 push r13 292d0: ef 92 push r14 292d2: ff 92 push r15 292d4: 0f 93 push r16 292d6: 1f 93 push r17 292d8: cf 93 push r28 292da: df 93 push r29 292dc: 24 e0 ldi r18, 0x04 ; 4 292de: 30 e0 ldi r19, 0x00 ; 0 292e0: 41 e0 ldi r20, 0x01 ; 1 292e2: 50 e0 ldi r21, 0x00 ; 0 292e4: d9 01 movw r26, r18 292e6: a5 5b subi r26, 0xB5 ; 181 292e8: b1 46 sbci r27, 0x61 ; 97 float celsius = 0; byte i; for (i=1; i raw) 292ea: fd 01 movw r30, r26 292ec: 65 91 lpm r22, Z+ 292ee: 74 91 lpm r23, Z 292f0: 86 17 cp r24, r22 292f2: 97 07 cpc r25, r23 292f4: 0c f0 brlt .+2 ; 0x292f8 292f6: 66 c0 rjmp .+204 ; 0x293c4 { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 292f8: 41 50 subi r20, 0x01 ; 1 292fa: 51 09 sbc r21, r1 292fc: 44 0f add r20, r20 292fe: 55 1f adc r21, r21 29300: 44 0f add r20, r20 29302: 55 1f adc r21, r21 29304: ea 01 movw r28, r20 29306: c3 5b subi r28, 0xB3 ; 179 29308: d1 46 sbci r29, 0x61 ; 97 2930a: fe 01 movw r30, r28 2930c: 05 91 lpm r16, Z+ 2930e: 14 91 lpm r17, Z (raw - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])) * 29310: 45 5b subi r20, 0xB5 ; 181 29312: 51 46 sbci r21, 0x61 ; 97 29314: fa 01 movw r30, r20 29316: 65 91 lpm r22, Z+ 29318: 74 91 lpm r23, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 2931a: f9 01 movw r30, r18 2931c: e3 5b subi r30, 0xB3 ; 179 2931e: f1 46 sbci r31, 0x61 ; 97 29320: e5 90 lpm r14, Z+ 29322: f4 90 lpm r15, Z 29324: fe 01 movw r30, r28 29326: c5 90 lpm r12, Z+ 29328: d4 90 lpm r13, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][0]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])); 2932a: fd 01 movw r30, r26 2932c: c5 91 lpm r28, Z+ 2932e: d4 91 lpm r29, Z 29330: fa 01 movw r30, r20 29332: a5 90 lpm r10, Z+ 29334: 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])) * 29336: 86 1b sub r24, r22 29338: 97 0b sbc r25, r23 2933a: bc 01 movw r22, r24 2933c: 99 0f add r25, r25 2933e: 88 0b sbc r24, r24 29340: 99 0b sbc r25, r25 29342: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 29346: 2b 01 movw r4, r22 29348: 3c 01 movw r6, r24 (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 2934a: b7 01 movw r22, r14 2934c: 6c 19 sub r22, r12 2934e: 7d 09 sbc r23, r13 29350: 07 2e mov r0, r23 29352: 00 0c add r0, r0 29354: 88 0b sbc r24, r24 29356: 99 0b sbc r25, r25 29358: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 2935c: 9b 01 movw r18, r22 2935e: 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])) * 29360: c3 01 movw r24, r6 29362: b2 01 movw r22, r4 29364: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 29368: 6b 01 movw r12, r22 2936a: 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])); 2936c: be 01 movw r22, r28 2936e: 6a 19 sub r22, r10 29370: 7b 09 sbc r23, r11 29372: 07 2e mov r0, r23 29374: 00 0c add r0, r0 29376: 88 0b sbc r24, r24 29378: 99 0b sbc r25, r25 2937a: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 2937e: 9b 01 movw r18, r22 29380: 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])) / 29382: c7 01 movw r24, r14 29384: b6 01 movw r22, r12 29386: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 2938a: 6b 01 movw r12, r22 2938c: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 2938e: b8 01 movw r22, r16 29390: 11 0f add r17, r17 29392: 88 0b sbc r24, r24 29394: 99 0b sbc r25, r25 29396: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 2939a: 9b 01 movw r18, r22 2939c: ac 01 movw r20, r24 2939e: c7 01 movw r24, r14 293a0: b6 01 movw r22, r12 293a2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> } } // Overflow: Set to last value in the table if (i == AMBIENTTEMPTABLE_LEN) celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]); return celsius; } 293a6: df 91 pop r29 293a8: cf 91 pop r28 293aa: 1f 91 pop r17 293ac: 0f 91 pop r16 293ae: ff 90 pop r15 293b0: ef 90 pop r14 293b2: df 90 pop r13 293b4: cf 90 pop r12 293b6: bf 90 pop r11 293b8: af 90 pop r10 293ba: 7f 90 pop r7 293bc: 6f 90 pop r6 293be: 5f 90 pop r5 293c0: 4f 90 pop r4 293c2: 08 95 ret 293c4: 4f 5f subi r20, 0xFF ; 255 293c6: 5f 4f sbci r21, 0xFF ; 255 293c8: 2c 5f subi r18, 0xFC ; 252 293ca: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempAmbient(int raw) { float celsius = 0; byte i; for (i=1; i 293d2: 88 cf rjmp .-240 ; 0x292e4 (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]); 293d4: e1 ed ldi r30, 0xD1 ; 209 293d6: fe e9 ldi r31, 0x9E ; 158 293d8: 65 91 lpm r22, Z+ 293da: 74 91 lpm r23, Z 293dc: 07 2e mov r0, r23 293de: 00 0c add r0, r0 293e0: 88 0b sbc r24, r24 293e2: 99 0b sbc r25, r25 293e4: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 293e8: de cf rjmp .-68 ; 0x293a6 000293ea : 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) { 293ea: 4f 92 push r4 293ec: 5f 92 push r5 293ee: 6f 92 push r6 293f0: 7f 92 push r7 293f2: af 92 push r10 293f4: bf 92 push r11 293f6: cf 92 push r12 293f8: df 92 push r13 293fa: ef 92 push r14 293fc: ff 92 push r15 293fe: 0f 93 push r16 29400: 1f 93 push r17 29402: cf 93 push r28 29404: df 93 push r29 29406: 24 e0 ldi r18, 0x04 ; 4 29408: 30 e0 ldi r19, 0x00 ; 0 2940a: 41 e0 ldi r20, 0x01 ; 1 2940c: 50 e0 ldi r21, 0x00 ; 0 2940e: d9 01 movw r26, r18 29410: a9 5a subi r26, 0xA9 ; 169 29412: b2 46 sbci r27, 0x62 ; 98 float celsius = 0; byte i; for (i=1; i raw) 29414: fd 01 movw r30, r26 29416: 65 91 lpm r22, Z+ 29418: 74 91 lpm r23, Z 2941a: 86 17 cp r24, r22 2941c: 97 07 cpc r25, r23 2941e: 0c f0 brlt .+2 ; 0x29422 29420: 80 c0 rjmp .+256 ; 0x29522 { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 29422: 41 50 subi r20, 0x01 ; 1 29424: 51 09 sbc r21, r1 29426: 44 0f add r20, r20 29428: 55 1f adc r21, r21 2942a: 44 0f add r20, r20 2942c: 55 1f adc r21, r21 2942e: 8a 01 movw r16, r20 29430: 07 5a subi r16, 0xA7 ; 167 29432: 12 46 sbci r17, 0x62 ; 98 29434: f8 01 movw r30, r16 29436: c5 90 lpm r12, Z+ 29438: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 2943a: 49 5a subi r20, 0xA9 ; 169 2943c: 52 46 sbci r21, 0x62 ; 98 2943e: fa 01 movw r30, r20 29440: 65 91 lpm r22, Z+ 29442: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 29444: f9 01 movw r30, r18 29446: e7 5a subi r30, 0xA7 ; 167 29448: f2 46 sbci r31, 0x62 ; 98 2944a: c5 91 lpm r28, Z+ 2944c: d4 91 lpm r29, Z 2944e: f8 01 movw r30, r16 29450: 05 91 lpm r16, Z+ 29452: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 29454: fd 01 movw r30, r26 29456: e5 90 lpm r14, Z+ 29458: f4 90 lpm r15, Z 2945a: fa 01 movw r30, r20 2945c: a5 90 lpm r10, Z+ 2945e: 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])) * 29460: 86 1b sub r24, r22 29462: 97 0b sbc r25, r23 29464: bc 01 movw r22, r24 29466: 99 0f add r25, r25 29468: 88 0b sbc r24, r24 2946a: 99 0b sbc r25, r25 2946c: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 29470: 2b 01 movw r4, r22 29472: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 29474: be 01 movw r22, r28 29476: 60 1b sub r22, r16 29478: 71 0b sbc r23, r17 2947a: 07 2e mov r0, r23 2947c: 00 0c add r0, r0 2947e: 88 0b sbc r24, r24 29480: 99 0b sbc r25, r25 29482: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 29486: 9b 01 movw r18, r22 29488: 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])) * 2948a: c3 01 movw r24, r6 2948c: b2 01 movw r22, r4 2948e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 29492: 2b 01 movw r4, r22 29494: 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])); 29496: b7 01 movw r22, r14 29498: 6a 19 sub r22, r10 2949a: 7b 09 sbc r23, r11 2949c: 07 2e mov r0, r23 2949e: 00 0c add r0, r0 294a0: 88 0b sbc r24, r24 294a2: 99 0b sbc r25, r25 294a4: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 294a8: 9b 01 movw r18, r22 294aa: 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])) / 294ac: c3 01 movw r24, r6 294ae: b2 01 movw r22, r4 294b0: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 294b4: 2b 01 movw r4, r22 294b6: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 294b8: b6 01 movw r22, r12 294ba: dd 0c add r13, r13 294bc: 88 0b sbc r24, r24 294be: 99 0b sbc r25, r25 294c0: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 294c4: 9b 01 movw r18, r22 294c6: ac 01 movw r20, r24 294c8: c3 01 movw r24, r6 294ca: b2 01 movw r22, r4 294cc: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 294d0: 6b 01 movw r12, r22 294d2: 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) 294d4: 20 e0 ldi r18, 0x00 ; 0 294d6: 30 e0 ldi r19, 0x00 ; 0 294d8: 40 e2 ldi r20, 0x20 ; 32 294da: 52 e4 ldi r21, 0x42 ; 66 294dc: c7 01 movw r24, r14 294de: b6 01 movw r22, r12 294e0: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 294e4: 87 fd sbrc r24, 7 294e6: 30 c0 rjmp .+96 ; 0x29548 294e8: 20 e0 ldi r18, 0x00 ; 0 294ea: 30 e0 ldi r19, 0x00 ; 0 294ec: 48 e4 ldi r20, 0x48 ; 72 294ee: 52 e4 ldi r21, 0x42 ; 66 294f0: c7 01 movw r24, r14 294f2: b6 01 movw r22, r12 294f4: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 294f8: 18 16 cp r1, r24 294fa: 34 f1 brlt .+76 ; 0x29548 { celsius = celsius + (_first_koef * (celsius - _offset_start)); 294fc: 20 e0 ldi r18, 0x00 ; 0 294fe: 30 e0 ldi r19, 0x00 ; 0 29500: 40 e2 ldi r20, 0x20 ; 32 29502: 52 e4 ldi r21, 0x42 ; 66 29504: c7 01 movw r24, r14 29506: b6 01 movw r22, r12 29508: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 2950c: 20 e0 ldi r18, 0x00 ; 0 2950e: 30 e0 ldi r19, 0x00 ; 0 29510: 40 e0 ldi r20, 0x00 ; 0 29512: 5f e3 ldi r21, 0x3F ; 63 29514: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 29518: 9b 01 movw r18, r22 2951a: 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; 2951c: c7 01 movw r24, r14 2951e: b6 01 movw r22, r12 29520: 43 c0 rjmp .+134 ; 0x295a8 29522: 4f 5f subi r20, 0xFF ; 255 29524: 5f 4f sbci r21, 0xFF ; 255 29526: 2c 5f subi r18, 0xFC ; 252 29528: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 29530: 6e cf rjmp .-292 ; 0x2940e break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 29532: e9 e4 ldi r30, 0x49 ; 73 29534: fe e9 ldi r31, 0x9E ; 158 29536: 65 91 lpm r22, Z+ 29538: 74 91 lpm r23, Z 2953a: 07 2e mov r0, r23 2953c: 00 0c add r0, r0 2953e: 88 0b sbc r24, r24 29540: 99 0b sbc r25, r25 29542: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 29546: c4 cf rjmp .-120 ; 0x294d0 if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 29548: 20 e0 ldi r18, 0x00 ; 0 2954a: 30 e0 ldi r19, 0x00 ; 0 2954c: 48 e4 ldi r20, 0x48 ; 72 2954e: 52 e4 ldi r21, 0x42 ; 66 29550: c7 01 movw r24, r14 29552: b6 01 movw r22, r12 29554: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 29558: 18 16 cp r1, r24 2955a: dc f5 brge .+118 ; 0x295d2 2955c: 20 e0 ldi r18, 0x00 ; 0 2955e: 30 e0 ldi r19, 0x00 ; 0 29560: 48 ec ldi r20, 0xC8 ; 200 29562: 52 e4 ldi r21, 0x42 ; 66 29564: c7 01 movw r24, r14 29566: b6 01 movw r22, r12 29568: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 2956c: 18 16 cp r1, r24 2956e: 8c f1 brlt .+98 ; 0x295d2 { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 29570: 20 e0 ldi r18, 0x00 ; 0 29572: 30 e0 ldi r19, 0x00 ; 0 29574: 40 ea ldi r20, 0xA0 ; 160 29576: 50 e4 ldi r21, 0x40 ; 64 29578: c7 01 movw r24, r14 2957a: b6 01 movw r22, r12 2957c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 29580: 2b 01 movw r4, r22 29582: 3c 01 movw r6, r24 29584: 20 e0 ldi r18, 0x00 ; 0 29586: 30 e0 ldi r19, 0x00 ; 0 29588: 48 e4 ldi r20, 0x48 ; 72 2958a: 52 e4 ldi r21, 0x42 ; 66 2958c: c7 01 movw r24, r14 2958e: b6 01 movw r22, r12 29590: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 29594: 2d ec ldi r18, 0xCD ; 205 29596: 3c ec ldi r19, 0xCC ; 204 29598: 4c ec ldi r20, 0xCC ; 204 2959a: 5d e3 ldi r21, 0x3D ; 61 2959c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 295a0: 9b 01 movw r18, r22 295a2: ac 01 movw r20, r24 295a4: c3 01 movw r24, r6 295a6: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 295a8: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 295ac: 6b 01 movw r12, r22 295ae: 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 } 295b0: c7 01 movw r24, r14 295b2: b6 01 movw r22, r12 295b4: df 91 pop r29 295b6: cf 91 pop r28 295b8: 1f 91 pop r17 295ba: 0f 91 pop r16 295bc: ff 90 pop r15 295be: ef 90 pop r14 295c0: df 90 pop r13 295c2: cf 90 pop r12 295c4: bf 90 pop r11 295c6: af 90 pop r10 295c8: 7f 90 pop r7 295ca: 6f 90 pop r6 295cc: 5f 90 pop r5 295ce: 4f 90 pop r4 295d0: 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) 295d2: 20 e0 ldi r18, 0x00 ; 0 295d4: 30 e0 ldi r19, 0x00 ; 0 295d6: 48 ec ldi r20, 0xC8 ; 200 295d8: 52 e4 ldi r21, 0x42 ; 66 295da: c7 01 movw r24, r14 295dc: b6 01 movw r22, r12 295de: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 295e2: 18 16 cp r1, r24 295e4: 2c f7 brge .-54 ; 0x295b0 { celsius = celsius + _offset; 295e6: 20 e0 ldi r18, 0x00 ; 0 295e8: 30 e0 ldi r19, 0x00 ; 0 295ea: 40 e2 ldi r20, 0x20 ; 32 295ec: 51 e4 ldi r21, 0x41 ; 65 295ee: 96 cf rjmp .-212 ; 0x2951c 000295f0 : } static void check_temp_raw(); static void temp_mgr_isr() { 295f0: 4f 92 push r4 295f2: 5f 92 push r5 295f4: 6f 92 push r6 295f6: 7f 92 push r7 295f8: af 92 push r10 295fa: cf 92 push r12 295fc: df 92 push r13 295fe: ef 92 push r14 29600: ff 92 push r15 29602: 0f 93 push r16 29604: 1f 93 push r17 29606: cf 93 push r28 29608: 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 2960e: 90 91 09 06 lds r25, 0x0609 ; 0x800609 29612: 0e 94 b1 d9 call 0x1b362 ; 0x1b362 29616: 60 93 1a 05 sts 0x051A, r22 ; 0x80051a 2961a: 70 93 1b 05 sts 0x051B, r23 ; 0x80051b 2961e: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c 29622: 90 93 1d 05 sts 0x051D, r25 ; 0x80051d current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 29626: 60 90 06 06 lds r6, 0x0606 ; 0x800606 2962a: 70 90 07 06 lds r7, 0x0607 ; 0x800607 2962e: c3 01 movw r24, r6 29630: 0f 94 f5 49 call 0x293ea ; 0x293ea 29634: 6b 01 movw r12, r22 29636: 7c 01 movw r14, r24 29638: c0 92 16 06 sts 0x0616, r12 ; 0x800616 2963c: d0 92 17 06 sts 0x0617, r13 ; 0x800617 29640: e0 92 18 06 sts 0x0618, r14 ; 0x800618 29644: f0 92 19 06 sts 0x0619, r15 ; 0x800619 #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 29648: 80 91 04 06 lds r24, 0x0604 ; 0x800604 2964c: 90 91 05 06 lds r25, 0x0605 ; 0x800605 29650: 0f 94 f5 49 call 0x293ea ; 0x293ea 29654: 60 93 00 06 sts 0x0600, r22 ; 0x800600 29658: 70 93 01 06 sts 0x0601, r23 ; 0x800601 2965c: 80 93 02 06 sts 0x0602, r24 ; 0x800602 29660: 90 93 03 06 sts 0x0603, r25 ; 0x800603 #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient_isr = analog2tempAmbient(current_temperature_raw_ambient); //thermistor for ambient is NTCG104LH104JT1 (2000) 29664: c0 91 12 06 lds r28, 0x0612 ; 0x800612 29668: d0 91 13 06 lds r29, 0x0613 ; 0x800613 2966c: ce 01 movw r24, r28 2966e: 0f 94 60 49 call 0x292c0 ; 0x292c0 29672: 60 93 1d 06 sts 0x061D, r22 ; 0x80061d 29676: 70 93 1e 06 sts 0x061E, r23 ; 0x80061e 2967a: 80 93 1f 06 sts 0x061F, r24 ; 0x80061f 2967e: 90 93 20 06 sts 0x0620, r25 ; 0x800620 #endif temp_meas_ready = true; 29682: 81 e0 ldi r24, 0x01 ; 1 29684: 80 93 ff 05 sts 0x05FF, r24 ; 0x8005ff { // update *_isr temperatures from raw values for PID regulation setIsrTemperaturesFromRawValues(); // clear the error assertion flag before checking again temp_error_state.assert = false; 29688: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 2968c: 8d 7f andi r24, 0xFD ; 253 2968e: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 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]) { 29692: 20 91 08 06 lds r18, 0x0608 ; 0x800608 29696: 30 91 09 06 lds r19, 0x0609 ; 0x800609 2969a: 80 91 9b 04 lds r24, 0x049B ; 0x80049b <_ZL12maxttemp_raw.lto_priv.476> 2969e: 90 91 9c 04 lds r25, 0x049C ; 0x80049c <_ZL12maxttemp_raw.lto_priv.476+0x1> 296a2: 82 17 cp r24, r18 296a4: 93 07 cpc r25, r19 296a6: 2c f0 brlt .+10 ; 0x296b2 #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 296a8: 40 e0 ldi r20, 0x00 ; 0 296aa: 60 e0 ldi r22, 0x00 ; 0 296ac: 80 e0 ldi r24, 0x00 ; 0 296ae: 0f 94 6d 44 call 0x288da ; 0x288da } //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) { 296b2: 80 91 99 04 lds r24, 0x0499 ; 0x800499 <_ZL16bed_maxttemp_raw.lto_priv.477> 296b6: 90 91 9a 04 lds r25, 0x049A ; 0x80049a <_ZL16bed_maxttemp_raw.lto_priv.477+0x1> 296ba: 86 15 cp r24, r6 296bc: 97 05 cpc r25, r7 296be: 2c f0 brlt .+10 ; 0x296ca #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 296c0: 40 e0 ldi r20, 0x00 ; 0 296c2: 60 e0 ldi r22, 0x00 ; 0 296c4: 81 e0 ldi r24, 0x01 ; 1 296c6: 0f 94 6d 44 call 0x288da ; 0x288da } #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) { 296ca: 80 91 97 04 lds r24, 0x0497 ; 0x800497 <_ZL20ambient_maxttemp_raw.lto_priv.478> 296ce: 90 91 98 04 lds r25, 0x0498 ; 0x800498 <_ZL20ambient_maxttemp_raw.lto_priv.478+0x1> 296d2: 8c 17 cp r24, r28 296d4: 9d 07 cpc r25, r29 296d6: 2c f0 brlt .+10 ; 0x296e2 #else if (current_temperature_raw_ambient >= ambient_maxttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::max); 296d8: 40 e0 ldi r20, 0x00 ; 0 296da: 60 e0 ldi r22, 0x00 ; 0 296dc: 82 e0 ldi r24, 0x02 ; 2 296de: 0f 94 6d 44 call 0x288da ; 0x288da #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) { 296e2: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.475> 296e6: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.475+0x1> 296ea: c8 17 cp r28, r24 296ec: d9 07 cpc r29, r25 296ee: 2c f0 brlt .+10 ; 0x296fa #else if (current_temperature_raw_ambient <= ambient_minttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::min); 296f0: 41 e0 ldi r20, 0x01 ; 1 296f2: 60 e0 ldi r22, 0x00 ; 0 296f4: 82 e0 ldi r24, 0x02 ; 2 296f6: 0f 94 6d 44 call 0x288da ; 0x288da #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 296fa: c1 3a cpi r28, 0xA1 ; 161 296fc: de 43 sbci r29, 0x3E ; 62 296fe: 0c f4 brge .+2 ; 0x29702 29700: cd c1 rjmp .+922 ; 0x29a9c { // 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]) { 29702: 60 91 9d 04 lds r22, 0x049D ; 0x80049d <_ZL8minttemp.lto_priv.474> 29706: 70 91 9e 04 lds r23, 0x049E ; 0x80049e <_ZL8minttemp.lto_priv.474+0x1> 2970a: 80 91 1b 06 lds r24, 0x061B ; 0x80061b 2970e: 90 91 1c 06 lds r25, 0x061C ; 0x80061c 29712: 68 17 cp r22, r24 29714: 79 07 cpc r23, r25 29716: 0c f0 brlt .+2 ; 0x2971a 29718: 55 c0 rjmp .+170 ; 0x297c4 // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 2971a: c0 91 11 06 lds r28, 0x0611 ; 0x800611 2971e: c1 11 cpse r28, r1 29720: 18 c0 rjmp .+48 ; 0x29752 29722: 6b 5f subi r22, 0xFB ; 251 29724: 7f 4f sbci r23, 0xFF ; 255 29726: 07 2e mov r0, r23 29728: 00 0c add r0, r0 2972a: 88 0b sbc r24, r24 2972c: 99 0b sbc r25, r25 2972e: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 29732: 9b 01 movw r18, r22 29734: ac 01 movw r20, r24 29736: c1 e0 ldi r28, 0x01 ; 1 29738: 60 91 1a 05 lds r22, 0x051A ; 0x80051a 2973c: 70 91 1b 05 lds r23, 0x051B ; 0x80051b 29740: 80 91 1c 05 lds r24, 0x051C ; 0x80051c 29744: 90 91 1d 05 lds r25, 0x051D ; 0x80051d 29748: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 2974c: 18 16 cp r1, r24 2974e: 0c f0 brlt .+2 ; 0x29752 29750: c0 e0 ldi r28, 0x00 ; 0 29752: c0 93 11 06 sts 0x0611, r28 ; 0x800611 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 29756: 68 e9 ldi r22, 0x98 ; 152 29758: 7a e3 ldi r23, 0x3A ; 58 2975a: 8e e0 ldi r24, 0x0E ; 14 2975c: 96 e0 ldi r25, 0x06 ; 6 2975e: 0f 94 e0 3e call 0x27dc0 ; 0x27dc0 ::expired_cont(unsigned short)> 29762: 81 11 cpse r24, r1 29764: 02 c0 rjmp .+4 ; 0x2976a 29766: cc 23 and r28, r28 29768: 29 f0 breq .+10 ; 0x29774 bCheckingOnHeater=true; // not necessary 2976a: 81 e0 ldi r24, 0x01 ; 1 2976c: 80 93 11 06 sts 0x0611, r24 ; 0x800611 check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active 29770: 0f 94 e7 44 call 0x289ce ; 0x289ce // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 29774: 80 91 14 06 lds r24, 0x0614 ; 0x800614 29778: 90 91 15 06 lds r25, 0x0615 ; 0x800615 2977c: 0b 97 sbiw r24, 0x0b ; 11 2977e: 4c f1 brlt .+82 ; 0x297d2 // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 29780: c0 91 0d 06 lds r28, 0x060D ; 0x80060d 29784: c1 11 cpse r28, r1 29786: 0c c0 rjmp .+24 ; 0x297a0 29788: c1 e0 ldi r28, 0x01 ; 1 2978a: 20 e0 ldi r18, 0x00 ; 0 2978c: 30 e0 ldi r19, 0x00 ; 0 2978e: 40 e7 ldi r20, 0x70 ; 112 29790: 51 e4 ldi r21, 0x41 ; 65 29792: c7 01 movw r24, r14 29794: b6 01 movw r22, r12 29796: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 2979a: 18 16 cp r1, r24 2979c: 0c f0 brlt .+2 ; 0x297a0 2979e: c0 e0 ldi r28, 0x00 ; 0 297a0: c0 93 0d 06 sts 0x060D, r28 ; 0x80060d if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 297a4: 60 e5 ldi r22, 0x50 ; 80 297a6: 73 ec ldi r23, 0xC3 ; 195 297a8: 8a e0 ldi r24, 0x0A ; 10 297aa: 96 e0 ldi r25, 0x06 ; 6 297ac: 0f 94 e0 3e call 0x27dc0 ; 0x27dc0 ::expired_cont(unsigned short)> 297b0: 81 11 cpse r24, r1 297b2: 02 c0 rjmp .+4 ; 0x297b8 297b4: cc 23 and r28, r28 297b6: 99 f0 breq .+38 ; 0x297de bCheckingOnBed=true; // not necessary 297b8: 81 e0 ldi r24, 0x01 ; 1 297ba: 80 93 0d 06 sts 0x060D, r24 ; 0x80060d #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); check_min_temp_bed(); 297be: 0f 94 d6 44 call 0x289ac ; 0x289ac 297c2: 0d c0 rjmp .+26 ; 0x297de check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ nozzle heating is off oTimer4minTempHeater.start(); 297c4: 8e e0 ldi r24, 0x0E ; 14 297c6: 96 e0 ldi r25, 0x06 ; 6 297c8: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> bCheckingOnHeater=false; 297cc: 10 92 11 06 sts 0x0611, r1 ; 0x800611 297d0: d1 cf rjmp .-94 ; 0x29774 check_min_temp_bed(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ bed heating is off oTimer4minTempBed.start(); 297d2: 8a e0 ldi r24, 0x0A ; 10 297d4: 96 e0 ldi r25, 0x06 ; 6 297d6: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> bCheckingOnBed=false; 297da: 10 92 0d 06 sts 0x060D, r1 ; 0x80060d 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); 297de: 60 91 19 05 lds r22, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.472> 297e2: 70 e0 ldi r23, 0x00 ; 0 297e4: 90 e0 ldi r25, 0x00 ; 0 297e6: 80 e0 ldi r24, 0x00 ; 0 297e8: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 297ec: 6b 01 movw r12, r22 297ee: 7c 01 movw r14, r24 297f0: 40 90 1a 05 lds r4, 0x051A ; 0x80051a 297f4: 50 90 1b 05 lds r5, 0x051B ; 0x80051b 297f8: 60 90 1c 05 lds r6, 0x051C ; 0x80051c 297fc: 70 90 1d 05 lds r7, 0x051D ; 0x80051d 29800: 60 91 1b 06 lds r22, 0x061B ; 0x80061b 29804: 70 91 1c 06 lds r23, 0x061C ; 0x80061c 29808: 07 2e mov r0, r23 2980a: 00 0c add r0, r0 2980c: 88 0b sbc r24, r24 2980e: 99 0b sbc r25, r25 29810: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 29814: ab 01 movw r20, r22 29816: bc 01 movw r22, r24 29818: a1 2c mov r10, r1 2981a: 93 01 movw r18, r6 2981c: 82 01 movw r16, r4 2981e: 81 e0 ldi r24, 0x01 ; 1 29820: 0f 94 f8 44 call 0x289f0 ; 0x289f0 #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 29824: 60 91 1a 06 lds r22, 0x061A ; 0x80061a 29828: 70 e0 ldi r23, 0x00 ; 0 2982a: 90 e0 ldi r25, 0x00 ; 0 2982c: 80 e0 ldi r24, 0x00 ; 0 2982e: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 29832: 6b 01 movw r12, r22 29834: 7c 01 movw r14, r24 29836: 40 90 16 06 lds r4, 0x0616 ; 0x800616 2983a: 50 90 17 06 lds r5, 0x0617 ; 0x800617 2983e: 60 90 18 06 lds r6, 0x0618 ; 0x800618 29842: 70 90 19 06 lds r7, 0x0619 ; 0x800619 29846: 60 91 14 06 lds r22, 0x0614 ; 0x800614 2984a: 70 91 15 06 lds r23, 0x0615 ; 0x800615 2984e: 07 2e mov r0, r23 29850: 00 0c add r0, r0 29852: 88 0b sbc r24, r24 29854: 99 0b sbc r25, r25 29856: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 2985a: ab 01 movw r20, r22 2985c: bc 01 movw r22, r24 2985e: aa 24 eor r10, r10 29860: a3 94 inc r10 29862: 93 01 movw r18, r6 29864: 82 01 movw r16, r4 29866: 80 e0 ldi r24, 0x00 ; 0 29868: 0f 94 f8 44 call 0x289f0 ; 0x289f0 return true; } static void check() { if(!enabled) return; 2986c: 80 91 20 05 lds r24, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.469> 29870: 88 23 and r24, r24 29872: 09 f4 brne .+2 ; 0x29876 29874: bc c0 rjmp .+376 ; 0x299ee uint8_t heater_pwm = soft_pwm[0]; 29876: c0 91 19 05 lds r28, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.472> uint8_t fan_pwm = soft_pwm_fan; 2987a: d0 91 9f 04 lds r29, 0x049F ; 0x80049f <_ZL12soft_pwm_fan.lto_priv.473> float heater_temp = current_temperature_isr[0]; 2987e: 40 90 1a 05 lds r4, 0x051A ; 0x80051a 29882: 50 90 1b 05 lds r5, 0x051B ; 0x80051b 29886: 60 90 1c 05 lds r6, 0x051C ; 0x80051c 2988a: 70 90 1d 05 lds r7, 0x051D ; 0x80051d float ambient_temp = current_temperature_ambient_isr; 2988e: c0 90 1d 06 lds r12, 0x061D ; 0x80061d 29892: d0 90 1e 06 lds r13, 0x061E ; 0x80061e 29896: e0 90 1f 06 lds r14, 0x061F ; 0x80061f 2989a: f0 90 20 06 lds r15, 0x0620 ; 0x800620 // 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) 2989e: 80 91 1a 13 lds r24, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 298a2: 80 ff sbrs r24, 0 298a4: 72 c0 rjmp .+228 ; 0x2998a 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); 298a6: 20 91 c4 12 lds r18, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 298aa: 30 91 c5 12 lds r19, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 298ae: 40 91 c6 12 lds r20, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 298b2: 50 91 c7 12 lds r21, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> 298b6: 61 e7 ldi r22, 0x71 ; 113 298b8: 7d e3 ldi r23, 0x3D ; 61 298ba: 8a e8 ldi r24, 0x8A ; 138 298bc: 9e e3 ldi r25, 0x3E ; 62 298be: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 298c2: 60 93 1b 13 sts 0x131B, r22 ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.394+0x8d> 298c6: 70 93 1c 13 sts 0x131C, r23 ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.394+0x8e> 298ca: 80 93 1d 13 sts 0x131D, r24 ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.394+0x8f> 298ce: 90 93 1e 13 sts 0x131E, r25 ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.394+0x90> warn_s = warn * TEMP_MGR_INTV; 298d2: 21 e7 ldi r18, 0x71 ; 113 298d4: 3d e3 ldi r19, 0x3D ; 61 298d6: 4a e8 ldi r20, 0x8A ; 138 298d8: 5e e3 ldi r21, 0x3E ; 62 298da: 60 91 12 13 lds r22, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 298de: 70 91 13 13 lds r23, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 298e2: 80 91 14 13 lds r24, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 298e6: 90 91 15 13 lds r25, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> 298ea: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 298ee: 60 93 1f 13 sts 0x131F, r22 ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.394+0x91> 298f2: 70 93 20 13 sts 0x1320, r23 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.394+0x92> 298f6: 80 93 21 13 sts 0x1321, r24 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.394+0x93> 298fa: 90 93 22 13 sts 0x1322, r25 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.394+0x94> err_s = err * TEMP_MGR_INTV; 298fe: 21 e7 ldi r18, 0x71 ; 113 29900: 3d e3 ldi r19, 0x3D ; 61 29902: 4a e8 ldi r20, 0x8A ; 138 29904: 5e e3 ldi r21, 0x3E ; 62 29906: 60 91 16 13 lds r22, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 2990a: 70 91 17 13 lds r23, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 2990e: 80 91 18 13 lds r24, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 29912: 90 91 19 13 lds r25, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> 29916: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2991a: 60 93 23 13 sts 0x1323, r22 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.394+0x95> 2991e: 70 93 24 13 sts 0x1324, r23 ; 0x801324 <_ZN13thermal_modelL4dataE.lto_priv.394+0x96> 29922: 80 93 25 13 sts 0x1325, r24 ; 0x801325 <_ZN13thermal_modelL4dataE.lto_priv.394+0x97> 29926: 90 93 26 13 sts 0x1326, r25 ; 0x801326 <_ZN13thermal_modelL4dataE.lto_priv.394+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 2992a: 80 91 cc 12 lds r24, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.394+0x3e> 2992e: 90 91 cd 12 lds r25, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.394+0x3f> 29932: 6e e0 ldi r22, 0x0E ; 14 29934: 71 e0 ldi r23, 0x01 ; 1 29936: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 2993a: 60 93 ae 12 sts 0x12AE, r22 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.394+0x20> 2993e: ee e8 ldi r30, 0x8E ; 142 29940: f2 e1 ldi r31, 0x12 ; 18 29942: 8e ea ldi r24, 0xAE ; 174 29944: 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; 29946: 40 e0 ldi r20, 0x00 ; 0 29948: 50 e0 ldi r21, 0x00 ; 0 2994a: 60 ec ldi r22, 0xC0 ; 192 2994c: 7f e7 ldi r23, 0x7F ; 127 2994e: 41 93 st Z+, r20 29950: 51 93 st Z+, r21 29952: 61 93 st Z+, r22 29954: 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) 29956: 8e 17 cp r24, r30 29958: 9f 07 cpc r25, r31 2995a: c9 f7 brne .-14 ; 0x2994e dT_lag_buf[i] = NAN; dT_lag_idx = 0; 2995c: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.394+0x21> dT_err_prev = 0; 29960: 10 92 b0 12 sts 0x12B0, r1 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x22> 29964: 10 92 b1 12 sts 0x12B1, r1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x23> 29968: 10 92 b2 12 sts 0x12B2, r1 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x24> 2996c: 10 92 b3 12 sts 0x12B3, r1 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x25> T_prev = NAN; 29970: 40 93 b4 12 sts 0x12B4, r20 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x26> 29974: 50 93 b5 12 sts 0x12B5, r21 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x27> 29978: 60 93 b6 12 sts 0x12B6, r22 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x28> 2997c: 70 93 b7 12 sts 0x12B7, r23 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x29> // clear the initialization flag flag_bits.uninitialized = false; 29980: 80 91 1a 13 lds r24, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 29984: 8e 7f andi r24, 0xFE ; 254 29986: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+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); 2998a: 87 01 movw r16, r14 2998c: 76 01 movw r14, r12 2998e: a3 01 movw r20, r6 29990: 92 01 movw r18, r4 29992: 6d 2f mov r22, r29 29994: 8c 2f mov r24, r28 29996: 0e 94 d5 da call 0x1b5aa ; 0x1b5aa // handle errors if(data.flag_bits.error) 2999a: 80 91 1a 13 lds r24, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 2999e: 81 ff sbrs r24, 1 299a0: 05 c0 rjmp .+10 ; 0x299ac set_temp_error(TempErrorSource::hotend, 0, TempErrorType::model); 299a2: 44 e0 ldi r20, 0x04 ; 4 299a4: 60 e0 ldi r22, 0x00 ; 0 299a6: 80 e0 ldi r24, 0x00 ; 0 299a8: 0f 94 6d 44 call 0x288da ; 0x288da // handle warning conditions as lower-priority but with greater feedback warning_state.assert = data.flag_bits.warning; 299ac: 90 91 1a 13 lds r25, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 299b0: 80 91 36 06 lds r24, 0x0636 ; 0x800636 299b4: 92 fb bst r25, 2 299b6: 81 f9 bld r24, 1 299b8: 80 93 36 06 sts 0x0636, r24 ; 0x800636 if(warning_state.assert) { 299bc: 80 91 36 06 lds r24, 0x0636 ; 0x800636 299c0: 81 ff sbrs r24, 1 299c2: 15 c0 rjmp .+42 ; 0x299ee warning_state.warning = true; 299c4: 80 91 36 06 lds r24, 0x0636 ; 0x800636 299c8: 81 60 ori r24, 0x01 ; 1 299ca: 80 93 36 06 sts 0x0636, r24 ; 0x800636 warning_state.dT_err = thermal_model::data.dT_err_prev; 299ce: 80 91 b0 12 lds r24, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x22> 299d2: 90 91 b1 12 lds r25, 0x12B1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x23> 299d6: a0 91 b2 12 lds r26, 0x12B2 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x24> 299da: b0 91 b3 12 lds r27, 0x12B3 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x25> 299de: 80 93 32 06 sts 0x0632, r24 ; 0x800632 299e2: 90 93 33 06 sts 0x0633, r25 ; 0x800633 299e6: a0 93 34 06 sts 0x0634, r26 ; 0x800634 299ea: b0 93 35 06 sts 0x0635, r27 ; 0x800635 (int)cur_pwm, (unsigned long)cur_temp_b, (unsigned long)cur_amb_b); } static void log_isr() { if(!log_buf.enabled) return; 299ee: 80 91 31 06 lds r24, 0x0631 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x10> 299f2: 88 23 and r24, r24 299f4: 09 f4 brne .+2 ; 0x299f8 299f6: 3f c0 rjmp .+126 ; 0x29a76 uint32_t stamp = _millis(); 299f8: 0f 94 86 3e call 0x27d0c ; 0x27d0c uint8_t delta_ms = stamp - log_buf.entry.stamp - (uint32_t)(TEMP_MGR_INTV * 1000); 299fc: c0 90 21 06 lds r12, 0x0621 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.556> 29a00: d0 90 22 06 lds r13, 0x0622 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x1> 29a04: e0 90 23 06 lds r14, 0x0623 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x2> 29a08: f0 90 24 06 lds r15, 0x0624 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x3> log_buf.entry.stamp = stamp; 29a0c: 60 93 21 06 sts 0x0621, r22 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.556> 29a10: 70 93 22 06 sts 0x0622, r23 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x1> 29a14: 80 93 23 06 sts 0x0623, r24 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x2> 29a18: 90 93 24 06 sts 0x0624, r25 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x3> ++log_buf.entry.counter; 29a1c: 20 91 26 06 lds r18, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x5> 29a20: 2f 5f subi r18, 0xFF ; 255 29a22: 20 93 26 06 sts 0x0626, r18 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.556+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); 29a26: 6c 19 sub r22, r12 29a28: 6e 50 subi r22, 0x0E ; 14 log_buf.entry.stamp = stamp; ++log_buf.entry.counter; log_buf.entry.delta_ms = delta_ms; 29a2a: 60 93 25 06 sts 0x0625, r22 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x4> log_buf.entry.cur_pwm = soft_pwm[0]; 29a2e: 80 91 19 05 lds r24, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.472> 29a32: 80 93 27 06 sts 0x0627, r24 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x6> log_buf.entry.cur_temp = current_temperature_isr[0]; 29a36: 80 91 1a 05 lds r24, 0x051A ; 0x80051a 29a3a: 90 91 1b 05 lds r25, 0x051B ; 0x80051b 29a3e: a0 91 1c 05 lds r26, 0x051C ; 0x80051c 29a42: b0 91 1d 05 lds r27, 0x051D ; 0x80051d 29a46: 80 93 28 06 sts 0x0628, r24 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x7> 29a4a: 90 93 29 06 sts 0x0629, r25 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x8> 29a4e: a0 93 2a 06 sts 0x062A, r26 ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x9> 29a52: b0 93 2b 06 sts 0x062B, r27 ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.556+0xa> log_buf.entry.cur_amb = current_temperature_ambient_isr; 29a56: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 29a5a: 90 91 1e 06 lds r25, 0x061E ; 0x80061e 29a5e: a0 91 1f 06 lds r26, 0x061F ; 0x80061f 29a62: b0 91 20 06 lds r27, 0x0620 ; 0x800620 29a66: 80 93 2c 06 sts 0x062C, r24 ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.556+0xb> 29a6a: 90 93 2d 06 sts 0x062D, r25 ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.556+0xc> 29a6e: a0 93 2e 06 sts 0x062E, r26 ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.556+0xd> 29a72: b0 93 2f 06 sts 0x062F, r27 ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.556+0xe> thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 29a76: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.471> 29a7a: 88 23 and r24, r24 29a7c: 91 f0 breq .+36 ; 0x29aa2 temp_mgr_pid(); } 29a7e: df 91 pop r29 29a80: cf 91 pop r28 29a82: 1f 91 pop r17 29a84: 0f 91 pop r16 29a86: ff 90 pop r15 29a88: ef 90 pop r14 29a8a: df 90 pop r13 29a8c: cf 90 pop r12 29a8e: af 90 pop r10 29a90: 7f 90 pop r7 29a92: 6f 90 pop r6 29a94: 5f 90 pop r5 29a96: 4f 90 pop r4 #endif #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); 29a98: 0d 94 15 1e jmp 0x23c2a ; 0x23c2a // *** end of 'common' part #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); 29a9c: 0f 94 e7 44 call 0x289ce ; 0x289ce 29aa0: 8e ce rjmp .-740 ; 0x297be #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); } 29aa2: df 91 pop r29 29aa4: cf 91 pop r28 29aa6: 1f 91 pop r17 29aa8: 0f 91 pop r16 29aaa: ff 90 pop r15 29aac: ef 90 pop r14 29aae: df 90 pop r13 29ab0: cf 90 pop r12 29ab2: af 90 pop r10 29ab4: 7f 90 pop r7 29ab6: 6f 90 pop r6 29ab8: 5f 90 pop r5 29aba: 4f 90 pop r4 29abc: 08 95 ret 00029abe <__vector_47>: ISR(TIMERx_COMPA_vect) { 29abe: 1f 92 push r1 29ac0: 0f 92 push r0 29ac2: 0f b6 in r0, 0x3f ; 63 29ac4: 0f 92 push r0 29ac6: 11 24 eor r1, r1 29ac8: 0b b6 in r0, 0x3b ; 59 29aca: 0f 92 push r0 29acc: 2f 93 push r18 29ace: 3f 93 push r19 29ad0: 4f 93 push r20 29ad2: 5f 93 push r21 29ad4: 6f 93 push r22 29ad6: 7f 93 push r23 29ad8: 8f 93 push r24 29ada: 9f 93 push r25 29adc: af 93 push r26 29ade: bf 93 push r27 29ae0: ef 93 push r30 29ae2: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 29ae4: 80 91 1f 05 lds r24, 0x051F ; 0x80051f <_ZL16adc_values_ready.lto_priv.470> 29ae8: 88 23 and r24, r24 29aea: 91 f0 breq .+36 ; 0x29b10 <__vector_47+0x52> adc_values_ready = false; 29aec: 10 92 1f 05 sts 0x051F, r1 ; 0x80051f <_ZL16adc_values_ready.lto_priv.470> adc_start_cycle(); 29af0: 0e 94 fc 8f call 0x11ff8 ; 0x11ff8 // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 29af4: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 29af8: 8d 7f andi r24, 0xFD ; 253 29afa: 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(); 29afe: 78 94 sei NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { temp_mgr_isr(); 29b00: 0f 94 f8 4a call 0x295f0 ; 0x295f0 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 29b04: f8 94 cli } ENABLE_TEMP_MGR_INTERRUPT(); 29b06: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 29b0a: 82 60 ori r24, 0x02 ; 2 29b0c: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> } 29b10: ff 91 pop r31 29b12: ef 91 pop r30 29b14: bf 91 pop r27 29b16: af 91 pop r26 29b18: 9f 91 pop r25 29b1a: 8f 91 pop r24 29b1c: 7f 91 pop r23 29b1e: 6f 91 pop r22 29b20: 5f 91 pop r21 29b22: 4f 91 pop r20 29b24: 3f 91 pop r19 29b26: 2f 91 pop r18 29b28: 0f 90 pop r0 29b2a: 0b be out 0x3b, r0 ; 59 29b2c: 0f 90 pop r0 29b2e: 0f be out 0x3f, r0 ; 63 29b30: 0f 90 pop r0 29b32: 1f 90 pop r1 29b34: 18 95 reti 00029b36 : } void handle_temp_error(); void manage_heater() { 29b36: 6f 92 push r6 29b38: 7f 92 push r7 29b3a: 8f 92 push r8 29b3c: 9f 92 push r9 29b3e: af 92 push r10 29b40: bf 92 push r11 29b42: cf 92 push r12 29b44: df 92 push r13 29b46: ef 92 push r14 29b48: ff 92 push r15 29b4a: 0f 93 push r16 29b4c: 1f 93 push r17 29b4e: cf 93 push r28 29b50: df 93 push r29 29b52: 1f 92 push r1 29b54: cd b7 in r28, 0x3d ; 61 29b56: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 29b58: 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) 29b5a: 80 91 ff 05 lds r24, 0x05FF ; 0x8005ff 29b5e: 88 23 and r24, r24 29b60: 09 f4 brne .+2 ; 0x29b64 29b62: bb c0 rjmp .+374 ; 0x29cda return; // syncronize temperatures with isr updateTemperatures(); 29b64: 0f 94 bc 47 call 0x28f78 ; 0x28f78 #ifdef THERMAL_MODEL // handle model warnings first, so not to override the error handler if(thermal_model::warning_state.warning) 29b68: 80 91 36 06 lds r24, 0x0636 ; 0x800636 29b6c: 80 ff sbrs r24, 0 29b6e: 51 c0 rjmp .+162 ; 0x29c12 } static void handle_warning() { // update values float warn = data.warn; 29b70: 10 91 12 13 lds r17, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 29b74: 00 91 13 13 lds r16, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 29b78: b0 90 14 13 lds r11, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 29b7c: a0 90 15 13 lds r10, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> float dT_err; { TempMgrGuard temp_mgr_guard; 29b80: ce 01 movw r24, r28 29b82: 01 96 adiw r24, 0x01 ; 1 29b84: 0f 94 d9 46 call 0x28db2 ; 0x28db2 dT_err = warning_state.dT_err; 29b88: c0 90 32 06 lds r12, 0x0632 ; 0x800632 29b8c: d0 90 33 06 lds r13, 0x0633 ; 0x800633 29b90: e0 90 34 06 lds r14, 0x0634 ; 0x800634 29b94: f0 90 35 06 lds r15, 0x0635 ; 0x800635 { // update values float warn = data.warn; float dT_err; { TempMgrGuard temp_mgr_guard; 29b98: ce 01 movw r24, r28 29b9a: 01 96 adiw r24, 0x01 ; 1 29b9c: 0f 94 cc 46 call 0x28d98 ; 0x28d98 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); 29ba0: af 92 push r10 29ba2: bf 92 push r11 29ba4: 0f 93 push r16 29ba6: 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 29ba8: 21 e7 ldi r18, 0x71 ; 113 29baa: 3d e3 ldi r19, 0x3D ; 61 29bac: 4a e8 ldi r20, 0x8A ; 138 29bae: 5e e3 ldi r21, 0x3E ; 62 29bb0: c7 01 movw r24, r14 29bb2: b6 01 movw r22, r12 29bb4: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> printf_P(PSTR("TM: error |%f|>%f\n"), (double)dT_err, (double)warn); 29bb8: 9f 93 push r25 29bba: 8f 93 push r24 29bbc: 7f 93 push r23 29bbe: 6f 93 push r22 29bc0: 84 e4 ldi r24, 0x44 ; 68 29bc2: 9d e9 ldi r25, 0x9D ; 157 29bc4: 9f 93 push r25 29bc6: 8f 93 push r24 29bc8: 0f 94 1d dc call 0x3b83a ; 0x3b83a static bool first = true; if(warning_state.assert) { 29bcc: 90 91 36 06 lds r25, 0x0636 ; 0x800636 29bd0: 0f b6 in r0, 0x3f ; 63 29bd2: f8 94 cli 29bd4: de bf out 0x3e, r29 ; 62 29bd6: 0f be out 0x3f, r0 ; 63 29bd8: cd bf out 0x3d, r28 ; 61 29bda: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.468> 29bde: 91 ff sbrs r25, 1 29be0: 93 c0 rjmp .+294 ; 0x29d08 if (first) { 29be2: 90 91 7b 02 lds r25, 0x027B ; 0x80027b 29be6: 99 23 and r25, r25 29be8: 09 f4 brne .+2 ; 0x29bec 29bea: 87 c0 rjmp .+270 ; 0x29cfa if(warn_beep) { 29bec: 88 23 and r24, r24 29bee: 79 f0 breq .+30 ; 0x29c0e lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); 29bf0: 86 e1 ldi r24, 0x16 ; 22 29bf2: 9a e4 ldi r25, 0x4A ; 74 29bf4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 29bf8: 61 e0 ldi r22, 0x01 ; 1 29bfa: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 WRITE(BEEPER, HIGH); 29bfe: 9f b7 in r25, 0x3f ; 63 29c00: f8 94 cli 29c02: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c06: 84 60 ori r24, 0x04 ; 4 29c08: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c0c: 9f bf out 0x3f, r25 ; 63 } first = false; 29c0e: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b if(thermal_model::warning_state.warning) thermal_model::handle_warning(); #endif // handle temperature errors if(temp_error_state.v) 29c12: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29c16: 88 23 and r24, r24 29c18: 89 f0 breq .+34 ; 0x29c3c #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 29c1a: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29c1e: 82 95 swap r24 29c20: 86 95 lsr r24 29c22: 87 70 andi r24, 0x07 ; 7 29c24: 84 30 cpi r24, 0x04 ; 4 29c26: 08 f0 brcs .+2 ; 0x29c2a 29c28: 82 c0 rjmp .+260 ; 0x29d2e 29c2a: 82 30 cpi r24, 0x02 ; 2 29c2c: 08 f0 brcs .+2 ; 0x29c30 29c2e: 1d c1 rjmp .+570 ; 0x29e6a 29c30: 88 23 and r24, r24 29c32: 09 f4 brne .+2 ; 0x29c36 29c34: f4 c0 rjmp .+488 ; 0x29e1e 29c36: 81 30 cpi r24, 0x01 ; 1 29c38: 09 f4 brne .+2 ; 0x29c3c 29c3a: 94 c0 rjmp .+296 ; 0x29d64 // handle temperature errors if(temp_error_state.v) handle_temp_error(); // periodically check fans checkFans(); 29c3c: 0e 94 0d 82 call 0x1041a ; 0x1041a } #ifdef THERMAL_MODEL_DEBUG static void log_usr() { if(!log_buf.enabled) return; 29c40: 80 91 31 06 lds r24, 0x0631 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x10> 29c44: 88 23 and r24, r24 29c46: 09 f4 brne .+2 ; 0x29c4a 29c48: 48 c0 rjmp .+144 ; 0x29cda uint8_t counter = log_buf.entry.counter; 29c4a: 80 91 26 06 lds r24, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x5> if (counter == log_buf.serial) return; 29c4e: 70 90 30 06 lds r7, 0x0630 ; 0x800630 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0xf> 29c52: 87 15 cp r24, r7 29c54: 09 f4 brne .+2 ; 0x29c58 29c56: 41 c0 rjmp .+130 ; 0x29cda // 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; 29c58: ce 01 movw r24, r28 29c5a: 01 96 adiw r24, 0x01 ; 1 29c5c: 0f 94 d9 46 call 0x28db2 ; 0x28db2 delta_ms = log_buf.entry.delta_ms; 29c60: 00 91 25 06 lds r16, 0x0625 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x4> counter = log_buf.entry.counter; 29c64: 10 91 26 06 lds r17, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x5> cur_pwm = log_buf.entry.cur_pwm; 29c68: 60 90 27 06 lds r6, 0x0627 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x6> cur_temp = log_buf.entry.cur_temp; 29c6c: c0 90 28 06 lds r12, 0x0628 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x7> 29c70: d0 90 29 06 lds r13, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x8> 29c74: e0 90 2a 06 lds r14, 0x062A ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.556+0x9> 29c78: f0 90 2b 06 lds r15, 0x062B ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.556+0xa> cur_amb = log_buf.entry.cur_amb; 29c7c: 80 90 2c 06 lds r8, 0x062C ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.556+0xb> 29c80: 90 90 2d 06 lds r9, 0x062D ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.556+0xc> 29c84: a0 90 2e 06 lds r10, 0x062E ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.556+0xd> 29c88: b0 90 2f 06 lds r11, 0x062F ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.556+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; 29c8c: ce 01 movw r24, r28 29c8e: 01 96 adiw r24, 0x01 ; 1 29c90: 0f 94 cc 46 call 0x28d98 ; 0x28d98 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; 29c94: 10 93 30 06 sts 0x0630, r17 ; 0x800630 <_ZN13thermal_modelL7log_bufE.lto_priv.556+0xf> printf_P(PSTR("TML %d %d %x %lx %lx\n"), (unsigned)d - 1, (int)delta_ms + 1, 29c98: bf 92 push r11 29c9a: af 92 push r10 29c9c: 9f 92 push r9 29c9e: 8f 92 push r8 29ca0: ff 92 push r15 29ca2: ef 92 push r14 29ca4: df 92 push r13 29ca6: cf 92 push r12 29ca8: 1f 92 push r1 29caa: 6f 92 push r6 29cac: 80 2f mov r24, r16 29cae: 00 0f add r16, r16 29cb0: 99 0b sbc r25, r25 29cb2: 01 96 adiw r24, 0x01 ; 1 29cb4: 9f 93 push r25 29cb6: 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; 29cb8: 81 2f mov r24, r17 29cba: 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, 29cbc: 81 50 subi r24, 0x01 ; 1 29cbe: 99 0b sbc r25, r25 29cc0: 9f 93 push r25 29cc2: 8f 93 push r24 29cc4: 87 ec ldi r24, 0xC7 ; 199 29cc6: 9c e9 ldi r25, 0x9C ; 156 29cc8: 9f 93 push r25 29cca: 8f 93 push r24 29ccc: 0f 94 1d dc call 0x3b83a ; 0x3b83a 29cd0: 0f b6 in r0, 0x3f ; 63 29cd2: f8 94 cli 29cd4: de bf out 0x3e, r29 ; 62 29cd6: 0f be out 0x3f, r0 ; 63 29cd8: cd bf out 0x3d, r28 ; 61 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 29cda: 0f 90 pop r0 29cdc: df 91 pop r29 29cde: cf 91 pop r28 29ce0: 1f 91 pop r17 29ce2: 0f 91 pop r16 29ce4: ff 90 pop r15 29ce6: ef 90 pop r14 29ce8: df 90 pop r13 29cea: cf 90 pop r12 29cec: bf 90 pop r11 29cee: af 90 pop r10 29cf0: 9f 90 pop r9 29cf2: 8f 90 pop r8 29cf4: 7f 90 pop r7 29cf6: 6f 90 pop r6 29cf8: 08 95 ret lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); WRITE(BEEPER, HIGH); } first = false; } else { if(warn_beep) TOGGLE(BEEPER); 29cfa: 88 23 and r24, r24 29cfc: 09 f4 brne .+2 ; 0x29d00 29cfe: 89 cf rjmp .-238 ; 0x29c12 29d00: 84 e0 ldi r24, 0x04 ; 4 29d02: 80 93 00 01 sts 0x0100, r24 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 29d06: 85 cf rjmp .-246 ; 0x29c12 } } else { // warning cleared, reset state warning_state.warning = false; 29d08: 90 91 36 06 lds r25, 0x0636 ; 0x800636 29d0c: 9e 7f andi r25, 0xFE ; 254 29d0e: 90 93 36 06 sts 0x0636, r25 ; 0x800636 if(warn_beep) WRITE(BEEPER, LOW); 29d12: 88 23 and r24, r24 29d14: 41 f0 breq .+16 ; 0x29d26 29d16: 9f b7 in r25, 0x3f ; 63 29d18: f8 94 cli 29d1a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29d1e: 8b 7f andi r24, 0xFB ; 251 29d20: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29d24: 9f bf out 0x3f, r25 ; 63 first = true; 29d26: 81 e0 ldi r24, 0x01 ; 1 29d28: 80 93 7b 02 sts 0x027B, r24 ; 0x80027b 29d2c: 72 cf rjmp .-284 ; 0x29c12 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 29d2e: 84 30 cpi r24, 0x04 ; 4 29d30: 09 f0 breq .+2 ; 0x29d34 29d32: 84 cf rjmp .-248 ; 0x29c3c #endif } break; #ifdef THERMAL_MODEL case TempErrorType::model: if(temp_error_state.assert) { 29d34: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29d38: 81 ff sbrs r24, 1 29d3a: b4 c0 rjmp .+360 ; 0x29ea4 if(IsStopped() == false) { 29d3c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 29d40: 81 11 cpse r24, r1 29d42: 04 c0 rjmp .+8 ; 0x29d4c SERIAL_ECHOLNPGM("TM: error triggered!"); 29d44: 8f e2 ldi r24, 0x2F ; 47 29d46: 9d e9 ldi r25, 0x9D ; 157 29d48: 0e 94 86 7b call 0xf70c ; 0xf70c } ThermalStop(true); 29d4c: 81 e0 ldi r24, 0x01 ; 1 29d4e: 0e 94 b7 7b call 0xf76e ; 0xf76e WRITE(BEEPER, HIGH); 29d52: 9f b7 in r25, 0x3f ; 63 29d54: f8 94 cli 29d56: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29d5a: 84 60 ori r24, 0x04 ; 4 29d5c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29d60: 9f bf out 0x3f, r25 ; 63 29d62: 6c cf rjmp .-296 ; 0x29c3c void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 29d64: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29d68: 86 95 lsr r24 29d6a: 86 95 lsr r24 29d6c: 83 70 andi r24, 0x03 ; 3 29d6e: 81 30 cpi r24, 0x01 ; 1 29d70: d9 f1 breq .+118 ; 0x29de8 29d72: 58 f0 brcs .+22 ; 0x29d8a 29d74: 82 30 cpi r24, 0x02 ; 2 29d76: 09 f0 breq .+2 ; 0x29d7a 29d78: 61 cf rjmp .-318 ; 0x29c3c } ThermalStop(); } static void ambient_min_temp_error(void) { if(IsStopped() == false) { 29d7a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 29d7e: 81 11 cpse r24, r1 29d80: 14 c0 rjmp .+40 ; 0x29daa temp_error_messagepgm(PSTR("MINTEMP AMB")); 29d82: 61 e0 ldi r22, 0x01 ; 1 29d84: 81 ef ldi r24, 0xF1 ; 241 29d86: 9c e9 ldi r25, 0x9C ; 156 29d88: 0e c0 rjmp .+28 ; 0x29da6 // 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) { 29d8a: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29d8e: 81 ff sbrs r24, 1 29d90: 10 c0 rjmp .+32 ; 0x29db2 min_temp_error(temp_error_state.index); 29d92: 60 91 1e 05 lds r22, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29d96: 62 95 swap r22 29d98: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 29d9a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 29d9e: 81 11 cpse r24, r1 29da0: 04 c0 rjmp .+8 ; 0x29daa temp_error_messagepgm(err, e); 29da2: 8d ed ldi r24, 0xDD ; 221 29da4: 9c e9 ldi r25, 0x9C ; 156 29da6: 0f 94 37 41 call 0x2826e ; 0x2826e prusa_statistics(92); } ThermalStop(); 29daa: 80 e0 ldi r24, 0x00 ; 0 29dac: 0e 94 b7 7b call 0xf76e ; 0xf76e 29db0: 45 cf rjmp .-374 ; 0x29c3c // 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); 29db2: 60 91 9d 04 lds r22, 0x049D ; 0x80049d <_ZL8minttemp.lto_priv.474> 29db6: 70 91 9e 04 lds r23, 0x049E ; 0x80049e <_ZL8minttemp.lto_priv.474+0x1> 29dba: 6b 5f subi r22, 0xFB ; 251 29dbc: 7f 4f sbci r23, 0xFF ; 255 29dbe: 07 2e mov r0, r23 29dc0: 00 0c add r0, r0 29dc2: 88 0b sbc r24, r24 29dc4: 99 0b sbc r25, r25 29dc6: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 29dca: 8b 01 movw r16, r22 29dcc: 9c 01 movw r18, r24 29dce: 40 91 61 0e lds r20, 0x0E61 ; 0x800e61 29dd2: 50 91 62 0e lds r21, 0x0E62 ; 0x800e62 29dd6: 60 91 63 0e lds r22, 0x0E63 ; 0x800e63 29dda: 70 91 64 0e lds r23, 0x0E64 ; 0x800e64 29dde: 87 e7 ldi r24, 0x77 ; 119 29de0: 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); 29de2: 0f 94 33 31 call 0x26266 ; 0x26266 29de6: 2a cf rjmp .-428 ; 0x29c3c // 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) { 29de8: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29dec: 81 ff sbrs r24, 1 29dee: 08 c0 rjmp .+16 ; 0x29e00 ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 29df0: 80 91 14 05 lds r24, 0x0514 ; 0x800514 29df4: 81 11 cpse r24, r1 29df6: d9 cf rjmp .-78 ; 0x29daa temp_error_messagepgm(err); 29df8: 61 e0 ldi r22, 0x01 ; 1 29dfa: 85 ee ldi r24, 0xE5 ; 229 29dfc: 9c e9 ldi r25, 0x9C ; 156 29dfe: d3 cf rjmp .-90 ; 0x29da6 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); 29e00: 40 91 f1 04 lds r20, 0x04F1 ; 0x8004f1 29e04: 50 91 f2 04 lds r21, 0x04F2 ; 0x8004f2 29e08: 60 91 f3 04 lds r22, 0x04F3 ; 0x8004f3 29e0c: 70 91 f4 04 lds r23, 0x04F4 ; 0x8004f4 29e10: 00 e0 ldi r16, 0x00 ; 0 29e12: 10 e0 ldi r17, 0x00 ; 0 29e14: 20 e7 ldi r18, 0x70 ; 112 29e16: 31 e4 ldi r19, 0x41 ; 65 29e18: 83 e7 ldi r24, 0x73 ; 115 29e1a: 92 e0 ldi r25, 0x02 ; 2 29e1c: e2 cf rjmp .-60 ; 0x29de2 break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 29e1e: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29e22: 86 95 lsr r24 29e24: 86 95 lsr r24 29e26: 83 70 andi r24, 0x03 ; 3 29e28: 81 30 cpi r24, 0x01 ; 1 29e2a: b9 f0 breq .+46 ; 0x29e5a 29e2c: 58 f0 brcs .+22 ; 0x29e44 29e2e: 82 30 cpi r24, 0x02 ; 2 29e30: 09 f0 breq .+2 ; 0x29e34 29e32: 04 cf rjmp .-504 ; 0x29c3c } #ifdef AMBIENT_THERMISTOR static void ambient_max_temp_error(void) { if(IsStopped() == false) { 29e34: 80 91 14 05 lds r24, 0x0514 ; 0x800514 29e38: 81 11 cpse r24, r1 29e3a: b7 cf rjmp .-146 ; 0x29daa temp_error_messagepgm(PSTR("MAXTEMP AMB")); 29e3c: 61 e0 ldi r22, 0x01 ; 1 29e3e: 81 e1 ldi r24, 0x11 ; 17 29e40: 9d e9 ldi r25, 0x9D ; 157 29e42: b1 cf rjmp .-158 ; 0x29da6 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 29e44: 60 91 1e 05 lds r22, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29e48: 62 95 swap r22 29e4a: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 29e4c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 29e50: 81 11 cpse r24, r1 29e52: ab cf rjmp .-170 ; 0x29daa temp_error_messagepgm(PSTR("MAXTEMP"), e); 29e54: 8d ef ldi r24, 0xFD ; 253 29e56: 9c e9 ldi r25, 0x9C ; 156 29e58: a6 cf rjmp .-180 ; 0x29da6 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 29e5a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 29e5e: 81 11 cpse r24, r1 29e60: a4 cf rjmp .-184 ; 0x29daa temp_error_messagepgm(PSTR("MAXTEMP BED")); 29e62: 61 e0 ldi r22, 0x01 ; 1 29e64: 85 e0 ldi r24, 0x05 ; 5 29e66: 9d e9 ldi r25, 0x9D ; 157 29e68: 9e cf rjmp .-196 ; 0x29da6 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 29e6a: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29e6e: 86 95 lsr r24 29e70: 86 95 lsr r24 29e72: 83 70 andi r24, 0x03 ; 3 29e74: 82 30 cpi r24, 0x02 ; 2 29e76: 08 f0 brcs .+2 ; 0x29e7a 29e78: e1 ce rjmp .-574 ; 0x29c3c case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 29e7a: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29e7e: 86 95 lsr r24 29e80: 86 95 lsr r24 29e82: 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), 29e84: 90 91 1e 05 lds r25, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29e88: 92 95 swap r25 29e8a: 96 95 lsr r25 29e8c: 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( 29e8e: 61 e0 ldi r22, 0x01 ; 1 29e90: 81 30 cpi r24, 0x01 ; 1 29e92: 09 f0 breq .+2 ; 0x29e96 29e94: 60 e0 ldi r22, 0x00 ; 0 29e96: 81 e0 ldi r24, 0x01 ; 1 29e98: 92 30 cpi r25, 0x02 ; 2 29e9a: 09 f0 breq .+2 ; 0x29e9e 29e9c: 80 e0 ldi r24, 0x00 ; 0 29e9e: 0f 94 6c 31 call 0x262d8 ; 0x262d8 29ea2: cc ce rjmp .-616 ; 0x29c3c SERIAL_ECHOLNPGM("TM: error triggered!"); } ThermalStop(true); WRITE(BEEPER, HIGH); } else { temp_error_state.v = 0; 29ea4: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_ZL16temp_error_state.lto_priv.467> WRITE(BEEPER, LOW); 29ea8: 9f b7 in r25, 0x3f ; 63 29eaa: f8 94 cli 29eac: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29eb0: 8b 7f andi r24, 0xFB ; 251 29eb2: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29eb6: 9f bf out 0x3f, r25 ; 63 // hotend error was transitory and disappeared, re-enable bed if (!target_temperature_bed) 29eb8: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 29ebc: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 29ec0: 89 2b or r24, r25 29ec2: 39 f4 brne .+14 ; 0x29ed2 target_temperature_bed = saved_bed_temperature; 29ec4: 80 91 af 05 lds r24, 0x05AF ; 0x8005af 29ec8: 90 e0 ldi r25, 0x00 ; 0 29eca: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c 29ece: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b SERIAL_ECHOLNPGM("TM: error cleared"); 29ed2: 8d e1 ldi r24, 0x1D ; 29 29ed4: 9d e9 ldi r25, 0x9D ; 157 29ed6: 0e 94 86 7b call 0xf70c ; 0xf70c 29eda: b0 ce rjmp .-672 ; 0x29c3c 00029edc : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 29edc: 4f 92 push r4 29ede: 5f 92 push r5 29ee0: 6f 92 push r6 29ee2: 7f 92 push r7 29ee4: 8f 92 push r8 29ee6: 9f 92 push r9 29ee8: af 92 push r10 29eea: bf 92 push r11 29eec: cf 92 push r12 29eee: df 92 push r13 29ef0: ef 92 push r14 29ef2: ff 92 push r15 29ef4: 6c 01 movw r12, r24 bool bDelayed; long nTime0 = _millis()/1000; 29ef6: 0f 94 86 3e call 0x27d0c ; 0x27d0c 29efa: 28 ee ldi r18, 0xE8 ; 232 29efc: 33 e0 ldi r19, 0x03 ; 3 29efe: 40 e0 ldi r20, 0x00 ; 0 29f00: 50 e0 ldi r21, 0x00 ; 0 29f02: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 29f06: 29 01 movw r4, r18 29f08: 3a 01 movw r6, r20 lcd_consume_click(); 29f0a: 0e 94 2d 72 call 0xe45a ; 0xe45a KEEPALIVE_STATE(PAUSED_FOR_USER); 29f0e: 84 e0 ldi r24, 0x04 ; 4 29f10: 80 93 96 02 sts 0x0296, r24 ; 0x800296 for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 29f14: f1 2c mov r15, r1 29f16: e1 2c mov r14, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 29f18: 0f 94 9b 4d call 0x29b36 ; 0x29b36 manage_inactivity(true); 29f1c: 81 e0 ldi r24, 0x01 ; 1 29f1e: 0e 94 5a 8c call 0x118b4 ; 0x118b4 bDelayed = ((_millis()/1000-nTime0) > nDelay); 29f22: 0f 94 86 3e call 0x27d0c ; 0x27d0c 29f26: 28 ee ldi r18, 0xE8 ; 232 29f28: 33 e0 ldi r19, 0x03 ; 3 29f2a: 40 e0 ldi r20, 0x00 ; 0 29f2c: 50 e0 ldi r21, 0x00 ; 0 29f2e: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 29f32: 49 01 movw r8, r18 29f34: 5a 01 movw r10, r20 29f36: 84 18 sub r8, r4 29f38: 95 08 sbc r9, r5 29f3a: a6 08 sbc r10, r6 29f3c: b7 08 sbc r11, r7 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click if (lcd_clicked() || bDelayed) { 29f3e: 0e 94 32 72 call 0xe464 ; 0xe464 29f42: 81 11 cpse r24, r1 29f44: 07 c0 rjmp .+14 ; 0x29f54 29f46: c8 14 cp r12, r8 29f48: d9 04 cpc r13, r9 29f4a: ea 04 cpc r14, r10 29f4c: fb 04 cpc r15, r11 29f4e: 20 f7 brcc .-56 ; 0x29f18 29f50: 81 e0 ldi r24, 0x01 ; 1 29f52: 07 c0 rjmp .+14 ; 0x29f62 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 29f54: 81 e0 ldi r24, 0x01 ; 1 29f56: c8 14 cp r12, r8 29f58: d9 04 cpc r13, r9 29f5a: ea 04 cpc r14, r10 29f5c: fb 04 cpc r15, r11 29f5e: 08 f0 brcs .+2 ; 0x29f62 29f60: 80 e0 ldi r24, 0x00 ; 0 if (lcd_clicked() || bDelayed) { KEEPALIVE_STATE(IN_HANDLER); 29f62: 92 e0 ldi r25, 0x02 ; 2 29f64: 90 93 96 02 sts 0x0296, r25 ; 0x800296 return(!bDelayed); } } } 29f68: 91 e0 ldi r25, 0x01 ; 1 29f6a: 89 27 eor r24, r25 29f6c: ff 90 pop r15 29f6e: ef 90 pop r14 29f70: df 90 pop r13 29f72: cf 90 pop r12 29f74: bf 90 pop r11 29f76: af 90 pop r10 29f78: 9f 90 pop r9 29f7a: 8f 90 pop r8 29f7c: 7f 90 pop r7 29f7e: 6f 90 pop r6 29f80: 5f 90 pop r5 29f82: 4f 90 pop r4 29f84: 08 95 ret 00029f86 : #endif } static void waiting_handler() { manage_heater(); 29f86: 0f 94 9b 4d call 0x29b36 ; 0x29b36 host_keepalive(); 29f8a: 0e 94 b2 81 call 0x10364 ; 0x10364 host_autoreport(); 29f8e: 0e 94 63 7b call 0xf6c6 ; 0xf6c6 checkFans(); 29f92: 0e 94 0d 82 call 0x1041a ; 0x1041a lcd_update(0); 29f96: 80 e0 ldi r24, 0x00 ; 0 29f98: 0c 94 dc 6f jmp 0xdfb8 ; 0xdfb8 00029f9c : } } static void __attribute__((noinline)) wait_temp() { while(current_temperature[0] < (target_temperature[0] - TEMP_HYSTERESIS)) { 29f9c: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 29fa0: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 29fa4: 65 50 subi r22, 0x05 ; 5 29fa6: 71 09 sbc r23, r1 29fa8: 07 2e mov r0, r23 29faa: 00 0c add r0, r0 29fac: 88 0b sbc r24, r24 29fae: 99 0b sbc r25, r25 29fb0: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 29fb4: 9b 01 movw r18, r22 29fb6: ac 01 movw r20, r24 29fb8: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 29fbc: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 29fc0: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 29fc4: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 29fc8: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 29fcc: 87 ff sbrs r24, 7 29fce: 07 c0 rjmp .+14 ; 0x29fde if(temp_error_state.v) break; 29fd0: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 29fd4: 81 11 cpse r24, r1 29fd6: 03 c0 rjmp .+6 ; 0x29fde waiting_handler(); 29fd8: 0f 94 c3 4f call 0x29f86 ; 0x29f86 29fdc: df cf rjmp .-66 ; 0x29f9c } } 29fde: 08 95 ret 00029fe0 : checkFans(); lcd_update(0); } static void wait(unsigned ms) { 29fe0: cf 92 push r12 29fe2: df 92 push r13 29fe4: ef 92 push r14 29fe6: ff 92 push r15 29fe8: 7c 01 movw r14, r24 unsigned long mark = _millis() + ms; 29fea: 0f 94 86 3e call 0x27d0c ; 0x27d0c 29fee: 9b 01 movw r18, r22 29ff0: ac 01 movw r20, r24 29ff2: 2e 0d add r18, r14 29ff4: 3f 1d adc r19, r15 29ff6: 41 1d adc r20, r1 29ff8: 51 1d adc r21, r1 29ffa: 69 01 movw r12, r18 29ffc: 7a 01 movw r14, r20 while(_millis() < mark) { 29ffe: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a002: 6c 15 cp r22, r12 2a004: 7d 05 cpc r23, r13 2a006: 8e 05 cpc r24, r14 2a008: 9f 05 cpc r25, r15 2a00a: 38 f4 brcc .+14 ; 0x2a01a if(temp_error_state.v) break; 2a00c: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.467> 2a010: 81 11 cpse r24, r1 2a012: 03 c0 rjmp .+6 ; 0x2a01a waiting_handler(); 2a014: 0f 94 c3 4f call 0x29f86 ; 0x29f86 2a018: f2 cf rjmp .-28 ; 0x29ffe } } 2a01a: ff 90 pop r15 2a01c: ef 90 pop r14 2a01e: df 90 pop r13 2a020: cf 90 pop r12 2a022: 08 95 ret 0002a024 : 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; 2a024: 20 91 da 06 lds r18, 0x06DA ; 0x8006da 2a028: 30 91 db 06 lds r19, 0x06DB ; 0x8006db 2a02c: 40 91 dc 06 lds r20, 0x06DC ; 0x8006dc 2a030: 50 91 dd 06 lds r21, 0x06DD ; 0x8006dd 2a034: 60 e0 ldi r22, 0x00 ; 0 2a036: 70 e0 ldi r23, 0x00 ; 0 2a038: 8f e7 ldi r24, 0x7F ; 127 2a03a: 93 e4 ldi r25, 0x43 ; 67 2a03c: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 2a040: 60 93 a9 04 sts 0x04A9, r22 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.482> 2a044: 70 93 aa 04 sts 0x04AA, r23 ; 0x8004aa <_ZL14iState_sum_max.lto_priv.482+0x1> 2a048: 80 93 ab 04 sts 0x04AB, r24 ; 0x8004ab <_ZL14iState_sum_max.lto_priv.482+0x2> 2a04c: 90 93 ac 04 sts 0x04AC, r25 ; 0x8004ac <_ZL14iState_sum_max.lto_priv.482+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 2a050: 20 91 e6 06 lds r18, 0x06E6 ; 0x8006e6 2a054: 30 91 e7 06 lds r19, 0x06E7 ; 0x8006e7 2a058: 40 91 e8 06 lds r20, 0x06E8 ; 0x8006e8 2a05c: 50 91 e9 06 lds r21, 0x06E9 ; 0x8006e9 2a060: 60 e0 ldi r22, 0x00 ; 0 2a062: 70 e0 ldi r23, 0x00 ; 0 2a064: 8f e7 ldi r24, 0x7F ; 127 2a066: 93 e4 ldi r25, 0x43 ; 67 2a068: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 2a06c: 60 93 a1 04 sts 0x04A1, r22 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.480> 2a070: 70 93 a2 04 sts 0x04A2, r23 ; 0x8004a2 <_ZL19temp_iState_max_bed.lto_priv.480+0x1> 2a074: 80 93 a3 04 sts 0x04A3, r24 ; 0x8004a3 <_ZL19temp_iState_max_bed.lto_priv.480+0x2> 2a078: 90 93 a4 04 sts 0x04A4, r25 ; 0x8004a4 <_ZL19temp_iState_max_bed.lto_priv.480+0x3> #endif } 2a07c: 08 95 ret 0002a07e : #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) { 2a07e: 2f 92 push r2 2a080: 3f 92 push r3 2a082: 4f 92 push r4 2a084: 5f 92 push r5 2a086: 6f 92 push r6 2a088: 7f 92 push r7 2a08a: 8f 92 push r8 2a08c: 9f 92 push r9 2a08e: af 92 push r10 2a090: bf 92 push r11 2a092: cf 92 push r12 2a094: df 92 push r13 2a096: ef 92 push r14 2a098: ff 92 push r15 2a09a: 0f 93 push r16 2a09c: 1f 93 push r17 2a09e: cf 93 push r28 2a0a0: df 93 push r29 2a0a2: cd b7 in r28, 0x3d ; 61 2a0a4: de b7 in r29, 0x3e ; 62 2a0a6: e0 97 sbiw r28, 0x30 ; 48 2a0a8: 0f b6 in r0, 0x3f ; 63 2a0aa: f8 94 cli 2a0ac: de bf out 0x3e, r29 ; 62 2a0ae: 0f be out 0x3f, r0 ; 63 2a0b0: cd bf out 0x3d, r28 ; 61 2a0b2: 6a 87 std Y+10, r22 ; 0x0a 2a0b4: 7b 87 std Y+11, r23 ; 0x0b 2a0b6: 8c 87 std Y+12, r24 ; 0x0c 2a0b8: 9d 87 std Y+13, r25 ; 0x0d 2a0ba: 1a 01 movw r2, r20 2a0bc: 3a a7 std Y+42, r19 ; 0x2a 2a0be: 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(); 2a0c0: 0f 94 52 44 call 0x288a4 ; 0x288a4 pid_tuning_finished = false; 2a0c4: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.471> // 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; 2a0c8: 29 a5 ldd r18, Y+41 ; 0x29 2a0ca: 3a a5 ldd r19, Y+42 ; 0x2a 2a0cc: 30 93 45 06 sts 0x0645, r19 ; 0x800645 2a0d0: 20 93 44 06 sts 0x0644, r18 ; 0x800644 float input = 0.0; pid_cycle=0; 2a0d4: 10 92 47 06 sts 0x0647, r1 ; 0x800647 2a0d8: 10 92 46 06 sts 0x0646, r1 ; 0x800646 bool heating = true; unsigned long temp_millis = _millis(); 2a0dc: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a0e0: 6e 83 std Y+6, r22 ; 0x06 2a0e2: 7f 83 std Y+7, r23 ; 0x07 2a0e4: 88 87 std Y+8, r24 ; 0x08 2a0e6: 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 2a0e8: 37 fe sbrs r3, 7 2a0ea: ff c0 rjmp .+510 ; 0x2a2ea 2a0ec: 3d e2 ldi r19, 0x2D ; 45 2a0ee: 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(); 2a0f0: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a0f4: 6c a3 std Y+36, r22 ; 0x24 2a0f6: 7d a3 std Y+37, r23 ; 0x25 2a0f8: 8e a3 std Y+38, r24 ; 0x26 2a0fa: 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."); 2a0fc: 8d e9 ldi r24, 0x9D ; 157 2a0fe: 9c e9 ldi r25, 0x9C ; 156 #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) unsigned long extruder_autofan_last_check = _millis(); #endif if ((extruder >= EXTRUDERS) 2a100: 12 14 cp r1, r2 2a102: 13 04 cpc r1, r3 2a104: 0c f4 brge .+2 ; 0x2a108 2a106: 8a c2 rjmp .+1300 ; 0x2a61c pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 2a108: 8a e8 ldi r24, 0x8A ; 138 2a10a: 9c e9 ldi r25, 0x9C ; 156 2a10c: 0e 94 86 7b call 0xf70c ; 0xf70c 2a110: 6a 85 ldd r22, Y+10 ; 0x0a 2a112: 7b 85 ldd r23, Y+11 ; 0x0b 2a114: 8c 85 ldd r24, Y+12 ; 0x0c 2a116: 9d 85 ldd r25, Y+13 ; 0x0d 2a118: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 2a11c: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 2a11e: 21 14 cp r2, r1 2a120: 31 04 cpc r3, r1 2a122: 09 f4 brne .+2 ; 0x2a126 2a124: e5 c0 rjmp .+458 ; 0x2a2f0 { soft_pwm_bed = (MAX_BED_POWER)/2; 2a126: 20 93 1a 06 sts 0x061A, r18 ; 0x80061a bias = d = (MAX_BED_POWER)/2; target_temperature_bed = (int)temp; // to display the requested target bed temperature properly on the main screen 2a12a: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 2a12e: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b 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 2a132: 8e 81 ldd r24, Y+6 ; 0x06 2a134: 9f 81 ldd r25, Y+7 ; 0x07 2a136: a8 85 ldd r26, Y+8 ; 0x08 2a138: b9 85 ldd r27, Y+9 ; 0x09 2a13a: 8e 87 std Y+14, r24 ; 0x0e 2a13c: 9f 87 std Y+15, r25 ; 0x0f 2a13e: a8 8b std Y+16, r26 ; 0x10 2a140: b9 8b std Y+17, r27 ; 0x11 2a142: 88 a3 std Y+32, r24 ; 0x20 2a144: 99 a3 std Y+33, r25 ; 0x21 2a146: aa a3 std Y+34, r26 ; 0x22 2a148: bb a3 std Y+35, r27 ; 0x23 2a14a: 1a 8a std Y+18, r1 ; 0x12 2a14c: 90 e4 ldi r25, 0x40 ; 64 2a14e: 9b 8b std Y+19, r25 ; 0x13 2a150: ac e1 ldi r26, 0x1C ; 28 2a152: ac 8b std Y+20, r26 ; 0x14 2a154: b6 e4 ldi r27, 0x46 ; 70 2a156: bd 8b std Y+21, r27 ; 0x15 2a158: 1e 8a std Y+22, r1 ; 0x16 2a15a: 1f 8a std Y+23, r1 ; 0x17 2a15c: 18 8e std Y+24, r1 ; 0x18 2a15e: 19 8e std Y+25, r1 ; 0x19 2a160: 6f e7 ldi r22, 0x7F ; 127 2a162: c6 2e mov r12, r22 2a164: d1 2c mov r13, r1 2a166: e1 2c mov r14, r1 2a168: f1 2c mov r15, r1 2a16a: 00 e0 ldi r16, 0x00 ; 0 2a16c: 10 e0 ldi r17, 0x00 ; 0 2a16e: 18 aa std Y+48, r1 ; 0x30 2a170: 1f a6 std Y+47, r1 ; 0x2f 2a172: 1d 82 std Y+5, r1 ; 0x05 2a174: 2f e7 ldi r18, 0x7F ; 127 2a176: 30 e0 ldi r19, 0x00 ; 0 2a178: 40 e0 ldi r20, 0x00 ; 0 2a17a: 50 e0 ldi r21, 0x00 ; 0 2a17c: 29 83 std Y+1, r18 ; 0x01 2a17e: 3a 83 std Y+2, r19 ; 0x02 2a180: 4b 83 std Y+3, r20 ; 0x03 2a182: 5c 83 std Y+4, r21 ; 0x04 2a184: 1b 8e std Y+27, r1 ; 0x1b 2a186: 1c 8e std Y+28, r1 ; 0x1c 2a188: 1d 8e std Y+29, r1 ; 0x1d 2a18a: 1e 8e std Y+30, r1 ; 0x1e 2a18c: 31 e0 ldi r19, 0x01 ; 1 2a18e: 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(); 2a190: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 2a192: 40 91 ff 05 lds r20, 0x05FF ; 0x8005ff 2a196: 48 a7 std Y+40, r20 ; 0x28 2a198: 44 23 and r20, r20 2a19a: 09 f4 brne .+2 ; 0x2a19e 2a19c: 2c c2 rjmp .+1112 ; 0x2a5f6 updateTemperatures(); 2a19e: 0f 94 bc 47 call 0x28f78 ; 0x28f78 input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2a1a2: 21 14 cp r2, r1 2a1a4: 31 04 cpc r3, r1 2a1a6: 09 f0 breq .+2 ; 0x2a1aa 2a1a8: aa c0 rjmp .+340 ; 0x2a2fe 2a1aa: 00 91 61 0e lds r16, 0x0E61 ; 0x800e61 2a1ae: 10 91 62 0e lds r17, 0x0E62 ; 0x800e62 2a1b2: 50 91 63 0e lds r21, 0x0E63 ; 0x800e63 2a1b6: 58 ab std Y+48, r21 ; 0x30 2a1b8: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 2a1bc: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 2a1be: 2e 89 ldd r18, Y+22 ; 0x16 2a1c0: 3f 89 ldd r19, Y+23 ; 0x17 2a1c2: 48 8d ldd r20, Y+24 ; 0x18 2a1c4: 59 8d ldd r21, Y+25 ; 0x19 2a1c6: b8 01 movw r22, r16 2a1c8: 88 a9 ldd r24, Y+48 ; 0x30 2a1ca: 9f a5 ldd r25, Y+47 ; 0x2f 2a1cc: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 2a1d0: 87 fd sbrc r24, 7 2a1d2: 06 c0 rjmp .+12 ; 0x2a1e0 2a1d4: 0e 8b std Y+22, r16 ; 0x16 2a1d6: 1f 8b std Y+23, r17 ; 0x17 2a1d8: b8 a9 ldd r27, Y+48 ; 0x30 2a1da: b8 8f std Y+24, r27 ; 0x18 2a1dc: 2f a5 ldd r18, Y+47 ; 0x2f 2a1de: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 2a1e0: 2a 89 ldd r18, Y+18 ; 0x12 2a1e2: 3b 89 ldd r19, Y+19 ; 0x13 2a1e4: 4c 89 ldd r20, Y+20 ; 0x14 2a1e6: 5d 89 ldd r21, Y+21 ; 0x15 2a1e8: b8 01 movw r22, r16 2a1ea: 88 a9 ldd r24, Y+48 ; 0x30 2a1ec: 9f a5 ldd r25, Y+47 ; 0x2f 2a1ee: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 2a1f2: 18 16 cp r1, r24 2a1f4: 34 f0 brlt .+12 ; 0x2a202 2a1f6: 0a 8b std Y+18, r16 ; 0x12 2a1f8: 1b 8b std Y+19, r17 ; 0x13 2a1fa: 38 a9 ldd r19, Y+48 ; 0x30 2a1fc: 3c 8b std Y+20, r19 ; 0x14 2a1fe: 4f a5 ldd r20, Y+47 ; 0x2f 2a200: 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) { 2a202: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a206: 2c a1 ldd r18, Y+36 ; 0x24 2a208: 3d a1 ldd r19, Y+37 ; 0x25 2a20a: 4e a1 ldd r20, Y+38 ; 0x26 2a20c: 5f a1 ldd r21, Y+39 ; 0x27 2a20e: 62 1b sub r22, r18 2a210: 73 0b sbc r23, r19 2a212: 84 0b sbc r24, r20 2a214: 95 0b sbc r25, r21 2a216: 65 3c cpi r22, 0xC5 ; 197 2a218: 79 40 sbci r23, 0x09 ; 9 2a21a: 81 05 cpc r24, r1 2a21c: 91 05 cpc r25, r1 2a21e: 40 f0 brcs .+16 ; 0x2a230 checkExtruderAutoFans(); 2a220: 0e 94 b2 77 call 0xef64 ; 0xef64 extruder_autofan_last_check = _millis(); 2a224: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a228: 6c a3 std Y+36, r22 ; 0x24 2a22a: 7d a3 std Y+37, r23 ; 0x25 2a22c: 8e a3 std Y+38, r24 ; 0x26 2a22e: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 2a230: 4a 8d ldd r20, Y+26 ; 0x1a 2a232: 44 23 and r20, r20 2a234: 09 f4 brne .+2 ; 0x2a238 2a236: 4c c0 rjmp .+152 ; 0x2a2d0 2a238: 2a 85 ldd r18, Y+10 ; 0x0a 2a23a: 3b 85 ldd r19, Y+11 ; 0x0b 2a23c: 4c 85 ldd r20, Y+12 ; 0x0c 2a23e: 5d 85 ldd r21, Y+13 ; 0x0d 2a240: b8 01 movw r22, r16 2a242: 88 a9 ldd r24, Y+48 ; 0x30 2a244: 9f a5 ldd r25, Y+47 ; 0x2f 2a246: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 2a24a: 18 16 cp r1, r24 2a24c: 0c f0 brlt .+2 ; 0x2a250 2a24e: d3 c1 rjmp .+934 ; 0x2a5f6 if(_millis() - t2 > 5000) { 2a250: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a254: 2e 85 ldd r18, Y+14 ; 0x0e 2a256: 3f 85 ldd r19, Y+15 ; 0x0f 2a258: 48 89 ldd r20, Y+16 ; 0x10 2a25a: 59 89 ldd r21, Y+17 ; 0x11 2a25c: 62 1b sub r22, r18 2a25e: 73 0b sbc r23, r19 2a260: 84 0b sbc r24, r20 2a262: 95 0b sbc r25, r21 2a264: 69 38 cpi r22, 0x89 ; 137 2a266: 73 41 sbci r23, 0x13 ; 19 2a268: 81 05 cpc r24, r1 2a26a: 91 05 cpc r25, r1 2a26c: 08 f4 brcc .+2 ; 0x2a270 2a26e: c3 c1 rjmp .+902 ; 0x2a5f6 2a270: d7 01 movw r26, r14 2a272: c6 01 movw r24, r12 2a274: 29 81 ldd r18, Y+1 ; 0x01 2a276: 3a 81 ldd r19, Y+2 ; 0x02 2a278: 4b 81 ldd r20, Y+3 ; 0x03 2a27a: 5c 81 ldd r21, Y+4 ; 0x04 2a27c: 82 1b sub r24, r18 2a27e: 93 0b sbc r25, r19 2a280: a4 0b sbc r26, r20 2a282: b5 0b sbc r27, r21 2a284: b5 95 asr r27 2a286: a7 95 ror r26 2a288: 97 95 ror r25 2a28a: 87 95 ror r24 heating=false; if (extruder<0) { 2a28c: 21 14 cp r2, r1 2a28e: 31 04 cpc r3, r1 2a290: 09 f4 brne .+2 ; 0x2a294 2a292: 40 c0 rjmp .+128 ; 0x2a314 soft_pwm_bed = (bias - d) >> 1; 2a294: 80 93 1a 06 sts 0x061A, r24 ; 0x80061a } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 2a298: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a29c: 6e 83 std Y+6, r22 ; 0x06 2a29e: 7f 83 std Y+7, r23 ; 0x07 2a2a0: 88 87 std Y+8, r24 ; 0x08 2a2a2: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 2a2a4: dc 01 movw r26, r24 2a2a6: cb 01 movw r24, r22 2a2a8: 2e 85 ldd r18, Y+14 ; 0x0e 2a2aa: 3f 85 ldd r19, Y+15 ; 0x0f 2a2ac: 48 89 ldd r20, Y+16 ; 0x10 2a2ae: 59 89 ldd r21, Y+17 ; 0x11 2a2b0: 82 1b sub r24, r18 2a2b2: 93 0b sbc r25, r19 2a2b4: a4 0b sbc r26, r20 2a2b6: b5 0b sbc r27, r21 2a2b8: 8b 8f std Y+27, r24 ; 0x1b 2a2ba: 9c 8f std Y+28, r25 ; 0x1c 2a2bc: ad 8f std Y+29, r26 ; 0x1d 2a2be: be 8f std Y+30, r27 ; 0x1e max=temp; 2a2c0: 3a 85 ldd r19, Y+10 ; 0x0a 2a2c2: 3e 8b std Y+22, r19 ; 0x16 2a2c4: 4b 85 ldd r20, Y+11 ; 0x0b 2a2c6: 4f 8b std Y+23, r20 ; 0x17 2a2c8: 5c 85 ldd r21, Y+12 ; 0x0c 2a2ca: 58 8f std Y+24, r21 ; 0x18 2a2cc: 8d 85 ldd r24, Y+13 ; 0x0d 2a2ce: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 2a2d0: 2a 85 ldd r18, Y+10 ; 0x0a 2a2d2: 3b 85 ldd r19, Y+11 ; 0x0b 2a2d4: 4c 85 ldd r20, Y+12 ; 0x0c 2a2d6: 5d 85 ldd r21, Y+13 ; 0x0d 2a2d8: b8 01 movw r22, r16 2a2da: 88 a9 ldd r24, Y+48 ; 0x30 2a2dc: 9f a5 ldd r25, Y+47 ; 0x2f 2a2de: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 2a2e2: 87 fd sbrc r24, 7 2a2e4: 1a c0 rjmp .+52 ; 0x2a31a if(_millis() - t1 > 5000) { 2a2e6: 1a 8e std Y+26, r1 ; 0x1a 2a2e8: 86 c1 rjmp .+780 ; 0x2a5f6 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 2a2ea: 4a e0 ldi r20, 0x0A ; 10 2a2ec: 4f 8f std Y+31, r20 ; 0x1f 2a2ee: 00 cf rjmp .-512 ; 0x2a0f0 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; 2a2f0: 20 93 19 05 sts 0x0519, r18 ; 0x800519 <_ZL8soft_pwm.lto_priv.472> bias = d = (PID_MAX)/2; target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen 2a2f4: 70 93 6e 0e sts 0x0E6E, r23 ; 0x800e6e 2a2f8: 60 93 6d 0e sts 0x0E6D, r22 ; 0x800e6d 2a2fc: 1a cf rjmp .-460 ; 0x2a132 wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2a2fe: 00 91 f1 04 lds r16, 0x04F1 ; 0x8004f1 2a302: 10 91 f2 04 lds r17, 0x04F2 ; 0x8004f2 2a306: 90 91 f3 04 lds r25, 0x04F3 ; 0x8004f3 2a30a: 98 ab std Y+48, r25 ; 0x30 2a30c: a0 91 f4 04 lds r26, 0x04F4 ; 0x8004f4 2a310: af a7 std Y+47, r26 ; 0x2f 2a312: 55 cf rjmp .-342 ; 0x2a1be heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 2a314: 80 93 19 05 sts 0x0519, r24 ; 0x800519 <_ZL8soft_pwm.lto_priv.472> 2a318: bf cf rjmp .-130 ; 0x2a298 t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 2a31a: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a31e: 2e 81 ldd r18, Y+6 ; 0x06 2a320: 3f 81 ldd r19, Y+7 ; 0x07 2a322: 48 85 ldd r20, Y+8 ; 0x08 2a324: 59 85 ldd r21, Y+9 ; 0x09 2a326: 62 1b sub r22, r18 2a328: 73 0b sbc r23, r19 2a32a: 84 0b sbc r24, r20 2a32c: 95 0b sbc r25, r21 2a32e: 69 38 cpi r22, 0x89 ; 137 2a330: 73 41 sbci r23, 0x13 ; 19 2a332: 81 05 cpc r24, r1 2a334: 91 05 cpc r25, r1 2a336: b8 f2 brcs .-82 ; 0x2a2e6 heating=true; t2=_millis(); 2a338: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a33c: 6e 87 std Y+14, r22 ; 0x0e 2a33e: 7f 87 std Y+15, r23 ; 0x0f 2a340: 88 8b std Y+16, r24 ; 0x10 2a342: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 2a344: 80 91 46 06 lds r24, 0x0646 ; 0x800646 2a348: 90 91 47 06 lds r25, 0x0647 ; 0x800647 2a34c: 18 16 cp r1, r24 2a34e: 19 06 cpc r1, r25 2a350: 0c f0 brlt .+2 ; 0x2a354 2a352: 2c c1 rjmp .+600 ; 0x2a5ac } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 2a354: 8e 85 ldd r24, Y+14 ; 0x0e 2a356: 9f 85 ldd r25, Y+15 ; 0x0f 2a358: a8 89 ldd r26, Y+16 ; 0x10 2a35a: b9 89 ldd r27, Y+17 ; 0x11 2a35c: 2e 81 ldd r18, Y+6 ; 0x06 2a35e: 3f 81 ldd r19, Y+7 ; 0x07 2a360: 48 85 ldd r20, Y+8 ; 0x08 2a362: 59 85 ldd r21, Y+9 ; 0x09 2a364: 82 1b sub r24, r18 2a366: 93 0b sbc r25, r19 2a368: a4 0b sbc r26, r20 2a36a: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 2a36c: 4b 8c ldd r4, Y+27 ; 0x1b 2a36e: 5c 8c ldd r5, Y+28 ; 0x1c 2a370: 6d 8c ldd r6, Y+29 ; 0x1d 2a372: 7e 8c ldd r7, Y+30 ; 0x1e 2a374: 48 0e add r4, r24 2a376: 59 1e adc r5, r25 2a378: 6a 1e adc r6, r26 2a37a: 7b 1e adc r7, r27 2a37c: 2b 8d ldd r18, Y+27 ; 0x1b 2a37e: 3c 8d ldd r19, Y+28 ; 0x1c 2a380: 4d 8d ldd r20, Y+29 ; 0x1d 2a382: 5e 8d ldd r21, Y+30 ; 0x1e 2a384: 28 1b sub r18, r24 2a386: 39 0b sbc r19, r25 2a388: 4a 0b sbc r20, r26 2a38a: 5b 0b sbc r21, r27 2a38c: 69 81 ldd r22, Y+1 ; 0x01 2a38e: 7a 81 ldd r23, Y+2 ; 0x02 2a390: 8b 81 ldd r24, Y+3 ; 0x03 2a392: 9c 81 ldd r25, Y+4 ; 0x04 2a394: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__mulsi3> 2a398: a3 01 movw r20, r6 2a39a: 92 01 movw r18, r4 2a39c: 0f 94 4c de call 0x3bc98 ; 0x3bc98 <__divmodsi4> 2a3a0: da 01 movw r26, r20 2a3a2: c9 01 movw r24, r18 2a3a4: 8c 0d add r24, r12 2a3a6: 9d 1d adc r25, r13 2a3a8: ae 1d adc r26, r14 2a3aa: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 2a3ac: 84 31 cpi r24, 0x14 ; 20 2a3ae: 91 05 cpc r25, r1 2a3b0: a1 05 cpc r26, r1 2a3b2: b1 05 cpc r27, r1 2a3b4: 0c f4 brge .+2 ; 0x2a3b8 2a3b6: 3c c1 rjmp .+632 ; 0x2a630 2a3b8: 6c 01 movw r12, r24 2a3ba: 7d 01 movw r14, r26 2a3bc: 3c ee ldi r19, 0xEC ; 236 2a3be: c3 16 cp r12, r19 2a3c0: d1 04 cpc r13, r1 2a3c2: e1 04 cpc r14, r1 2a3c4: f1 04 cpc r15, r1 2a3c6: 2c f0 brlt .+10 ; 0x2a3d2 2a3c8: 4b ee ldi r20, 0xEB ; 235 2a3ca: c4 2e mov r12, r20 2a3cc: d1 2c mov r13, r1 2a3ce: e1 2c mov r14, r1 2a3d0: 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; 2a3d2: 80 38 cpi r24, 0x80 ; 128 2a3d4: 91 05 cpc r25, r1 2a3d6: a1 05 cpc r26, r1 2a3d8: b1 05 cpc r27, r1 2a3da: 0c f4 brge .+2 ; 0x2a3de 2a3dc: 37 c1 rjmp .+622 ; 0x2a64c 2a3de: 8e ef ldi r24, 0xFE ; 254 2a3e0: 90 e0 ldi r25, 0x00 ; 0 2a3e2: a0 e0 ldi r26, 0x00 ; 0 2a3e4: b0 e0 ldi r27, 0x00 ; 0 2a3e6: 8c 19 sub r24, r12 2a3e8: 9d 09 sbc r25, r13 2a3ea: ae 09 sbc r26, r14 2a3ec: bf 09 sbc r27, r15 2a3ee: 89 83 std Y+1, r24 ; 0x01 2a3f0: 9a 83 std Y+2, r25 ; 0x02 2a3f2: ab 83 std Y+3, r26 ; 0x03 2a3f4: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 2a3f6: 82 e8 ldi r24, 0x82 ; 130 2a3f8: 9c e9 ldi r25, 0x9C ; 156 2a3fa: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2a3fe: c7 01 movw r24, r14 2a400: b6 01 movw r22, r12 2a402: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 2a406: 8d e7 ldi r24, 0x7D ; 125 2a408: 9c e9 ldi r25, 0x9C ; 156 2a40a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2a40e: 69 81 ldd r22, Y+1 ; 0x01 2a410: 7a 81 ldd r23, Y+2 ; 0x02 2a412: 8b 81 ldd r24, Y+3 ; 0x03 2a414: 9c 81 ldd r25, Y+4 ; 0x04 2a416: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 2a41a: 86 e7 ldi r24, 0x76 ; 118 2a41c: 9c e9 ldi r25, 0x9C ; 156 2a41e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2a422: 42 e0 ldi r20, 0x02 ; 2 2a424: 6a 89 ldd r22, Y+18 ; 0x12 2a426: 7b 89 ldd r23, Y+19 ; 0x13 2a428: 8c 89 ldd r24, Y+20 ; 0x14 2a42a: 9d 89 ldd r25, Y+21 ; 0x15 2a42c: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 2a430: 8f e6 ldi r24, 0x6F ; 111 2a432: 9c e9 ldi r25, 0x9C ; 156 2a434: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2a438: 6e 89 ldd r22, Y+22 ; 0x16 2a43a: 7f 89 ldd r23, Y+23 ; 0x17 2a43c: 88 8d ldd r24, Y+24 ; 0x18 2a43e: 99 8d ldd r25, Y+25 ; 0x19 2a440: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e if(pid_cycle > 2) { 2a444: 80 91 46 06 lds r24, 0x0646 ; 0x800646 2a448: 90 91 47 06 lds r25, 0x0647 ; 0x800647 2a44c: 03 97 sbiw r24, 0x03 ; 3 2a44e: 0c f4 brge .+2 ; 0x2a452 2a450: ad c0 rjmp .+346 ; 0x2a5ac Ku = (4.0*d)/(3.14159*(max-min)/2.0); 2a452: 69 81 ldd r22, Y+1 ; 0x01 2a454: 7a 81 ldd r23, Y+2 ; 0x02 2a456: 8b 81 ldd r24, Y+3 ; 0x03 2a458: 9c 81 ldd r25, Y+4 ; 0x04 2a45a: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 2a45e: 20 e0 ldi r18, 0x00 ; 0 2a460: 30 e0 ldi r19, 0x00 ; 0 2a462: 40 e8 ldi r20, 0x80 ; 128 2a464: 50 e4 ldi r21, 0x40 ; 64 2a466: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2a46a: 4b 01 movw r8, r22 2a46c: 5c 01 movw r10, r24 2a46e: 2a 89 ldd r18, Y+18 ; 0x12 2a470: 3b 89 ldd r19, Y+19 ; 0x13 2a472: 4c 89 ldd r20, Y+20 ; 0x14 2a474: 5d 89 ldd r21, Y+21 ; 0x15 2a476: 6e 89 ldd r22, Y+22 ; 0x16 2a478: 7f 89 ldd r23, Y+23 ; 0x17 2a47a: 88 8d ldd r24, Y+24 ; 0x18 2a47c: 99 8d ldd r25, Y+25 ; 0x19 2a47e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 2a482: 20 ed ldi r18, 0xD0 ; 208 2a484: 3f e0 ldi r19, 0x0F ; 15 2a486: 49 e4 ldi r20, 0x49 ; 73 2a488: 50 e4 ldi r21, 0x40 ; 64 2a48a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2a48e: 20 e0 ldi r18, 0x00 ; 0 2a490: 30 e0 ldi r19, 0x00 ; 0 2a492: 40 e0 ldi r20, 0x00 ; 0 2a494: 5f e3 ldi r21, 0x3F ; 63 2a496: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2a49a: 9b 01 movw r18, r22 2a49c: ac 01 movw r20, r24 2a49e: c5 01 movw r24, r10 2a4a0: b4 01 movw r22, r8 2a4a2: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 2a4a6: 4b 01 movw r8, r22 2a4a8: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 2a4aa: c3 01 movw r24, r6 2a4ac: b2 01 movw r22, r4 2a4ae: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 2a4b2: 20 e0 ldi r18, 0x00 ; 0 2a4b4: 30 e0 ldi r19, 0x00 ; 0 2a4b6: 4a e7 ldi r20, 0x7A ; 122 2a4b8: 54 e4 ldi r21, 0x44 ; 68 2a4ba: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 2a4be: 2b 01 movw r4, r22 2a4c0: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 2a4c2: 89 e6 ldi r24, 0x69 ; 105 2a4c4: 9c e9 ldi r25, 0x9C ; 156 2a4c6: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2a4ca: 42 e0 ldi r20, 0x02 ; 2 2a4cc: c5 01 movw r24, r10 2a4ce: b4 01 movw r22, r8 2a4d0: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 2a4d4: 83 e6 ldi r24, 0x63 ; 99 2a4d6: 9c e9 ldi r25, 0x9C ; 156 2a4d8: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2a4dc: c3 01 movw r24, r6 2a4de: b2 01 movw r22, r4 2a4e0: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e _Kp = 0.6*Ku; 2a4e4: 2a e9 ldi r18, 0x9A ; 154 2a4e6: 39 e9 ldi r19, 0x99 ; 153 2a4e8: 49 e1 ldi r20, 0x19 ; 25 2a4ea: 5f e3 ldi r21, 0x3F ; 63 2a4ec: c5 01 movw r24, r10 2a4ee: b4 01 movw r22, r8 2a4f0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2a4f4: 4b 01 movw r8, r22 2a4f6: 5c 01 movw r10, r24 2a4f8: 80 92 ef 03 sts 0x03EF, r8 ; 0x8003ef <_Kp> 2a4fc: 90 92 f0 03 sts 0x03F0, r9 ; 0x8003f0 <_Kp+0x1> 2a500: a0 92 f1 03 sts 0x03F1, r10 ; 0x8003f1 <_Kp+0x2> 2a504: b0 92 f2 03 sts 0x03F2, r11 ; 0x8003f2 <_Kp+0x3> _Ki = 2*_Kp/Tu; 2a508: ac 01 movw r20, r24 2a50a: 9b 01 movw r18, r22 2a50c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 2a510: a3 01 movw r20, r6 2a512: 92 01 movw r18, r4 2a514: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 2a518: 60 93 eb 03 sts 0x03EB, r22 ; 0x8003eb <_Ki> 2a51c: 70 93 ec 03 sts 0x03EC, r23 ; 0x8003ec <_Ki+0x1> 2a520: 80 93 ed 03 sts 0x03ED, r24 ; 0x8003ed <_Ki+0x2> 2a524: 90 93 ee 03 sts 0x03EE, r25 ; 0x8003ee <_Ki+0x3> _Kd = _Kp*Tu/8; 2a528: a3 01 movw r20, r6 2a52a: 92 01 movw r18, r4 2a52c: c5 01 movw r24, r10 2a52e: b4 01 movw r22, r8 2a530: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2a534: 20 e0 ldi r18, 0x00 ; 0 2a536: 30 e0 ldi r19, 0x00 ; 0 2a538: 40 e0 ldi r20, 0x00 ; 0 2a53a: 5e e3 ldi r21, 0x3E ; 62 2a53c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2a540: 60 93 e7 03 sts 0x03E7, r22 ; 0x8003e7 <_Kd> 2a544: 70 93 e8 03 sts 0x03E8, r23 ; 0x8003e8 <_Kd+0x1> 2a548: 80 93 e9 03 sts 0x03E9, r24 ; 0x8003e9 <_Kd+0x2> 2a54c: 90 93 ea 03 sts 0x03EA, r25 ; 0x8003ea <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 2a550: 85 e5 ldi r24, 0x55 ; 85 2a552: 9c e9 ldi r25, 0x9C ; 156 2a554: 0e 94 86 7b call 0xf70c ; 0xf70c SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 2a558: 8f e4 ldi r24, 0x4F ; 79 2a55a: 9c e9 ldi r25, 0x9C ; 156 2a55c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2a560: 60 91 ef 03 lds r22, 0x03EF ; 0x8003ef <_Kp> 2a564: 70 91 f0 03 lds r23, 0x03F0 ; 0x8003f0 <_Kp+0x1> 2a568: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 <_Kp+0x2> 2a56c: 90 91 f2 03 lds r25, 0x03F2 ; 0x8003f2 <_Kp+0x3> 2a570: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 2a574: 89 e4 ldi r24, 0x49 ; 73 2a576: 9c e9 ldi r25, 0x9C ; 156 2a578: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2a57c: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb <_Ki> 2a580: 70 91 ec 03 lds r23, 0x03EC ; 0x8003ec <_Ki+0x1> 2a584: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Ki+0x2> 2a588: 90 91 ee 03 lds r25, 0x03EE ; 0x8003ee <_Ki+0x3> 2a58c: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 2a590: 83 e4 ldi r24, 0x43 ; 67 2a592: 9c e9 ldi r25, 0x9C ; 156 2a594: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2a598: 60 91 e7 03 lds r22, 0x03E7 ; 0x8003e7 <_Kd> 2a59c: 70 91 e8 03 lds r23, 0x03E8 ; 0x8003e8 <_Kd+0x1> 2a5a0: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 <_Kd+0x2> 2a5a4: 90 91 ea 03 lds r25, 0x03EA ; 0x8003ea <_Kd+0x3> 2a5a8: 0f 94 9f 75 call 0x2eb3e ; 0x2eb3e 2a5ac: 89 81 ldd r24, Y+1 ; 0x01 2a5ae: 9a 81 ldd r25, Y+2 ; 0x02 2a5b0: ab 81 ldd r26, Y+3 ; 0x03 2a5b2: bc 81 ldd r27, Y+4 ; 0x04 2a5b4: 8c 0d add r24, r12 2a5b6: 9d 1d adc r25, r13 2a5b8: ae 1d adc r26, r14 2a5ba: bf 1d adc r27, r15 2a5bc: b5 95 asr r27 2a5be: a7 95 ror r26 2a5c0: 97 95 ror r25 2a5c2: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 2a5c4: 21 14 cp r2, r1 2a5c6: 31 04 cpc r3, r1 2a5c8: 09 f4 brne .+2 ; 0x2a5cc 2a5ca: 45 c0 rjmp .+138 ; 0x2a656 { soft_pwm_bed = (bias + d) >> 1; 2a5cc: 80 93 1a 06 sts 0x061A, r24 ; 0x80061a } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 2a5d0: 80 91 46 06 lds r24, 0x0646 ; 0x800646 2a5d4: 90 91 47 06 lds r25, 0x0647 ; 0x800647 2a5d8: 01 96 adiw r24, 0x01 ; 1 2a5da: 90 93 47 06 sts 0x0647, r25 ; 0x800647 2a5de: 80 93 46 06 sts 0x0646, r24 ; 0x800646 min=temp; 2a5e2: 3a 85 ldd r19, Y+10 ; 0x0a 2a5e4: 3a 8b std Y+18, r19 ; 0x12 2a5e6: 4b 85 ldd r20, Y+11 ; 0x0b 2a5e8: 4b 8b std Y+19, r20 ; 0x13 2a5ea: 5c 85 ldd r21, Y+12 ; 0x0c 2a5ec: 5c 8b std Y+20, r21 ; 0x14 2a5ee: 8d 85 ldd r24, Y+13 ; 0x0d 2a5f0: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 2a5f2: 98 a5 ldd r25, Y+40 ; 0x28 2a5f4: 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)) { 2a5f6: 20 e0 ldi r18, 0x00 ; 0 2a5f8: 30 e0 ldi r19, 0x00 ; 0 2a5fa: 40 ef ldi r20, 0xF0 ; 240 2a5fc: 51 e4 ldi r21, 0x41 ; 65 2a5fe: 6a 85 ldd r22, Y+10 ; 0x0a 2a600: 7b 85 ldd r23, Y+11 ; 0x0b 2a602: 8c 85 ldd r24, Y+12 ; 0x0c 2a604: 9d 85 ldd r25, Y+13 ; 0x0d 2a606: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 2a60a: 98 01 movw r18, r16 2a60c: 48 a9 ldd r20, Y+48 ; 0x30 2a60e: 5f a5 ldd r21, Y+47 ; 0x2f 2a610: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 2a614: 87 ff sbrs r24, 7 2a616: 22 c0 rjmp .+68 ; 0x2a65c SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 2a618: 89 e1 ldi r24, 0x19 ; 25 2a61a: 9c e9 ldi r25, 0x9C ; 156 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"); 2a61c: 0e 94 86 7b call 0xf70c ; 0xf70c pid_tuning_finished = true; 2a620: 81 e0 ldi r24, 0x01 ; 1 2a622: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.471> pid_cycle = 0; 2a626: 10 92 47 06 sts 0x0647, r1 ; 0x800647 2a62a: 10 92 46 06 sts 0x0646, r1 ; 0x800646 2a62e: 98 c0 rjmp .+304 ; 0x2a760 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); 2a630: 34 e1 ldi r19, 0x14 ; 20 2a632: c3 2e mov r12, r19 2a634: d1 2c mov r13, r1 2a636: e1 2c mov r14, r1 2a638: f1 2c mov r15, r1 2a63a: 24 e1 ldi r18, 0x14 ; 20 2a63c: 30 e0 ldi r19, 0x00 ; 0 2a63e: 40 e0 ldi r20, 0x00 ; 0 2a640: 50 e0 ldi r21, 0x00 ; 0 2a642: 29 83 std Y+1, r18 ; 0x01 2a644: 3a 83 std Y+2, r19 ; 0x02 2a646: 4b 83 std Y+3, r20 ; 0x03 2a648: 5c 83 std Y+4, r21 ; 0x04 2a64a: d5 ce rjmp .-598 ; 0x2a3f6 2a64c: c9 82 std Y+1, r12 ; 0x01 2a64e: da 82 std Y+2, r13 ; 0x02 2a650: eb 82 std Y+3, r14 ; 0x03 2a652: fc 82 std Y+4, r15 ; 0x04 2a654: d0 ce rjmp .-608 ; 0x2a3f6 if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 2a656: 80 93 19 05 sts 0x0519, r24 ; 0x800519 <_ZL8soft_pwm.lto_priv.472> 2a65a: ba cf rjmp .-140 ; 0x2a5d0 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 2a65c: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a660: 28 a1 ldd r18, Y+32 ; 0x20 2a662: 39 a1 ldd r19, Y+33 ; 0x21 2a664: 4a a1 ldd r20, Y+34 ; 0x22 2a666: 5b a1 ldd r21, Y+35 ; 0x23 2a668: 62 1b sub r22, r18 2a66a: 73 0b sbc r23, r19 2a66c: 84 0b sbc r24, r20 2a66e: 95 0b sbc r25, r21 2a670: 61 3d cpi r22, 0xD1 ; 209 2a672: 77 40 sbci r23, 0x07 ; 7 2a674: 81 05 cpc r24, r1 2a676: 91 05 cpc r25, r1 2a678: 58 f1 brcs .+86 ; 0x2a6d0 int p; if (extruder<0){ p=soft_pwm_bed; 2a67a: a0 90 1a 06 lds r10, 0x061A ; 0x80061a 2a67e: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 2a680: 86 e1 ldi r24, 0x16 ; 22 2a682: 9c e9 ldi r25, 0x9C ; 156 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 2a684: 21 14 cp r2, r1 2a686: 31 04 cpc r3, r1 2a688: 29 f4 brne .+10 ; 0x2a694 p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 2a68a: a0 90 19 05 lds r10, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.472> 2a68e: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 2a690: 83 e1 ldi r24, 0x13 ; 19 2a692: 9c e9 ldi r25, 0x9C ; 156 2a694: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2a698: 42 e0 ldi r20, 0x02 ; 2 2a69a: b8 01 movw r22, r16 2a69c: 88 a9 ldd r24, Y+48 ; 0x30 2a69e: 9f a5 ldd r25, Y+47 ; 0x2f 2a6a0: 0f 94 e7 d5 call 0x3abce ; 0x3abce } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 2a6a4: 8f e0 ldi r24, 0x0F ; 15 2a6a6: 9c e9 ldi r25, 0x9C ; 156 2a6a8: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_PROTOCOLLN(p); 2a6ac: c5 01 movw r24, r10 2a6ae: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 if (safety_check_cycles == 0) { //save ambient temp 2a6b2: 4d 81 ldd r20, Y+5 ; 0x05 2a6b4: 44 23 and r20, r20 2a6b6: 09 f4 brne .+2 ; 0x2a6ba 2a6b8: 6c c0 rjmp .+216 ; 0x2a792 temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 2a6ba: 5f 8d ldd r21, Y+31 ; 0x1f 2a6bc: 45 17 cp r20, r21 2a6be: 70 f5 brcc .+92 ; 0x2a71c safety_check_cycles++; 2a6c0: 4f 5f subi r20, 0xFF ; 255 2a6c2: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 2a6c4: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a6c8: 68 a3 std Y+32, r22 ; 0x20 2a6ca: 79 a3 std Y+33, r23 ; 0x21 2a6cc: 8a a3 std Y+34, r24 ; 0x22 2a6ce: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 2a6d0: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a6d4: 4b 01 movw r8, r22 2a6d6: 5c 01 movw r10, r24 2a6d8: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a6dc: 4e 80 ldd r4, Y+6 ; 0x06 2a6de: 5f 80 ldd r5, Y+7 ; 0x07 2a6e0: 68 84 ldd r6, Y+8 ; 0x08 2a6e2: 79 84 ldd r7, Y+9 ; 0x09 2a6e4: 2e 85 ldd r18, Y+14 ; 0x0e 2a6e6: 3f 85 ldd r19, Y+15 ; 0x0f 2a6e8: 48 89 ldd r20, Y+16 ; 0x10 2a6ea: 59 89 ldd r21, Y+17 ; 0x11 2a6ec: 42 0e add r4, r18 2a6ee: 53 1e adc r5, r19 2a6f0: 64 1e adc r6, r20 2a6f2: 75 1e adc r7, r21 2a6f4: 84 18 sub r8, r4 2a6f6: 95 08 sbc r9, r5 2a6f8: a6 08 sbc r10, r6 2a6fa: b7 08 sbc r11, r7 2a6fc: 86 0e add r8, r22 2a6fe: 97 1e adc r9, r23 2a700: a8 1e adc r10, r24 2a702: b9 1e adc r11, r25 2a704: 31 e8 ldi r19, 0x81 ; 129 2a706: 83 16 cp r8, r19 2a708: 3f e4 ldi r19, 0x4F ; 79 2a70a: 93 06 cpc r9, r19 2a70c: 32 e1 ldi r19, 0x12 ; 18 2a70e: a3 06 cpc r10, r19 2a710: b1 04 cpc r11, r1 2a712: 08 f4 brcc .+2 ; 0x2a716 2a714: 47 c0 rjmp .+142 ; 0x2a7a4 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 2a716: 82 ef ldi r24, 0xF2 ; 242 2a718: 9b e9 ldi r25, 0x9B ; 155 2a71a: 80 cf rjmp .-256 ; 0x2a61c 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 2a71c: 8d 81 ldd r24, Y+5 ; 0x05 2a71e: 9f 8d ldd r25, Y+31 ; 0x1f 2a720: 89 13 cpse r24, r25 2a722: d0 cf rjmp .-96 ; 0x2a6c4 safety_check_cycles++; 2a724: 8f 5f subi r24, 0xFF ; 255 2a726: 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) { 2a728: 2b a5 ldd r18, Y+43 ; 0x2b 2a72a: 3c a5 ldd r19, Y+44 ; 0x2c 2a72c: 4d a5 ldd r20, Y+45 ; 0x2d 2a72e: 5e a5 ldd r21, Y+46 ; 0x2e 2a730: b8 01 movw r22, r16 2a732: 88 a9 ldd r24, Y+48 ; 0x30 2a734: 9f a5 ldd r25, Y+47 ; 0x2f 2a736: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 2a73a: 9f 77 andi r25, 0x7F ; 127 2a73c: 20 e0 ldi r18, 0x00 ; 0 2a73e: 30 e0 ldi r19, 0x00 ; 0 2a740: 40 ea ldi r20, 0xA0 ; 160 2a742: 50 e4 ldi r21, 0x40 ; 64 2a744: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 2a748: 87 ff sbrs r24, 7 2a74a: bc cf rjmp .-136 ; 0x2a6c4 temp_runaway_stop(false, (extruder<0)); 2a74c: 63 2d mov r22, r3 2a74e: 66 1f adc r22, r22 2a750: 66 27 eor r22, r22 2a752: 66 1f adc r22, r22 2a754: 80 e0 ldi r24, 0x00 ; 0 2a756: 0f 94 6c 31 call 0x262d8 ; 0x262d8 pid_tuning_finished = true; 2a75a: 81 e0 ldi r24, 0x01 ; 1 2a75c: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.471> pid_cycle = 0; return; } lcd_update(0); } } 2a760: e0 96 adiw r28, 0x30 ; 48 2a762: 0f b6 in r0, 0x3f ; 63 2a764: f8 94 cli 2a766: de bf out 0x3e, r29 ; 62 2a768: 0f be out 0x3f, r0 ; 63 2a76a: cd bf out 0x3d, r28 ; 61 2a76c: df 91 pop r29 2a76e: cf 91 pop r28 2a770: 1f 91 pop r17 2a772: 0f 91 pop r16 2a774: ff 90 pop r15 2a776: ef 90 pop r14 2a778: df 90 pop r13 2a77a: cf 90 pop r12 2a77c: bf 90 pop r11 2a77e: af 90 pop r10 2a780: 9f 90 pop r9 2a782: 8f 90 pop r8 2a784: 7f 90 pop r7 2a786: 6f 90 pop r6 2a788: 5f 90 pop r5 2a78a: 4f 90 pop r4 2a78c: 3f 90 pop r3 2a78e: 2f 90 pop r2 2a790: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 2a792: 0b a7 std Y+43, r16 ; 0x2b 2a794: 1c a7 std Y+44, r17 ; 0x2c 2a796: a8 a9 ldd r26, Y+48 ; 0x30 2a798: ad a7 std Y+45, r26 ; 0x2d 2a79a: bf a5 ldd r27, Y+47 ; 0x2f 2a79c: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 2a79e: 21 e0 ldi r18, 0x01 ; 1 2a7a0: 2d 83 std Y+5, r18 ; 0x05 2a7a2: 90 cf rjmp .-224 ; 0x2a6c4 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 2a7a4: 80 91 46 06 lds r24, 0x0646 ; 0x800646 2a7a8: 90 91 47 06 lds r25, 0x0647 ; 0x800647 2a7ac: 49 a5 ldd r20, Y+41 ; 0x29 2a7ae: 5a a5 ldd r21, Y+42 ; 0x2a 2a7b0: 48 17 cp r20, r24 2a7b2: 59 07 cpc r21, r25 2a7b4: 1c f4 brge .+6 ; 0x2a7bc SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 2a7b6: 86 e9 ldi r24, 0x96 ; 150 2a7b8: 9b e9 ldi r25, 0x9B ; 155 2a7ba: 30 cf rjmp .-416 ; 0x2a61c pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 2a7bc: 80 e0 ldi r24, 0x00 ; 0 2a7be: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 2a7c2: e6 cc rjmp .-1588 ; 0x2a190 0002a7c4 : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 2a7c4: 0f 93 push r16 2a7c6: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2a7c8: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 2a7cc: 81 30 cpi r24, 0x01 ; 1 2a7ce: 19 f5 brne .+70 ; 0x2a816 2a7d0: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2a7d4: 00 91 a8 05 lds r16, 0x05A8 ; 0x8005a8 2a7d8: 10 91 a9 05 lds r17, 0x05A9 ; 0x8005a9 2a7dc: 20 91 aa 05 lds r18, 0x05AA ; 0x8005aa 2a7e0: 30 91 ab 05 lds r19, 0x05AB ; 0x8005ab 2a7e4: 60 1b sub r22, r16 2a7e6: 71 0b sbc r23, r17 2a7e8: 82 0b sbc r24, r18 2a7ea: 93 0b sbc r25, r19 2a7ec: 28 ee ldi r18, 0xE8 ; 232 2a7ee: 33 e0 ldi r19, 0x03 ; 3 2a7f0: 40 e0 ldi r20, 0x00 ; 0 2a7f2: 50 e0 ldi r21, 0x00 ; 0 2a7f4: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 2a7f8: 60 91 a4 05 lds r22, 0x05A4 ; 0x8005a4 2a7fc: 70 91 a5 05 lds r23, 0x05A5 ; 0x8005a5 2a800: 80 91 a6 05 lds r24, 0x05A6 ; 0x8005a6 2a804: 90 91 a7 05 lds r25, 0x05A7 ; 0x8005a7 2a808: 62 0f add r22, r18 2a80a: 73 1f adc r23, r19 2a80c: 84 1f adc r24, r20 2a80e: 95 1f adc r25, r21 } 2a810: 1f 91 pop r17 2a812: 0f 91 pop r16 2a814: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2a816: 60 91 4f 06 lds r22, 0x064F ; 0x80064f 2a81a: 70 91 50 06 lds r23, 0x0650 ; 0x800650 2a81e: 80 91 51 06 lds r24, 0x0651 ; 0x800651 2a822: 90 91 52 06 lds r25, 0x0652 ; 0x800652 2a826: d6 cf rjmp .-84 ; 0x2a7d4 0002a828 : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 2a828: 4f 92 push r4 2a82a: 5f 92 push r5 2a82c: 6f 92 push r6 2a82e: 7f 92 push r7 2a830: 8f 92 push r8 2a832: 9f 92 push r9 2a834: af 92 push r10 2a836: bf 92 push r11 2a838: cf 92 push r12 2a83a: df 92 push r13 2a83c: ef 92 push r14 2a83e: ff 92 push r15 2a840: 0f 93 push r16 2a842: 1f 93 push r17 2a844: cf 93 push r28 2a846: df 93 push r29 2a848: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 2a84c: 0e 94 c5 68 call 0xd18a ; 0xd18a 2a850: 88 23 and r24, r24 2a852: 09 f4 brne .+2 ; 0x2a856 2a854: 6e c0 rjmp .+220 ; 0x2a932 { const float _met = ((float)total_filament_used) / (100000.f); 2a856: 60 91 62 06 lds r22, 0x0662 ; 0x800662 2a85a: 70 91 63 06 lds r23, 0x0663 ; 0x800663 2a85e: 80 91 64 06 lds r24, 0x0664 ; 0x800664 2a862: 90 91 65 06 lds r25, 0x0665 ; 0x800665 2a866: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 2a86a: 20 e0 ldi r18, 0x00 ; 0 2a86c: 30 e5 ldi r19, 0x50 ; 80 2a86e: 43 ec ldi r20, 0xC3 ; 195 2a870: 57 e4 ldi r21, 0x47 ; 71 2a872: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 2a876: 56 2e mov r5, r22 2a878: 47 2e mov r4, r23 2a87a: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 2a87c: 0f 94 e2 53 call 0x2a7c4 ; 0x2a7c4 2a880: 6b 01 movw r12, r22 2a882: 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(); 2a884: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_printf_P(_N( 2a888: 8b e2 ldi r24, 0x2B ; 43 2a88a: 9d e4 ldi r25, 0x4D ; 77 2a88c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2a890: 18 2f mov r17, r24 2a892: 09 2f mov r16, r25 2a894: 8b e1 ldi r24, 0x1B ; 27 2a896: 9d e4 ldi r25, 0x4D ; 77 2a898: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2a89c: 78 2e mov r7, r24 2a89e: 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; 2a8a0: 8c e3 ldi r24, 0x3C ; 60 2a8a2: 88 2e mov r8, r24 2a8a4: 91 2c mov r9, r1 2a8a6: a1 2c mov r10, r1 2a8a8: b1 2c mov r11, r1 2a8aa: c7 01 movw r24, r14 2a8ac: b6 01 movw r22, r12 2a8ae: a5 01 movw r20, r10 2a8b0: 94 01 movw r18, r8 2a8b2: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 2a8b6: 7f 93 push r23 2a8b8: 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; 2a8ba: ca 01 movw r24, r20 2a8bc: b9 01 movw r22, r18 2a8be: a5 01 movw r20, r10 2a8c0: 94 01 movw r18, r8 2a8c2: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 2a8c6: 7f 93 push r23 2a8c8: 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; 2a8ca: c7 01 movw r24, r14 2a8cc: b6 01 movw r22, r12 2a8ce: 20 e1 ldi r18, 0x10 ; 16 2a8d0: 3e e0 ldi r19, 0x0E ; 14 2a8d2: 40 e0 ldi r20, 0x00 ; 0 2a8d4: 50 e0 ldi r21, 0x00 ; 0 2a8d6: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 2a8da: 5f 93 push r21 2a8dc: 4f 93 push r20 2a8de: 3f 93 push r19 2a8e0: 2f 93 push r18 2a8e2: 0f 93 push r16 2a8e4: 1f 93 push r17 2a8e6: df 93 push r29 2a8e8: cf 93 push r28 2a8ea: 4f 92 push r4 2a8ec: 5f 92 push r5 2a8ee: 6f 92 push r6 2a8f0: 7f 92 push r7 2a8f2: 8d e4 ldi r24, 0x4D ; 77 2a8f4: 90 e7 ldi r25, 0x70 ; 112 2a8f6: 9f 93 push r25 2a8f8: 8f 93 push r24 2a8fa: 0e 94 ee 6f call 0xdfdc ; 0xdfdc "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 2a8fe: 8d b7 in r24, 0x3d ; 61 2a900: 9e b7 in r25, 0x3e ; 62 2a902: 42 96 adiw r24, 0x12 ; 18 2a904: 0f b6 in r0, 0x3f ; 63 2a906: f8 94 cli 2a908: 9e bf out 0x3e, r25 ; 62 2a90a: 0f be out 0x3f, r0 ; 63 2a90c: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 2a90e: df 91 pop r29 2a910: cf 91 pop r28 2a912: 1f 91 pop r17 2a914: 0f 91 pop r16 2a916: ff 90 pop r15 2a918: ef 90 pop r14 2a91a: df 90 pop r13 2a91c: cf 90 pop r12 2a91e: bf 90 pop r11 2a920: af 90 pop r10 2a922: 9f 90 pop r9 2a924: 8f 90 pop r8 2a926: 7f 90 pop r7 2a928: 6f 90 pop r6 2a92a: 5f 90 pop r5 2a92c: 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(); 2a92e: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 2a932: 81 ef ldi r24, 0xF1 ; 241 2a934: 9f e0 ldi r25, 0x0F ; 15 2a936: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 2a93a: 2b 01 movw r4, r22 2a93c: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 2a93e: 8d ee ldi r24, 0xED ; 237 2a940: 9f e0 ldi r25, 0x0F ; 15 2a942: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 2a946: 6b 01 movw r12, r22 2a948: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 2a94a: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_printf_P(_N( 2a94e: 88 e0 ldi r24, 0x08 ; 8 2a950: 9d e4 ldi r25, 0x4D ; 77 2a952: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2a956: 98 2e mov r9, r24 2a958: 89 2e mov r8, r25 2a95a: 87 ef ldi r24, 0xF7 ; 247 2a95c: 9c e4 ldi r25, 0x4C ; 76 2a95e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2a962: b8 2e mov r11, r24 2a964: 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; 2a966: c7 01 movw r24, r14 2a968: b6 01 movw r22, r12 2a96a: 2c e3 ldi r18, 0x3C ; 60 2a96c: 30 e0 ldi r19, 0x00 ; 0 2a96e: 40 e0 ldi r20, 0x00 ; 0 2a970: 50 e0 ldi r21, 0x00 ; 0 2a972: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 2a976: 7f 93 push r23 2a978: 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; 2a97a: ca 01 movw r24, r20 2a97c: b9 01 movw r22, r18 2a97e: 28 e1 ldi r18, 0x18 ; 24 2a980: 30 e0 ldi r19, 0x00 ; 0 2a982: 40 e0 ldi r20, 0x00 ; 0 2a984: 50 e0 ldi r21, 0x00 ; 0 2a986: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2a98a: 7f 93 push r23 2a98c: 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; 2a98e: c7 01 movw r24, r14 2a990: b6 01 movw r22, r12 2a992: 20 ea ldi r18, 0xA0 ; 160 2a994: 35 e0 ldi r19, 0x05 ; 5 2a996: 40 e0 ldi r20, 0x00 ; 0 2a998: 50 e0 ldi r21, 0x00 ; 0 2a99a: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2a99e: 5f 93 push r21 2a9a0: 4f 93 push r20 2a9a2: 3f 93 push r19 2a9a4: 2f 93 push r18 2a9a6: 8f 92 push r8 2a9a8: 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; 2a9aa: c3 01 movw r24, r6 2a9ac: b2 01 movw r22, r4 2a9ae: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 2a9b2: 20 e0 ldi r18, 0x00 ; 0 2a9b4: 30 e0 ldi r19, 0x00 ; 0 2a9b6: 48 ec ldi r20, 0xC8 ; 200 2a9b8: 52 e4 ldi r21, 0x42 ; 66 2a9ba: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2a9be: 9f 93 push r25 2a9c0: 8f 93 push r24 2a9c2: 7f 93 push r23 2a9c4: 6f 93 push r22 2a9c6: af 92 push r10 2a9c8: bf 92 push r11 2a9ca: 89 e2 ldi r24, 0x29 ; 41 2a9cc: 90 e7 ldi r25, 0x70 ; 112 2a9ce: 9f 93 push r25 2a9d0: 8f 93 push r24 2a9d2: 0e 94 ee 6f call 0xdfdc ; 0xdfdc "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 2a9d6: 8d b7 in r24, 0x3d ; 61 2a9d8: 9e b7 in r25, 0x3e ; 62 2a9da: 42 96 adiw r24, 0x12 ; 18 2a9dc: 0f b6 in r0, 0x3f ; 63 2a9de: f8 94 cli 2a9e0: 9e bf out 0x3e, r25 ; 62 2a9e2: 0f be out 0x3f, r0 ; 63 2a9e4: 8d bf out 0x3d, r24 ; 61 2a9e6: 93 cf rjmp .-218 ; 0x2a90e 0002a9e8 : 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()") { 2a9e8: cf 92 push r12 2a9ea: df 92 push r13 2a9ec: ef 92 push r14 2a9ee: ff 92 push r15 2a9f0: 0f 93 push r16 2a9f2: 1f 93 push r17 2a9f4: cf 93 push r28 2a9f6: df 93 push r29 2a9f8: 00 d0 rcall .+0 ; 0x2a9fa 2a9fa: 00 d0 rcall .+0 ; 0x2a9fc 2a9fc: 1f 92 push r1 2a9fe: 1f 92 push r1 2aa00: cd b7 in r28, 0x3d ; 61 2aa02: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 2aa04: 80 91 37 05 lds r24, 0x0537 ; 0x800537 2aa08: 90 91 38 05 lds r25, 0x0538 ; 0x800538 2aa0c: 00 97 sbiw r24, 0x00 ; 0 2aa0e: e1 f1 breq .+120 ; 0x2aa88 { const int16_t initial_feedmultiply = feedmultiply; 2aa10: 20 91 39 02 lds r18, 0x0239 ; 0x800239 2aa14: 30 91 3a 02 lds r19, 0x023A ; 0x80023a // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 2aa18: 24 36 cpi r18, 0x64 ; 100 2aa1a: 31 05 cpc r19, r1 2aa1c: 4c f4 brge .+18 ; 0x2aa30 2aa1e: ac 01 movw r20, r24 2aa20: 42 0f add r20, r18 2aa22: 53 1f adc r21, r19 2aa24: 45 36 cpi r20, 0x65 ; 101 2aa26: 51 05 cpc r21, r1 2aa28: 6c f4 brge .+26 ; 0x2aa44 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; 2aa2a: 82 0f add r24, r18 2aa2c: 93 1f adc r25, r19 2aa2e: 0c c0 rjmp .+24 ; 0x2aa48 #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 2aa30: 24 36 cpi r18, 0x64 ; 100 2aa32: 31 05 cpc r19, r1 2aa34: 09 f4 brne .+2 ; 0x2aa38 2aa36: 55 c0 rjmp .+170 ; 0x2aae2 (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 2aa38: ac 01 movw r20, r24 2aa3a: 42 0f add r20, r18 2aa3c: 53 1f adc r21, r19 2aa3e: 44 36 cpi r20, 0x64 ; 100 2aa40: 51 05 cpc r21, r1 2aa42: 9c f7 brge .-26 ; 0x2aa2a { feedmultiply = 100; 2aa44: 84 e6 ldi r24, 0x64 ; 100 2aa46: 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; 2aa48: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 2aa4c: 80 93 39 02 sts 0x0239, r24 ; 0x800239 if (initial_feedmultiply != feedmultiply) { 2aa50: 80 91 39 02 lds r24, 0x0239 ; 0x800239 2aa54: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 2aa58: 82 17 cp r24, r18 2aa5a: 93 07 cpc r25, r19 2aa5c: a9 f0 breq .+42 ; 0x2aa88 feedmultiply = constrain(feedmultiply, 10, 999); 2aa5e: 88 3e cpi r24, 0xE8 ; 232 2aa60: 53 e0 ldi r21, 0x03 ; 3 2aa62: 95 07 cpc r25, r21 2aa64: 14 f0 brlt .+4 ; 0x2aa6a 2aa66: 87 ee ldi r24, 0xE7 ; 231 2aa68: 93 e0 ldi r25, 0x03 ; 3 2aa6a: 8a 30 cpi r24, 0x0A ; 10 2aa6c: 91 05 cpc r25, r1 2aa6e: 14 f4 brge .+4 ; 0x2aa74 2aa70: 8a e0 ldi r24, 0x0A ; 10 2aa72: 90 e0 ldi r25, 0x00 ; 0 2aa74: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 2aa78: 80 93 39 02 sts 0x0239, r24 ; 0x800239 lcd_encoder = 0; // Consume rotation event 2aa7c: 10 92 38 05 sts 0x0538, r1 ; 0x800538 2aa80: 10 92 37 05 sts 0x0537, r1 ; 0x800537 refresh_saved_feedrate_multiplier_in_ram(); 2aa84: 0e 94 18 66 call 0xcc30 ; 0xcc30 } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 2aa88: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2aa8c: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 2aa8e: 10 92 4e 06 sts 0x064E, r1 ; 0x80064e } if (lcd_status_update_delay) 2aa92: 10 91 4e 06 lds r17, 0x064E ; 0x80064e 2aa96: 11 23 and r17, r17 2aa98: 91 f1 breq .+100 ; 0x2aafe lcd_status_update_delay--; 2aa9a: 2f ef ldi r18, 0xFF ; 255 2aa9c: 21 0f add r18, r17 2aa9e: 20 93 4e 06 sts 0x064E, r18 ; 0x80064e if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 2aaa2: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 2aaa6: 81 11 cpse r24, r1 2aaa8: 0d c0 rjmp .+26 ; 0x2aac4 2aaaa: 0e 94 32 72 call 0xe464 ; 0xe464 2aaae: 88 23 and r24, r24 2aab0: 49 f0 breq .+18 ; 0x2aac4 menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 2aab2: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 menu_submenu(lcd_main_menu); 2aab6: 60 e0 ldi r22, 0x00 ; 0 2aab8: 84 ee ldi r24, 0xE4 ; 228 2aaba: 93 ee ldi r25, 0xE3 ; 227 2aabc: 0f 94 47 d0 call 0x3a08e ; 0x3a08e lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 2aac0: 0e 94 c1 70 call 0xe182 ; 0xe182 } } 2aac4: 28 96 adiw r28, 0x08 ; 8 2aac6: 0f b6 in r0, 0x3f ; 63 2aac8: f8 94 cli 2aaca: de bf out 0x3e, r29 ; 62 2aacc: 0f be out 0x3f, r0 ; 63 2aace: cd bf out 0x3d, r28 ; 61 2aad0: df 91 pop r29 2aad2: cf 91 pop r28 2aad4: 1f 91 pop r17 2aad6: 0f 91 pop r16 2aad8: ff 90 pop r15 2aada: ef 90 pop r14 2aadc: df 90 pop r13 2aade: cf 90 pop r12 2aae0: 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) { 2aae2: 8b 30 cpi r24, 0x0B ; 11 2aae4: 91 05 cpc r25, r1 2aae6: 1c f0 brlt .+6 ; 0x2aaee feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 2aae8: 86 5a subi r24, 0xA6 ; 166 2aaea: 9f 4f sbci r25, 0xFF ; 255 2aaec: ad cf rjmp .-166 ; 0x2aa48 } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 2aaee: 86 3f cpi r24, 0xF6 ; 246 2aaf0: 4f ef ldi r20, 0xFF ; 255 2aaf2: 94 07 cpc r25, r20 2aaf4: 0c f0 brlt .+2 ; 0x2aaf8 2aaf6: ac cf rjmp .-168 ; 0x2aa50 feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 2aaf8: 82 59 subi r24, 0x92 ; 146 2aafa: 9f 4f sbci r25, 0xFF ; 255 2aafc: a5 cf rjmp .-182 ; 0x2aa48 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; 2aafe: 6a e0 ldi r22, 0x0A ; 10 2ab00: 60 93 4e 06 sts 0x064E, r22 ; 0x80064e ReInitLCD++; 2ab04: 80 91 4d 06 lds r24, 0x064D ; 0x80064d 2ab08: 8f 5f subi r24, 0xFF ; 255 2ab0a: 80 93 4d 06 sts 0x064D, r24 ; 0x80064d if (ReInitLCD == 30) 2ab0e: 8e 31 cpi r24, 0x1E ; 30 2ab10: 09 f0 breq .+2 ; 0x2ab14 2ab12: 9f c0 rjmp .+318 ; 0x2ac52 { ReInitLCD = 0 ; 2ab14: 10 92 4d 06 sts 0x064D, r1 ; 0x80064d #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 2ab18: 0e 94 c1 70 call 0xe182 ; 0xe182 lcd_status_message_idx = 0; // Re-draw message from beginning 2ab1c: 10 92 39 05 sts 0x0539, r1 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.462> //! F - feedrate symbol LCD_STR_FEEDRATE //! t - clock symbol LCD_STR_THERMOMETER //! @endcode void lcdui_print_status_screen(void) { lcd_frame_start(); 2ab20: 0e 94 c9 6f call 0xdf92 ; 0xdf92 lcd_home(); //line 0 2ab24: 0e 94 41 70 call 0xe082 ; 0xe082 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 2ab28: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 2ab2c: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 2ab30: 07 2e mov r0, r23 2ab32: 00 0c add r0, r0 2ab34: 88 0b sbc r24, r24 2ab36: 99 0b sbc r25, r25 2ab38: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__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)); 2ab3c: 20 e0 ldi r18, 0x00 ; 0 2ab3e: 30 e0 ldi r19, 0x00 ; 0 2ab40: 40 e0 ldi r20, 0x00 ; 0 2ab42: 5f e3 ldi r21, 0x3F ; 63 2ab44: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 2ab48: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 2ab4c: 6b 01 movw r12, r22 2ab4e: 20 e0 ldi r18, 0x00 ; 0 2ab50: 30 e0 ldi r19, 0x00 ; 0 2ab52: 40 e0 ldi r20, 0x00 ; 0 2ab54: 5f e3 ldi r21, 0x3F ; 63 2ab56: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 2ab5a: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 2ab5e: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 2ab62: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 2ab66: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 2ab6a: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 2ab6e: a6 01 movw r20, r12 2ab70: 82 e8 ldi r24, 0x82 ; 130 2ab72: 0f 94 1d 2e call 0x25c3a ; 0x25c3a lcd_space(3); //3 spaces 2ab76: 83 e0 ldi r24, 0x03 ; 3 2ab78: 0e 94 0b 70 call 0xe016 ; 0xe016 } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 2ab7c: 80 91 75 07 lds r24, 0x0775 ; 0x800775 2ab80: 81 30 cpi r24, 0x01 ; 1 2ab82: 09 f0 breq .+2 ; 0x2ab86 2ab84: 6e c0 rjmp .+220 ; 0x2ac62 lcd_puts_P(_N("Z --- ")); 2ab86: 88 e8 ldi r24, 0x88 ; 136 2ab88: 9f e6 ldi r25, 0x6F ; 111 2ab8a: 0e 94 00 70 call 0xe000 ; 0xe000 lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 2ab8e: 61 e0 ldi r22, 0x01 ; 1 2ab90: 80 e0 ldi r24, 0x00 ; 0 2ab92: 0e 94 15 70 call 0xe02a ; 0xe02a }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 2ab96: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 2ab9a: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 2ab9e: 07 2e mov r0, r23 2aba0: 00 0c add r0, r0 2aba2: 88 0b sbc r24, r24 2aba4: 99 0b sbc r25, r25 2aba6: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 2abaa: 20 e0 ldi r18, 0x00 ; 0 2abac: 30 e0 ldi r19, 0x00 ; 0 2abae: 40 e0 ldi r20, 0x00 ; 0 2abb0: 5f e3 ldi r21, 0x3F ; 63 2abb2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 2abb6: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 2abba: 6b 01 movw r12, r22 2abbc: 20 e0 ldi r18, 0x00 ; 0 2abbe: 30 e0 ldi r19, 0x00 ; 0 2abc0: 40 e0 ldi r20, 0x00 ; 0 2abc2: 5f e3 ldi r21, 0x3F ; 63 2abc4: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 2abc8: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 2abcc: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 2abd0: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 2abd4: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 2abd8: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 2abdc: a6 01 movw r20, r12 2abde: 80 e8 ldi r24, 0x80 ; 128 2abe0: 0f 94 1d 2e call 0x25c3a ; 0x25c3a lcd_space(3); //3 spaces 2abe4: 83 e0 ldi r24, 0x03 ; 3 2abe6: 0e 94 0b 70 call 0xe016 ; 0xe016 #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 2abea: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 2abee: 8f 93 push r24 2abf0: 80 91 39 02 lds r24, 0x0239 ; 0x800239 2abf4: 8f 93 push r24 2abf6: 81 e9 ldi r24, 0x91 ; 145 2abf8: 9f e6 ldi r25, 0x6F ; 111 2abfa: 9f 93 push r25 2abfc: 8f 93 push r24 2abfe: 0e 94 ee 6f call 0xdfdc ; 0xdfdc lcd_space(8 - chars); 2ac02: 98 e0 ldi r25, 0x08 ; 8 2ac04: 98 1b sub r25, r24 2ac06: 89 2f mov r24, r25 2ac08: 0e 94 0b 70 call 0xe016 ; 0xe016 #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 2ac0c: 62 e0 ldi r22, 0x02 ; 2 2ac0e: 80 e0 ldi r24, 0x00 ; 0 2ac10: 0e 94 15 70 call 0xe02a ; 0xe02a } // 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(" ")); 2ac14: 0f 90 pop r0 2ac16: 0f 90 pop r0 2ac18: 0f 90 pop r0 2ac1a: 0f 90 pop r0 2ac1c: 80 91 11 05 lds r24, 0x0511 ; 0x800511 2ac20: e0 90 6e 14 lds r14, 0x146E ; 0x80146e 2ac24: 81 11 cpse r24, r1 2ac26: 3e c0 rjmp .+124 ; 0x2aca4 2ac28: 24 ea ldi r18, 0xA4 ; 164 2ac2a: c2 2e mov r12, r18 2ac2c: 2f e6 ldi r18, 0x6F ; 111 2ac2e: d2 2e mov r13, r18 2ac30: e1 10 cpse r14, r1 2ac32: 3c c0 rjmp .+120 ; 0x2acac 2ac34: 88 ea ldi r24, 0xA8 ; 168 2ac36: c8 2e mov r12, r24 2ac38: 8f e6 ldi r24, 0x6F ; 111 2ac3a: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2ac3c: 0e 94 16 69 call 0xd22c ; 0xd22c 2ac40: f8 2e mov r15, r24 2ac42: 88 23 and r24, r24 2ac44: e1 f1 breq .+120 ; 0x2acbe 2ac46: 80 91 86 02 lds r24, 0x0286 ; 0x800286 2ac4a: 8f 3f cpi r24, 0xFF ; 255 2ac4c: 89 f5 brne .+98 ; 0x2acb0 2ac4e: f1 2c mov r15, r1 2ac50: 36 c0 rjmp .+108 ; 0x2acbe ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 2ac52: 0f 94 16 de call 0x3bc2c ; 0x3bc2c <__divmodqi4> 2ac56: 91 11 cpse r25, r1 2ac58: 63 cf rjmp .-314 ; 0x2ab20 lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 2ac5a: 80 e0 ldi r24, 0x00 ; 0 2ac5c: 0e 94 80 70 call 0xe100 ; 0xe100 2ac60: 5d cf rjmp .-326 ; 0x2ab1c 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]?' ':'?'); 2ac62: 80 91 42 07 lds r24, 0x0742 ; 0x800742 2ac66: 88 23 and r24, r24 2ac68: d9 f0 breq .+54 ; 0x2aca0 2ac6a: 80 e2 ldi r24, 0x20 ; 32 2ac6c: 1f 92 push r1 2ac6e: 8f 93 push r24 2ac70: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 2ac74: 8f 93 push r24 2ac76: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 2ac7a: 8f 93 push r24 2ac7c: 80 91 4c 07 lds r24, 0x074C ; 0x80074c 2ac80: 8f 93 push r24 2ac82: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 2ac86: 8f 93 push r24 2ac88: 8f e7 ldi r24, 0x7F ; 127 2ac8a: 9f e6 ldi r25, 0x6F ; 111 2ac8c: 9f 93 push r25 2ac8e: 8f 93 push r24 2ac90: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 2ac94: 0f b6 in r0, 0x3f ; 63 2ac96: f8 94 cli 2ac98: de bf out 0x3e, r29 ; 62 2ac9a: 0f be out 0x3f, r0 ; 63 2ac9c: cd bf out 0x3d, r28 ; 61 2ac9e: 77 cf rjmp .-274 ; 0x2ab8e 2aca0: 8f e3 ldi r24, 0x3F ; 63 2aca2: e4 cf rjmp .-56 ; 0x2ac6c } // 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(" ")); 2aca4: 9c ea ldi r25, 0xAC ; 172 2aca6: c9 2e mov r12, r25 2aca8: 9f e6 ldi r25, 0x6F ; 111 2acaa: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2acac: ee 20 and r14, r14 2acae: 31 f2 breq .-116 ; 0x2ac3c if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2acb0: 80 91 df 03 lds r24, 0x03DF ; 0x8003df // 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)); 2acb4: ff 24 eor r15, r15 2acb6: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2acb8: 88 23 and r24, r24 2acba: 09 f4 brne .+2 ; 0x2acbe 2acbc: bb c0 rjmp .+374 ; 0x2ae34 { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 2acbe: 81 ea ldi r24, 0xA1 ; 161 2acc0: 9d e0 ldi r25, 0x0D ; 13 2acc2: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2acc6: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 2acc8: 0e 94 5a 78 call 0xf0b4 ; 0xf0b4 if ((nextSheet >= 0) && (sheetNR != nextSheet)) 2accc: 87 fd sbrc r24, 7 2acce: b2 c0 rjmp .+356 ; 0x2ae34 2acd0: 08 17 cp r16, r24 2acd2: 09 f4 brne .+2 ; 0x2acd6 2acd4: af c0 rjmp .+350 ; 0x2ae34 { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 2acd6: 9b e0 ldi r25, 0x0B ; 11 2acd8: 09 02 muls r16, r25 2acda: b0 01 movw r22, r0 2acdc: 11 24 eor r1, r1 2acde: 67 5b subi r22, 0xB7 ; 183 2ace0: 72 4f sbci r23, 0xF2 ; 242 2ace2: 47 e0 ldi r20, 0x07 ; 7 2ace4: 50 e0 ldi r21, 0x00 ; 0 2ace6: 8e 01 movw r16, r28 2ace8: 0f 5f subi r16, 0xFF ; 255 2acea: 1f 4f sbci r17, 0xFF ; 255 2acec: c8 01 movw r24, r16 2acee: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 sheet[7] = '\0'; 2acf2: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 2acf4: 1f 93 push r17 2acf6: 0f 93 push r16 2acf8: 81 ec ldi r24, 0xC1 ; 193 2acfa: 91 ea ldi r25, 0xA1 ; 161 lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 2acfc: 9f 93 push r25 2acfe: 8f 93 push r24 2ad00: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 2ad04: 0f 90 pop r0 2ad06: 0f 90 pop r0 2ad08: 0f 90 pop r0 2ad0a: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 2ad0c: 80 91 98 13 lds r24, 0x1398 ; 0x801398 2ad10: 81 30 cpi r24, 0x01 ; 1 2ad12: 09 f0 breq .+2 ; 0x2ad16 2ad14: e9 c0 rjmp .+466 ; 0x2aee8 // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 2ad16: 0f 94 a4 36 call 0x26d48 ; 0x26d48 2ad1a: 95 e0 ldi r25, 0x05 ; 5 2ad1c: 98 1b sub r25, r24 2ad1e: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2ad20: 0e 94 0b 70 call 0xe016 ; 0xe016 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()) { 2ad24: 0e 94 16 69 call 0xd22c ; 0xd22c 2ad28: 88 23 and r24, r24 2ad2a: 09 f4 brne .+2 ; 0x2ad2e 2ad2c: fa c0 rjmp .+500 ; 0x2af22 uint16_t print_tc = PRINT_TIME_REMAINING_INIT; // unit: minutes char suff = ' '; char suff_doubt = ' '; #ifdef TMC2130 if (SilentModeMenu != SILENT_MODE_OFF) { 2ad2e: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 2ad32: 88 23 and r24, r24 2ad34: 09 f4 brne .+2 ; 0x2ad38 2ad36: da c0 rjmp .+436 ; 0x2aeec if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT) 2ad38: c0 90 8d 02 lds r12, 0x028D ; 0x80028d 2ad3c: d0 90 8e 02 lds r13, 0x028E ; 0x80028e print_tr = print_time_remaining_silent; //#ifdef CLOCK_INTERVAL_TIME if (print_time_to_change_silent != PRINT_TIME_REMAINING_INIT) 2ad40: e0 90 8b 02 lds r14, 0x028B ; 0x80028b 2ad44: f0 90 8c 02 lds r15, 0x028C ; 0x80028c #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 2ad48: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2ad4c: 8a 30 cpi r24, 0x0A ; 10 2ad4e: 11 f4 brne .+4 ; 0x2ad54 clock_interval = 0; 2ad50: 10 92 4c 06 sts 0x064C, r1 ; 0x80064c clock_interval++; 2ad54: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2ad58: 8f 5f subi r24, 0xFF ; 255 2ad5a: 80 93 4c 06 sts 0x064C, r24 ; 0x80064c if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 2ad5e: 2f ef ldi r18, 0xFF ; 255 2ad60: e2 16 cp r14, r18 2ad62: f2 06 cpc r15, r18 2ad64: 21 f0 breq .+8 ; 0x2ad6e 2ad66: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 2ad68: 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) { 2ad6a: 86 30 cpi r24, 0x06 ; 6 2ad6c: 70 f4 brcc .+28 ; 0x2ad8a print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 2ad6e: 3f ef ldi r19, 0xFF ; 255 2ad70: c3 16 cp r12, r19 2ad72: d3 06 cpc r13, r19 2ad74: 09 f0 breq .+2 ; 0x2ad78 2ad76: c3 c0 rjmp .+390 ; 0x2aefe print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 2ad78: 0f 94 e2 53 call 0x2a7c4 ; 0x2a7c4 2ad7c: 2c e3 ldi r18, 0x3C ; 60 2ad7e: 30 e0 ldi r19, 0x00 ; 0 2ad80: 40 e0 ldi r20, 0x00 ; 0 2ad82: 50 e0 ldi r21, 0x00 ; 0 2ad84: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__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 = ' '; 2ad88: 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)) { 2ad8a: 40 91 39 02 lds r20, 0x0239 ; 0x800239 2ad8e: 50 91 3a 02 lds r21, 0x023A ; 0x80023a 2ad92: 44 36 cpi r20, 0x64 ; 100 2ad94: 51 05 cpc r21, r1 2ad96: 09 f4 brne .+2 ; 0x2ad9a 2ad98: b5 c0 rjmp .+362 ; 0x2af04 2ad9a: c2 16 cp r12, r18 2ad9c: d3 06 cpc r13, r19 2ad9e: 21 f0 breq .+8 ; 0x2ada8 2ada0: e2 16 cp r14, r18 2ada2: f3 06 cpc r15, r19 2ada4: 09 f0 breq .+2 ; 0x2ada8 2ada6: ae c0 rjmp .+348 ; 0x2af04 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); 2ada8: a4 e6 ldi r26, 0x64 ; 100 2adaa: b0 e0 ldi r27, 0x00 ; 0 2adac: 0f 94 fb dd call 0x3bbf6 ; 0x3bbf6 <__umulhisi3> 2adb0: 9a 01 movw r18, r20 2adb2: 55 0f add r21, r21 2adb4: 44 0b sbc r20, r20 2adb6: 55 0b sbc r21, r21 2adb8: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 2adbc: 4f e3 ldi r20, 0x3F ; 63 2adbe: e4 2e mov r14, r20 2adc0: 04 2e mov r0, r20 2adc2: 00 0c add r0, r0 2adc4: ff 08 sbc r15, r15 2adc6: e1 2f mov r30, r17 2adc8: 01 2e mov r0, r17 2adca: 00 0c add r0, r0 2adcc: ff 0b sbc r31, r31 2adce: c9 01 movw r24, r18 2add0: 6c e3 ldi r22, 0x3C ; 60 2add2: 70 e0 ldi r23, 0x00 ; 0 2add4: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__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 2add8: 20 37 cpi r18, 0x70 ; 112 2adda: 37 41 sbci r19, 0x17 ; 23 2addc: 08 f0 brcs .+2 ; 0x2ade0 2adde: 94 c0 rjmp .+296 ; 0x2af08 chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 2ade0: ff 92 push r15 2ade2: 4f 93 push r20 2ade4: ff 93 push r31 2ade6: 1f 93 push r17 2ade8: 9f 93 push r25 2adea: 8f 93 push r24 2adec: 7f 93 push r23 2adee: 6f 93 push r22 2adf0: 8b eb ldi r24, 0xBB ; 187 2adf2: 9f e6 ldi r25, 0x6F ; 111 2adf4: 9f 93 push r25 2adf6: 8f 93 push r24 2adf8: 0e 94 ee 6f call 0xdfdc ; 0xdfdc else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 2adfc: 0f b6 in r0, 0x3f ; 63 2adfe: f8 94 cli 2ae00: de bf out 0x3e, r29 ; 62 2ae02: 0f be out 0x3f, r0 ; 63 2ae04: 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); 2ae06: 98 e0 ldi r25, 0x08 ; 8 2ae08: 98 1b sub r25, r24 2ae0a: 89 2f mov r24, r25 2ae0c: 0e 94 0b 70 call 0xe016 ; 0xe016 #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 2ae10: 63 e0 ldi r22, 0x03 ; 3 2ae12: 80 e0 ldi r24, 0x00 ; 0 2ae14: 0e 94 15 70 call 0xe02a ; 0xe02a #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 2ae18: 0f 94 ad 3f call 0x27f5a ; 0x27f5a lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 2ae1c: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 2ae20: 88 23 and r24, r24 2ae22: 09 f4 brne .+2 ; 0x2ae26 2ae24: 3e ce rjmp .-900 ; 0x2aaa2 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) { 2ae26: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 2ae2a: 81 11 cpse r24, r1 2ae2c: 3a ce rjmp .-908 ; 0x2aaa2 2ae2e: 0f 94 1d 0b call 0x2163a ; 0x2163a 2ae32: 37 ce rjmp .-914 ; 0x2aaa2 lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 2ae34: e1 10 cpse r14, r1 2ae36: 04 c0 rjmp .+8 ; 0x2ae40 2ae38: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.464> 2ae3c: 81 11 cpse r24, r1 2ae3e: 4a c0 rjmp .+148 ; 0x2aed4 // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 2ae40: df 92 push r13 2ae42: cf 92 push r12 2ae44: 8d eb ldi r24, 0xBD ; 189 2ae46: 91 ea ldi r25, 0xA1 ; 161 2ae48: 9f 93 push r25 2ae4a: 8f 93 push r24 2ae4c: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 2ae50: 0f 90 pop r0 2ae52: 0f 90 pop r0 2ae54: 0f 90 pop r0 2ae56: 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) 2ae58: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 2ae5c: 81 11 cpse r24, r1 2ae5e: 04 c0 rjmp .+8 ; 0x2ae68 2ae60: 80 91 86 02 lds r24, 0x0286 ; 0x800286 2ae64: 85 36 cpi r24, 0x65 ; 101 2ae66: f0 f1 brcs .+124 ; 0x2aee4 { percent_done = print_percent_done_normal; } else if (print_percent_done_silent <= 100) 2ae68: 80 91 85 02 lds r24, 0x0285 ; 0x800285 2ae6c: 85 36 cpi r24, 0x65 ; 101 2ae6e: d0 f1 brcs .+116 ; 0x2aee4 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;}; 2ae70: 80 91 01 17 lds r24, 0x1701 ; 0x801701 2ae74: 88 23 and r24, r24 2ae76: 19 f1 breq .+70 ; 0x2aebe 2ae78: 80 91 7b 17 lds r24, 0x177B ; 0x80177b 2ae7c: 90 91 7c 17 lds r25, 0x177C ; 0x80177c 2ae80: a0 91 7d 17 lds r26, 0x177D ; 0x80177d 2ae84: b0 91 7e 17 lds r27, 0x177E ; 0x80177e 2ae88: 00 97 sbiw r24, 0x00 ; 0 2ae8a: a1 05 cpc r26, r1 2ae8c: b1 05 cpc r27, r1 2ae8e: b9 f0 breq .+46 ; 0x2aebe 2ae90: bc 01 movw r22, r24 2ae92: cd 01 movw r24, r26 2ae94: 6d 59 subi r22, 0x9D ; 157 2ae96: 7f 4f sbci r23, 0xFF ; 255 2ae98: 8f 4f sbci r24, 0xFF ; 255 2ae9a: 9f 4f sbci r25, 0xFF ; 255 2ae9c: 24 e6 ldi r18, 0x64 ; 100 2ae9e: 30 e0 ldi r19, 0x00 ; 0 2aea0: 40 e0 ldi r20, 0x00 ; 0 2aea2: 50 e0 ldi r21, 0x00 ; 0 2aea4: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 2aea8: 60 91 82 17 lds r22, 0x1782 ; 0x801782 2aeac: 70 91 83 17 lds r23, 0x1783 ; 0x801783 2aeb0: 80 91 84 17 lds r24, 0x1784 ; 0x801784 2aeb4: 90 91 85 17 lds r25, 0x1785 ; 0x801785 2aeb8: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 2aebc: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 2aebe: 21 2f mov r18, r17 2aec0: 30 e0 ldi r19, 0x00 ; 0 2aec2: 8e e9 ldi r24, 0x9E ; 158 2aec4: 9f e6 ldi r25, 0x6F ; 111 2aec6: f1 10 cpse r15, r1 2aec8: 02 c0 rjmp .+4 ; 0x2aece 2aeca: 88 e9 ldi r24, 0x98 ; 152 2aecc: 9f e6 ldi r25, 0x6F ; 111 2aece: 3f 93 push r19 2aed0: 2f 93 push r18 2aed2: 14 cf rjmp .-472 ; 0x2acfc if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 2aed4: 81 e0 ldi r24, 0x01 ; 1 2aed6: 0e 94 0b 70 call 0xe016 ; 0xe016 lcd_print(hostName); // Two characters 2aeda: 89 e4 ldi r24, 0x49 ; 73 2aedc: 96 e0 ldi r25, 0x06 ; 6 2aede: 0e 94 1c 72 call 0xe438 ; 0xe438 2aee2: ba cf rjmp .-140 ; 0x2ae58 2aee4: 18 2f mov r17, r24 2aee6: eb cf rjmp .-42 ; 0x2aebe lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2aee8: 85 e0 ldi r24, 0x05 ; 5 2aeea: 1a cf rjmp .-460 ; 0x2ad20 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) 2aeec: c0 90 89 02 lds r12, 0x0289 ; 0x800289 2aef0: d0 90 8a 02 lds r13, 0x028A ; 0x80028a print_tr = print_time_remaining_normal; //#ifdef CLOCK_INTERVAL_TIME if (print_time_to_change_normal != PRINT_TIME_REMAINING_INIT) 2aef4: e0 90 87 02 lds r14, 0x0287 ; 0x800287 2aef8: f0 90 88 02 lds r15, 0x0288 ; 0x800288 2aefc: 25 cf rjmp .-438 ; 0x2ad48 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) { 2aefe: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 2af00: 12 e5 ldi r17, 0x52 ; 82 2af02: 43 cf rjmp .-378 ; 0x2ad8a 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 = ' '; 2af04: 40 e2 ldi r20, 0x20 ; 32 2af06: 5b cf rjmp .-330 ; 0x2adbe } 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); 2af08: ff 92 push r15 2af0a: 4f 93 push r20 2af0c: ff 93 push r31 2af0e: 1f 93 push r17 2af10: 7f 93 push r23 2af12: 6f 93 push r22 2af14: 80 eb ldi r24, 0xB0 ; 176 2af16: 9f e6 ldi r25, 0x6F ; 111 2af18: 9f 93 push r25 2af1a: 8f 93 push r24 2af1c: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 2af20: 6d cf rjmp .-294 ; 0x2adfc } 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); 2af22: 85 ea ldi r24, 0xA5 ; 165 2af24: 9d e0 ldi r25, 0x0D ; 13 2af26: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 2af2a: bc 01 movw r22, r24 2af2c: 90 e0 ldi r25, 0x00 ; 0 2af2e: 80 e0 ldi r24, 0x00 ; 0 2af30: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 2af34: 20 e0 ldi r18, 0x00 ; 0 2af36: 30 e0 ldi r19, 0x00 ; 0 2af38: 4a e7 ldi r20, 0x7A ; 122 2af3a: 54 e4 ldi r21, 0x44 ; 68 2af3c: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 2af40: 9f 93 push r25 2af42: 8f 93 push r24 2af44: 7f 93 push r23 2af46: 6f 93 push r22 2af48: 86 ec ldi r24, 0xC6 ; 198 2af4a: 91 ea ldi r25, 0xA1 ; 161 2af4c: 9f 93 push r25 2af4e: 8f 93 push r24 2af50: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 2af54: 0f 90 pop r0 2af56: 0f 90 pop r0 2af58: 0f 90 pop r0 2af5a: 0f 90 pop r0 2af5c: 0f 90 pop r0 2af5e: 0f 90 pop r0 2af60: 52 cf rjmp .-348 ; 0x2ae06 0002af62 : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 2af62: 10 92 9d 03 sts 0x039D, r1 ; 0x80039d startTimestamp = 0; 2af66: 10 92 a8 05 sts 0x05A8, r1 ; 0x8005a8 2af6a: 10 92 a9 05 sts 0x05A9, r1 ; 0x8005a9 2af6e: 10 92 aa 05 sts 0x05AA, r1 ; 0x8005aa 2af72: 10 92 ab 05 sts 0x05AB, r1 ; 0x8005ab stopTimestamp = 0; 2af76: 10 92 4f 06 sts 0x064F, r1 ; 0x80064f 2af7a: 10 92 50 06 sts 0x0650, r1 ; 0x800650 2af7e: 10 92 51 06 sts 0x0651, r1 ; 0x800651 2af82: 10 92 52 06 sts 0x0652, r1 ; 0x800652 accumulator = 0; 2af86: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 2af8a: 10 92 a5 05 sts 0x05A5, r1 ; 0x8005a5 2af8e: 10 92 a6 05 sts 0x05A6, r1 ; 0x8005a6 2af92: 10 92 a7 05 sts 0x05A7, r1 ; 0x8005a7 } 2af96: 08 95 ret 0002af98 : /** * @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; } 2af98: 80 91 9d 03 lds r24, 0x039D ; 0x80039d } else return false; } bool Stopwatch::start() { if (!isRunning()) { 2af9c: 81 30 cpi r24, 0x01 ; 1 2af9e: f1 f0 breq .+60 ; 0x2afdc if (isPaused()) accumulator = duration(); 2afa0: 82 30 cpi r24, 0x02 ; 2 2afa2: c9 f4 brne .+50 ; 0x2afd6 2afa4: 0f 94 e2 53 call 0x2a7c4 ; 0x2a7c4 2afa8: 60 93 a4 05 sts 0x05A4, r22 ; 0x8005a4 2afac: 70 93 a5 05 sts 0x05A5, r23 ; 0x8005a5 2afb0: 80 93 a6 05 sts 0x05A6, r24 ; 0x8005a6 2afb4: 90 93 a7 05 sts 0x05A7, r25 ; 0x8005a7 else reset(); state = RUNNING; 2afb8: 81 e0 ldi r24, 0x01 ; 1 2afba: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d startTimestamp = _millis(); 2afbe: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2afc2: 60 93 a8 05 sts 0x05A8, r22 ; 0x8005a8 2afc6: 70 93 a9 05 sts 0x05A9, r23 ; 0x8005a9 2afca: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa 2afce: 90 93 ab 05 sts 0x05AB, r25 ; 0x8005ab 2afd2: 81 e0 ldi r24, 0x01 ; 1 2afd4: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 2afd6: 0f 94 b1 57 call 0x2af62 ; 0x2af62 2afda: ee cf rjmp .-36 ; 0x2afb8 state = RUNNING; startTimestamp = _millis(); return true; } else return false; 2afdc: 80 e0 ldi r24, 0x00 ; 0 } 2afde: 08 95 ret 0002afe0 : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 2afe0: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 2afe4: 81 50 subi r24, 0x01 ; 1 2afe6: 82 30 cpi r24, 0x02 ; 2 2afe8: 70 f4 brcc .+28 ; 0x2b006 state = STOPPED; 2afea: 10 92 9d 03 sts 0x039D, r1 ; 0x80039d stopTimestamp = _millis(); 2afee: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2aff2: 60 93 4f 06 sts 0x064F, r22 ; 0x80064f 2aff6: 70 93 50 06 sts 0x0650, r23 ; 0x800650 2affa: 80 93 51 06 sts 0x0651, r24 ; 0x800651 2affe: 90 93 52 06 sts 0x0652, r25 ; 0x800652 2b002: 81 e0 ldi r24, 0x01 ; 1 2b004: 08 95 ret return true; } else return false; 2b006: 80 e0 ldi r24, 0x00 ; 0 } 2b008: 08 95 ret 0002b00a : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 2b00a: 2f b7 in r18, 0x3f ; 63 2b00c: f8 94 cli count_pos = count_position[axis]; 2b00e: 94 e0 ldi r25, 0x04 ; 4 2b010: 89 9f mul r24, r25 2b012: f0 01 movw r30, r0 2b014: 11 24 eor r1, r1 2b016: ec 59 subi r30, 0x9C ; 156 2b018: f8 4f sbci r31, 0xF8 ; 248 2b01a: 60 81 ld r22, Z 2b01c: 71 81 ldd r23, Z+1 ; 0x01 2b01e: 82 81 ldd r24, Z+2 ; 0x02 2b020: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 2b022: 2f bf out 0x3f, r18 ; 63 return count_pos; } 2b024: 08 95 ret 0002b026 : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 2b026: cf 93 push r28 2b028: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 2b02a: 0f 94 05 58 call 0x2b00a ; 0x2b00a 2b02e: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 2b032: 24 e0 ldi r18, 0x04 ; 4 2b034: c2 9f mul r28, r18 2b036: f0 01 movw r30, r0 2b038: 11 24 eor r1, r1 2b03a: ee 58 subi r30, 0x8E ; 142 2b03c: f9 4f sbci r31, 0xF9 ; 249 2b03e: 20 81 ld r18, Z 2b040: 31 81 ldd r19, Z+1 ; 0x01 2b042: 42 81 ldd r20, Z+2 ; 0x02 2b044: 53 81 ldd r21, Z+3 ; 0x03 2b046: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> } 2b04a: cf 91 pop r28 2b04c: 08 95 ret 0002b04e : } // Block until all buffered steps are executed void st_synchronize() { 2b04e: cf 93 push r28 2b050: df 93 push r29 2b052: 00 d0 rcall .+0 ; 0x2b054 2b054: 1f 92 push r1 2b056: cd b7 in r28, 0x3d ; 61 2b058: 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); 2b05a: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 2b05e: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 while(blocks_queued()) 2b062: 98 17 cp r25, r24 2b064: 09 f4 brne .+2 ; 0x2b068 2b066: 46 c0 rjmp .+140 ; 0x2b0f4 { #ifdef TMC2130 manage_heater(); 2b068: 0f 94 9b 4d call 0x29b36 ; 0x29b36 tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); } bool tmc2130_update_sg() { if (tmc2130_sg_measure <= E_AXIS) 2b06c: 80 91 3b 02 lds r24, 0x023B ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.487> 2b070: 84 30 cpi r24, 0x04 ; 4 2b072: 38 f0 brcs .+14 ; 0x2b082 // Vojtech: Don't disable motors inside the planner! if (!tmc2130_update_sg()) { manage_inactivity(true); 2b074: 81 e0 ldi r24, 0x01 ; 1 2b076: 0e 94 5a 8c call 0x118b4 ; 0x118b4 lcd_update(0); 2b07a: 80 e0 ldi r24, 0x00 ; 0 2b07c: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 2b080: ec cf rjmp .-40 ; 0x2b05a { uint32_t val32 = 0; 2b082: 19 82 std Y+1, r1 ; 0x01 2b084: 1a 82 std Y+2, r1 ; 0x02 2b086: 1b 82 std Y+3, r1 ; 0x03 2b088: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(tmc2130_sg_measure, TMC2130_REG_DRV_STATUS, &val32); 2b08a: ae 01 movw r20, r28 2b08c: 4f 5f subi r20, 0xFF ; 255 2b08e: 5f 4f sbci r21, 0xFF ; 255 2b090: 6f e6 ldi r22, 0x6F ; 111 2b092: 0f 94 a7 38 call 0x2714e ; 0x2714e tmc2130_sg_measure_val += (val32 & 0x3ff); 2b096: 89 81 ldd r24, Y+1 ; 0x01 2b098: 9a 81 ldd r25, Y+2 ; 0x02 2b09a: ab 81 ldd r26, Y+3 ; 0x03 2b09c: bc 81 ldd r27, Y+4 ; 0x04 2b09e: 93 70 andi r25, 0x03 ; 3 2b0a0: aa 27 eor r26, r26 2b0a2: bb 27 eor r27, r27 2b0a4: 40 91 cd 03 lds r20, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_val.lto_priv.488> 2b0a8: 50 91 ce 03 lds r21, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_val.lto_priv.488+0x1> 2b0ac: 60 91 cf 03 lds r22, 0x03CF ; 0x8003cf <_ZL22tmc2130_sg_measure_val.lto_priv.488+0x2> 2b0b0: 70 91 d0 03 lds r23, 0x03D0 ; 0x8003d0 <_ZL22tmc2130_sg_measure_val.lto_priv.488+0x3> 2b0b4: 84 0f add r24, r20 2b0b6: 95 1f adc r25, r21 2b0b8: a6 1f adc r26, r22 2b0ba: b7 1f adc r27, r23 2b0bc: 80 93 cd 03 sts 0x03CD, r24 ; 0x8003cd <_ZL22tmc2130_sg_measure_val.lto_priv.488> 2b0c0: 90 93 ce 03 sts 0x03CE, r25 ; 0x8003ce <_ZL22tmc2130_sg_measure_val.lto_priv.488+0x1> 2b0c4: a0 93 cf 03 sts 0x03CF, r26 ; 0x8003cf <_ZL22tmc2130_sg_measure_val.lto_priv.488+0x2> 2b0c8: b0 93 d0 03 sts 0x03D0, r27 ; 0x8003d0 <_ZL22tmc2130_sg_measure_val.lto_priv.488+0x3> tmc2130_sg_measure_cnt++; 2b0cc: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 <_ZL22tmc2130_sg_measure_cnt.lto_priv.489> 2b0d0: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca <_ZL22tmc2130_sg_measure_cnt.lto_priv.489+0x1> 2b0d4: a0 91 cb 03 lds r26, 0x03CB ; 0x8003cb <_ZL22tmc2130_sg_measure_cnt.lto_priv.489+0x2> 2b0d8: b0 91 cc 03 lds r27, 0x03CC ; 0x8003cc <_ZL22tmc2130_sg_measure_cnt.lto_priv.489+0x3> 2b0dc: 01 96 adiw r24, 0x01 ; 1 2b0de: a1 1d adc r26, r1 2b0e0: b1 1d adc r27, r1 2b0e2: 80 93 c9 03 sts 0x03C9, r24 ; 0x8003c9 <_ZL22tmc2130_sg_measure_cnt.lto_priv.489> 2b0e6: 90 93 ca 03 sts 0x03CA, r25 ; 0x8003ca <_ZL22tmc2130_sg_measure_cnt.lto_priv.489+0x1> 2b0ea: a0 93 cb 03 sts 0x03CB, r26 ; 0x8003cb <_ZL22tmc2130_sg_measure_cnt.lto_priv.489+0x2> 2b0ee: b0 93 cc 03 sts 0x03CC, r27 ; 0x8003cc <_ZL22tmc2130_sg_measure_cnt.lto_priv.489+0x3> 2b0f2: b3 cf rjmp .-154 ; 0x2b05a #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); #endif //TMC2130 } } 2b0f4: 0f 90 pop r0 2b0f6: 0f 90 pop r0 2b0f8: 0f 90 pop r0 2b0fa: 0f 90 pop r0 2b0fc: df 91 pop r29 2b0fe: cf 91 pop r28 2b100: 08 95 ret 0002b102 : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 2b102: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 2b104: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2b108: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 2b10c: 80 ed ldi r24, 0xD0 ; 208 2b10e: 97 e0 ldi r25, 0x07 ; 7 2b110: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b114: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 2b118: 10 92 e9 04 sts 0x04E9, r1 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.490+0x1> 2b11c: 10 92 e8 04 sts 0x04E8, r1 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.490> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2b120: 80 91 e6 04 lds r24, 0x04E6 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> 2b124: 90 91 e7 04 lds r25, 0x04E7 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2b128: 01 97 sbiw r24, 0x01 ; 1 2b12a: 8e 3f cpi r24, 0xFE ; 254 2b12c: 9f 4f sbci r25, 0xFF ; 255 2b12e: 20 f4 brcc .+8 ; 0x2b138 nextAdvanceISR = 0; 2b130: 10 92 e7 04 sts 0x04E7, r1 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2b134: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> #endif } 2b138: 08 95 ret 0002b13a : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 2b13a: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 2b13e: 81 11 cpse r24, r1 2b140: 3c c0 rjmp .+120 ; 0x2b1ba #ifdef TMC2130 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; 2b142: 81 e0 ldi r24, 0x01 ; 1 2b144: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 2b148: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 2b14c: 8f ef ldi r24, 0xFF ; 255 2b14e: 9f e0 ldi r25, 0x0F ; 15 2b150: 0f 94 7f dd call 0x3bafe ; 0x3bafe 2b154: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 2b158: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 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()) 2b15c: 98 17 cp r25, r24 2b15e: 41 f0 breq .+16 ; 0x2b170 { lcd_display_message_fullscreen_P(_T(MSG_MODE_CHANGE_IN_PROGRESS)); 2b160: 8a e2 ldi r24, 0x2A ; 42 2b162: 9f e4 ldi r25, 0x4F ; 79 2b164: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2b168: 0f 94 80 34 call 0x26900 ; 0x26900 // Wait until the planner queue is drained and the stepper routine achieves // an idle state. st_synchronize(); 2b16c: 0f 94 27 58 call 0x2b04e ; 0x2b04e } tmc2130_wait_standstill_xy(1000); 2b170: 0f 94 b4 87 call 0x30f68 ; 0x30f68 cli(); 2b174: f8 94 cli tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 2b176: 81 e0 ldi r24, 0x01 ; 1 2b178: 90 91 a4 03 lds r25, 0x03A4 ; 0x8003a4 2b17c: 91 11 cpse r25, r1 2b17e: 01 c0 rjmp .+2 ; 0x2b182 2b180: 80 e0 ldi r24, 0x00 ; 0 2b182: 80 93 6c 06 sts 0x066C, r24 ; 0x80066c update_mode_profile(); 2b186: 0f 94 91 aa call 0x35522 ; 0x35522 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(); 2b18a: 0e 94 f8 f8 call 0x1f1f0 ; 0x1f1f0 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) { } 2b18e: 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())); 2b190: 82 70 andi r24, 0x02 ; 2 2b192: 0f 94 1c 3b call 0x27638 ; 0x27638 // 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(); 2b196: 0f 94 81 58 call 0x2b102 ; 0x2b102 sei(); 2b19a: 78 94 sei #else st_current_init(); #endif //TMC2130 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) 2b19c: 89 e6 ldi r24, 0x69 ; 105 2b19e: 9f e0 ldi r25, 0x0F ; 15 2b1a0: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2b1a4: 88 23 and r24, r24 2b1a6: 61 f0 breq .+24 ; 0x2b1c0 2b1a8: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 2b1ac: 88 23 and r24, r24 2b1ae: 41 f0 breq .+16 ; 0x2b1c0 menu_submenu(lcd_crash_mode_info2); 2b1b0: 60 e0 ldi r22, 0x00 ; 0 2b1b2: 80 e2 ldi r24, 0x20 ; 32 2b1b4: 9a e3 ldi r25, 0x3A ; 58 2b1b6: 0d 94 47 d0 jmp 0x3a08e ; 0x3a08e 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; 2b1ba: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 2b1be: c4 cf rjmp .-120 ; 0x2b148 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) menu_submenu(lcd_crash_mode_info2); #endif //TMC2130 } 2b1c0: 08 95 ret 0002b1c2 <__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) { 2b1c2: 1f 92 push r1 2b1c4: 0f 92 push r0 2b1c6: 0f b6 in r0, 0x3f ; 63 2b1c8: 0f 92 push r0 2b1ca: 11 24 eor r1, r1 2b1cc: 0b b6 in r0, 0x3b ; 59 2b1ce: 0f 92 push r0 2b1d0: 6f 92 push r6 2b1d2: 7f 92 push r7 2b1d4: 8f 92 push r8 2b1d6: cf 92 push r12 2b1d8: df 92 push r13 2b1da: ef 92 push r14 2b1dc: ff 92 push r15 2b1de: 0f 93 push r16 2b1e0: 1f 93 push r17 2b1e2: 2f 93 push r18 2b1e4: 3f 93 push r19 2b1e6: 4f 93 push r20 2b1e8: 5f 93 push r21 2b1ea: 6f 93 push r22 2b1ec: 7f 93 push r23 2b1ee: 8f 93 push r24 2b1f0: 9f 93 push r25 2b1f2: af 93 push r26 2b1f4: bf 93 push r27 2b1f6: cf 93 push r28 2b1f8: df 93 push r29 2b1fa: ef 93 push r30 2b1fc: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2b1fe: 80 91 e6 04 lds r24, 0x04E6 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> 2b202: 90 91 e7 04 lds r25, 0x04E7 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2b206: 9c 01 movw r18, r24 2b208: 21 50 subi r18, 0x01 ; 1 2b20a: 31 09 sbc r19, r1 2b20c: 2e 3f cpi r18, 0xFE ; 254 2b20e: 3f 4f sbci r19, 0xFF ; 255 2b210: 90 f4 brcc .+36 ; 0x2b236 <__vector_17+0x74> { if(nextAdvanceISR > OCR1A) 2b212: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b216: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b21a: 28 17 cp r18, r24 2b21c: 39 07 cpc r19, r25 2b21e: 08 f0 brcs .+2 ; 0x2b222 <__vector_17+0x60> 2b220: f9 c0 rjmp .+498 ; 0x2b414 <__vector_17+0x252> nextAdvanceISR -= OCR1A; 2b222: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b226: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b22a: 82 1b sub r24, r18 2b22c: 93 0b sbc r25, r19 2b22e: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2b232: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 2b236: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b23a: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b23e: 80 91 e8 04 lds r24, 0x04E8 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.490> 2b242: 90 91 e9 04 lds r25, 0x04E9 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.490+0x1> 2b246: 28 17 cp r18, r24 2b248: 39 07 cpc r19, r25 2b24a: 08 f0 brcs .+2 ; 0x2b24e <__vector_17+0x8c> 2b24c: e8 c0 rjmp .+464 ; 0x2b41e <__vector_17+0x25c> nextMainISR -= OCR1A; 2b24e: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b252: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b256: 82 1b sub r24, r18 2b258: 93 0b sbc r25, r19 2b25a: 90 93 e9 04 sts 0x04E9, r25 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.490+0x1> 2b25e: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.490> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 2b262: 80 91 e8 04 lds r24, 0x04E8 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.490> 2b266: 90 91 e9 04 lds r25, 0x04E9 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.490+0x1> 2b26a: 89 2b or r24, r25 2b26c: 11 f0 breq .+4 ; 0x2b272 <__vector_17+0xb0> 2b26e: 0d 94 31 62 jmp 0x2c462 ; 0x2c462 <__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) 2b272: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b276: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b27a: 30 97 sbiw r30, 0x00 ; 0 2b27c: 09 f0 breq .+2 ; 0x2b280 <__vector_17+0xbe> 2b27e: 87 c1 rjmp .+782 ; 0x2b58e <__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) { 2b280: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 2b284: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 2b288: 98 17 cp r25, r24 2b28a: 09 f4 brne .+2 ; 0x2b28e <__vector_17+0xcc> 2b28c: f9 c1 rjmp .+1010 ; 0x2b680 <__vector_17+0x4be> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 2b28e: c0 91 57 0e lds r28, 0x0E57 ; 0x800e57 2b292: 2c 2f mov r18, r28 2b294: 30 e0 ldi r19, 0x00 ; 0 2b296: 5e e6 ldi r21, 0x6E ; 110 2b298: c5 9f mul r28, r21 2b29a: e0 01 movw r28, r0 2b29c: 11 24 eor r1, r1 2b29e: ca 58 subi r28, 0x8A ; 138 2b2a0: d8 4f sbci r29, 0xF8 ; 248 block->busy = true; 2b2a2: fe 01 movw r30, r28 2b2a4: e9 5b subi r30, 0xB9 ; 185 2b2a6: ff 4f sbci r31, 0xFF ; 255 2b2a8: 41 e0 ldi r20, 0x01 ; 1 2b2aa: 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(); 2b2ac: d0 93 a3 05 sts 0x05A3, r29 ; 0x8005a3 2b2b0: c0 93 a2 05 sts 0x05A2, r28 ; 0x8005a2 if (current_block != NULL) { 2b2b4: 20 97 sbiw r28, 0x00 ; 0 2b2b6: 09 f4 brne .+2 ; 0x2b2ba <__vector_17+0xf8> 2b2b8: e3 c1 rjmp .+966 ; 0x2b680 <__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; 2b2ba: 10 92 9e 05 sts 0x059E, r1 ; 0x80059e 2b2be: 10 92 9f 05 sts 0x059F, r1 ; 0x80059f 2b2c2: 10 92 a0 05 sts 0x05A0, r1 ; 0x8005a0 2b2c6: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 // 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; 2b2ca: 10 92 9d 05 sts 0x059D, r1 ; 0x80059d acc_step_rate = uint16_t(current_block->initial_rate); 2b2ce: 8a ad ldd r24, Y+58 ; 0x3a 2b2d0: 9b ad ldd r25, Y+59 ; 0x3b 2b2d2: 90 93 9c 05 sts 0x059C, r25 ; 0x80059c 2b2d6: 80 93 9b 05 sts 0x059B, r24 ; 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; 2b2da: 81 34 cpi r24, 0x41 ; 65 2b2dc: ec e9 ldi r30, 0x9C ; 156 2b2de: 9e 07 cpc r25, r30 2b2e0: 08 f0 brcs .+2 ; 0x2b2e4 <__vector_17+0x122> 2b2e2: a2 c0 rjmp .+324 ; 0x2b428 <__vector_17+0x266> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2b2e4: 81 32 cpi r24, 0x21 ; 33 2b2e6: fe e4 ldi r31, 0x4E ; 78 2b2e8: 9f 07 cpc r25, r31 2b2ea: 08 f4 brcc .+2 ; 0x2b2ee <__vector_17+0x12c> 2b2ec: a0 c0 rjmp .+320 ; 0x2b42e <__vector_17+0x26c> step_rate = (step_rate >> 2)&0x3fff; 2b2ee: 96 95 lsr r25 2b2f0: 87 95 ror r24 2b2f2: 96 95 lsr r25 2b2f4: 87 95 ror r24 step_loops = 4; 2b2f6: 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; 2b2f8: 40 93 9a 05 sts 0x059A, r20 ; 0x80059a else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2b2fc: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2b2fe: 81 15 cp r24, r1 2b300: e8 e0 ldi r30, 0x08 ; 8 2b302: 9e 07 cpc r25, r30 2b304: 08 f4 brcc .+2 ; 0x2b308 <__vector_17+0x146> 2b306: a4 c0 rjmp .+328 ; 0x2b450 <__vector_17+0x28e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2b308: e9 2f mov r30, r25 2b30a: ff 27 eor r31, r31 2b30c: ee 0f add r30, r30 2b30e: ff 1f adc r31, r31 2b310: ee 0f add r30, r30 2b312: ff 1f adc r31, r31 2b314: af 01 movw r20, r30 2b316: 4a 56 subi r20, 0x6A ; 106 2b318: 58 46 sbci r21, 0x68 ; 104 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2b31a: fa 01 movw r30, r20 2b31c: 32 96 adiw r30, 0x02 ; 2 2b31e: a5 91 lpm r26, Z+ 2b320: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2b322: fa 01 movw r30, r20 2b324: 45 91 lpm r20, Z+ 2b326: 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. ); 2b328: b8 9f mul r27, r24 2b32a: b0 01 movw r22, r0 2b32c: a8 9f mul r26, r24 2b32e: 00 0c add r0, r0 2b330: 61 1d adc r22, r1 2b332: 11 24 eor r1, r1 2b334: 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); 2b336: ca 01 movw r24, r20 2b338: 86 1b sub r24, r22 2b33a: 97 0b sbc r25, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 2b33c: 84 36 cpi r24, 0x64 ; 100 2b33e: 91 05 cpc r25, r1 2b340: 10 f4 brcc .+4 ; 0x2b346 <__vector_17+0x184> 2b342: 84 e6 ldi r24, 0x64 ; 100 2b344: 90 e0 ldi r25, 0x00 ; 0 2b346: b0 e0 ldi r27, 0x00 ; 0 2b348: a0 e0 ldi r26, 0x00 ; 0 2b34a: 80 93 96 05 sts 0x0596, r24 ; 0x800596 2b34e: 90 93 97 05 sts 0x0597, r25 ; 0x800597 2b352: a0 93 98 05 sts 0x0598, r26 ; 0x800598 2b356: b0 93 99 05 sts 0x0599, r27 ; 0x800599 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2b35a: 4e e6 ldi r20, 0x6E ; 110 2b35c: 42 9f mul r20, r18 2b35e: c0 01 movw r24, r0 2b360: 43 9f mul r20, r19 2b362: 90 0d add r25, r0 2b364: 11 24 eor r1, r1 2b366: 8a 58 subi r24, 0x8A ; 138 2b368: 98 4f sbci r25, 0xF8 ; 248 2b36a: fc 01 movw r30, r24 2b36c: e4 5b subi r30, 0xB4 ; 180 2b36e: ff 4f sbci r31, 0xFF ; 255 2b370: 40 81 ld r20, Z 2b372: 44 23 and r20, r20 2b374: 49 f0 breq .+18 ; 0x2b388 <__vector_17+0x1c6> target_adv_steps = current_block->max_adv_steps; 2b376: 81 5b subi r24, 0xB1 ; 177 2b378: 9f 4f sbci r25, 0xFF ; 255 2b37a: fc 01 movw r30, r24 2b37c: 80 81 ld r24, Z 2b37e: 91 81 ldd r25, Z+1 ; 0x01 2b380: 90 93 95 05 sts 0x0595, r25 ; 0x800595 2b384: 80 93 94 05 sts 0x0594, r24 ; 0x800594 } e_steps = 0; 2b388: 10 92 93 05 sts 0x0593, r1 ; 0x800593 nextAdvanceISR = ADV_NEVER; 2b38c: 8f ef ldi r24, 0xFF ; 255 2b38e: 9f ef ldi r25, 0xFF ; 255 2b390: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2b394: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> LA_phase = -1; 2b398: 80 93 92 05 sts 0x0592, r24 ; 0x800592 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 2b39c: 8e e6 ldi r24, 0x6E ; 110 2b39e: 82 9f mul r24, r18 2b3a0: f0 01 movw r30, r0 2b3a2: 83 9f mul r24, r19 2b3a4: f0 0d add r31, r0 2b3a6: 11 24 eor r1, r1 2b3a8: ea 58 subi r30, 0x8A ; 138 2b3aa: f8 4f sbci r31, 0xF8 ; 248 2b3ac: 85 a9 ldd r24, Z+53 ; 0x35 2b3ae: 84 ff sbrs r24, 4 2b3b0: 08 c0 rjmp .+16 ; 0x2b3c2 <__vector_17+0x200> count_position[E_AXIS] = 0; 2b3b2: 10 92 70 07 sts 0x0770, r1 ; 0x800770 2b3b6: 10 92 71 07 sts 0x0771, r1 ; 0x800771 2b3ba: 10 92 72 07 sts 0x0772, r1 ; 0x800772 2b3be: 10 92 73 07 sts 0x0773, r1 ; 0x800773 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 2b3c2: 83 ff sbrs r24, 3 2b3c4: 66 c0 rjmp .+204 ; 0x2b492 <__vector_17+0x2d0> const int16_t value = -(current_block->step_event_count.lo >> 1); 2b3c6: 8e e6 ldi r24, 0x6E ; 110 2b3c8: 82 9f mul r24, r18 2b3ca: f0 01 movw r30, r0 2b3cc: 83 9f mul r24, r19 2b3ce: f0 0d add r31, r0 2b3d0: 11 24 eor r1, r1 2b3d2: ea 58 subi r30, 0x8A ; 138 2b3d4: f8 4f sbci r31, 0xF8 ; 248 2b3d6: 80 89 ldd r24, Z+16 ; 0x10 2b3d8: 91 89 ldd r25, Z+17 ; 0x11 2b3da: 96 95 lsr r25 2b3dc: 87 95 ror r24 2b3de: 91 95 neg r25 2b3e0: 81 95 neg r24 2b3e2: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 2b3e4: 90 93 83 05 sts 0x0583, r25 ; 0x800583 2b3e8: 80 93 82 05 sts 0x0582, r24 ; 0x800582 2b3ec: 90 93 87 05 sts 0x0587, r25 ; 0x800587 2b3f0: 80 93 86 05 sts 0x0586, r24 ; 0x800586 2b3f4: 90 93 8b 05 sts 0x058B, r25 ; 0x80058b 2b3f8: 80 93 8a 05 sts 0x058A, r24 ; 0x80058a 2b3fc: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f 2b400: 80 93 8e 05 sts 0x058E, r24 ; 0x80058e } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 2b404: 81 e0 ldi r24, 0x01 ; 1 2b406: 24 85 ldd r18, Z+12 ; 0x0c 2b408: 35 85 ldd r19, Z+13 ; 0x0d 2b40a: 23 2b or r18, r19 2b40c: 09 f0 breq .+2 ; 0x2b410 <__vector_17+0x24e> 2b40e: 82 c0 rjmp .+260 ; 0x2b514 <__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; 2b410: 80 e0 ldi r24, 0x00 ; 0 2b412: 80 c0 rjmp .+256 ; 0x2b514 <__vector_17+0x352> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 2b414: 10 92 e7 04 sts 0x04E7, r1 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2b418: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> 2b41c: 0c cf rjmp .-488 ; 0x2b236 <__vector_17+0x74> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 2b41e: 10 92 e9 04 sts 0x04E9, r1 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.490+0x1> 2b422: 10 92 e8 04 sts 0x04E8, r1 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.490> 2b426: 1d cf rjmp .-454 ; 0x2b262 <__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; 2b428: 80 e4 ldi r24, 0x40 ; 64 2b42a: 9c e9 ldi r25, 0x9C ; 156 2b42c: 60 cf rjmp .-320 ; 0x2b2ee <__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 2b42e: 81 31 cpi r24, 0x11 ; 17 2b430: 57 e2 ldi r21, 0x27 ; 39 2b432: 95 07 cpc r25, r21 2b434: 20 f0 brcs .+8 ; 0x2b43e <__vector_17+0x27c> step_rate = (step_rate >> 1)&0x7fff; 2b436: 96 95 lsr r25 2b438: 87 95 ror r24 step_loops = 2; 2b43a: 42 e0 ldi r20, 0x02 ; 2 2b43c: 5d cf rjmp .-326 ; 0x2b2f8 <__vector_17+0x136> } else { step_loops = 1; 2b43e: 40 93 9a 05 sts 0x059A, r20 ; 0x80059a 2b442: 80 32 cpi r24, 0x20 ; 32 2b444: 91 05 cpc r25, r1 2b446: 08 f0 brcs .+2 ; 0x2b44a <__vector_17+0x288> 2b448: 59 cf rjmp .-334 ; 0x2b2fc <__vector_17+0x13a> 2b44a: 80 e2 ldi r24, 0x20 ; 32 2b44c: 90 e0 ldi r25, 0x00 ; 0 2b44e: 56 cf rjmp .-340 ; 0x2b2fc <__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; 2b450: ac 01 movw r20, r24 2b452: 56 95 lsr r21 2b454: 47 95 ror r20 2b456: 4c 7f andi r20, 0xFC ; 252 2b458: 4a 56 subi r20, 0x6A ; 106 2b45a: 5c 46 sbci r21, 0x6C ; 108 timer = (unsigned short)pgm_read_word_near(table_address); 2b45c: fa 01 movw r30, r20 2b45e: 65 91 lpm r22, Z+ 2b460: 74 91 lpm r23, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2b462: fa 01 movw r30, r20 2b464: 32 96 adiw r30, 0x02 ; 2 2b466: a5 91 lpm r26, Z+ 2b468: b4 91 lpm r27, Z 2b46a: ac 01 movw r20, r24 2b46c: 47 70 andi r20, 0x07 ; 7 2b46e: 55 27 eor r21, r21 2b470: 4a 9f mul r20, r26 2b472: c0 01 movw r24, r0 2b474: 4b 9f mul r20, r27 2b476: 90 0d add r25, r0 2b478: 5a 9f mul r21, r26 2b47a: 90 0d add r25, r0 2b47c: 11 24 eor r1, r1 2b47e: e3 e0 ldi r30, 0x03 ; 3 2b480: 96 95 lsr r25 2b482: 87 95 ror r24 2b484: ea 95 dec r30 2b486: e1 f7 brne .-8 ; 0x2b480 <__vector_17+0x2be> 2b488: ab 01 movw r20, r22 2b48a: 48 1b sub r20, r24 2b48c: 59 0b sbc r21, r25 2b48e: ca 01 movw r24, r20 2b490: 55 cf rjmp .-342 ; 0x2b33c <__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); 2b492: 8e e6 ldi r24, 0x6E ; 110 2b494: 82 9f mul r24, r18 2b496: f0 01 movw r30, r0 2b498: 83 9f mul r24, r19 2b49a: f0 0d add r31, r0 2b49c: 11 24 eor r1, r1 2b49e: ea 58 subi r30, 0x8A ; 138 2b4a0: f8 4f sbci r31, 0xF8 ; 248 2b4a2: 80 89 ldd r24, Z+16 ; 0x10 2b4a4: 91 89 ldd r25, Z+17 ; 0x11 2b4a6: a2 89 ldd r26, Z+18 ; 0x12 2b4a8: b3 89 ldd r27, Z+19 ; 0x13 2b4aa: b6 95 lsr r27 2b4ac: a7 95 ror r26 2b4ae: 97 95 ror r25 2b4b0: 87 95 ror r24 2b4b2: b0 95 com r27 2b4b4: a0 95 com r26 2b4b6: 90 95 com r25 2b4b8: 81 95 neg r24 2b4ba: 9f 4f sbci r25, 0xFF ; 255 2b4bc: af 4f sbci r26, 0xFF ; 255 2b4be: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 2b4c0: 80 93 82 05 sts 0x0582, r24 ; 0x800582 2b4c4: 90 93 83 05 sts 0x0583, r25 ; 0x800583 2b4c8: a0 93 84 05 sts 0x0584, r26 ; 0x800584 2b4cc: b0 93 85 05 sts 0x0585, r27 ; 0x800585 2b4d0: 80 93 86 05 sts 0x0586, r24 ; 0x800586 2b4d4: 90 93 87 05 sts 0x0587, r25 ; 0x800587 2b4d8: a0 93 88 05 sts 0x0588, r26 ; 0x800588 2b4dc: b0 93 89 05 sts 0x0589, r27 ; 0x800589 2b4e0: 80 93 8a 05 sts 0x058A, r24 ; 0x80058a 2b4e4: 90 93 8b 05 sts 0x058B, r25 ; 0x80058b 2b4e8: a0 93 8c 05 sts 0x058C, r26 ; 0x80058c 2b4ec: b0 93 8d 05 sts 0x058D, r27 ; 0x80058d 2b4f0: 80 93 8e 05 sts 0x058E, r24 ; 0x80058e 2b4f4: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f 2b4f8: a0 93 90 05 sts 0x0590, r26 ; 0x800590 2b4fc: b0 93 91 05 sts 0x0591, r27 ; 0x800591 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 2b500: 81 e0 ldi r24, 0x01 ; 1 2b502: 44 85 ldd r20, Z+12 ; 0x0c 2b504: 55 85 ldd r21, Z+13 ; 0x0d 2b506: 66 85 ldd r22, Z+14 ; 0x0e 2b508: 77 85 ldd r23, Z+15 ; 0x0f 2b50a: 45 2b or r20, r21 2b50c: 46 2b or r20, r22 2b50e: 47 2b or r20, r23 2b510: 09 f4 brne .+2 ; 0x2b514 <__vector_17+0x352> 2b512: 7e cf rjmp .-260 ; 0x2b410 <__vector_17+0x24e> 2b514: 80 93 81 05 sts 0x0581, r24 ; 0x800581 #endif } step_events_completed.wide = 0; 2b518: 10 92 7d 05 sts 0x057D, r1 ; 0x80057d 2b51c: 10 92 7e 05 sts 0x057E, r1 ; 0x80057e 2b520: 10 92 7f 05 sts 0x057F, r1 ; 0x80057f 2b524: 10 92 80 05 sts 0x0580, r1 ; 0x800580 // Set directions. out_bits = current_block->direction_bits; 2b528: 88 8d ldd r24, Y+24 ; 0x18 2b52a: 80 93 7c 05 sts 0x057C, r24 ; 0x80057c // 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); 2b532: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b536: 81 60 ori r24, 0x01 ; 1 2b538: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 2b53c: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 2b53e: 80 93 6f 02 sts 0x026F, r24 ; 0x80026f } if((out_bits & (1< 2b546: 81 ff sbrs r24, 1 2b548: 8b c0 rjmp .+278 ; 0x2b660 <__vector_17+0x49e> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 2b54a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b54e: 8d 7f andi r24, 0xFD ; 253 2b550: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 2b554: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 2b556: 80 93 70 02 sts 0x0270, r24 ; 0x800270 } if ((out_bits & (1< 2b55e: 82 ff sbrs r24, 2 2b560: 86 c0 rjmp .+268 ; 0x2b66e <__vector_17+0x4ac> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 2b562: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b566: 84 60 ori r24, 0x04 ; 4 2b568: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 2b56c: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 2b56e: 80 93 71 02 sts 0x0271, r24 ; 0x800271 } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 2b572: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 2b576: 83 ff sbrs r24, 3 2b578: 81 c0 rjmp .+258 ; 0x2b67c <__vector_17+0x4ba> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 2b57a: 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; 2b57c: 80 93 72 02 sts 0x0272, r24 ; 0x800272 //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) 2b580: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b584: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b588: 30 97 sbiw r30, 0x00 ; 0 2b58a: 09 f4 brne .+2 ; 0x2b58e <__vector_17+0x3cc> 2b58c: 3d c7 rjmp .+3706 ; 0x2c408 <__vector_17+0x1246> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 2b58e: 80 91 8f 02 lds r24, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 2b592: 50 91 79 05 lds r21, 0x0579 ; 0x800579 2b596: 88 23 and r24, r24 2b598: 09 f4 brne .+2 ; 0x2b59c <__vector_17+0x3da> 2b59a: cb c0 rjmp .+406 ; 0x2b732 <__vector_17+0x570> { uint8_t _endstop_hit = endstop_hit; 2b59c: 20 91 0e 05 lds r18, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.494> uint8_t _endstop = endstop; 2b5a0: 80 91 7b 05 lds r24, 0x057B ; 0x80057b uint8_t _old_endstop = old_endstop; 2b5a4: 90 91 7a 05 lds r25, 0x057A ; 0x80057a #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))); 2b5ac: 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))); 2b5b4: 42 fd sbrc r20, 2 2b5b6: 83 c0 rjmp .+262 ; 0x2b6be <__vector_17+0x4fc> 2b5b8: 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)) { 2b5ba: 49 2f mov r20, r25 2b5bc: 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)){ 2b5be: 48 23 and r20, r24 2b5c0: b1 f0 breq .+44 ; 0x2b5ee <__vector_17+0x42c> 2b5c2: c0 80 ld r12, Z 2b5c4: d1 80 ldd r13, Z+1 ; 0x01 2b5c6: e2 80 ldd r14, Z+2 ; 0x02 2b5c8: f3 80 ldd r15, Z+3 ; 0x03 2b5ca: 1c 14 cp r1, r12 2b5cc: 1d 04 cpc r1, r13 2b5ce: 1e 04 cpc r1, r14 2b5d0: 1f 04 cpc r1, r15 2b5d2: 6c f4 brge .+26 ; 0x2b5ee <__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); 2b5d4: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 2b5d6: c0 88 ldd r12, Z+16 ; 0x10 2b5d8: d1 88 ldd r13, Z+17 ; 0x11 2b5da: e2 88 ldd r14, Z+18 ; 0x12 2b5dc: f3 88 ldd r15, Z+19 ; 0x13 2b5de: c0 92 7d 05 sts 0x057D, r12 ; 0x80057d 2b5e2: d0 92 7e 05 sts 0x057E, r13 ; 0x80057e 2b5e6: e0 92 7f 05 sts 0x057F, r14 ; 0x80057f 2b5ea: f0 92 80 05 sts 0x0580, r15 ; 0x800580 #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))); 2b5ee: 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))); 2b5f6: 47 fd sbrc r20, 7 2b5f8: 6c c0 rjmp .+216 ; 0x2b6d2 <__vector_17+0x510> 2b5fa: 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)) { 2b5fc: 49 2f mov r20, r25 2b5fe: 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)){ 2b600: 48 23 and r20, r24 2b602: b1 f0 breq .+44 ; 0x2b630 <__vector_17+0x46e> 2b604: c4 80 ldd r12, Z+4 ; 0x04 2b606: d5 80 ldd r13, Z+5 ; 0x05 2b608: e6 80 ldd r14, Z+6 ; 0x06 2b60a: f7 80 ldd r15, Z+7 ; 0x07 2b60c: 1c 14 cp r1, r12 2b60e: 1d 04 cpc r1, r13 2b610: 1e 04 cpc r1, r14 2b612: 1f 04 cpc r1, r15 2b614: 6c f4 brge .+26 ; 0x2b630 <__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); 2b616: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 2b618: c0 88 ldd r12, Z+16 ; 0x10 2b61a: d1 88 ldd r13, Z+17 ; 0x11 2b61c: e2 88 ldd r14, Z+18 ; 0x12 2b61e: f3 88 ldd r15, Z+19 ; 0x13 2b620: c0 92 7d 05 sts 0x057D, r12 ; 0x80057d 2b624: d0 92 7e 05 sts 0x057E, r13 ; 0x80057e 2b628: e0 92 7f 05 sts 0x057F, r14 ; 0x80057f 2b62c: f0 92 80 05 sts 0x0580, r15 ; 0x800580 } #endif } if ((out_bits & (1< { #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) if (! check_z_endstop) { 2b634: 51 11 cpse r21, r1 2b636: 77 c0 rjmp .+238 ; 0x2b726 <__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)) 2b638: 30 91 6c 06 lds r19, 0x066C ; 0x80066c 2b63c: 31 30 cpi r19, 0x01 ; 1 2b63e: 09 f0 breq .+2 ; 0x2b642 <__vector_17+0x480> 2b640: 52 c0 rjmp .+164 ; 0x2b6e6 <__vector_17+0x524> 2b642: 30 91 40 06 lds r19, 0x0640 ; 0x800640 2b646: 32 fd sbrc r19, 2 2b648: 4e c0 rjmp .+156 ; 0x2b6e6 <__vector_17+0x524> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 2b64a: 1c 9b sbis 0x03, 4 ; 3 2b64c: 52 c0 rjmp .+164 ; 0x2b6f2 <__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))); 2b64e: 84 60 ori r24, 0x04 ; 4 2b650: 51 c0 rjmp .+162 ; 0x2b6f4 <__vector_17+0x532> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 2b656: 8e 7f andi r24, 0xFE ; 254 2b658: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 2b65c: 81 e0 ldi r24, 0x01 ; 1 2b65e: 6f cf rjmp .-290 ; 0x2b53e <__vector_17+0x37c> } if((out_bits & (1< 2b664: 82 60 ori r24, 0x02 ; 2 2b666: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 2b66a: 81 e0 ldi r24, 0x01 ; 1 2b66c: 74 cf rjmp .-280 ; 0x2b556 <__vector_17+0x394> } if ((out_bits & (1< 2b672: 8b 7f andi r24, 0xFB ; 251 2b674: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 2b678: 81 e0 ldi r24, 0x01 ; 1 2b67a: 79 cf rjmp .-270 ; 0x2b56e <__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; 2b67c: 81 e0 ldi r24, 0x01 ; 1 2b67e: 7e cf rjmp .-260 ; 0x2b57c <__vector_17+0x3ba> } } else { _NEXT_ISR(2000); // 1kHz. 2b680: 80 ed ldi r24, 0xD0 ; 208 2b682: 97 e0 ldi r25, 0x07 ; 7 2b684: 90 93 e9 04 sts 0x04E9, r25 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.490+0x1> 2b688: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.490> 2b68c: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL9main_Rate.lto_priv.492+0x1> 2b690: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL9main_Rate.lto_priv.492> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 2b694: 8f ef ldi r24, 0xFF ; 255 2b696: 9f ef ldi r25, 0xFF ; 255 2b698: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2b69c: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> e_steps = 0; 2b6a0: 10 92 93 05 sts 0x0593, r1 ; 0x800593 // incrementally lose pressure to give a chance for // a new LA block to be scheduled and recover if(current_adv_steps) 2b6a4: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> 2b6a8: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 2b6ac: 00 97 sbiw r24, 0x00 ; 0 2b6ae: 09 f4 brne .+2 ; 0x2b6b2 <__vector_17+0x4f0> 2b6b0: 67 cf rjmp .-306 ; 0x2b580 <__vector_17+0x3be> --current_adv_steps; 2b6b2: 01 97 sbiw r24, 0x01 ; 1 2b6b4: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 2b6b8: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> 2b6bc: 61 cf rjmp .-318 ; 0x2b580 <__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))); 2b6be: 8e 7f andi r24, 0xFE ; 254 2b6c0: 7c cf rjmp .-264 ; 0x2b5ba <__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))); 2b6c2: 42 fd sbrc r20, 2 2b6c4: 04 c0 rjmp .+8 ; 0x2b6ce <__vector_17+0x50c> 2b6c6: 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)){ 2b6c8: 49 2f mov r20, r25 2b6ca: 40 71 andi r20, 0x10 ; 16 2b6cc: 78 cf rjmp .-272 ; 0x2b5be <__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))); 2b6ce: 8f 7e andi r24, 0xEF ; 239 2b6d0: fb cf rjmp .-10 ; 0x2b6c8 <__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))); 2b6d2: 8d 7f andi r24, 0xFD ; 253 2b6d4: 93 cf rjmp .-218 ; 0x2b5fc <__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))); 2b6d6: 47 fd sbrc r20, 7 2b6d8: 04 c0 rjmp .+8 ; 0x2b6e2 <__vector_17+0x520> 2b6da: 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)){ 2b6dc: 49 2f mov r20, r25 2b6de: 40 72 andi r20, 0x20 ; 32 2b6e0: 8f cf rjmp .-226 ; 0x2b600 <__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))); 2b6e2: 8f 7d andi r24, 0xDF ; 223 2b6e4: fb cf rjmp .-10 ; 0x2b6dc <__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))); 2b6e6: 1c 99 sbic 0x03, 4 ; 3 2b6e8: b2 cf rjmp .-156 ; 0x2b64e <__vector_17+0x48c> 2b6ea: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b6ee: 36 ff sbrs r19, 6 2b6f0: ae cf rjmp .-164 ; 0x2b64e <__vector_17+0x48c> 2b6f2: 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)) { 2b6f4: 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)) { 2b6f6: 98 23 and r25, r24 2b6f8: b1 f0 breq .+44 ; 0x2b726 <__vector_17+0x564> 2b6fa: c0 84 ldd r12, Z+8 ; 0x08 2b6fc: d1 84 ldd r13, Z+9 ; 0x09 2b6fe: e2 84 ldd r14, Z+10 ; 0x0a 2b700: f3 84 ldd r15, Z+11 ; 0x0b 2b702: 1c 14 cp r1, r12 2b704: 1d 04 cpc r1, r13 2b706: 1e 04 cpc r1, r14 2b708: 1f 04 cpc r1, r15 2b70a: 6c f4 brge .+26 ; 0x2b726 <__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); 2b70c: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2b70e: c0 88 ldd r12, Z+16 ; 0x10 2b710: d1 88 ldd r13, Z+17 ; 0x11 2b712: e2 88 ldd r14, Z+18 ; 0x12 2b714: f3 88 ldd r15, Z+19 ; 0x13 2b716: c0 92 7d 05 sts 0x057D, r12 ; 0x80057d 2b71a: d0 92 7e 05 sts 0x057E, r13 ; 0x80057e 2b71e: e0 92 7f 05 sts 0x057F, r14 ; 0x80057f 2b722: f0 92 80 05 sts 0x0580, r15 ; 0x800580 } #endif } endstop = _endstop; 2b726: 80 93 7b 05 sts 0x057B, r24 ; 0x80057b old_endstop = _endstop; //apply current endstop state to the old endstop 2b72a: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a endstop_hit = _endstop_hit; 2b72e: 20 93 0e 05 sts 0x050E, r18 ; 0x80050e <_ZL11endstop_hit.lto_priv.494> } // 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) { 2b732: 55 23 and r21, r21 2b734: 09 f4 brne .+2 ; 0x2b738 <__vector_17+0x576> 2b736: 40 c0 rjmp .+128 ; 0x2b7b8 <__vector_17+0x5f6> uint8_t _endstop_hit = endstop_hit; 2b738: 20 91 0e 05 lds r18, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.494> uint8_t _endstop = endstop; 2b73c: 80 91 7b 05 lds r24, 0x057B ; 0x80057b uint8_t _old_endstop = old_endstop; 2b740: 90 91 7a 05 lds r25, 0x057A ; 0x80057a // 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)) 2b744: 30 91 6c 06 lds r19, 0x066C ; 0x80066c 2b748: 31 30 cpi r19, 0x01 ; 1 2b74a: c9 f4 brne .+50 ; 0x2b77e <__vector_17+0x5bc> 2b74c: 30 91 40 06 lds r19, 0x0640 ; 0x800640 2b750: 32 fd sbrc r19, 2 2b752: 15 c0 rjmp .+42 ; 0x2b77e <__vector_17+0x5bc> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 2b754: 1c 9b sbis 0x03, 4 ; 3 2b756: 19 c0 rjmp .+50 ; 0x2b78a <__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))); 2b758: 84 60 ori r24, 0x04 ; 4 2b75a: 18 c0 rjmp .+48 ; 0x2b78c <__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)) 2b75c: 30 91 6c 06 lds r19, 0x066C ; 0x80066c 2b760: 31 30 cpi r19, 0x01 ; 1 2b762: 31 f4 brne .+12 ; 0x2b770 <__vector_17+0x5ae> 2b764: 30 91 40 06 lds r19, 0x0640 ; 0x800640 2b768: 32 fd sbrc r19, 2 2b76a: 02 c0 rjmp .+4 ; 0x2b770 <__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))); 2b76c: 8f 7b andi r24, 0xBF ; 191 2b76e: 05 c0 rjmp .+10 ; 0x2b77a <__vector_17+0x5b8> 2b770: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b774: 36 fd sbrc r19, 6 2b776: fa cf rjmp .-12 ; 0x2b76c <__vector_17+0x5aa> 2b778: 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)) { 2b77a: 90 74 andi r25, 0x40 ; 64 2b77c: bc cf rjmp .-136 ; 0x2b6f6 <__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))); 2b77e: 1c 99 sbic 0x03, 4 ; 3 2b780: eb cf rjmp .-42 ; 0x2b758 <__vector_17+0x596> 2b782: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b786: 36 ff sbrs r19, 6 2b788: e7 cf rjmp .-50 ; 0x2b758 <__vector_17+0x596> 2b78a: 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)) { 2b78c: 94 70 andi r25, 0x04 ; 4 2b78e: 98 23 and r25, r24 2b790: 69 f0 breq .+26 ; 0x2b7ac <__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); 2b792: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2b794: 40 89 ldd r20, Z+16 ; 0x10 2b796: 51 89 ldd r21, Z+17 ; 0x11 2b798: 62 89 ldd r22, Z+18 ; 0x12 2b79a: 73 89 ldd r23, Z+19 ; 0x13 2b79c: 40 93 7d 05 sts 0x057D, r20 ; 0x80057d 2b7a0: 50 93 7e 05 sts 0x057E, r21 ; 0x80057e 2b7a4: 60 93 7f 05 sts 0x057F, r22 ; 0x80057f 2b7a8: 70 93 80 05 sts 0x0580, r23 ; 0x800580 } endstop = _endstop; 2b7ac: 80 93 7b 05 sts 0x057B, r24 ; 0x80057b old_endstop = _endstop; //apply current endstop state to the old endstop 2b7b0: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a endstop_hit = _endstop_hit; 2b7b4: 20 93 0e 05 sts 0x050E, r18 ; 0x80050e <_ZL11endstop_hit.lto_priv.494> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 2b7b8: 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) 2b7ba: 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); 2b7bc: 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); 2b7be: 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); 2b7c0: 04 e0 ldi r16, 0x04 ; 4 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 2b7c2: 83 ff sbrs r24, 3 2b7c4: 08 c1 rjmp .+528 ; 0x2b9d6 <__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) 2b7c6: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 2b7ca: c8 17 cp r28, r24 2b7cc: 08 f0 brcs .+2 ; 0x2b7d0 <__vector_17+0x60e> 2b7ce: 72 c2 rjmp .+1252 ; 0x2bcb4 <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 2b7d0: 0f 94 5a 21 call 0x242b4 ; 0x242b4 // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 2b7d4: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b7d8: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b7dc: 80 81 ld r24, Z 2b7de: 91 81 ldd r25, Z+1 ; 0x01 2b7e0: 20 91 82 05 lds r18, 0x0582 ; 0x800582 2b7e4: 30 91 83 05 lds r19, 0x0583 ; 0x800583 2b7e8: 82 0f add r24, r18 2b7ea: 93 1f adc r25, r19 2b7ec: 90 93 83 05 sts 0x0583, r25 ; 0x800583 2b7f0: 80 93 82 05 sts 0x0582, r24 ; 0x800582 if (counter[X_AXIS].lo > 0) { 2b7f4: 18 16 cp r1, r24 2b7f6: 19 06 cpc r1, r25 2b7f8: 64 f5 brge .+88 ; 0x2b852 <__vector_17+0x690> STEP_NC_HI(X_AXIS); 2b7fa: 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; 2b7fc: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b800: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b804: 80 91 82 05 lds r24, 0x0582 ; 0x800582 2b808: 90 91 83 05 lds r25, 0x0583 ; 0x800583 2b80c: 20 89 ldd r18, Z+16 ; 0x10 2b80e: 31 89 ldd r19, Z+17 ; 0x11 2b810: 82 1b sub r24, r18 2b812: 93 0b sbc r25, r19 2b814: 90 93 83 05 sts 0x0583, r25 ; 0x800583 2b818: 80 93 82 05 sts 0x0582, r24 ; 0x800582 count_position[X_AXIS]+=count_direction[X_AXIS]; 2b81c: 90 91 6f 02 lds r25, 0x026F ; 0x80026f 2b820: 40 91 64 07 lds r20, 0x0764 ; 0x800764 2b824: 50 91 65 07 lds r21, 0x0765 ; 0x800765 2b828: 60 91 66 07 lds r22, 0x0766 ; 0x800766 2b82c: 70 91 67 07 lds r23, 0x0767 ; 0x800767 2b830: 89 2f mov r24, r25 2b832: 99 0f add r25, r25 2b834: 99 0b sbc r25, r25 2b836: aa 0b sbc r26, r26 2b838: bb 0b sbc r27, r27 2b83a: 84 0f add r24, r20 2b83c: 95 1f adc r25, r21 2b83e: a6 1f adc r26, r22 2b840: b7 1f adc r27, r23 2b842: 80 93 64 07 sts 0x0764, r24 ; 0x800764 2b846: 90 93 65 07 sts 0x0765, r25 ; 0x800765 2b84a: a0 93 66 07 sts 0x0766, r26 ; 0x800766 2b84e: b0 93 67 07 sts 0x0767, r27 ; 0x800767 #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; 2b852: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b856: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b85a: 84 81 ldd r24, Z+4 ; 0x04 2b85c: 95 81 ldd r25, Z+5 ; 0x05 2b85e: 20 91 86 05 lds r18, 0x0586 ; 0x800586 2b862: 30 91 87 05 lds r19, 0x0587 ; 0x800587 2b866: 82 0f add r24, r18 2b868: 93 1f adc r25, r19 2b86a: 90 93 87 05 sts 0x0587, r25 ; 0x800587 2b86e: 80 93 86 05 sts 0x0586, r24 ; 0x800586 if (counter[Y_AXIS].lo > 0) { 2b872: 18 16 cp r1, r24 2b874: 19 06 cpc r1, r25 2b876: 44 f5 brge .+80 ; 0x2b8c8 <__vector_17+0x706> STEP_NC_HI(Y_AXIS); 2b878: 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; 2b87a: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b87e: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b882: 20 89 ldd r18, Z+16 ; 0x10 2b884: 31 89 ldd r19, Z+17 ; 0x11 2b886: 82 1b sub r24, r18 2b888: 93 0b sbc r25, r19 2b88a: 90 93 87 05 sts 0x0587, r25 ; 0x800587 2b88e: 80 93 86 05 sts 0x0586, r24 ; 0x800586 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 2b892: 90 91 70 02 lds r25, 0x0270 ; 0x800270 2b896: 40 91 68 07 lds r20, 0x0768 ; 0x800768 2b89a: 50 91 69 07 lds r21, 0x0769 ; 0x800769 2b89e: 60 91 6a 07 lds r22, 0x076A ; 0x80076a 2b8a2: 70 91 6b 07 lds r23, 0x076B ; 0x80076b 2b8a6: 89 2f mov r24, r25 2b8a8: 99 0f add r25, r25 2b8aa: 99 0b sbc r25, r25 2b8ac: aa 0b sbc r26, r26 2b8ae: bb 0b sbc r27, r27 2b8b0: 84 0f add r24, r20 2b8b2: 95 1f adc r25, r21 2b8b4: a6 1f adc r26, r22 2b8b6: b7 1f adc r27, r23 2b8b8: 80 93 68 07 sts 0x0768, r24 ; 0x800768 2b8bc: 90 93 69 07 sts 0x0769, r25 ; 0x800769 2b8c0: a0 93 6a 07 sts 0x076A, r26 ; 0x80076a 2b8c4: b0 93 6b 07 sts 0x076B, r27 ; 0x80076b #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; 2b8c8: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b8cc: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b8d0: 80 85 ldd r24, Z+8 ; 0x08 2b8d2: 91 85 ldd r25, Z+9 ; 0x09 2b8d4: 20 91 8a 05 lds r18, 0x058A ; 0x80058a 2b8d8: 30 91 8b 05 lds r19, 0x058B ; 0x80058b 2b8dc: 82 0f add r24, r18 2b8de: 93 1f adc r25, r19 2b8e0: 90 93 8b 05 sts 0x058B, r25 ; 0x80058b 2b8e4: 80 93 8a 05 sts 0x058A, r24 ; 0x80058a if (counter[Z_AXIS].lo > 0) { 2b8e8: 18 16 cp r1, r24 2b8ea: 19 06 cpc r1, r25 2b8ec: 44 f5 brge .+80 ; 0x2b93e <__vector_17+0x77c> STEP_NC_HI(Z_AXIS); 2b8ee: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 2b8f0: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b8f4: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b8f8: 20 89 ldd r18, Z+16 ; 0x10 2b8fa: 31 89 ldd r19, Z+17 ; 0x11 2b8fc: 82 1b sub r24, r18 2b8fe: 93 0b sbc r25, r19 2b900: 90 93 8b 05 sts 0x058B, r25 ; 0x80058b 2b904: 80 93 8a 05 sts 0x058A, r24 ; 0x80058a count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2b908: 90 91 71 02 lds r25, 0x0271 ; 0x800271 2b90c: 40 91 6c 07 lds r20, 0x076C ; 0x80076c 2b910: 50 91 6d 07 lds r21, 0x076D ; 0x80076d 2b914: 60 91 6e 07 lds r22, 0x076E ; 0x80076e 2b918: 70 91 6f 07 lds r23, 0x076F ; 0x80076f 2b91c: 89 2f mov r24, r25 2b91e: 99 0f add r25, r25 2b920: 99 0b sbc r25, r25 2b922: aa 0b sbc r26, r26 2b924: bb 0b sbc r27, r27 2b926: 84 0f add r24, r20 2b928: 95 1f adc r25, r21 2b92a: a6 1f adc r26, r22 2b92c: b7 1f adc r27, r23 2b92e: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 2b932: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 2b936: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 2b93a: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 2b93e: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b942: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b946: 80 91 8e 05 lds r24, 0x058E ; 0x80058e 2b94a: 90 91 8f 05 lds r25, 0x058F ; 0x80058f 2b94e: 24 85 ldd r18, Z+12 ; 0x0c 2b950: 35 85 ldd r19, Z+13 ; 0x0d 2b952: 82 0f add r24, r18 2b954: 93 1f adc r25, r19 2b956: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f 2b95a: 80 93 8e 05 sts 0x058E, r24 ; 0x80058e 2b95e: 20 89 ldd r18, Z+16 ; 0x10 2b960: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 2b962: 18 16 cp r1, r24 2b964: 19 06 cpc r1, r25 2b966: 44 f5 brge .+80 ; 0x2b9b8 <__vector_17+0x7f6> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 2b968: 82 1b sub r24, r18 2b96a: 93 0b sbc r25, r19 2b96c: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f 2b970: 80 93 8e 05 sts 0x058E, r24 ; 0x80058e count_position[E_AXIS] += count_direction[E_AXIS]; 2b974: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2b978: 40 91 70 07 lds r20, 0x0770 ; 0x800770 2b97c: 50 91 71 07 lds r21, 0x0771 ; 0x800771 2b980: 60 91 72 07 lds r22, 0x0772 ; 0x800772 2b984: 70 91 73 07 lds r23, 0x0773 ; 0x800773 2b988: 89 2f mov r24, r25 2b98a: 99 0f add r25, r25 2b98c: 99 0b sbc r25, r25 2b98e: aa 0b sbc r26, r26 2b990: bb 0b sbc r27, r27 2b992: 84 0f add r24, r20 2b994: 95 1f adc r25, r21 2b996: a6 1f adc r26, r22 2b998: b7 1f adc r27, r23 2b99a: 80 93 70 07 sts 0x0770, r24 ; 0x800770 2b99e: 90 93 71 07 sts 0x0771, r25 ; 0x800771 2b9a2: a0 93 72 07 sts 0x0772, r26 ; 0x800772 2b9a6: b0 93 73 07 sts 0x0773, r27 ; 0x800773 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 2b9aa: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2b9ae: 80 91 93 05 lds r24, 0x0593 ; 0x800593 2b9b2: 89 0f add r24, r25 2b9b4: 80 93 93 05 sts 0x0593, r24 ; 0x800593 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) 2b9b8: 80 91 7d 05 lds r24, 0x057D ; 0x80057d 2b9bc: 90 91 7e 05 lds r25, 0x057E ; 0x80057e 2b9c0: 01 96 adiw r24, 0x01 ; 1 2b9c2: 90 93 7e 05 sts 0x057E, r25 ; 0x80057e 2b9c6: 80 93 7d 05 sts 0x057D, r24 ; 0x80057d 2b9ca: 82 17 cp r24, r18 2b9cc: 93 07 cpc r25, r19 2b9ce: 08 f0 brcs .+2 ; 0x2b9d2 <__vector_17+0x810> 2b9d0: 71 c1 rjmp .+738 ; 0x2bcb4 <__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) 2b9d2: cf 5f subi r28, 0xFF ; 255 2b9d4: f8 ce rjmp .-528 ; 0x2b7c6 <__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) 2b9d6: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 2b9da: c8 17 cp r28, r24 2b9dc: 08 f0 brcs .+2 ; 0x2b9e0 <__vector_17+0x81e> 2b9de: 6a c1 rjmp .+724 ; 0x2bcb4 <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 2b9e0: 0f 94 5a 21 call 0x242b4 ; 0x242b4 // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 2b9e4: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b9e8: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b9ec: 80 81 ld r24, Z 2b9ee: 91 81 ldd r25, Z+1 ; 0x01 2b9f0: a2 81 ldd r26, Z+2 ; 0x02 2b9f2: b3 81 ldd r27, Z+3 ; 0x03 2b9f4: 40 91 82 05 lds r20, 0x0582 ; 0x800582 2b9f8: 50 91 83 05 lds r21, 0x0583 ; 0x800583 2b9fc: 60 91 84 05 lds r22, 0x0584 ; 0x800584 2ba00: 70 91 85 05 lds r23, 0x0585 ; 0x800585 2ba04: 84 0f add r24, r20 2ba06: 95 1f adc r25, r21 2ba08: a6 1f adc r26, r22 2ba0a: b7 1f adc r27, r23 2ba0c: 80 93 82 05 sts 0x0582, r24 ; 0x800582 2ba10: 90 93 83 05 sts 0x0583, r25 ; 0x800583 2ba14: a0 93 84 05 sts 0x0584, r26 ; 0x800584 2ba18: b0 93 85 05 sts 0x0585, r27 ; 0x800585 if (counter[X_AXIS].wide > 0) { 2ba1c: 18 16 cp r1, r24 2ba1e: 19 06 cpc r1, r25 2ba20: 1a 06 cpc r1, r26 2ba22: 1b 06 cpc r1, r27 2ba24: c4 f5 brge .+112 ; 0x2ba96 <__vector_17+0x8d4> STEP_NC_HI(X_AXIS); 2ba26: 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; 2ba28: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2ba2c: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2ba30: 80 91 82 05 lds r24, 0x0582 ; 0x800582 2ba34: 90 91 83 05 lds r25, 0x0583 ; 0x800583 2ba38: a0 91 84 05 lds r26, 0x0584 ; 0x800584 2ba3c: b0 91 85 05 lds r27, 0x0585 ; 0x800585 2ba40: 40 89 ldd r20, Z+16 ; 0x10 2ba42: 51 89 ldd r21, Z+17 ; 0x11 2ba44: 62 89 ldd r22, Z+18 ; 0x12 2ba46: 73 89 ldd r23, Z+19 ; 0x13 2ba48: 84 1b sub r24, r20 2ba4a: 95 0b sbc r25, r21 2ba4c: a6 0b sbc r26, r22 2ba4e: b7 0b sbc r27, r23 2ba50: 80 93 82 05 sts 0x0582, r24 ; 0x800582 2ba54: 90 93 83 05 sts 0x0583, r25 ; 0x800583 2ba58: a0 93 84 05 sts 0x0584, r26 ; 0x800584 2ba5c: b0 93 85 05 sts 0x0585, r27 ; 0x800585 count_position[X_AXIS]+=count_direction[X_AXIS]; 2ba60: 90 91 6f 02 lds r25, 0x026F ; 0x80026f 2ba64: 40 91 64 07 lds r20, 0x0764 ; 0x800764 2ba68: 50 91 65 07 lds r21, 0x0765 ; 0x800765 2ba6c: 60 91 66 07 lds r22, 0x0766 ; 0x800766 2ba70: 70 91 67 07 lds r23, 0x0767 ; 0x800767 2ba74: 89 2f mov r24, r25 2ba76: 99 0f add r25, r25 2ba78: 99 0b sbc r25, r25 2ba7a: aa 0b sbc r26, r26 2ba7c: bb 0b sbc r27, r27 2ba7e: 84 0f add r24, r20 2ba80: 95 1f adc r25, r21 2ba82: a6 1f adc r26, r22 2ba84: b7 1f adc r27, r23 2ba86: 80 93 64 07 sts 0x0764, r24 ; 0x800764 2ba8a: 90 93 65 07 sts 0x0765, r25 ; 0x800765 2ba8e: a0 93 66 07 sts 0x0766, r26 ; 0x800766 2ba92: b0 93 67 07 sts 0x0767, r27 ; 0x800767 #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; 2ba96: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2ba9a: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2ba9e: 84 81 ldd r24, Z+4 ; 0x04 2baa0: 95 81 ldd r25, Z+5 ; 0x05 2baa2: a6 81 ldd r26, Z+6 ; 0x06 2baa4: b7 81 ldd r27, Z+7 ; 0x07 2baa6: 40 91 86 05 lds r20, 0x0586 ; 0x800586 2baaa: 50 91 87 05 lds r21, 0x0587 ; 0x800587 2baae: 60 91 88 05 lds r22, 0x0588 ; 0x800588 2bab2: 70 91 89 05 lds r23, 0x0589 ; 0x800589 2bab6: 84 0f add r24, r20 2bab8: 95 1f adc r25, r21 2baba: a6 1f adc r26, r22 2babc: b7 1f adc r27, r23 2babe: 80 93 86 05 sts 0x0586, r24 ; 0x800586 2bac2: 90 93 87 05 sts 0x0587, r25 ; 0x800587 2bac6: a0 93 88 05 sts 0x0588, r26 ; 0x800588 2baca: b0 93 89 05 sts 0x0589, r27 ; 0x800589 if (counter[Y_AXIS].wide > 0) { 2bace: 18 16 cp r1, r24 2bad0: 19 06 cpc r1, r25 2bad2: 1a 06 cpc r1, r26 2bad4: 1b 06 cpc r1, r27 2bad6: 84 f5 brge .+96 ; 0x2bb38 <__vector_17+0x976> STEP_NC_HI(Y_AXIS); 2bad8: 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; 2bada: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bade: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bae2: 40 89 ldd r20, Z+16 ; 0x10 2bae4: 51 89 ldd r21, Z+17 ; 0x11 2bae6: 62 89 ldd r22, Z+18 ; 0x12 2bae8: 73 89 ldd r23, Z+19 ; 0x13 2baea: 84 1b sub r24, r20 2baec: 95 0b sbc r25, r21 2baee: a6 0b sbc r26, r22 2baf0: b7 0b sbc r27, r23 2baf2: 80 93 86 05 sts 0x0586, r24 ; 0x800586 2baf6: 90 93 87 05 sts 0x0587, r25 ; 0x800587 2bafa: a0 93 88 05 sts 0x0588, r26 ; 0x800588 2bafe: b0 93 89 05 sts 0x0589, r27 ; 0x800589 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 2bb02: 90 91 70 02 lds r25, 0x0270 ; 0x800270 2bb06: 40 91 68 07 lds r20, 0x0768 ; 0x800768 2bb0a: 50 91 69 07 lds r21, 0x0769 ; 0x800769 2bb0e: 60 91 6a 07 lds r22, 0x076A ; 0x80076a 2bb12: 70 91 6b 07 lds r23, 0x076B ; 0x80076b 2bb16: 89 2f mov r24, r25 2bb18: 99 0f add r25, r25 2bb1a: 99 0b sbc r25, r25 2bb1c: aa 0b sbc r26, r26 2bb1e: bb 0b sbc r27, r27 2bb20: 84 0f add r24, r20 2bb22: 95 1f adc r25, r21 2bb24: a6 1f adc r26, r22 2bb26: b7 1f adc r27, r23 2bb28: 80 93 68 07 sts 0x0768, r24 ; 0x800768 2bb2c: 90 93 69 07 sts 0x0769, r25 ; 0x800769 2bb30: a0 93 6a 07 sts 0x076A, r26 ; 0x80076a 2bb34: b0 93 6b 07 sts 0x076B, r27 ; 0x80076b #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; 2bb38: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bb3c: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bb40: 80 85 ldd r24, Z+8 ; 0x08 2bb42: 91 85 ldd r25, Z+9 ; 0x09 2bb44: a2 85 ldd r26, Z+10 ; 0x0a 2bb46: b3 85 ldd r27, Z+11 ; 0x0b 2bb48: 40 91 8a 05 lds r20, 0x058A ; 0x80058a 2bb4c: 50 91 8b 05 lds r21, 0x058B ; 0x80058b 2bb50: 60 91 8c 05 lds r22, 0x058C ; 0x80058c 2bb54: 70 91 8d 05 lds r23, 0x058D ; 0x80058d 2bb58: 84 0f add r24, r20 2bb5a: 95 1f adc r25, r21 2bb5c: a6 1f adc r26, r22 2bb5e: b7 1f adc r27, r23 2bb60: 80 93 8a 05 sts 0x058A, r24 ; 0x80058a 2bb64: 90 93 8b 05 sts 0x058B, r25 ; 0x80058b 2bb68: a0 93 8c 05 sts 0x058C, r26 ; 0x80058c 2bb6c: b0 93 8d 05 sts 0x058D, r27 ; 0x80058d if (counter[Z_AXIS].wide > 0) { 2bb70: 18 16 cp r1, r24 2bb72: 19 06 cpc r1, r25 2bb74: 1a 06 cpc r1, r26 2bb76: 1b 06 cpc r1, r27 2bb78: 84 f5 brge .+96 ; 0x2bbda <__vector_17+0xa18> STEP_NC_HI(Z_AXIS); 2bb7a: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 2bb7c: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bb80: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bb84: 40 89 ldd r20, Z+16 ; 0x10 2bb86: 51 89 ldd r21, Z+17 ; 0x11 2bb88: 62 89 ldd r22, Z+18 ; 0x12 2bb8a: 73 89 ldd r23, Z+19 ; 0x13 2bb8c: 84 1b sub r24, r20 2bb8e: 95 0b sbc r25, r21 2bb90: a6 0b sbc r26, r22 2bb92: b7 0b sbc r27, r23 2bb94: 80 93 8a 05 sts 0x058A, r24 ; 0x80058a 2bb98: 90 93 8b 05 sts 0x058B, r25 ; 0x80058b 2bb9c: a0 93 8c 05 sts 0x058C, r26 ; 0x80058c 2bba0: b0 93 8d 05 sts 0x058D, r27 ; 0x80058d count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2bba4: 90 91 71 02 lds r25, 0x0271 ; 0x800271 2bba8: 40 91 6c 07 lds r20, 0x076C ; 0x80076c 2bbac: 50 91 6d 07 lds r21, 0x076D ; 0x80076d 2bbb0: 60 91 6e 07 lds r22, 0x076E ; 0x80076e 2bbb4: 70 91 6f 07 lds r23, 0x076F ; 0x80076f 2bbb8: 89 2f mov r24, r25 2bbba: 99 0f add r25, r25 2bbbc: 99 0b sbc r25, r25 2bbbe: aa 0b sbc r26, r26 2bbc0: bb 0b sbc r27, r27 2bbc2: 84 0f add r24, r20 2bbc4: 95 1f adc r25, r21 2bbc6: a6 1f adc r26, r22 2bbc8: b7 1f adc r27, r23 2bbca: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 2bbce: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 2bbd2: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 2bbd6: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 2bbda: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bbde: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bbe2: 80 91 8e 05 lds r24, 0x058E ; 0x80058e 2bbe6: 90 91 8f 05 lds r25, 0x058F ; 0x80058f 2bbea: a0 91 90 05 lds r26, 0x0590 ; 0x800590 2bbee: b0 91 91 05 lds r27, 0x0591 ; 0x800591 2bbf2: 44 85 ldd r20, Z+12 ; 0x0c 2bbf4: 55 85 ldd r21, Z+13 ; 0x0d 2bbf6: 66 85 ldd r22, Z+14 ; 0x0e 2bbf8: 77 85 ldd r23, Z+15 ; 0x0f 2bbfa: 84 0f add r24, r20 2bbfc: 95 1f adc r25, r21 2bbfe: a6 1f adc r26, r22 2bc00: b7 1f adc r27, r23 2bc02: 80 93 8e 05 sts 0x058E, r24 ; 0x80058e 2bc06: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f 2bc0a: a0 93 90 05 sts 0x0590, r26 ; 0x800590 2bc0e: b0 93 91 05 sts 0x0591, r27 ; 0x800591 2bc12: 40 89 ldd r20, Z+16 ; 0x10 2bc14: 51 89 ldd r21, Z+17 ; 0x11 2bc16: 62 89 ldd r22, Z+18 ; 0x12 2bc18: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 2bc1a: 18 16 cp r1, r24 2bc1c: 19 06 cpc r1, r25 2bc1e: 1a 06 cpc r1, r26 2bc20: 1b 06 cpc r1, r27 2bc22: 74 f5 brge .+92 ; 0x2bc80 <__vector_17+0xabe> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 2bc24: 84 1b sub r24, r20 2bc26: 95 0b sbc r25, r21 2bc28: a6 0b sbc r26, r22 2bc2a: b7 0b sbc r27, r23 2bc2c: 80 93 8e 05 sts 0x058E, r24 ; 0x80058e 2bc30: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f 2bc34: a0 93 90 05 sts 0x0590, r26 ; 0x800590 2bc38: b0 93 91 05 sts 0x0591, r27 ; 0x800591 count_position[E_AXIS] += count_direction[E_AXIS]; 2bc3c: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2bc40: c0 90 70 07 lds r12, 0x0770 ; 0x800770 2bc44: d0 90 71 07 lds r13, 0x0771 ; 0x800771 2bc48: e0 90 72 07 lds r14, 0x0772 ; 0x800772 2bc4c: f0 90 73 07 lds r15, 0x0773 ; 0x800773 2bc50: 89 2f mov r24, r25 2bc52: 99 0f add r25, r25 2bc54: 99 0b sbc r25, r25 2bc56: aa 0b sbc r26, r26 2bc58: bb 0b sbc r27, r27 2bc5a: 8c 0d add r24, r12 2bc5c: 9d 1d adc r25, r13 2bc5e: ae 1d adc r26, r14 2bc60: bf 1d adc r27, r15 2bc62: 80 93 70 07 sts 0x0770, r24 ; 0x800770 2bc66: 90 93 71 07 sts 0x0771, r25 ; 0x800771 2bc6a: a0 93 72 07 sts 0x0772, r26 ; 0x800772 2bc6e: b0 93 73 07 sts 0x0773, r27 ; 0x800773 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 2bc72: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2bc76: 80 91 93 05 lds r24, 0x0593 ; 0x800593 2bc7a: 89 0f add r24, r25 2bc7c: 80 93 93 05 sts 0x0593, r24 ; 0x800593 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) 2bc80: 80 91 7d 05 lds r24, 0x057D ; 0x80057d 2bc84: 90 91 7e 05 lds r25, 0x057E ; 0x80057e 2bc88: a0 91 7f 05 lds r26, 0x057F ; 0x80057f 2bc8c: b0 91 80 05 lds r27, 0x0580 ; 0x800580 2bc90: 01 96 adiw r24, 0x01 ; 1 2bc92: a1 1d adc r26, r1 2bc94: b1 1d adc r27, r1 2bc96: 80 93 7d 05 sts 0x057D, r24 ; 0x80057d 2bc9a: 90 93 7e 05 sts 0x057E, r25 ; 0x80057e 2bc9e: a0 93 7f 05 sts 0x057F, r26 ; 0x80057f 2bca2: b0 93 80 05 sts 0x0580, r27 ; 0x800580 2bca6: 84 17 cp r24, r20 2bca8: 95 07 cpc r25, r21 2bcaa: a6 07 cpc r26, r22 2bcac: b7 07 cpc r27, r23 2bcae: 10 f4 brcc .+4 ; 0x2bcb4 <__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) 2bcb0: cf 5f subi r28, 0xFF ; 255 2bcb2: 91 ce rjmp .-734 ; 0x2b9d6 <__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); 2bcb4: 80 91 93 05 lds r24, 0x0593 ; 0x800593 2bcb8: 88 23 and r24, r24 2bcba: 39 f0 breq .+14 ; 0x2bcca <__vector_17+0xb08> 2bcbc: 87 fd sbrc r24, 7 2bcbe: ee c0 rjmp .+476 ; 0x2be9c <__vector_17+0xcda> 2bcc0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2bcc4: 80 64 ori r24, 0x40 ; 64 2bcc6: 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) { 2bcca: 40 91 7d 05 lds r20, 0x057D ; 0x80057d 2bcce: 50 91 7e 05 lds r21, 0x057E ; 0x80057e 2bcd2: 60 91 7f 05 lds r22, 0x057F ; 0x80057f 2bcd6: 70 91 80 05 lds r23, 0x0580 ; 0x800580 2bcda: c0 91 a2 05 lds r28, 0x05A2 ; 0x8005a2 2bcde: d0 91 a3 05 lds r29, 0x05A3 ; 0x8005a3 2bce2: 89 8d ldd r24, Y+25 ; 0x19 2bce4: 9a 8d ldd r25, Y+26 ; 0x1a 2bce6: ab 8d ldd r26, Y+27 ; 0x1b 2bce8: bc 8d ldd r27, Y+28 ; 0x1c 2bcea: 84 17 cp r24, r20 2bcec: 95 07 cpc r25, r21 2bcee: a6 07 cpc r26, r22 2bcf0: b7 07 cpc r27, r23 2bcf2: 08 f4 brcc .+2 ; 0x2bcf6 <__vector_17+0xb34> 2bcf4: 34 c1 rjmp .+616 ; 0x2bf5e <__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); 2bcf6: 40 91 96 05 lds r20, 0x0596 ; 0x800596 2bcfa: 50 91 97 05 lds r21, 0x0597 ; 0x800597 2bcfe: 60 91 98 05 lds r22, 0x0598 ; 0x800598 2bd02: 70 91 99 05 lds r23, 0x0599 ; 0x800599 "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. ); 2bd06: cc 88 ldd r12, Y+20 ; 0x14 2bd08: dd 88 ldd r13, Y+21 ; 0x15 2bd0a: ee 88 ldd r14, Y+22 ; 0x16 2bd0c: aa 27 eor r26, r26 2bd0e: 4d 9d mul r20, r13 2bd10: b1 2d mov r27, r1 2bd12: 5e 9d mul r21, r14 2bd14: c0 01 movw r24, r0 2bd16: 6e 9d mul r22, r14 2bd18: 90 0d add r25, r0 2bd1a: 6d 9d mul r22, r13 2bd1c: 80 0d add r24, r0 2bd1e: 91 1d adc r25, r1 2bd20: 4e 9d mul r20, r14 2bd22: b0 0d add r27, r0 2bd24: 81 1d adc r24, r1 2bd26: 9a 1f adc r25, r26 2bd28: 5d 9d mul r21, r13 2bd2a: b0 0d add r27, r0 2bd2c: 81 1d adc r24, r1 2bd2e: 9a 1f adc r25, r26 2bd30: 6c 9d mul r22, r12 2bd32: b0 0d add r27, r0 2bd34: 81 1d adc r24, r1 2bd36: 9a 1f adc r25, r26 2bd38: 5c 9d mul r21, r12 2bd3a: b1 0d add r27, r1 2bd3c: 8a 1f adc r24, r26 2bd3e: 9a 1f adc r25, r26 2bd40: bb 0f add r27, r27 2bd42: 8a 1f adc r24, r26 2bd44: 9a 1f adc r25, r26 2bd46: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 2bd48: 2a ad ldd r18, Y+58 ; 0x3a 2bd4a: 3b ad ldd r19, Y+59 ; 0x3b 2bd4c: 82 0f add r24, r18 2bd4e: 93 1f adc r25, r19 2bd50: 90 93 9c 05 sts 0x059C, r25 ; 0x80059c 2bd54: 80 93 9b 05 sts 0x059B, r24 ; 0x80059b // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 2bd58: 2e a9 ldd r18, Y+54 ; 0x36 2bd5a: 3f a9 ldd r19, Y+55 ; 0x37 2bd5c: 28 17 cp r18, r24 2bd5e: 39 07 cpc r19, r25 2bd60: 20 f4 brcc .+8 ; 0x2bd6a <__vector_17+0xba8> acc_step_rate = current_block->nominal_rate; 2bd62: 30 93 9c 05 sts 0x059C, r19 ; 0x80059c 2bd66: 20 93 9b 05 sts 0x059B, r18 ; 0x80059b // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 2bd6a: 80 91 9b 05 lds r24, 0x059B ; 0x80059b 2bd6e: 90 91 9c 05 lds r25, 0x059C ; 0x80059c #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; 2bd72: 81 34 cpi r24, 0x41 ; 65 2bd74: fc e9 ldi r31, 0x9C ; 156 2bd76: 9f 07 cpc r25, r31 2bd78: 08 f0 brcs .+2 ; 0x2bd7c <__vector_17+0xbba> 2bd7a: 94 c0 rjmp .+296 ; 0x2bea4 <__vector_17+0xce2> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2bd7c: 81 32 cpi r24, 0x21 ; 33 2bd7e: 2e e4 ldi r18, 0x4E ; 78 2bd80: 92 07 cpc r25, r18 2bd82: 08 f4 brcc .+2 ; 0x2bd86 <__vector_17+0xbc4> 2bd84: 92 c0 rjmp .+292 ; 0x2beaa <__vector_17+0xce8> step_rate = (step_rate >> 2)&0x3fff; 2bd86: 96 95 lsr r25 2bd88: 87 95 ror r24 2bd8a: 96 95 lsr r25 2bd8c: 87 95 ror r24 step_loops = 4; 2bd8e: 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; 2bd90: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2bd94: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2bd96: 81 15 cp r24, r1 2bd98: f8 e0 ldi r31, 0x08 ; 8 2bd9a: 9f 07 cpc r25, r31 2bd9c: 08 f4 brcc .+2 ; 0x2bda0 <__vector_17+0xbde> 2bd9e: 97 c0 rjmp .+302 ; 0x2bece <__vector_17+0xd0c> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2bda0: e9 2f mov r30, r25 2bda2: ff 27 eor r31, r31 2bda4: ee 0f add r30, r30 2bda6: ff 1f adc r31, r31 2bda8: ee 0f add r30, r30 2bdaa: ff 1f adc r31, r31 2bdac: 9f 01 movw r18, r30 2bdae: 2a 56 subi r18, 0x6A ; 106 2bdb0: 38 46 sbci r19, 0x68 ; 104 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2bdb2: f9 01 movw r30, r18 2bdb4: 32 96 adiw r30, 0x02 ; 2 2bdb6: a5 91 lpm r26, Z+ 2bdb8: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2bdba: f9 01 movw r30, r18 2bdbc: 25 91 lpm r18, Z+ 2bdbe: 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. ); 2bdc0: b8 9f mul r27, r24 2bdc2: f0 01 movw r30, r0 2bdc4: a8 9f mul r26, r24 2bdc6: 00 0c add r0, r0 2bdc8: e1 1d adc r30, r1 2bdca: 11 24 eor r1, r1 2bdcc: 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); 2bdce: c9 01 movw r24, r18 2bdd0: 8e 1b sub r24, r30 2bdd2: 9f 0b sbc r25, r31 2bdd4: 84 36 cpi r24, 0x64 ; 100 2bdd6: 91 05 cpc r25, r1 2bdd8: 10 f4 brcc .+4 ; 0x2bdde <__vector_17+0xc1c> 2bdda: 84 e6 ldi r24, 0x64 ; 100 2bddc: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 2bdde: 90 93 e9 04 sts 0x04E9, r25 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.490+0x1> 2bde2: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.490> 2bde6: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL9main_Rate.lto_priv.492+0x1> 2bdea: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL9main_Rate.lto_priv.492> acceleration_time += timer; 2bdee: 48 0f add r20, r24 2bdf0: 59 1f adc r21, r25 2bdf2: 61 1d adc r22, r1 2bdf4: 71 1d adc r23, r1 2bdf6: 40 93 96 05 sts 0x0596, r20 ; 0x800596 2bdfa: 50 93 97 05 sts 0x0597, r21 ; 0x800597 2bdfe: 60 93 98 05 sts 0x0598, r22 ; 0x800598 2be02: 70 93 99 05 sts 0x0599, r23 ; 0x800599 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2be06: fe 01 movw r30, r28 2be08: e4 5b subi r30, 0xB4 ; 180 2be0a: ff 4f sbci r31, 0xFF ; 255 2be0c: 80 81 ld r24, Z 2be0e: 81 11 cpse r24, r1 2be10: 7d c0 rjmp .+250 ; 0x2bf0c <__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; 2be12: 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) { 2be14: 80 ff sbrs r24, 0 2be16: 16 c0 rjmp .+44 ; 0x2be44 <__vector_17+0xc82> LA_phase = -1; 2be18: 9f ef ldi r25, 0xFF ; 255 2be1a: 90 93 92 05 sts 0x0592, r25 ; 0x800592 if (current_adv_steps == target_adv_steps) { 2be1e: e0 91 e2 04 lds r30, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> 2be22: f0 91 e3 04 lds r31, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 2be26: 20 91 94 05 lds r18, 0x0594 ; 0x800594 2be2a: 30 91 95 05 lds r19, 0x0595 ; 0x800595 2be2e: e2 17 cp r30, r18 2be30: f3 07 cpc r31, r19 2be32: 09 f0 breq .+2 ; 0x2be36 <__vector_17+0xc74> 2be34: 24 c2 rjmp .+1096 ; 0x2c27e <__vector_17+0x10bc> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 2be36: 8f ef ldi r24, 0xFF ; 255 2be38: 9f ef ldi r25, 0xFF ; 255 2be3a: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2be3e: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> 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; 2be42: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 2be44: 80 fd sbrc r24, 0 2be46: 07 c0 rjmp .+14 ; 0x2be56 <__vector_17+0xc94> 2be48: 80 91 e6 04 lds r24, 0x04E6 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> 2be4c: 90 91 e7 04 lds r25, 0x04E7 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2be50: 01 96 adiw r24, 0x01 ; 1 2be52: 09 f4 brne .+2 ; 0x2be56 <__vector_17+0xc94> 2be54: b2 c2 rjmp .+1380 ; 0x2c3ba <__vector_17+0x11f8> // update timers & phase for the next iteration advance_spread(main_Rate); 2be56: e0 91 e4 04 lds r30, 0x04E4 ; 0x8004e4 <_ZL9main_Rate.lto_priv.492> 2be5a: f0 91 e5 04 lds r31, 0x04E5 ; 0x8004e5 <_ZL9main_Rate.lto_priv.492+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 2be5e: 80 91 73 05 lds r24, 0x0573 ; 0x800573 2be62: 90 91 74 05 lds r25, 0x0574 ; 0x800574 2be66: a0 91 75 05 lds r26, 0x0575 ; 0x800575 2be6a: b0 91 76 05 lds r27, 0x0576 ; 0x800576 2be6e: 8e 0f add r24, r30 2be70: 9f 1f adc r25, r31 2be72: a1 1d adc r26, r1 2be74: b1 1d adc r27, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 2be76: c3 5b subi r28, 0xB3 ; 179 2be78: df 4f sbci r29, 0xFF ; 255 2be7a: 08 81 ld r16, Y 2be7c: 19 81 ldd r17, Y+1 ; 0x01 2be7e: 30 e0 ldi r19, 0x00 ; 0 2be80: 20 e0 ldi r18, 0x00 ; 0 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 2be82: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 2be84: 80 17 cp r24, r16 2be86: 91 07 cpc r25, r17 2be88: a2 07 cpc r26, r18 2be8a: b3 07 cpc r27, r19 2be8c: 08 f4 brcc .+2 ; 0x2be90 <__vector_17+0xcce> 2be8e: 27 c2 rjmp .+1102 ; 0x2c2de <__vector_17+0x111c> { ++ticks; 2be90: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 2be92: 80 1b sub r24, r16 2be94: 91 0b sbc r25, r17 2be96: a2 0b sbc r26, r18 2be98: b3 0b sbc r27, r19 2be9a: f4 cf rjmp .-24 ; 0x2be84 <__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); 2be9c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2bea0: 8f 7b andi r24, 0xBF ; 191 2bea2: 11 cf rjmp .-478 ; 0x2bcc6 <__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; 2bea4: 80 e4 ldi r24, 0x40 ; 64 2bea6: 9c e9 ldi r25, 0x9C ; 156 2bea8: 6e cf rjmp .-292 ; 0x2bd86 <__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 2beaa: 81 31 cpi r24, 0x11 ; 17 2beac: e7 e2 ldi r30, 0x27 ; 39 2beae: 9e 07 cpc r25, r30 2beb0: 20 f0 brcs .+8 ; 0x2beba <__vector_17+0xcf8> step_rate = (step_rate >> 1)&0x7fff; 2beb2: 96 95 lsr r25 2beb4: 87 95 ror r24 step_loops = 2; 2beb6: 22 e0 ldi r18, 0x02 ; 2 2beb8: 6b cf rjmp .-298 ; 0x2bd90 <__vector_17+0xbce> } else { step_loops = 1; 2beba: 21 e0 ldi r18, 0x01 ; 1 2bebc: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a 2bec0: 80 32 cpi r24, 0x20 ; 32 2bec2: 91 05 cpc r25, r1 2bec4: 08 f0 brcs .+2 ; 0x2bec8 <__vector_17+0xd06> 2bec6: 66 cf rjmp .-308 ; 0x2bd94 <__vector_17+0xbd2> 2bec8: 80 e2 ldi r24, 0x20 ; 32 2beca: 90 e0 ldi r25, 0x00 ; 0 2becc: 63 cf rjmp .-314 ; 0x2bd94 <__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; 2bece: 9c 01 movw r18, r24 2bed0: 36 95 lsr r19 2bed2: 27 95 ror r18 2bed4: 2c 7f andi r18, 0xFC ; 252 2bed6: 2a 56 subi r18, 0x6A ; 106 2bed8: 3c 46 sbci r19, 0x6C ; 108 timer = (unsigned short)pgm_read_word_near(table_address); 2beda: f9 01 movw r30, r18 2bedc: a5 91 lpm r26, Z+ 2bede: b4 91 lpm r27, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2bee0: f9 01 movw r30, r18 2bee2: 32 96 adiw r30, 0x02 ; 2 2bee4: 05 91 lpm r16, Z+ 2bee6: 14 91 lpm r17, Z 2bee8: 87 70 andi r24, 0x07 ; 7 2beea: 99 27 eor r25, r25 2beec: 80 9f mul r24, r16 2beee: 90 01 movw r18, r0 2bef0: 81 9f mul r24, r17 2bef2: 30 0d add r19, r0 2bef4: 90 9f mul r25, r16 2bef6: 30 0d add r19, r0 2bef8: 11 24 eor r1, r1 2befa: f3 e0 ldi r31, 0x03 ; 3 2befc: 36 95 lsr r19 2befe: 27 95 ror r18 2bf00: fa 95 dec r31 2bf02: e1 f7 brne .-8 ; 0x2befc <__vector_17+0xd3a> 2bf04: cd 01 movw r24, r26 2bf06: 82 1b sub r24, r18 2bf08: 93 0b sbc r25, r19 2bf0a: 64 cf rjmp .-312 ; 0x2bdd4 <__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) { 2bf0c: 40 91 7d 05 lds r20, 0x057D ; 0x80057d 2bf10: 50 91 7e 05 lds r21, 0x057E ; 0x80057e 2bf14: 60 91 7f 05 lds r22, 0x057F ; 0x80057f 2bf18: 70 91 80 05 lds r23, 0x0580 ; 0x800580 2bf1c: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 2bf20: 90 e0 ldi r25, 0x00 ; 0 2bf22: b0 e0 ldi r27, 0x00 ; 0 2bf24: a0 e0 ldi r26, 0x00 ; 0 2bf26: 84 17 cp r24, r20 2bf28: 95 07 cpc r25, r21 2bf2a: a6 07 cpc r26, r22 2bf2c: b7 07 cpc r27, r23 2bf2e: 08 f4 brcc .+2 ; 0x2bf32 <__vector_17+0xd70> 2bf30: 70 cf rjmp .-288 ; 0x2be12 <__vector_17+0xc50> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 2bf32: 80 91 81 05 lds r24, 0x0581 ; 0x800581 2bf36: 81 11 cpse r24, r1 2bf38: 02 c0 rjmp .+4 ; 0x2bf3e <__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; 2bf3a: 83 e0 ldi r24, 0x03 ; 3 2bf3c: 6b cf rjmp .-298 ; 0x2be14 <__vector_17+0xc52> if (e_extruding && current_adv_steps > target_adv_steps) 2bf3e: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> 2bf42: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 2bf46: 20 91 94 05 lds r18, 0x0594 ; 0x800594 2bf4a: 30 91 95 05 lds r19, 0x0595 ; 0x800595 2bf4e: 28 17 cp r18, r24 2bf50: 39 07 cpc r19, r25 2bf52: 98 f7 brcc .-26 ; 0x2bf3a <__vector_17+0xd78> target_adv_steps = current_adv_steps; 2bf54: 90 93 95 05 sts 0x0595, r25 ; 0x800595 2bf58: 80 93 94 05 sts 0x0594, r24 ; 0x800594 2bf5c: ee cf rjmp .-36 ; 0x2bf3a <__vector_17+0xd78> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 2bf5e: 80 91 7d 05 lds r24, 0x057D ; 0x80057d 2bf62: 90 91 7e 05 lds r25, 0x057E ; 0x80057e 2bf66: a0 91 7f 05 lds r26, 0x057F ; 0x80057f 2bf6a: b0 91 80 05 lds r27, 0x0580 ; 0x800580 2bf6e: 4d 8d ldd r20, Y+29 ; 0x1d 2bf70: 5e 8d ldd r21, Y+30 ; 0x1e 2bf72: 6f 8d ldd r22, Y+31 ; 0x1f 2bf74: 78 a1 ldd r23, Y+32 ; 0x20 2bf76: 48 17 cp r20, r24 2bf78: 59 07 cpc r21, r25 2bf7a: 6a 07 cpc r22, r26 2bf7c: 7b 07 cpc r23, r27 2bf7e: 08 f0 brcs .+2 ; 0x2bf82 <__vector_17+0xdc0> 2bf80: e3 c0 rjmp .+454 ; 0x2c148 <__vector_17+0xf86> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 2bf82: c0 90 9e 05 lds r12, 0x059E ; 0x80059e 2bf86: d0 90 9f 05 lds r13, 0x059F ; 0x80059f 2bf8a: e0 90 a0 05 lds r14, 0x05A0 ; 0x8005a0 2bf8e: f0 90 a1 05 lds r15, 0x05A1 ; 0x8005a1 "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. ); 2bf92: 6c 88 ldd r6, Y+20 ; 0x14 2bf94: 7d 88 ldd r7, Y+21 ; 0x15 2bf96: 8e 88 ldd r8, Y+22 ; 0x16 2bf98: aa 27 eor r26, r26 2bf9a: c7 9c mul r12, r7 2bf9c: b1 2d mov r27, r1 2bf9e: d8 9c mul r13, r8 2bfa0: f0 01 movw r30, r0 2bfa2: e8 9c mul r14, r8 2bfa4: f0 0d add r31, r0 2bfa6: e7 9c mul r14, r7 2bfa8: e0 0d add r30, r0 2bfaa: f1 1d adc r31, r1 2bfac: c8 9c mul r12, r8 2bfae: b0 0d add r27, r0 2bfb0: e1 1d adc r30, r1 2bfb2: fa 1f adc r31, r26 2bfb4: d7 9c mul r13, r7 2bfb6: b0 0d add r27, r0 2bfb8: e1 1d adc r30, r1 2bfba: fa 1f adc r31, r26 2bfbc: e6 9c mul r14, r6 2bfbe: b0 0d add r27, r0 2bfc0: e1 1d adc r30, r1 2bfc2: fa 1f adc r31, r26 2bfc4: d6 9c mul r13, r6 2bfc6: b1 0d add r27, r1 2bfc8: ea 1f adc r30, r26 2bfca: fa 1f adc r31, r26 2bfcc: bb 0f add r27, r27 2bfce: ea 1f adc r30, r26 2bfd0: fa 1f adc r31, r26 2bfd2: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 2bfd4: 20 91 9b 05 lds r18, 0x059B ; 0x80059b 2bfd8: 30 91 9c 05 lds r19, 0x059C ; 0x80059c 2bfdc: 8e ad ldd r24, Y+62 ; 0x3e 2bfde: 9f ad ldd r25, Y+63 ; 0x3f 2bfe0: 2e 17 cp r18, r30 2bfe2: 3f 07 cpc r19, r31 2bfe4: 30 f0 brcs .+12 ; 0x2bff2 <__vector_17+0xe30> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 2bfe6: 2e 1b sub r18, r30 2bfe8: 3f 0b sbc r19, r31 2bfea: 82 17 cp r24, r18 2bfec: 93 07 cpc r25, r19 2bfee: 08 f4 brcc .+2 ; 0x2bff2 <__vector_17+0xe30> 2bff0: 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; 2bff2: 81 34 cpi r24, 0x41 ; 65 2bff4: 2c e9 ldi r18, 0x9C ; 156 2bff6: 92 07 cpc r25, r18 2bff8: 08 f0 brcs .+2 ; 0x2bffc <__vector_17+0xe3a> 2bffa: 75 c0 rjmp .+234 ; 0x2c0e6 <__vector_17+0xf24> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2bffc: 81 32 cpi r24, 0x21 ; 33 2bffe: ee e4 ldi r30, 0x4E ; 78 2c000: 9e 07 cpc r25, r30 2c002: 08 f4 brcc .+2 ; 0x2c006 <__vector_17+0xe44> 2c004: 73 c0 rjmp .+230 ; 0x2c0ec <__vector_17+0xf2a> step_rate = (step_rate >> 2)&0x3fff; 2c006: 96 95 lsr r25 2c008: 87 95 ror r24 2c00a: 96 95 lsr r25 2c00c: 87 95 ror r24 step_loops = 4; 2c00e: 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; 2c010: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2c014: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2c016: 81 15 cp r24, r1 2c018: 28 e0 ldi r18, 0x08 ; 8 2c01a: 92 07 cpc r25, r18 2c01c: 08 f4 brcc .+2 ; 0x2c020 <__vector_17+0xe5e> 2c01e: 78 c0 rjmp .+240 ; 0x2c110 <__vector_17+0xf4e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2c020: e9 2f mov r30, r25 2c022: ff 27 eor r31, r31 2c024: ee 0f add r30, r30 2c026: ff 1f adc r31, r31 2c028: ee 0f add r30, r30 2c02a: ff 1f adc r31, r31 2c02c: 9f 01 movw r18, r30 2c02e: 2a 56 subi r18, 0x6A ; 106 2c030: 38 46 sbci r19, 0x68 ; 104 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2c032: f9 01 movw r30, r18 2c034: 32 96 adiw r30, 0x02 ; 2 2c036: a5 91 lpm r26, Z+ 2c038: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2c03a: f9 01 movw r30, r18 2c03c: 25 91 lpm r18, Z+ 2c03e: 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. ); 2c040: b8 9f mul r27, r24 2c042: f0 01 movw r30, r0 2c044: a8 9f mul r26, r24 2c046: 00 0c add r0, r0 2c048: e1 1d adc r30, r1 2c04a: 11 24 eor r1, r1 2c04c: 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); 2c04e: 2e 1b sub r18, r30 2c050: 3f 0b sbc r19, r31 2c052: c9 01 movw r24, r18 2c054: 24 36 cpi r18, 0x64 ; 100 2c056: 31 05 cpc r19, r1 2c058: 10 f4 brcc .+4 ; 0x2c05e <__vector_17+0xe9c> 2c05a: 84 e6 ldi r24, 0x64 ; 100 2c05c: 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); 2c05e: 90 93 e9 04 sts 0x04E9, r25 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.490+0x1> 2c062: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.490> 2c066: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL9main_Rate.lto_priv.492+0x1> 2c06a: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL9main_Rate.lto_priv.492> deceleration_time += timer; 2c06e: c8 0e add r12, r24 2c070: d9 1e adc r13, r25 2c072: e1 1c adc r14, r1 2c074: f1 1c adc r15, r1 2c076: c0 92 9e 05 sts 0x059E, r12 ; 0x80059e 2c07a: d0 92 9f 05 sts 0x059F, r13 ; 0x80059f 2c07e: e0 92 a0 05 sts 0x05A0, r14 ; 0x8005a0 2c082: f0 92 a1 05 sts 0x05A1, r15 ; 0x8005a1 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2c086: fe 01 movw r30, r28 2c088: e4 5b subi r30, 0xB4 ; 180 2c08a: ff 4f sbci r31, 0xFF ; 255 2c08c: 80 81 ld r24, Z 2c08e: 88 23 and r24, r24 2c090: 09 f4 brne .+2 ; 0x2c094 <__vector_17+0xed2> 2c092: bf ce rjmp .-642 ; 0x2be12 <__vector_17+0xc50> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 2c094: 80 91 7d 05 lds r24, 0x057D ; 0x80057d 2c098: 90 91 7e 05 lds r25, 0x057E ; 0x80057e 2c09c: a0 91 7f 05 lds r26, 0x057F ; 0x80057f 2c0a0: b0 91 80 05 lds r27, 0x0580 ; 0x800580 2c0a4: 20 91 9a 05 lds r18, 0x059A ; 0x80059a 2c0a8: 42 0f add r20, r18 2c0aa: 51 1d adc r21, r1 2c0ac: 61 1d adc r22, r1 2c0ae: 71 1d adc r23, r1 2c0b0: 48 17 cp r20, r24 2c0b2: 59 07 cpc r21, r25 2c0b4: 6a 07 cpc r22, r26 2c0b6: 7b 07 cpc r23, r27 2c0b8: 08 f4 brcc .+2 ; 0x2c0bc <__vector_17+0xefa> 2c0ba: ab ce rjmp .-682 ; 0x2be12 <__vector_17+0xc50> target_adv_steps = current_block->final_adv_steps; 2c0bc: 35 96 adiw r30, 0x05 ; 5 2c0be: 20 81 ld r18, Z 2c0c0: 31 81 ldd r19, Z+1 ; 0x01 2c0c2: 30 93 95 05 sts 0x0595, r19 ; 0x800595 2c0c6: 20 93 94 05 sts 0x0594, r18 ; 0x800594 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 2c0ca: 80 91 81 05 lds r24, 0x0581 ; 0x800581 2c0ce: 88 23 and r24, r24 2c0d0: 09 f4 brne .+2 ; 0x2c0d4 <__vector_17+0xf12> 2c0d2: 33 cf rjmp .-410 ; 0x2bf3a <__vector_17+0xd78> 2c0d4: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> 2c0d8: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 2c0dc: 82 17 cp r24, r18 2c0de: 93 07 cpc r25, r19 2c0e0: 08 f0 brcs .+2 ; 0x2c0e4 <__vector_17+0xf22> 2c0e2: 2b cf rjmp .-426 ; 0x2bf3a <__vector_17+0xd78> 2c0e4: 37 cf rjmp .-402 ; 0x2bf54 <__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; 2c0e6: 80 e4 ldi r24, 0x40 ; 64 2c0e8: 9c e9 ldi r25, 0x9C ; 156 2c0ea: 8d cf rjmp .-230 ; 0x2c006 <__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 2c0ec: 81 31 cpi r24, 0x11 ; 17 2c0ee: f7 e2 ldi r31, 0x27 ; 39 2c0f0: 9f 07 cpc r25, r31 2c0f2: 20 f0 brcs .+8 ; 0x2c0fc <__vector_17+0xf3a> step_rate = (step_rate >> 1)&0x7fff; 2c0f4: 96 95 lsr r25 2c0f6: 87 95 ror r24 step_loops = 2; 2c0f8: 22 e0 ldi r18, 0x02 ; 2 2c0fa: 8a cf rjmp .-236 ; 0x2c010 <__vector_17+0xe4e> } else { step_loops = 1; 2c0fc: 21 e0 ldi r18, 0x01 ; 1 2c0fe: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a 2c102: 80 32 cpi r24, 0x20 ; 32 2c104: 91 05 cpc r25, r1 2c106: 08 f0 brcs .+2 ; 0x2c10a <__vector_17+0xf48> 2c108: 85 cf rjmp .-246 ; 0x2c014 <__vector_17+0xe52> 2c10a: 80 e2 ldi r24, 0x20 ; 32 2c10c: 90 e0 ldi r25, 0x00 ; 0 2c10e: 82 cf rjmp .-252 ; 0x2c014 <__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; 2c110: dc 01 movw r26, r24 2c112: b6 95 lsr r27 2c114: a7 95 ror r26 2c116: ac 7f andi r26, 0xFC ; 252 2c118: aa 56 subi r26, 0x6A ; 106 2c11a: bc 46 sbci r27, 0x6C ; 108 timer = (unsigned short)pgm_read_word_near(table_address); 2c11c: fd 01 movw r30, r26 2c11e: 25 91 lpm r18, Z+ 2c120: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c122: fd 01 movw r30, r26 2c124: 32 96 adiw r30, 0x02 ; 2 2c126: a5 91 lpm r26, Z+ 2c128: b4 91 lpm r27, Z 2c12a: 87 70 andi r24, 0x07 ; 7 2c12c: 99 27 eor r25, r25 2c12e: 8a 9f mul r24, r26 2c130: f0 01 movw r30, r0 2c132: 8b 9f mul r24, r27 2c134: f0 0d add r31, r0 2c136: 9a 9f mul r25, r26 2c138: f0 0d add r31, r0 2c13a: 11 24 eor r1, r1 2c13c: a3 e0 ldi r26, 0x03 ; 3 2c13e: f6 95 lsr r31 2c140: e7 95 ror r30 2c142: aa 95 dec r26 2c144: e1 f7 brne .-8 ; 0x2c13e <__vector_17+0xf7c> 2c146: 83 cf rjmp .-250 ; 0x2c04e <__vector_17+0xe8c> } } #endif } else { if (! step_loops_nominal) { 2c148: 80 91 9d 05 lds r24, 0x059D ; 0x80059d 2c14c: 88 23 and r24, r24 2c14e: 71 f0 breq .+28 ; 0x2c16c <__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; 2c150: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 2c152: 20 91 77 05 lds r18, 0x0577 ; 0x800577 2c156: 30 91 78 05 lds r19, 0x0578 ; 0x800578 2c15a: 30 93 e9 04 sts 0x04E9, r19 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.490+0x1> 2c15e: 20 93 e8 04 sts 0x04E8, r18 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.490> 2c162: 30 93 e5 04 sts 0x04E5, r19 ; 0x8004e5 <_ZL9main_Rate.lto_priv.492+0x1> 2c166: 20 93 e4 04 sts 0x04E4, r18 ; 0x8004e4 <_ZL9main_Rate.lto_priv.492> 2c16a: 54 ce rjmp .-856 ; 0x2be14 <__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); 2c16c: 8e a9 ldd r24, Y+54 ; 0x36 2c16e: 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; 2c170: 81 34 cpi r24, 0x41 ; 65 2c172: 4c e9 ldi r20, 0x9C ; 156 2c174: 94 07 cpc r25, r20 2c176: 08 f0 brcs .+2 ; 0x2c17a <__vector_17+0xfb8> 2c178: 4e c0 rjmp .+156 ; 0x2c216 <__vector_17+0x1054> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2c17a: 81 32 cpi r24, 0x21 ; 33 2c17c: 5e e4 ldi r21, 0x4E ; 78 2c17e: 95 07 cpc r25, r21 2c180: 08 f4 brcc .+2 ; 0x2c184 <__vector_17+0xfc2> 2c182: 4c c0 rjmp .+152 ; 0x2c21c <__vector_17+0x105a> step_rate = (step_rate >> 2)&0x3fff; 2c184: 96 95 lsr r25 2c186: 87 95 ror r24 2c188: 96 95 lsr r25 2c18a: 87 95 ror r24 step_loops = 4; 2c18c: 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; 2c18e: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2c192: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2c194: 81 15 cp r24, r1 2c196: f8 e0 ldi r31, 0x08 ; 8 2c198: 9f 07 cpc r25, r31 2c19a: 08 f4 brcc .+2 ; 0x2c19e <__vector_17+0xfdc> 2c19c: 51 c0 rjmp .+162 ; 0x2c240 <__vector_17+0x107e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2c19e: e9 2f mov r30, r25 2c1a0: ff 27 eor r31, r31 2c1a2: ee 0f add r30, r30 2c1a4: ff 1f adc r31, r31 2c1a6: ee 0f add r30, r30 2c1a8: ff 1f adc r31, r31 2c1aa: 9f 01 movw r18, r30 2c1ac: 2a 56 subi r18, 0x6A ; 106 2c1ae: 38 46 sbci r19, 0x68 ; 104 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2c1b0: f9 01 movw r30, r18 2c1b2: 32 96 adiw r30, 0x02 ; 2 2c1b4: 65 91 lpm r22, Z+ 2c1b6: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2c1b8: f9 01 movw r30, r18 2c1ba: 25 91 lpm r18, Z+ 2c1bc: 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. ); 2c1be: 78 9f mul r23, r24 2c1c0: a0 01 movw r20, r0 2c1c2: 68 9f mul r22, r24 2c1c4: 00 0c add r0, r0 2c1c6: 41 1d adc r20, r1 2c1c8: 11 24 eor r1, r1 2c1ca: 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); 2c1cc: c9 01 movw r24, r18 2c1ce: 84 1b sub r24, r20 2c1d0: 95 0b sbc r25, r21 2c1d2: 84 36 cpi r24, 0x64 ; 100 2c1d4: 91 05 cpc r25, r1 2c1d6: 10 f4 brcc .+4 ; 0x2c1dc <__vector_17+0x101a> 2c1d8: 84 e6 ldi r24, 0x64 ; 100 2c1da: 90 e0 ldi r25, 0x00 ; 0 2c1dc: 90 93 78 05 sts 0x0578, r25 ; 0x800578 2c1e0: 80 93 77 05 sts 0x0577, r24 ; 0x800577 step_loops_nominal = step_loops; 2c1e4: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 2c1e8: 80 93 9d 05 sts 0x059D, r24 ; 0x80059d #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 2c1ec: fe 01 movw r30, r28 2c1ee: e4 5b subi r30, 0xB4 ; 180 2c1f0: ff 4f sbci r31, 0xFF ; 255 2c1f2: 80 81 ld r24, Z 2c1f4: 88 23 and r24, r24 2c1f6: 09 f4 brne .+2 ; 0x2c1fa <__vector_17+0x1038> 2c1f8: ab cf rjmp .-170 ; 0x2c150 <__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) 2c1fa: 80 91 81 05 lds r24, 0x0581 ; 0x800581 2c1fe: 88 23 and r24, r24 2c200: 41 f0 breq .+16 ; 0x2c212 <__vector_17+0x1050> target_adv_steps = current_adv_steps; 2c202: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> 2c206: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 2c20a: 90 93 95 05 sts 0x0595, r25 ; 0x800595 2c20e: 80 93 94 05 sts 0x0594, r24 ; 0x800594 #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; 2c212: 81 e0 ldi r24, 0x01 ; 1 2c214: 9e cf rjmp .-196 ; 0x2c152 <__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; 2c216: 80 e4 ldi r24, 0x40 ; 64 2c218: 9c e9 ldi r25, 0x9C ; 156 2c21a: b4 cf rjmp .-152 ; 0x2c184 <__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 2c21c: 81 31 cpi r24, 0x11 ; 17 2c21e: e7 e2 ldi r30, 0x27 ; 39 2c220: 9e 07 cpc r25, r30 2c222: 20 f0 brcs .+8 ; 0x2c22c <__vector_17+0x106a> step_rate = (step_rate >> 1)&0x7fff; 2c224: 96 95 lsr r25 2c226: 87 95 ror r24 step_loops = 2; 2c228: 22 e0 ldi r18, 0x02 ; 2 2c22a: b1 cf rjmp .-158 ; 0x2c18e <__vector_17+0xfcc> } else { step_loops = 1; 2c22c: 21 e0 ldi r18, 0x01 ; 1 2c22e: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a 2c232: 80 32 cpi r24, 0x20 ; 32 2c234: 91 05 cpc r25, r1 2c236: 08 f0 brcs .+2 ; 0x2c23a <__vector_17+0x1078> 2c238: ac cf rjmp .-168 ; 0x2c192 <__vector_17+0xfd0> 2c23a: 80 e2 ldi r24, 0x20 ; 32 2c23c: 90 e0 ldi r25, 0x00 ; 0 2c23e: a9 cf rjmp .-174 ; 0x2c192 <__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; 2c240: 9c 01 movw r18, r24 2c242: 36 95 lsr r19 2c244: 27 95 ror r18 2c246: 2c 7f andi r18, 0xFC ; 252 2c248: 2a 56 subi r18, 0x6A ; 106 2c24a: 3c 46 sbci r19, 0x6C ; 108 timer = (unsigned short)pgm_read_word_near(table_address); 2c24c: f9 01 movw r30, r18 2c24e: 45 91 lpm r20, Z+ 2c250: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c252: f9 01 movw r30, r18 2c254: 32 96 adiw r30, 0x02 ; 2 2c256: 65 91 lpm r22, Z+ 2c258: 74 91 lpm r23, Z 2c25a: 87 70 andi r24, 0x07 ; 7 2c25c: 99 27 eor r25, r25 2c25e: 86 9f mul r24, r22 2c260: 90 01 movw r18, r0 2c262: 87 9f mul r24, r23 2c264: 30 0d add r19, r0 2c266: 96 9f mul r25, r22 2c268: 30 0d add r19, r0 2c26a: 11 24 eor r1, r1 2c26c: a3 e0 ldi r26, 0x03 ; 3 2c26e: 36 95 lsr r19 2c270: 27 95 ror r18 2c272: aa 95 dec r26 2c274: e1 f7 brne .-8 ; 0x2c26e <__vector_17+0x10ac> 2c276: ca 01 movw r24, r20 2c278: 82 1b sub r24, r18 2c27a: 93 0b sbc r25, r19 2c27c: aa cf rjmp .-172 ; 0x2c1d2 <__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; 2c27e: de 01 movw r26, r28 2c280: a3 5b subi r26, 0xB3 ; 179 2c282: bf 4f sbci r27, 0xFF ; 255 2c284: 4d 91 ld r20, X+ 2c286: 5c 91 ld r21, X 2c288: 11 97 sbiw r26, 0x01 ; 1 2c28a: 70 e0 ldi r23, 0x00 ; 0 2c28c: 60 e0 ldi r22, 0x00 ; 0 2c28e: 40 93 73 05 sts 0x0573, r20 ; 0x800573 2c292: 50 93 74 05 sts 0x0574, r21 ; 0x800574 2c296: 60 93 75 05 sts 0x0575, r22 ; 0x800575 2c29a: 70 93 76 05 sts 0x0576, r23 ; 0x800576 e_step_loops = current_block->advance_step_loops; 2c29e: 16 96 adiw r26, 0x06 ; 6 2c2a0: 9c 91 ld r25, X 2c2a2: 90 93 72 05 sts 0x0572, r25 ; 0x800572 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 2c2a6: 98 2f mov r25, r24 2c2a8: 92 70 andi r25, 0x02 ; 2 2c2aa: 09 f4 brne .+2 ; 0x2c2ae <__vector_17+0x10ec> 2c2ac: cb cd rjmp .-1130 ; 0x2be44 <__vector_17+0xc82> 2c2ae: 90 91 81 05 lds r25, 0x0581 ; 0x800581 2c2b2: 99 23 and r25, r25 2c2b4: 09 f4 brne .+2 ; 0x2c2b8 <__vector_17+0x10f6> 2c2b6: c6 cd rjmp .-1140 ; 0x2be44 <__vector_17+0xc82> 2c2b8: 2e 17 cp r18, r30 2c2ba: 3f 07 cpc r19, r31 2c2bc: 08 f0 brcs .+2 ; 0x2c2c0 <__vector_17+0x10fe> 2c2be: c2 cd rjmp .-1148 ; 0x2be44 <__vector_17+0xc82> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 2c2c0: 44 0f add r20, r20 2c2c2: 55 1f adc r21, r21 2c2c4: 66 1f adc r22, r22 2c2c6: 77 1f adc r23, r23 2c2c8: 40 93 73 05 sts 0x0573, r20 ; 0x800573 2c2cc: 50 93 74 05 sts 0x0574, r21 ; 0x800574 2c2d0: 60 93 75 05 sts 0x0575, r22 ; 0x800575 2c2d4: 70 93 76 05 sts 0x0576, r23 ; 0x800576 LA_phase = 0; 2c2d8: 10 92 92 05 sts 0x0592, r1 ; 0x800592 2c2dc: b3 cd rjmp .-1178 ; 0x2be44 <__vector_17+0xc82> 2c2de: 80 93 73 05 sts 0x0573, r24 ; 0x800573 2c2e2: 90 93 74 05 sts 0x0574, r25 ; 0x800574 2c2e6: a0 93 75 05 sts 0x0575, r26 ; 0x800575 2c2ea: b0 93 76 05 sts 0x0576, r27 ; 0x800576 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 2c2ee: 61 11 cpse r22, r1 2c2f0: 1b c0 rjmp .+54 ; 0x2c328 <__vector_17+0x1166> { eISR_Rate = timer; 2c2f2: f0 93 71 05 sts 0x0571, r31 ; 0x800571 2c2f6: e0 93 70 05 sts 0x0570, r30 ; 0x800570 nextAdvanceISR = timer; 2c2fa: f0 93 e7 04 sts 0x04E7, r31 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2c2fe: e0 93 e6 04 sts 0x04E6, r30 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { // update timers & phase for the next iteration advance_spread(main_Rate); if (LA_phase >= 0) { 2c302: 80 91 92 05 lds r24, 0x0592 ; 0x800592 2c306: 87 fd sbrc r24, 7 2c308: 58 c0 rjmp .+176 ; 0x2c3ba <__vector_17+0x11f8> if (step_loops == e_step_loops) 2c30a: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 2c30e: 10 91 72 05 lds r17, 0x0572 ; 0x800572 2c312: 28 81 ld r18, Y 2c314: 39 81 ldd r19, Y+1 ; 0x01 2c316: 81 13 cpse r24, r17 2c318: 35 c0 rjmp .+106 ; 0x2c384 <__vector_17+0x11c2> LA_phase = (current_block->advance_rate < main_Rate); 2c31a: 81 e0 ldi r24, 0x01 ; 1 2c31c: 2e 17 cp r18, r30 2c31e: 3f 07 cpc r19, r31 2c320: 08 f4 brcc .+2 ; 0x2c324 <__vector_17+0x1162> 2c322: 49 c0 rjmp .+146 ; 0x2c3b6 <__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); 2c324: 80 e0 ldi r24, 0x00 ; 0 2c326: 47 c0 rjmp .+142 ; 0x2c3b6 <__vector_17+0x11f4> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 2c328: 64 30 cpi r22, 0x04 ; 4 2c32a: 28 f5 brcc .+74 ; 0x2c376 <__vector_17+0x11b4> eISR_Rate = fastdiv(timer, ticks + 1); 2c32c: 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); 2c32e: 63 30 cpi r22, 0x03 ; 3 2c330: a9 f0 breq .+42 ; 0x2c35c <__vector_17+0x119a> 2c332: 66 95 lsr r22 2c334: af 01 movw r20, r30 2c336: 02 c0 rjmp .+4 ; 0x2c33c <__vector_17+0x117a> 2c338: 56 95 lsr r21 2c33a: 47 95 ror r20 2c33c: 6a 95 dec r22 2c33e: e2 f7 brpl .-8 ; 0x2c338 <__vector_17+0x1176> 2c340: 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); 2c342: 70 93 71 05 sts 0x0571, r23 ; 0x800571 2c346: 60 93 70 05 sts 0x0570, r22 ; 0x800570 } nextAdvanceISR = eISR_Rate; 2c34a: 80 91 70 05 lds r24, 0x0570 ; 0x800570 2c34e: 90 91 71 05 lds r25, 0x0571 ; 0x800571 2c352: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2c356: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> 2c35a: d3 cf rjmp .-90 ; 0x2c302 <__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; 2c35c: 9f 01 movw r18, r30 2c35e: ab ea ldi r26, 0xAB ; 171 2c360: ba ea ldi r27, 0xAA ; 170 2c362: 0f 94 fb dd call 0x3bbf6 ; 0x3bbf6 <__umulhisi3> 2c366: 41 e1 ldi r20, 0x11 ; 17 2c368: 96 95 lsr r25 2c36a: 87 95 ror r24 2c36c: 77 95 ror r23 2c36e: 67 95 ror r22 2c370: 4a 95 dec r20 2c372: d1 f7 brne .-12 ; 0x2c368 <__vector_17+0x11a6> 2c374: e6 cf rjmp .-52 ; 0x2c342 <__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); 2c376: 70 e0 ldi r23, 0x00 ; 0 2c378: 6f 5f subi r22, 0xFF ; 255 2c37a: 7f 4f sbci r23, 0xFF ; 255 2c37c: cf 01 movw r24, r30 2c37e: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 2c382: df cf rjmp .-66 ; 0x2c342 <__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); 2c384: 83 30 cpi r24, 0x03 ; 3 2c386: 09 f4 brne .+2 ; 0x2c38a <__vector_17+0x11c8> 2c388: cf c0 rjmp .+414 ; 0x2c528 <__vector_17+0x1366> 2c38a: 86 95 lsr r24 2c38c: a9 01 movw r20, r18 2c38e: 02 c0 rjmp .+4 ; 0x2c394 <__vector_17+0x11d2> 2c390: 56 95 lsr r21 2c392: 47 95 ror r20 2c394: 8a 95 dec r24 2c396: e2 f7 brpl .-8 ; 0x2c390 <__vector_17+0x11ce> 2c398: 13 30 cpi r17, 0x03 ; 3 2c39a: 09 f4 brne .+2 ; 0x2c39e <__vector_17+0x11dc> 2c39c: d3 c0 rjmp .+422 ; 0x2c544 <__vector_17+0x1382> 2c39e: 16 95 lsr r17 2c3a0: bf 01 movw r22, r30 2c3a2: 02 c0 rjmp .+4 ; 0x2c3a8 <__vector_17+0x11e6> 2c3a4: 76 95 lsr r23 2c3a6: 67 95 ror r22 2c3a8: 1a 95 dec r17 2c3aa: e2 f7 brpl .-8 ; 0x2c3a4 <__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); 2c3ac: 81 e0 ldi r24, 0x01 ; 1 2c3ae: 46 17 cp r20, r22 2c3b0: 57 07 cpc r21, r23 2c3b2: 08 f0 brcs .+2 ; 0x2c3b6 <__vector_17+0x11f4> 2c3b4: b7 cf rjmp .-146 ; 0x2c324 <__vector_17+0x1162> 2c3b6: 80 93 92 05 sts 0x0592, r24 ; 0x800592 } } // 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(); 2c3ba: 0f 94 5a 21 call 0x242b4 ; 0x242b4 #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 2c3be: 40 91 7d 05 lds r20, 0x057D ; 0x80057d 2c3c2: 50 91 7e 05 lds r21, 0x057E ; 0x80057e 2c3c6: 60 91 7f 05 lds r22, 0x057F ; 0x80057f 2c3ca: 70 91 80 05 lds r23, 0x0580 ; 0x800580 2c3ce: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2c3d2: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2c3d6: 80 89 ldd r24, Z+16 ; 0x10 2c3d8: 91 89 ldd r25, Z+17 ; 0x11 2c3da: a2 89 ldd r26, Z+18 ; 0x12 2c3dc: b3 89 ldd r27, Z+19 ; 0x13 2c3de: 48 17 cp r20, r24 2c3e0: 59 07 cpc r21, r25 2c3e2: 6a 07 cpc r22, r26 2c3e4: 7b 07 cpc r23, r27 2c3e6: 80 f0 brcs .+32 ; 0x2c408 <__vector_17+0x1246> current_block = NULL; 2c3e8: 10 92 a3 05 sts 0x05A3, r1 ; 0x8005a3 2c3ec: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 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) { 2c3f0: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 2c3f4: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 2c3f8: 98 17 cp r25, r24 2c3fa: 31 f0 breq .+12 ; 0x2c408 <__vector_17+0x1246> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2c3fc: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 2c400: 8f 5f subi r24, 0xFF ; 255 2c402: 8f 70 andi r24, 0x0F ; 15 2c404: 80 93 57 0e sts 0x0E57, r24 ; 0x800e57 return mask; } void tmc2130_st_isr() { if (tmc2130_mode == TMC2130_MODE_SILENT || tmc2130_sg_stop_on_crash == false || tmc2130_sg_homing_axes_mask != 0) 2c408: 80 91 6c 06 lds r24, 0x066C ; 0x80066c 2c40c: 81 30 cpi r24, 0x01 ; 1 2c40e: 49 f1 breq .+82 ; 0x2c462 <__vector_17+0x12a0> 2c410: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 2c414: 88 23 and r24, r24 2c416: 29 f1 breq .+74 ; 0x2c462 <__vector_17+0x12a0> 2c418: 80 91 40 06 lds r24, 0x0640 ; 0x800640 2c41c: 81 11 cpse r24, r1 2c41e: 21 c0 rjmp .+66 ; 0x2c462 <__vector_17+0x12a0> } uint8_t tmc2130_sample_diag() { uint8_t mask = 0; if (!READ(X_TMC2130_DIAG)) mask |= X_AXIS_MASK; 2c420: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2c424: 81 e0 ldi r24, 0x01 ; 1 2c426: 29 2f mov r18, r25 2c428: 24 70 andi r18, 0x04 ; 4 2c42a: 92 fd sbrc r25, 2 2c42c: 80 e0 ldi r24, 0x00 ; 0 if (!READ(Y_TMC2130_DIAG)) mask |= Y_AXIS_MASK; 2c42e: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2c432: 82 60 ori r24, 0x02 ; 2 2c434: 97 ff sbrs r25, 7 2c436: 03 c0 rjmp .+6 ; 0x2c43e <__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) { 2c438: 21 11 cpse r18, r1 2c43a: 13 c0 rjmp .+38 ; 0x2c462 <__vector_17+0x12a0> 2c43c: 81 e0 ldi r24, 0x01 ; 1 tmc2130_sg_crash = mask; 2c43e: 80 93 10 05 sts 0x0510, r24 ; 0x800510 tmc2130_sg_stop_on_crash = false; 2c442: 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 2c446: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.495+0x8> 2c44a: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.495+0x9> 2c44e: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.495+0xa> 2c452: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.495+0xb> 2c456: 20 e0 ldi r18, 0x00 ; 0 2c458: 30 e0 ldi r19, 0x00 ; 0 2c45a: 40 e8 ldi r20, 0x80 ; 128 2c45c: 5f eb ldi r21, 0xBF ; 191 2c45e: 0e 94 e2 8a call 0x115c4 ; 0x115c4 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2c462: 60 91 e6 04 lds r22, 0x04E6 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> 2c466: 70 91 e7 04 lds r23, 0x04E7 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> if (eisr) 2c46a: 61 15 cp r22, r1 2c46c: 71 05 cpc r23, r1 2c46e: 09 f0 breq .+2 ; 0x2c472 <__vector_17+0x12b0> 2c470: 46 c0 rjmp .+140 ; 0x2c4fe <__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) { 2c472: 40 91 e2 04 lds r20, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> 2c476: 50 91 e3 04 lds r21, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 2c47a: 20 91 94 05 lds r18, 0x0594 ; 0x800594 2c47e: 30 91 95 05 lds r19, 0x0595 ; 0x800595 2c482: 80 91 93 05 lds r24, 0x0593 ; 0x800593 2c486: 24 17 cp r18, r20 2c488: 35 07 cpc r19, r21 2c48a: 08 f0 brcs .+2 ; 0x2c48e <__vector_17+0x12cc> 2c48c: 6c c0 rjmp .+216 ; 0x2c566 <__vector_17+0x13a4> // decompression if (e_step_loops != 1) { 2c48e: 90 91 72 05 lds r25, 0x0572 ; 0x800572 2c492: 91 30 cpi r25, 0x01 ; 1 2c494: 41 f0 breq .+16 ; 0x2c4a6 <__vector_17+0x12e4> uint16_t d_steps = current_adv_steps - target_adv_steps; 2c496: 42 1b sub r20, r18 2c498: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 2c49a: 94 17 cp r25, r20 2c49c: 15 06 cpc r1, r21 2c49e: 19 f0 breq .+6 ; 0x2c4a6 <__vector_17+0x12e4> 2c4a0: 10 f0 brcs .+4 ; 0x2c4a6 <__vector_17+0x12e4> e_step_loops = d_steps; 2c4a2: 40 93 72 05 sts 0x0572, r20 ; 0x800572 } e_steps -= e_step_loops; 2c4a6: 90 91 72 05 lds r25, 0x0572 ; 0x800572 2c4aa: 89 1b sub r24, r25 2c4ac: 80 93 93 05 sts 0x0593, r24 ; 0x800593 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2c4b0: 88 23 and r24, r24 2c4b2: 39 f0 breq .+14 ; 0x2c4c2 <__vector_17+0x1300> 2c4b4: 87 fd sbrc r24, 7 2c4b6: 53 c0 rjmp .+166 ; 0x2c55e <__vector_17+0x139c> 2c4b8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c4bc: 80 64 ori r24, 0x40 ; 64 2c4be: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 2c4c2: 20 91 72 05 lds r18, 0x0572 ; 0x800572 2c4c6: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> 2c4ca: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 2c4ce: 82 1b sub r24, r18 2c4d0: 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; 2c4d2: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 2c4d6: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> } if (current_adv_steps == target_adv_steps) { 2c4da: 20 91 e2 04 lds r18, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> 2c4de: 30 91 e3 04 lds r19, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 2c4e2: 80 91 94 05 lds r24, 0x0594 ; 0x800594 2c4e6: 90 91 95 05 lds r25, 0x0595 ; 0x800595 2c4ea: 28 17 cp r18, r24 2c4ec: 39 07 cpc r19, r25 2c4ee: 09 f0 breq .+2 ; 0x2c4f2 <__vector_17+0x1330> 2c4f0: 66 c0 rjmp .+204 ; 0x2c5be <__vector_17+0x13fc> // advance steps completed nextAdvanceISR = ADV_NEVER; 2c4f2: 8f ef ldi r24, 0xFF ; 255 2c4f4: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2c4f6: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2c4fa: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 2c4fe: 40 91 93 05 lds r20, 0x0593 ; 0x800593 2c502: 41 11 cpse r20, r1 2c504: 61 c0 rjmp .+194 ; 0x2c5c8 <__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) 2c506: 80 91 e6 04 lds r24, 0x04E6 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> 2c50a: 90 91 e7 04 lds r25, 0x04E7 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 2c50e: 20 91 e8 04 lds r18, 0x04E8 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.490> 2c512: 30 91 e9 04 lds r19, 0x04E9 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.490+0x1> 2c516: 8f 3f cpi r24, 0xFF ; 255 2c518: 98 07 cpc r25, r24 2c51a: 09 f0 breq .+2 ; 0x2c51e <__vector_17+0x135c> 2c51c: 88 c0 rjmp .+272 ; 0x2c62e <__vector_17+0x146c> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 2c51e: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c522: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2c526: 8e c0 rjmp .+284 ; 0x2c644 <__vector_17+0x1482> // @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; 2c528: ab ea ldi r26, 0xAB ; 171 2c52a: ba ea ldi r27, 0xAA ; 170 2c52c: 0f 94 fb dd call 0x3bbf6 ; 0x3bbf6 <__umulhisi3> 2c530: ab 01 movw r20, r22 2c532: bc 01 movw r22, r24 2c534: 31 e1 ldi r19, 0x11 ; 17 2c536: 76 95 lsr r23 2c538: 67 95 ror r22 2c53a: 57 95 ror r21 2c53c: 47 95 ror r20 2c53e: 3a 95 dec r19 2c540: d1 f7 brne .-12 ; 0x2c536 <__vector_17+0x1374> 2c542: 2a cf rjmp .-428 ; 0x2c398 <__vector_17+0x11d6> 2c544: 9f 01 movw r18, r30 2c546: ab ea ldi r26, 0xAB ; 171 2c548: ba ea ldi r27, 0xAA ; 170 2c54a: 0f 94 fb dd call 0x3bbf6 ; 0x3bbf6 <__umulhisi3> 2c54e: 21 e1 ldi r18, 0x11 ; 17 2c550: 96 95 lsr r25 2c552: 87 95 ror r24 2c554: 77 95 ror r23 2c556: 67 95 ror r22 2c558: 2a 95 dec r18 2c55a: d1 f7 brne .-12 ; 0x2c550 <__vector_17+0x138e> 2c55c: 27 cf rjmp .-434 ; 0x2c3ac <__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); 2c55e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c562: 8f 7b andi r24, 0xBF ; 191 2c564: ac cf rjmp .-168 ; 0x2c4be <__vector_17+0x12fc> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 2c566: 42 17 cp r20, r18 2c568: 53 07 cpc r21, r19 2c56a: 08 f0 brcs .+2 ; 0x2c56e <__vector_17+0x13ac> 2c56c: b6 cf rjmp .-148 ; 0x2c4da <__vector_17+0x1318> // compression if (e_step_loops != 1) { 2c56e: 90 91 72 05 lds r25, 0x0572 ; 0x800572 2c572: 91 30 cpi r25, 0x01 ; 1 2c574: 41 f0 breq .+16 ; 0x2c586 <__vector_17+0x13c4> uint16_t d_steps = target_adv_steps - current_adv_steps; 2c576: 24 1b sub r18, r20 2c578: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 2c57a: 92 17 cp r25, r18 2c57c: 13 06 cpc r1, r19 2c57e: 19 f0 breq .+6 ; 0x2c586 <__vector_17+0x13c4> 2c580: 10 f0 brcs .+4 ; 0x2c586 <__vector_17+0x13c4> e_step_loops = d_steps; 2c582: 20 93 72 05 sts 0x0572, r18 ; 0x800572 } e_steps += e_step_loops; 2c586: 90 91 72 05 lds r25, 0x0572 ; 0x800572 2c58a: 89 0f add r24, r25 2c58c: 80 93 93 05 sts 0x0593, r24 ; 0x800593 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2c590: 88 23 and r24, r24 2c592: 39 f0 breq .+14 ; 0x2c5a2 <__vector_17+0x13e0> 2c594: 87 fd sbrc r24, 7 2c596: 0f c0 rjmp .+30 ; 0x2c5b6 <__vector_17+0x13f4> 2c598: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c59c: 80 64 ori r24, 0x40 ; 64 2c59e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 2c5a2: 80 91 72 05 lds r24, 0x0572 ; 0x800572 2c5a6: 20 91 e2 04 lds r18, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> 2c5aa: 30 91 e3 04 lds r19, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 2c5ae: 82 0f add r24, r18 2c5b0: 93 2f mov r25, r19 2c5b2: 91 1d adc r25, r1 2c5b4: 8e cf rjmp .-228 ; 0x2c4d2 <__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); 2c5b6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c5ba: 8f 7b andi r24, 0xBF ; 191 2c5bc: f0 cf rjmp .-32 ; 0x2c59e <__vector_17+0x13dc> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2c5be: 80 91 70 05 lds r24, 0x0570 ; 0x800570 2c5c2: 90 91 71 05 lds r25, 0x0571 ; 0x800571 2c5c6: 97 cf rjmp .-210 ; 0x2c4f6 <__vector_17+0x1334> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 2c5c8: 80 91 92 05 lds r24, 0x0592 ; 0x800592 2c5cc: 87 fd sbrc r24, 7 2c5ce: 0e c0 rjmp .+28 ; 0x2c5ec <__vector_17+0x142a> 2c5d0: 08 2e mov r0, r24 2c5d2: 00 0c add r0, r0 2c5d4: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2c5d6: 21 e0 ldi r18, 0x01 ; 1 2c5d8: 30 e0 ldi r19, 0x00 ; 0 2c5da: 61 15 cp r22, r1 2c5dc: 71 05 cpc r23, r1 2c5de: 11 f0 breq .+4 ; 0x2c5e4 <__vector_17+0x1422> 2c5e0: 30 e0 ldi r19, 0x00 ; 0 2c5e2: 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)) { 2c5e4: 82 17 cp r24, r18 2c5e6: 93 07 cpc r25, r19 2c5e8: 09 f0 breq .+2 ; 0x2c5ec <__vector_17+0x142a> 2c5ea: 8d cf rjmp .-230 ; 0x2c506 <__vector_17+0x1344> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 2c5ec: 20 91 72 05 lds r18, 0x0572 ; 0x800572 2c5f0: 67 2b or r22, r23 2c5f2: 11 f0 breq .+4 ; 0x2c5f8 <__vector_17+0x1436> 2c5f4: 20 91 9a 05 lds r18, 0x059A ; 0x80059a max_ticks = min(abs(e_steps), max_ticks); 2c5f8: 84 2f mov r24, r20 2c5fa: 04 2e mov r0, r20 2c5fc: 00 0c add r0, r0 2c5fe: 99 0b sbc r25, r25 2c600: 97 ff sbrs r25, 7 2c602: 03 c0 rjmp .+6 ; 0x2c60a <__vector_17+0x1448> 2c604: 91 95 neg r25 2c606: 81 95 neg r24 2c608: 91 09 sbc r25, r1 2c60a: 30 e0 ldi r19, 0x00 ; 0 2c60c: 28 17 cp r18, r24 2c60e: 39 07 cpc r19, r25 2c610: 0c f4 brge .+2 ; 0x2c614 <__vector_17+0x1452> 2c612: c9 01 movw r24, r18 2c614: 21 e0 ldi r18, 0x01 ; 1 2c616: 47 ff sbrs r20, 7 2c618: 2f ef ldi r18, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 2c61a: 38 e0 ldi r19, 0x08 ; 8 2c61c: 36 b9 out 0x06, r19 ; 6 e_steps += (rev? 1: -1); 2c61e: 90 91 93 05 lds r25, 0x0593 ; 0x800593 2c622: 92 0f add r25, r18 2c624: 90 93 93 05 sts 0x0593, r25 ; 0x800593 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); 2c628: 81 50 subi r24, 0x01 ; 1 2c62a: c1 f7 brne .-16 ; 0x2c61c <__vector_17+0x145a> 2c62c: 6c cf rjmp .-296 ; 0x2c506 <__vector_17+0x1344> } // 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) 2c62e: ac 01 movw r20, r24 2c630: 48 5d subi r20, 0xD8 ; 216 2c632: 5f 4f sbci r21, 0xFF ; 255 2c634: 42 17 cp r20, r18 2c636: 53 07 cpc r21, r19 2c638: 08 f0 brcs .+2 ; 0x2c63c <__vector_17+0x147a> 2c63a: 71 cf rjmp .-286 ; 0x2c51e <__vector_17+0x135c> OCR1A = nextAdvanceISR; 2c63c: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c640: 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) { 2c644: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2c648: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c64c: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2c650: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2c654: 40 96 adiw r24, 0x10 ; 16 2c656: 28 17 cp r18, r24 2c658: 39 07 cpc r19, r25 2c65a: 48 f4 brcc .+18 ; 0x2c66e <__vector_17+0x14ac> // 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; 2c65c: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2c660: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2c664: 40 96 adiw r24, 0x10 ; 16 2c666: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c66a: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 2c66e: ff 91 pop r31 2c670: ef 91 pop r30 2c672: df 91 pop r29 2c674: cf 91 pop r28 2c676: bf 91 pop r27 2c678: af 91 pop r26 2c67a: 9f 91 pop r25 2c67c: 8f 91 pop r24 2c67e: 7f 91 pop r23 2c680: 6f 91 pop r22 2c682: 5f 91 pop r21 2c684: 4f 91 pop r20 2c686: 3f 91 pop r19 2c688: 2f 91 pop r18 2c68a: 1f 91 pop r17 2c68c: 0f 91 pop r16 2c68e: ff 90 pop r15 2c690: ef 90 pop r14 2c692: df 90 pop r13 2c694: cf 90 pop r12 2c696: 8f 90 pop r8 2c698: 7f 90 pop r7 2c69a: 6f 90 pop r6 2c69c: 0f 90 pop r0 2c69e: 0b be out 0x3b, r0 ; 59 2c6a0: 0f 90 pop r0 2c6a2: 0f be out 0x3f, r0 ; 63 2c6a4: 0f 90 pop r0 2c6a6: 1f 90 pop r1 2c6a8: 18 95 reti 0002c6aa : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 2c6aa: 90 91 79 05 lds r25, 0x0579 ; 0x800579 check_z_endstop = check; 2c6ae: 80 93 79 05 sts 0x0579, r24 ; 0x800579 CRITICAL_SECTION_START; 2c6b2: 2f b7 in r18, 0x3f ; 63 2c6b4: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 2c6b6: 80 91 0e 05 lds r24, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.494> 2c6ba: 8b 7f andi r24, 0xFB ; 251 2c6bc: 80 93 0e 05 sts 0x050E, r24 ; 0x80050e <_ZL11endstop_hit.lto_priv.494> CRITICAL_SECTION_END; 2c6c0: 2f bf out 0x3f, r18 ; 63 return old; } 2c6c2: 89 2f mov r24, r25 2c6c4: 08 95 ret 0002c6c6 : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 2c6c6: 80 91 0e 05 lds r24, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.494> CRITICAL_SECTION_START; 2c6ca: 2f b7 in r18, 0x3f ; 63 2c6cc: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 2c6ce: 90 91 0e 05 lds r25, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.494> 2c6d2: 9b 7f andi r25, 0xFB ; 251 2c6d4: 90 93 0e 05 sts 0x050E, r25 ; 0x80050e <_ZL11endstop_hit.lto_priv.494> CRITICAL_SECTION_END; 2c6d8: 2f bf out 0x3f, r18 ; 63 return hit; } 2c6da: 82 fb bst r24, 2 2c6dc: 88 27 eor r24, r24 2c6de: 80 f9 bld r24, 0 2c6e0: 08 95 ret 0002c6e2 : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 2c6e2: 90 91 0e 05 lds r25, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.494> endstop_hit = 0; 2c6e6: 10 92 0e 05 sts 0x050E, r1 ; 0x80050e <_ZL11endstop_hit.lto_priv.494> return old; 2c6ea: 81 e0 ldi r24, 0x01 ; 1 2c6ec: 91 11 cpse r25, r1 2c6ee: 01 c0 rjmp .+2 ; 0x2c6f2 2c6f0: 80 e0 ldi r24, 0x00 ; 0 } 2c6f2: 08 95 ret 0002c6f4 : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 2c6f4: 90 91 e1 04 lds r25, 0x04E1 ; 0x8004e1 2c6f8: 91 30 cpi r25, 0x01 ; 1 2c6fa: a1 f0 breq .+40 ; 0x2c724 2c6fc: 28 f0 brcs .+10 ; 0x2c708 2c6fe: 92 30 cpi r25, 0x02 ; 2 2c700: a9 f0 breq .+42 ; 0x2c72c 2c702: 93 30 cpi r25, 0x03 ; 3 2c704: c1 f0 breq .+48 ; 0x2c736 2c706: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 2c708: 81 11 cpse r24, r1 2c70a: 02 c0 rjmp .+4 ; 0x2c710 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(); 2c70c: 0d 94 c2 21 jmp 0x24384 ; 0x24384 switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c710: 82 30 cpi r24, 0x02 ; 2 2c712: 11 f4 brne .+4 ; 0x2c718 break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 2c714: 0d 94 a1 31 jmp 0x26342 ; 0x26342 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) 2c718: 85 30 cpi r24, 0x05 ; 5 2c71a: 09 f0 breq .+2 ; 0x2c71e 2c71c: 50 c0 rjmp .+160 ; 0x2c7be Sound_DoSound_Alert(false); 2c71e: 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); 2c720: 0d 94 a0 21 jmp 0x24340 ; 0x24340 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) 2c724: 88 23 and r24, r24 2c726: 91 f3 breq .-28 ; 0x2c70c Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c728: 82 30 cpi r24, 0x02 ; 2 2c72a: a1 f3 breq .-24 ; 0x2c714 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 2c72c: 85 30 cpi r24, 0x05 ; 5 2c72e: 09 f0 breq .+2 ; 0x2c732 2c730: 46 c0 rjmp .+140 ; 0x2c7be Sound_DoSound_Alert(true); 2c732: 81 e0 ldi r24, 0x01 ; 1 2c734: f5 cf rjmp .-22 ; 0x2c720 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) 2c736: 88 23 and r24, r24 2c738: 49 f3 breq .-46 ; 0x2c70c Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c73a: 82 30 cpi r24, 0x02 ; 2 2c73c: 59 f3 breq .-42 ; 0x2c714 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 2c73e: 85 30 cpi r24, 0x05 ; 5 2c740: 71 f3 breq .-36 ; 0x2c71e Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 2c742: 86 30 cpi r24, 0x06 ; 6 2c744: e1 f4 brne .+56 ; 0x2c77e 2c746: 85 e0 ldi r24, 0x05 ; 5 2c748: 27 e2 ldi r18, 0x27 ; 39 2c74a: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 2c74c: 4f b7 in r20, 0x3f ; 63 2c74e: f8 94 cli 2c750: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c754: 94 60 ori r25, 0x04 ; 4 2c756: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c75a: 4f bf out 0x3f, r20 ; 63 2c75c: f9 01 movw r30, r18 2c75e: 31 97 sbiw r30, 0x01 ; 1 2c760: f1 f7 brne .-4 ; 0x2c75e delayMicroseconds(75); WRITE(BEEPER,LOW); 2c762: 4f b7 in r20, 0x3f ; 63 2c764: f8 94 cli 2c766: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c76a: 9b 7f andi r25, 0xFB ; 251 2c76c: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c770: 4f bf out 0x3f, r20 ; 63 2c772: f9 01 movw r30, r18 2c774: 31 97 sbiw r30, 0x01 ; 1 2c776: f1 f7 brne .-4 ; 0x2c774 2c778: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 2c77a: 41 f7 brne .-48 ; 0x2c74c 2c77c: 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) 2c77e: 87 30 cpi r24, 0x07 ; 7 2c780: f1 f4 brne .+60 ; 0x2c7be } } static void Sound_DoSound_Blind_Alert(void) { backlight_wake(1); 2c782: 81 e0 ldi r24, 0x01 ; 1 2c784: 0e 94 18 8c call 0x11830 ; 0x11830 2c788: 84 e1 ldi r24, 0x14 ; 20 2c78a: 23 e7 ldi r18, 0x73 ; 115 2c78c: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 2c78e: 4f b7 in r20, 0x3f ; 63 2c790: f8 94 cli 2c792: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c796: 94 60 ori r25, 0x04 ; 4 2c798: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c79c: 4f bf out 0x3f, r20 ; 63 2c79e: f9 01 movw r30, r18 2c7a0: 31 97 sbiw r30, 0x01 ; 1 2c7a2: f1 f7 brne .-4 ; 0x2c7a0 delayMicroseconds(94); WRITE(BEEPER,LOW); 2c7a4: 4f b7 in r20, 0x3f ; 63 2c7a6: f8 94 cli 2c7a8: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c7ac: 9b 7f andi r25, 0xFB ; 251 2c7ae: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c7b2: 4f bf out 0x3f, r20 ; 63 2c7b4: f9 01 movw r30, r18 2c7b6: 31 97 sbiw r30, 0x01 ; 1 2c7b8: f1 f7 brne .-4 ; 0x2c7b6 2c7ba: 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++) 2c7bc: 41 f7 brne .-48 ; 0x2c78e Sound_DoSound_Blind_Alert(); break; default: break; } } 2c7be: 08 95 ret 0002c7c0 : //! @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 ) { 2c7c0: 2f 92 push r2 2c7c2: 3f 92 push r3 2c7c4: 4f 92 push r4 2c7c6: 5f 92 push r5 2c7c8: 6f 92 push r6 2c7ca: 7f 92 push r7 2c7cc: 8f 92 push r8 2c7ce: 9f 92 push r9 2c7d0: af 92 push r10 2c7d2: bf 92 push r11 2c7d4: cf 92 push r12 2c7d6: df 92 push r13 2c7d8: ef 92 push r14 2c7da: ff 92 push r15 2c7dc: 0f 93 push r16 2c7de: 1f 93 push r17 2c7e0: cf 93 push r28 2c7e2: df 93 push r29 2c7e4: 00 d0 rcall .+0 ; 0x2c7e6 2c7e6: 00 d0 rcall .+0 ; 0x2c7e8 2c7e8: cd b7 in r28, 0x3d ; 61 2c7ea: de b7 in r29, 0x3e ; 62 2c7ec: 5c 01 movw r10, r24 2c7ee: 6c 83 std Y+4, r22 ; 0x04 2c7f0: 34 2e mov r3, r20 2c7f2: 3b 83 std Y+3, r19 ; 0x03 2c7f4: 2a 83 std Y+2, r18 ; 0x02 2c7f6: 48 01 movw r8, r16 2c7f8: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 2c7fa: 00 97 sbiw r24, 0x00 ; 0 2c7fc: 09 f0 breq .+2 ; 0x2c800 2c7fe: 51 c0 rjmp .+162 ; 0x2c8a2 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); 2c800: 87 01 movw r16, r14 2c802: 22 2d mov r18, r2 2c804: a4 01 movw r20, r8 2c806: 6a 81 ldd r22, Y+2 ; 0x02 2c808: 7b 81 ldd r23, Y+3 ; 0x03 2c80a: 83 2d mov r24, r3 2c80c: 0f 94 2f 34 call 0x2685e ; 0x2685e 2c810: d1 2c mov r13, r1 2c812: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 2c814: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2c818: 2b 01 movw r4, r22 2c81a: 3c 01 movw r6, r24 lcd_consume_click(); 2c81c: 0e 94 2d 72 call 0xe45a ; 0xe45a KEEPALIVE_STATE(PAUSED_FOR_USER); 2c820: 84 e0 ldi r24, 0x04 ; 4 2c822: 80 93 96 02 sts 0x0296, r24 ; 0x800296 2c826: de 82 std Y+6, r13 ; 0x06 2c828: cd 82 std Y+5, r12 ; 0x05 2c82a: 24 e6 ldi r18, 0x64 ; 100 2c82c: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 2c82e: 82 e3 ldi r24, 0x32 ; 50 2c830: 90 e0 ldi r25, 0x00 ; 0 2c832: 0e 94 ff 8e call 0x11dfe ; 0x11dfe if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 2c836: 3c 81 ldd r19, Y+4 ; 0x04 2c838: 31 11 cpse r19, r1 2c83a: 3a c0 rjmp .+116 ; 0x2c8b0 current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 2c83c: 80 91 37 05 lds r24, 0x0537 ; 0x800537 2c840: 90 91 38 05 lds r25, 0x0538 ; 0x800538 2c844: 00 97 sbiw r24, 0x00 ; 0 2c846: 09 f0 breq .+2 ; 0x2c84a 2c848: 42 c0 rjmp .+132 ; 0x2c8ce } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 2c84a: 0e 94 32 72 call 0xe464 ; 0xe464 2c84e: 88 23 and r24, r24 2c850: 09 f4 brne .+2 ; 0x2c854 2c852: 67 c0 rjmp .+206 ; 0x2c922 if (msg_next == NULL) { 2c854: 8d 81 ldd r24, Y+5 ; 0x05 2c856: 9e 81 ldd r25, Y+6 ; 0x06 2c858: 89 2b or r24, r25 2c85a: 09 f0 breq .+2 ; 0x2c85e 2c85c: 5e c0 rjmp .+188 ; 0x2c91a if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 2c85e: 82 e0 ldi r24, 0x02 ; 2 2c860: 80 93 96 02 sts 0x0296, r24 ; 0x800296 // 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; 2c864: 91 e0 ldi r25, 0x01 ; 1 2c866: 90 93 6e 02 sts 0x026E, r25 ; 0x80026e lcd_draw_update = 2; 2c86a: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d return current_selection; } 2c86e: 83 2d mov r24, r3 2c870: 26 96 adiw r28, 0x06 ; 6 2c872: 0f b6 in r0, 0x3f ; 63 2c874: f8 94 cli 2c876: de bf out 0x3e, r29 ; 62 2c878: 0f be out 0x3f, r0 ; 63 2c87a: cd bf out 0x3d, r28 ; 61 2c87c: df 91 pop r29 2c87e: cf 91 pop r28 2c880: 1f 91 pop r17 2c882: 0f 91 pop r16 2c884: ff 90 pop r15 2c886: ef 90 pop r14 2c888: df 90 pop r13 2c88a: cf 90 pop r12 2c88c: bf 90 pop r11 2c88e: af 90 pop r10 2c890: 9f 90 pop r9 2c892: 8f 90 pop r8 2c894: 7f 90 pop r7 2c896: 6f 90 pop r6 2c898: 5f 90 pop r5 2c89a: 4f 90 pop r4 2c89c: 3f 90 pop r3 2c89e: 2f 90 pop r2 2c8a0: 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; 2c8a2: 0f 94 80 34 call 0x26900 ; 0x26900 2c8a6: 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) { 2c8a8: 89 2b or r24, r25 2c8aa: 09 f0 breq .+2 ; 0x2c8ae 2c8ac: b3 cf rjmp .-154 ; 0x2c814 2c8ae: a8 cf rjmp .-176 ; 0x2c800 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) { 2c8b0: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2c8b4: 64 19 sub r22, r4 2c8b6: 75 09 sbc r23, r5 2c8b8: 86 09 sbc r24, r6 2c8ba: 97 09 sbc r25, r7 2c8bc: 61 33 cpi r22, 0x31 ; 49 2c8be: 75 47 sbci r23, 0x75 ; 117 2c8c0: 81 05 cpc r24, r1 2c8c2: 91 05 cpc r25, r1 2c8c4: 08 f4 brcc .+2 ; 0x2c8c8 2c8c6: ba cf rjmp .-140 ; 0x2c83c current_selection = LCD_BUTTON_TIMEOUT; 2c8c8: 33 24 eor r3, r3 2c8ca: 3a 94 dec r3 2c8cc: c8 cf rjmp .-112 ; 0x2c85e goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 2c8ce: 2d 81 ldd r18, Y+5 ; 0x05 2c8d0: 3e 81 ldd r19, Y+6 ; 0x06 2c8d2: 23 2b or r18, r19 2c8d4: f9 f4 brne .+62 ; 0x2c914 if (third_choice) { // third_choice is not nullptr, safe to dereference 2c8d6: e1 14 cp r14, r1 2c8d8: f1 04 cpc r15, r1 2c8da: b1 f0 breq .+44 ; 0x2c908 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2c8dc: 97 ff sbrs r25, 7 2c8de: 0f c0 rjmp .+30 ; 0x2c8fe 2c8e0: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 2c8e2: 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); 2c8e4: 87 01 movw r16, r14 2c8e6: 22 2d mov r18, r2 2c8e8: a4 01 movw r20, r8 2c8ea: 6a 81 ldd r22, Y+2 ; 0x02 2c8ec: 7b 81 ldd r23, Y+3 ; 0x03 2c8ee: 83 2d mov r24, r3 2c8f0: 0f 94 2f 34 call 0x2685e ; 0x2685e lcd_encoder = 0; 2c8f4: 10 92 38 05 sts 0x0538, r1 ; 0x800538 2c8f8: 10 92 37 05 sts 0x0537, r1 ; 0x800537 2c8fc: a6 cf rjmp .-180 ; 0x2c84a 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) { 2c8fe: 32 e0 ldi r19, 0x02 ; 2 2c900: 33 16 cp r3, r19 2c902: 81 f3 breq .-32 ; 0x2c8e4 // Rotating knob clockwise current_selection++; 2c904: 33 94 inc r3 2c906: ee cf rjmp .-36 ; 0x2c8e4 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2c908: 39 2e mov r3, r25 2c90a: 30 94 com r3 2c90c: 33 1c adc r3, r3 2c90e: 33 24 eor r3, r3 2c910: 33 1c adc r3, r3 2c912: e8 cf rjmp .-48 ; 0x2c8e4 } } 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); 2c914: 87 e0 ldi r24, 0x07 ; 7 2c916: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 goto exit; } else break; } } if (multi_screen) { 2c91a: c1 14 cp r12, r1 2c91c: d1 04 cpc r13, r1 2c91e: 79 f4 brne .+30 ; 0x2c93e 2c920: 84 cf rjmp .-248 ; 0x2c82a 2c922: 99 81 ldd r25, Y+1 ; 0x01 2c924: 91 50 subi r25, 0x01 ; 1 2c926: 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) { 2c928: 91 11 cpse r25, r1 2c92a: 81 cf rjmp .-254 ; 0x2c82e goto exit; } else break; } } if (multi_screen) { 2c92c: c1 14 cp r12, r1 2c92e: d1 04 cpc r13, r1 2c930: 61 f0 breq .+24 ; 0x2c94a if (msg_next == NULL) { 2c932: 2d 81 ldd r18, Y+5 ; 0x05 2c934: 3e 81 ldd r19, Y+6 ; 0x06 2c936: 23 2b or r18, r19 2c938: 11 f4 brne .+4 ; 0x2c93e 2c93a: be 82 std Y+6, r11 ; 0x06 2c93c: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 2c93e: 8d 81 ldd r24, Y+5 ; 0x05 2c940: 9e 81 ldd r25, Y+6 ; 0x06 2c942: 0f 94 80 34 call 0x26900 ; 0x26900 2c946: 9e 83 std Y+6, r25 ; 0x06 2c948: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 2c94a: 8d 81 ldd r24, Y+5 ; 0x05 2c94c: 9e 81 ldd r25, Y+6 ; 0x06 2c94e: 89 2b or r24, r25 2c950: 09 f0 breq .+2 ; 0x2c954 2c952: 6b cf rjmp .-298 ; 0x2c82a lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 2c954: 87 01 movw r16, r14 2c956: 22 2d mov r18, r2 2c958: a4 01 movw r20, r8 2c95a: 6a 81 ldd r22, Y+2 ; 0x02 2c95c: 7b 81 ldd r23, Y+3 ; 0x03 2c95e: 83 2d mov r24, r3 2c960: 0f 94 2f 34 call 0x2685e ; 0x2685e 2c964: 62 cf rjmp .-316 ; 0x2c82a 0002c966 : //! @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) { 2c966: bf 92 push r11 2c968: cf 92 push r12 2c96a: df 92 push r13 2c96c: ef 92 push r14 2c96e: ff 92 push r15 2c970: 0f 93 push r16 2c972: 1f 93 push r17 2c974: cf 93 push r28 2c976: df 93 push r29 2c978: ec 01 movw r28, r24 2c97a: d6 2e mov r13, r22 2c97c: 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); 2c97e: 89 ec ldi r24, 0xC9 ; 201 2c980: 9d e3 ldi r25, 0x3D ; 61 2c982: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2c986: 8c 01 movw r16, r24 2c988: 83 ec ldi r24, 0xC3 ; 195 2c98a: 9d e3 ldi r25, 0x3D ; 61 2c98c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2c990: 2a e0 ldi r18, 0x0A ; 10 2c992: c2 2e mov r12, r18 2c994: f1 2c mov r15, r1 2c996: e1 2c mov r14, r1 2c998: 9c 01 movw r18, r24 2c99a: 4b 2d mov r20, r11 2c99c: 6d 2d mov r22, r13 2c99e: ce 01 movw r24, r28 2c9a0: 0f 94 e0 63 call 0x2c7c0 ; 0x2c7c0 } 2c9a4: df 91 pop r29 2c9a6: cf 91 pop r28 2c9a8: 1f 91 pop r17 2c9aa: 0f 91 pop r16 2c9ac: ff 90 pop r15 2c9ae: ef 90 pop r14 2c9b0: df 90 pop r13 2c9b2: cf 90 pop r12 2c9b4: bf 90 pop r11 2c9b6: 08 95 ret 0002c9b8 : //! ---------------------- | ---------------- //! 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) { 2c9b8: af 92 push r10 2c9ba: bf 92 push r11 2c9bc: cf 92 push r12 2c9be: df 92 push r13 2c9c0: ef 92 push r14 2c9c2: ff 92 push r15 2c9c4: 0f 93 push r16 2c9c6: 1f 93 push r17 2c9c8: cf 93 push r28 2c9ca: 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); 2c9cc: 88 23 and r24, r24 2c9ce: 29 f0 breq .+10 ; 0x2c9da 2c9d0: 61 e0 ldi r22, 0x01 ; 1 2c9d2: 8f e5 ldi r24, 0x5F ; 95 2c9d4: 9f e0 ldi r25, 0x0F ; 15 2c9d6: 0f 94 7f dd call 0x3bafe ; 0x3bafe FORCE_BL_ON_START; 2c9da: 81 e0 ldi r24, 0x01 ; 1 2c9dc: 0e 94 f4 8b call 0x117e8 ; 0x117e8 while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 2c9e0: 84 e5 ldi r24, 0x54 ; 84 2c9e2: e8 2e mov r14, r24 2c9e4: 85 ea ldi r24, 0xA5 ; 165 2c9e6: f8 2e mov r15, r24 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2c9e8: 97 ed ldi r25, 0xD7 ; 215 2c9ea: c9 2e mov r12, r25 2c9ec: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2c9ee: 2c e3 ldi r18, 0x3C ; 60 2c9f0: a2 2e mov r10, r18 2c9f2: b1 2c mov r11, r1 2c9f4: 0c 2f mov r16, r28 2c9f6: 10 e0 ldi r17, 0x00 ; 0 2c9f8: 1f 92 push r1 2c9fa: cf 93 push r28 2c9fc: ff 92 push r15 2c9fe: ef 92 push r14 2ca00: 0f 94 1d dc call 0x3b83a ; 0x3b83a switch (state) { 2ca04: 0f 90 pop r0 2ca06: 0f 90 pop r0 2ca08: 0f 90 pop r0 2ca0a: 0f 90 pop r0 2ca0c: cf 30 cpi r28, 0x0F ; 15 2ca0e: a0 f7 brcc .-24 ; 0x2c9f8 2ca10: f8 01 movw r30, r16 2ca12: 88 27 eor r24, r24 2ca14: e1 5f subi r30, 0xF1 ; 241 2ca16: fa 49 sbci r31, 0x9A ; 154 2ca18: 8e 4f sbci r24, 0xFE ; 254 2ca1a: 0d 94 6b de jmp 0x3bcd6 ; 0x3bcd6 <__tablejump2__> 2ca1e: ae 3b cpi r26, 0xBE ; 190 2ca20: b0 3b cpi r27, 0xB0 ; 176 2ca22: bc 3a cpi r27, 0xAC ; 172 2ca24: 66 3b cpi r22, 0xB6 ; 182 2ca26: c4 3b cpi r28, 0xB4 ; 180 2ca28: ce 39 cpi r28, 0x9E ; 158 2ca2a: b8 3a cpi r27, 0xA8 ; 168 2ca2c: 00 3b cpi r16, 0xB0 ; 176 2ca2e: a8 3b cpi r26, 0xB8 ; 184 2ca30: 12 3b cpi r17, 0xB2 ; 178 2ca32: e4 39 cpi r30, 0x94 ; 148 2ca34: 82 3a cpi r24, 0xA2 ; 162 2ca36: c2 3a cpi r28, 0xA2 ; 162 2ca38: c8 3a cpi r28, 0xA8 ; 168 2ca3a: c8 3a cpi r28, 0xA8 ; 168 // 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; 2ca3c: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 2ca40: 8f e5 ldi r24, 0x5F ; 95 2ca42: 9f e0 ldi r25, 0x0F ; 15 2ca44: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2ca48: 82 30 cpi r24, 0x02 ; 2 2ca4a: 39 f4 brne .+14 ; 0x2ca5a // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 2ca4c: 86 ea ldi r24, 0xA6 ; 166 2ca4e: 96 e5 ldi r25, 0x56 ; 86 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)); 2ca50: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2ca54: 0f 94 07 35 call 0x26a0e ; 0x26a0e 2ca58: 0f c0 rjmp .+30 ; 0x2ca78 // 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); 2ca5a: 81 e4 ldi r24, 0x41 ; 65 2ca5c: 96 e5 ldi r25, 0x56 ; 86 2ca5e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2ca62: 40 e0 ldi r20, 0x00 ; 0 2ca64: 60 e0 ldi r22, 0x00 ; 0 2ca66: 0f 94 b3 64 call 0x2c966 ; 0x2c966 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 2ca6a: 81 11 cpse r24, r1 2ca6c: 07 c0 rjmp .+14 ; 0x2ca7c 2ca6e: 61 e0 ldi r22, 0x01 ; 1 2ca70: 8f e5 ldi r24, 0x5F ; 95 2ca72: 9f e0 ldi r25, 0x0F ; 15 2ca74: 0f 94 7f dd call 0x3bafe ; 0x3bafe state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 2ca78: c1 e0 ldi r28, 0x01 ; 1 2ca7a: bc cf rjmp .-136 ; 0x2c9f4 2ca7c: 60 e0 ldi r22, 0x00 ; 0 2ca7e: 8f e5 ldi r24, 0x5F ; 95 2ca80: 9f e0 ldi r25, 0x0F ; 15 2ca82: 0f 94 7f dd call 0x3bafe ; 0x3bafe 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); 2ca86: 10 e0 ldi r17, 0x00 ; 0 2ca88: 00 e0 ldi r16, 0x00 ; 0 end = true; break; } } FORCE_BL_ON_END; 2ca8a: 80 e0 ldi r24, 0x00 ; 0 2ca8c: 0e 94 f4 8b call 0x117e8 ; 0x117e8 const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); 2ca90: 1f 93 push r17 2ca92: 0f 93 push r16 2ca94: 8f ec ldi r24, 0xCF ; 207 2ca96: 90 e7 ldi r25, 0x70 ; 112 2ca98: 9f 93 push r25 2ca9a: 8f 93 push r24 2ca9c: 0f 94 1d dc call 0x3b83a ; 0x3b83a switch (state) { 2caa0: 0f 90 pop r0 2caa2: 0f 90 pop r0 2caa4: 0f 90 pop r0 2caa6: 0f 90 pop r0 2caa8: cd 30 cpi r28, 0x0D ; 13 2caaa: 09 f4 brne .+2 ; 0x2caae 2caac: ff c0 rjmp .+510 ; 0x2ccac 2caae: ce 30 cpi r28, 0x0E ; 14 2cab0: 09 f4 brne .+2 ; 0x2cab4 2cab2: 11 c1 rjmp .+546 ; 0x2ccd6 case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 2cab4: 80 e6 ldi r24, 0x60 ; 96 2cab6: 93 e5 ldi r25, 0x53 ; 83 FORCE_BL_ON_END; const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); switch (state) { 2cab8: cc 23 and r28, r28 2caba: 09 f4 brne .+2 ; 0x2cabe 2cabc: 0e c1 rjmp .+540 ; 0x2ccda break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 2cabe: 81 e0 ldi r24, 0x01 ; 1 2cac0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_update(2); 2cac4: 82 e0 ldi r24, 0x02 ; 2 } 2cac6: cf 91 pop r28 2cac8: 1f 91 pop r17 2caca: 0f 91 pop r16 2cacc: ff 90 pop r15 2cace: ef 90 pop r14 2cad0: df 90 pop r13 2cad2: cf 90 pop r12 2cad4: bf 90 pop r11 2cad6: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 2cad8: 0c 94 dc 6f jmp 0xdfb8 ; 0xdfb8 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2cadc: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.453> 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)) { 2cae0: 81 e0 ldi r24, 0x01 ; 1 2cae2: 0e 94 6d f8 call 0x1f0da ; 0x1f0da state = S::Selftest; 2cae6: 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)) { 2cae8: 88 23 and r24, r24 2caea: 09 f4 brne .+2 ; 0x2caee 2caec: 83 cf rjmp .-250 ; 0x2c9f4 state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 2caee: 82 e0 ldi r24, 0x02 ; 2 2caf0: 0e 94 6d f8 call 0x1f0da ; 0x1f0da // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 2caf4: 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)) { 2caf6: 88 23 and r24, r24 2caf8: 09 f4 brne .+2 ; 0x2cafc 2cafa: 7c cf rjmp .-264 ; 0x2c9f4 // 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)) { 2cafc: 84 e0 ldi r24, 0x04 ; 4 2cafe: 0e 94 6d f8 call 0x1f0da ; 0x1f0da state = S::Z; 2cb02: 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)) { 2cb04: 88 23 and r24, r24 2cb06: 09 f4 brne .+2 ; 0x2cb0a 2cb08: 75 cf rjmp .-278 ; 0x2c9f4 state = S::Z; #ifdef THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL)) { 2cb0a: 88 e0 ldi r24, 0x08 ; 8 2cb0c: 0e 94 6d f8 call 0x1f0da ; 0x1f0da state = S::ThermalModel; 2cb10: 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)) { 2cb12: 88 23 and r24, r24 2cb14: 09 f4 brne .+2 ; 0x2cb18 2cb16: 6e cf rjmp .-292 ; 0x2c9f4 state = S::ThermalModel; #endif //THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) { 2cb18: 80 e1 ldi r24, 0x10 ; 16 2cb1a: 0e 94 6d f8 call 0x1f0da ; 0x1f0da state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 2cb1e: 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)) { 2cb20: 81 11 cpse r24, r1 2cb22: 68 cf rjmp .-304 ; 0x2c9f4 state = S::IsFil; 2cb24: c6 e0 ldi r28, 0x06 ; 6 2cb26: 66 cf rjmp .-308 ; 0x2c9f4 // all required steps completed, finish successfully state = S::Finish; } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 2cb28: 88 ef ldi r24, 0xF8 ; 248 2cb2a: 95 e5 ldi r25, 0x55 ; 85 2cb2c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cb30: 0f 94 07 35 call 0x26a0e ; 0x26a0e wizard_event = lcd_selftest(); 2cb34: 0f 94 77 19 call 0x232ee ; 0x232ee 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); 2cb38: 81 11 cpse r24, r1 2cb3a: 9e cf rjmp .-196 ; 0x2ca78 } 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); 2cb3c: ce e0 ldi r28, 0x0E ; 14 2cb3e: 5a cf rjmp .-332 ; 0x2c9f4 break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 2cb40: 8a eb ldi r24, 0xBA ; 186 2cb42: 95 e5 ldi r25, 0x55 ; 85 2cb44: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cb48: 0f 94 07 35 call 0x26a0e ; 0x26a0e wizard_event = gcode_M45(false, 0); 2cb4c: 80 e0 ldi r24, 0x00 ; 0 2cb4e: 0e 94 95 e6 call 0x1cd2a ; 0x1cd2a 2cb52: f2 cf rjmp .-28 ; 0x2cb38 state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 2cb54: 82 e9 ldi r24, 0x92 ; 146 2cb56: 95 e5 ldi r25, 0x55 ; 85 2cb58: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cb5c: 0f 94 07 35 call 0x26a0e ; 0x26a0e lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 2cb60: 84 e6 ldi r24, 0x64 ; 100 2cb62: 95 e5 ldi r25, 0x55 ; 85 2cb64: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cb68: 0f 94 07 35 call 0x26a0e ; 0x26a0e lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 2cb6c: 84 e4 ldi r24, 0x44 ; 68 2cb6e: 95 e5 ldi r25, 0x55 ; 85 2cb70: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cb74: 0f 94 07 35 call 0x26a0e ; 0x26a0e wizard_event = gcode_M45(true, 0); 2cb78: 81 e0 ldi r24, 0x01 ; 1 2cb7a: 0e 94 95 e6 call 0x1cd2a ; 0x1cd2a if (!wizard_event) { 2cb7e: 88 23 and r24, r24 2cb80: e9 f2 breq .-70 ; 0x2cb3c state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 2cb82: 60 e0 ldi r22, 0x00 ; 0 2cb84: 70 e0 ldi r23, 0x00 ; 0 2cb86: 88 ed ldi r24, 0xD8 ; 216 2cb88: 91 e4 ldi r25, 0x41 ; 65 2cb8a: 0e 94 95 6f call 0xdf2a ; 0xdf2a if(!MMU2::mmu2.Enabled()) { 2cb8e: 80 91 98 13 lds r24, 0x1398 ; 0x801398 2cb92: 81 30 cpi r24, 0x01 ; 1 2cb94: 09 f4 brne .+2 ; 0x2cb98 2cb96: 70 cf rjmp .-288 ; 0x2ca78 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2cb98: d0 92 6e 0e sts 0x0E6E, r13 ; 0x800e6e 2cb9c: c0 92 6d 0e sts 0x0E6D, r12 ; 0x800e6d //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)); 2cba0: 8f e1 ldi r24, 0x1F ; 31 2cba2: 95 e5 ldi r25, 0x55 ; 85 2cba4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cba8: 0f 94 80 34 call 0x26900 ; 0x26900 wait_preheat(); 2cbac: 0f 94 8d 34 call 0x2691a ; 0x2691a unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 2cbb0: 60 e0 ldi r22, 0x00 ; 0 2cbb2: 70 e0 ldi r23, 0x00 ; 0 2cbb4: cb 01 movw r24, r22 2cbb6: 0f 94 d2 15 call 0x22ba4 ; 0x22ba4 lcd_wizard_load(); // load filament 2cbba: 0f 94 70 35 call 0x26ae0 ; 0x26ae0 2cbbe: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 2cbc2: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d 2cbc6: 58 cf rjmp .-336 ; 0x2ca78 state = S::Restore; } break; #ifdef THERMAL_MODEL case S::ThermalModel: lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_CAL)); 2cbc8: 8f ed ldi r24, 0xDF ; 223 2cbca: 94 e5 ldi r25, 0x54 ; 84 2cbcc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cbd0: 0f 94 07 35 call 0x26a0e ; 0x26a0e lcd_commands_type = LcdCommands::ThermalModel; 2cbd4: 85 e0 ldi r24, 0x05 ; 5 2cbd6: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 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); 2cbda: 05 e0 ldi r16, 0x05 ; 5 2cbdc: 10 e0 ldi r17, 0x00 ; 0 2cbde: 55 cf rjmp .-342 ; 0x2ca8a 2cbe0: d0 92 6e 0e sts 0x0E6E, r13 ; 0x800e6e 2cbe4: c0 92 6d 0e sts 0x0E6D, r12 ; 0x800e6d resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2cbe8: b0 92 6c 0e sts 0x0E6C, r11 ; 0x800e6c 2cbec: a0 92 6b 0e sts 0x0E6B, r10 ; 0x800e6b #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); 2cbf0: 89 ec ldi r24, 0xC9 ; 201 2cbf2: 94 e5 ldi r25, 0x54 ; 84 2cbf4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cbf8: 41 e0 ldi r20, 0x01 ; 1 2cbfa: 60 e0 ldi r22, 0x00 ; 0 2cbfc: 0f 94 b3 64 call 0x2c966 ; 0x2c966 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 2cc00: 88 23 and r24, r24 2cc02: 09 f1 breq .+66 ; 0x2cc46 state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 2cc04: 80 91 98 13 lds r24, 0x1398 ; 0x801398 else state = S::Preheat; 2cc08: 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; 2cc0a: 81 30 cpi r24, 0x01 ; 1 2cc0c: 09 f0 breq .+2 ; 0x2cc10 2cc0e: f2 ce rjmp .-540 ; 0x2c9f4 2cc10: c8 e0 ldi r28, 0x08 ; 8 2cc12: f0 ce rjmp .-544 ; 0x2c9f4 else state = S::Preheat; } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 2cc14: 20 e0 ldi r18, 0x00 ; 0 2cc16: 41 e0 ldi r20, 0x01 ; 1 2cc18: 70 e0 ldi r23, 0x00 ; 0 2cc1a: 60 e0 ldi r22, 0x00 ; 0 2cc1c: 8c ed ldi r24, 0xDC ; 220 2cc1e: 99 e3 ldi r25, 0x39 ; 57 2cc20: 0f 94 04 cf call 0x39e08 ; 0x39e08 lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 2cc24: 88 e8 ldi r24, 0x88 ; 136 2cc26: 94 e5 ldi r25, 0x54 ; 84 2cc28: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cc2c: 0f 94 07 35 call 0x26a0e ; 0x26a0e 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); 2cc30: 07 e0 ldi r16, 0x07 ; 7 2cc32: 10 e0 ldi r17, 0x00 ; 0 2cc34: 2a cf rjmp .-428 ; 0x2ca8a 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(); 2cc36: 0f 94 8d 34 call 0x2691a ; 0x2691a lcd_wizard_load(); 2cc3a: 0f 94 70 35 call 0x26ae0 ; 0x26ae0 state = S::Lay1CalHot; 2cc3e: cb e0 ldi r28, 0x0B ; 11 2cc40: d9 ce rjmp .-590 ; 0x2c9f4 break; case S::LoadFilCold: lcd_wizard_load(); 2cc42: 0f 94 70 35 call 0x26ae0 ; 0x26ae0 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; 2cc46: ca e0 ldi r28, 0x0A ; 10 2cc48: d5 ce rjmp .-598 ; 0x2c9f4 case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 2cc4a: 81 e0 ldi r24, 0x01 ; 1 2cc4c: 0f 94 52 35 call 0x26aa4 ; 0x26aa4 menu_goto(lcd_v2_calibration, 0, true); 2cc50: 20 e0 ldi r18, 0x00 ; 0 2cc52: 41 e0 ldi r20, 0x01 ; 1 2cc54: 70 e0 ldi r23, 0x00 ; 0 2cc56: 60 e0 ldi r22, 0x00 ; 0 2cc58: 82 ef ldi r24, 0xF2 ; 242 2cc5a: 9a e3 ldi r25, 0x3A ; 58 2cc5c: 0f 94 04 cf call 0x39e08 ; 0x39e08 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); 2cc60: 0a e0 ldi r16, 0x0A ; 10 2cc62: 10 e0 ldi r17, 0x00 ; 0 2cc64: 12 cf rjmp .-476 ; 0x2ca8a 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); 2cc66: 80 e0 ldi r24, 0x00 ; 0 2cc68: 0f 94 52 35 call 0x26aa4 ; 0x26aa4 lcd_commands_type = LcdCommands::Layer1Cal; 2cc6c: 84 e0 ldi r24, 0x04 ; 4 2cc6e: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 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); 2cc72: 0b e0 ldi r16, 0x0B ; 11 2cc74: 10 e0 ldi r17, 0x00 ; 0 2cc76: 09 cf rjmp .-494 ; 0x2ca8a 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); 2cc78: 85 e3 ldi r24, 0x35 ; 53 2cc7a: 94 e5 ldi r25, 0x54 ; 84 2cc7c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cc80: 41 e0 ldi r20, 0x01 ; 1 2cc82: 60 e0 ldi r22, 0x00 ; 0 2cc84: 0f 94 b3 64 call 0x2c966 ; 0x2c966 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 2cc88: 81 11 cpse r24, r1 2cc8a: 07 c0 rjmp .+14 ; 0x2cc9a { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 2cc8c: 85 e0 ldi r24, 0x05 ; 5 2cc8e: 94 e5 ldi r25, 0x54 ; 84 2cc90: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cc94: 0f 94 07 35 call 0x26a0e ; 0x26a0e 2cc98: d6 cf rjmp .-84 ; 0x2cc46 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 2cc9a: 8f e9 ldi r24, 0x9F ; 159 2cc9c: 93 e5 ldi r25, 0x53 ; 83 2cc9e: d8 ce rjmp .-592 ; 0x2ca50 2cca0: 60 e0 ldi r22, 0x00 ; 0 2cca2: 8f e5 ldi r24, 0x5F ; 95 2cca4: 9f e0 ldi r25, 0x0F ; 15 2cca6: 0f 94 7f dd call 0x3bafe ; 0x3bafe 2ccaa: ef ce rjmp .-546 ; 0x2ca8a msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 2ccac: 81 e4 ldi r24, 0x41 ; 65 2ccae: 93 e5 ldi r25, 0x53 ; 83 2ccb0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2ccb4: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2ccb6: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.453> case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); lcd_reset_alert_level(); lcd_setstatuspgm(MSG_WELCOME); 2ccba: 8e e0 ldi r24, 0x0E ; 14 2ccbc: 91 e7 ldi r25, 0x71 ; 113 2ccbe: 0f 94 0c 0b call 0x21618 ; 0x21618 lcd_return_to_status(); 2ccc2: 0f 94 4e 26 call 0x24c9c ; 0x24c9c default: // exiting for later re-entry break; } if (msg) { 2ccc6: 01 15 cp r16, r1 2ccc8: 11 05 cpc r17, r1 2ccca: 09 f4 brne .+2 ; 0x2ccce 2cccc: f8 ce rjmp .-528 ; 0x2cabe lcd_show_fullscreen_message_and_wait_P(msg); 2ccce: c8 01 movw r24, r16 2ccd0: 0f 94 07 35 call 0x26a0e ; 0x26a0e 2ccd4: f4 ce rjmp .-536 ; 0x2cabe lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 2ccd6: 8f ed ldi r24, 0xDF ; 223 2ccd8: 92 e5 ldi r25, 0x52 ; 82 2ccda: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2ccde: 8c 01 movw r16, r24 2cce0: f2 cf rjmp .-28 ; 0x2ccc6 0002cce2 : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 2cce2: cf 93 push r28 2cce4: 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); 2cce6: 82 ec ldi r24, 0xC2 ; 194 2cce8: 92 e5 ldi r25, 0x52 ; 82 2ccea: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2ccee: 41 e0 ldi r20, 0x01 ; 1 2ccf0: 4c 27 eor r20, r28 2ccf2: 60 e0 ldi r22, 0x00 ; 0 2ccf4: 0f 94 b3 64 call 0x2c966 ; 0x2c966 2ccf8: 91 e0 ldi r25, 0x01 ; 1 2ccfa: 81 11 cpse r24, r1 2ccfc: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 2ccfe: c9 17 cp r28, r25 2cd00: 59 f0 breq .+22 ; 0x2cd18 lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 2cd02: 88 e9 ldi r24, 0x98 ; 152 2cd04: 92 e5 ldi r25, 0x52 ; 82 2cd06: cc 23 and r28, r28 2cd08: 11 f0 breq .+4 ; 0x2cd0e 2cd0a: 8c e1 ldi r24, 0x1C ; 28 2cd0c: 98 e4 ldi r25, 0x48 ; 72 2cd0e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 } #endif //STEEL_SHEET } 2cd12: 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)); 2cd14: 0d 94 07 35 jmp 0x26a0e ; 0x26a0e } #endif //STEEL_SHEET } 2cd18: cf 91 pop r28 2cd1a: 08 95 ret 0002cd1c : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 2cd1c: cf 93 push r28 2cd1e: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 2cd20: 8f e6 ldi r24, 0x6F ; 111 2cd22: 92 e5 ldi r25, 0x52 ; 82 2cd24: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cd28: 40 e0 ldi r20, 0x00 ; 0 2cd2a: 6c 2f mov r22, r28 2cd2c: 0f 94 b3 64 call 0x2c966 ; 0x2c966 if (result == LCD_LEFT_BUTTON_CHOICE) { 2cd30: 81 11 cpse r24, r1 2cd32: 03 c0 rjmp .+6 ; 0x2cd3a lcd_mesh_calibration_z(); } } 2cd34: 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(); 2cd36: 0d 94 90 26 jmp 0x24d20 ; 0x24d20 } } 2cd3a: cf 91 pop r28 2cd3c: 08 95 ret 0002cd3e : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 2cd3e: 8f e1 ldi r24, 0x1F ; 31 2cd40: 0e 94 6d f8 call 0x1f0da ; 0x1f0da 2cd44: 81 11 cpse r24, r1 2cd46: 06 c0 rjmp .+12 ; 0x2cd54 // 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); 2cd48: 8f e1 ldi r24, 0x1F ; 31 2cd4a: 0e 94 33 e6 call 0x1cc66 ; 0x1cc66 lcd_wizard(WizState::Run); 2cd4e: 80 e0 ldi r24, 0x00 ; 0 2cd50: 0d 94 dc 64 jmp 0x2c9b8 ; 0x2c9b8 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); 2cd54: 8d ec ldi r24, 0xCD ; 205 2cd56: 9f e4 ldi r25, 0x4F ; 79 2cd58: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cd5c: 41 e0 ldi r20, 0x01 ; 1 2cd5e: 60 e0 ldi r22, 0x00 ; 0 2cd60: 0f 94 b3 64 call 0x2c966 ; 0x2c966 } if (result) { 2cd64: 88 23 and r24, r24 2cd66: 81 f3 breq .-32 ; 0x2cd48 calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 2cd68: 0f 94 4e 26 call 0x24c9c ; 0x24c9c lcd_update_enable(true); 2cd6c: 81 e0 ldi r24, 0x01 ; 1 2cd6e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_update(2); 2cd72: 82 e0 ldi r24, 0x02 ; 2 2cd74: 0c 94 dc 6f jmp 0xdfb8 ; 0xdfb8 0002cd78 : } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { 2cd78: cf 93 push r28 2cd7a: c8 2f mov r28, r24 if (!lang_select(lang)) 2cd7c: 0e 94 69 73 call 0xe6d2 ; 0xe6d2 2cd80: 81 11 cpse r24, r1 2cd82: 37 c0 rjmp .+110 ; 0x2cdf2 { if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_COPY_SEL_LANG), false, LCD_LEFT_BUTTON_CHOICE) == LCD_LEFT_BUTTON_CHOICE) 2cd84: 87 e4 ldi r24, 0x47 ; 71 2cd86: 9f e4 ldi r25, 0x4F ; 79 2cd88: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cd8c: 40 e0 ldi r20, 0x00 ; 0 2cd8e: 60 e0 ldi r22, 0x00 ; 0 2cd90: 0f 94 b3 64 call 0x2c966 ; 0x2c966 2cd94: 81 11 cpse r24, r1 2cd96: 20 c0 rjmp .+64 ; 0x2cdd8 #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 2cd98: 0e 94 1e 73 call 0xe63c ; 0xe63c if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 2cd9c: c2 30 cpi r28, 0x02 ; 2 2cd9e: e0 f0 brcs .+56 ; 0x2cdd8 2cda0: 8c 17 cp r24, r28 2cda2: d0 f0 brcs .+52 ; 0x2cdd8 softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 2cda4: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 2cda6: 8a ea ldi r24, 0xAA ; 170 2cda8: 95 e5 ldi r25, 0x55 ; 85 2cdaa: dc 01 movw r26, r24 2cdac: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7e3> 2cdb0: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7e4> 2cdb4: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7e5> 2cdb8: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7e6> boot_app_flags = BOOT_APP_FLG_USER0; 2cdbc: 80 e8 ldi r24, 0x80 ; 128 2cdbe: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7e2> boot_copy_size = 0; 2cdc2: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x7e0> 2cdc6: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x7df> bootapp_reboot_user0(lang << 3); 2cdca: cc 0f add r28, r28 2cdcc: cc 0f add r28, r28 2cdce: cc 0f add r28, r28 boot_reserved = reserved; 2cdd0: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x7e1> // bootapp_print_vars(); softReset(); 2cdd4: 0e 94 81 68 call 0xd102 ; 0xd102 lang_boot_update_start(lang); lcd_update_enable(true); 2cdd8: 81 e0 ldi r24, 0x01 ; 1 2cdda: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 menu_goto(lcd_language_menu, 0, true, true); 2cdde: 21 e0 ldi r18, 0x01 ; 1 2cde0: 41 e0 ldi r20, 0x01 ; 1 2cde2: 70 e0 ldi r23, 0x00 ; 0 2cde4: 60 e0 ldi r22, 0x00 ; 0 2cde6: 84 e7 ldi r24, 0x74 ; 116 2cde8: 9a e3 ldi r25, 0x3A ; 58 2cdea: 0f 94 04 cf call 0x39e08 ; 0x39e08 2cdee: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout } } 2cdf2: cf 91 pop r28 2cdf4: 08 95 ret 0002cdf6 : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 2cdf6: cf 93 push r28 MENU_BEGIN(); 2cdf8: 0f 94 da ce call 0x39db4 ; 0x39db4 2cdfc: 10 92 15 05 sts 0x0515, r1 ; 0x800515 2ce00: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2ce04: 84 30 cpi r24, 0x04 ; 4 2ce06: 08 f0 brcs .+2 ; 0x2ce0a 2ce08: 4a c0 rjmp .+148 ; 0x2ce9e 2ce0a: 10 92 18 05 sts 0x0518, r1 ; 0x800518 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 2ce0e: 0e 94 52 72 call 0xe4a4 ; 0xe4a4 2ce12: 88 23 and r24, r24 2ce14: 31 f0 breq .+12 ; 0x2ce22 2ce16: 88 eb ldi r24, 0xB8 ; 184 2ce18: 9d e3 ldi r25, 0x3D ; 61 2ce1a: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2ce1e: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 2ce22: 8e e6 ldi r24, 0x6E ; 110 2ce24: 95 e6 ldi r25, 0x65 ; 101 2ce26: 0e 94 68 72 call 0xe4d0 ; 0xe4d0 2ce2a: 0f 94 88 ce call 0x39d10 ; 0x39d10 2ce2e: 88 23 and r24, r24 2ce30: 21 f0 breq .+8 ; 0x2ce3a { menu_setlang(0); 2ce32: 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(); } 2ce34: 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); 2ce36: 0d 94 bc 66 jmp 0x2cd78 ; 0x2cd78 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(); 2ce3a: 0e 94 1e 73 call 0xe63c ; 0xe63c 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 2ce3e: 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 2ce40: 82 30 cpi r24, 0x02 ; 2 2ce42: 51 f4 brne .+20 ; 0x2ce58 2ce44: 0e 94 3f 72 call 0xe47e ; 0xe47e { if (menu_item_text_P(lang_get_name_by_code(lang_get_code(1)))) 2ce48: 0e 94 68 72 call 0xe4d0 ; 0xe4d0 2ce4c: 0f 94 88 ce call 0x39d10 ; 0x39d10 2ce50: 88 23 and r24, r24 2ce52: 81 f0 breq .+32 ; 0x2ce74 { menu_setlang(1); 2ce54: 81 e0 ldi r24, 0x01 ; 1 2ce56: ee cf rjmp .-36 ; 0x2ce34 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)))) 2ce58: 8c 2f mov r24, r28 2ce5a: 0e 94 cf 72 call 0xe59e ; 0xe59e 2ce5e: 0e 94 68 72 call 0xe4d0 ; 0xe4d0 2ce62: 0f 94 88 ce call 0x39d10 ; 0x39d10 2ce66: 88 23 and r24, r24 2ce68: 11 f0 breq .+4 ; 0x2ce6e { menu_setlang(i); 2ce6a: 8c 2f mov r24, r28 2ce6c: e3 cf rjmp .-58 ; 0x2ce34 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 2ce6e: cf 5f subi r28, 0xFF ; 255 2ce70: c8 30 cpi r28, 0x08 ; 8 2ce72: 91 f7 brne .-28 ; 0x2ce58 return; } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); 2ce74: 81 e6 ldi r24, 0x61 ; 97 2ce76: 9f e4 ldi r25, 0x4F ; 79 2ce78: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2ce7c: 62 ec ldi r22, 0xC2 ; 194 2ce7e: 7b e3 ldi r23, 0x3B ; 59 2ce80: 0f 94 08 d1 call 0x3a210 ; 0x3a210 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 2ce84: 0f 94 ae ce call 0x39d5c ; 0x39d5c #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 2ce88: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2ce8c: 8f 5f subi r24, 0xFF ; 255 2ce8e: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2ce92: 80 91 17 05 lds r24, 0x0517 ; 0x800517 2ce96: 8f 5f subi r24, 0xFF ; 255 2ce98: 80 93 17 05 sts 0x0517, r24 ; 0x800517 2ce9c: b1 cf rjmp .-158 ; 0x2ce00 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 2ce9e: cf 91 pop r28 2cea0: 08 95 ret 0002cea2 : } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { 2cea2: cf 93 push r28 2cea4: df 93 push r29 MENU_BEGIN(); 2cea6: 0f 94 da ce call 0x39db4 ; 0x39db4 2ceaa: 10 92 15 05 sts 0x0515, r1 ; 0x800515 2ceae: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2ceb2: 84 30 cpi r24, 0x04 ; 4 2ceb4: 58 f5 brcc .+86 ; 0x2cf0c 2ceb6: 10 92 18 05 sts 0x0518, r1 ; 0x800518 uint8_t cnt = lang_get_count(); 2ceba: 0e 94 1e 73 call 0xe63c ; 0xe63c 2cebe: d8 2f mov r29, r24 MENU_ITEM_BACK_P(_T(MSG_SELECT_LANGUAGE)); //Back to previous Menu 2cec0: 81 e5 ldi r24, 0x51 ; 81 2cec2: 98 e5 ldi r25, 0x58 ; 88 2cec4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cec8: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a for (uint8_t i = 8; i < cnt; i++) //all community languages 2cecc: c8 e0 ldi r28, 0x08 ; 8 2cece: cd 17 cp r28, r29 2ced0: 80 f4 brcc .+32 ; 0x2cef2 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 2ced2: 8c 2f mov r24, r28 2ced4: 0e 94 cf 72 call 0xe59e ; 0xe59e 2ced8: 0e 94 68 72 call 0xe4d0 ; 0xe4d0 2cedc: 0f 94 88 ce call 0x39d10 ; 0x39d10 2cee0: 88 23 and r24, r24 2cee2: 29 f0 breq .+10 ; 0x2ceee { menu_setlang(i); 2cee4: 8c 2f mov r24, r28 return; } MENU_END(); } 2cee6: df 91 pop r29 2cee8: 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); 2ceea: 0d 94 bc 66 jmp 0x2cd78 ; 0x2cd78 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 2ceee: cf 5f subi r28, 0xFF ; 255 2cef0: ee cf rjmp .-36 ; 0x2cece if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) { menu_setlang(i); return; } MENU_END(); 2cef2: 0f 94 ae ce call 0x39d5c ; 0x39d5c #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { MENU_BEGIN(); 2cef6: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2cefa: 8f 5f subi r24, 0xFF ; 255 2cefc: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2cf00: 80 91 17 05 lds r24, 0x0517 ; 0x800517 2cf04: 8f 5f subi r24, 0xFF ; 255 2cf06: 80 93 17 05 sts 0x0517, r24 ; 0x800517 2cf0a: d1 cf rjmp .-94 ; 0x2ceae { menu_setlang(i); return; } MENU_END(); } 2cf0c: df 91 pop r29 2cf0e: cf 91 pop r28 2cf10: 08 95 ret 0002cf12 : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 2cf12: cf 92 push r12 2cf14: ef 92 push r14 2cf16: ff 92 push r15 2cf18: 0f 93 push r16 2cf1a: 1f 93 push r17 2cf1c: cf 93 push r28 2cf1e: 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); 2cf20: 82 ea ldi r24, 0xA2 ; 162 2cf22: 9c e4 ldi r25, 0x4C ; 76 2cf24: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cf28: 7c 01 movw r14, r24 2cf2a: 89 ec ldi r24, 0xC9 ; 201 2cf2c: 9d e3 ldi r25, 0x3D ; 61 2cf2e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cf32: 8c 01 movw r16, r24 2cf34: 83 ec ldi r24, 0xC3 ; 195 2cf36: 9d e3 ldi r25, 0x3D ; 61 2cf38: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cf3c: ec 01 movw r28, r24 2cf3e: 87 e7 ldi r24, 0x77 ; 119 2cf40: 9c e4 ldi r25, 0x4C ; 76 2cf42: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2cf46: 28 e0 ldi r18, 0x08 ; 8 2cf48: c2 2e mov r12, r18 2cf4a: 9e 01 movw r18, r28 2cf4c: 40 e0 ldi r20, 0x00 ; 0 2cf4e: 60 e0 ldi r22, 0x00 ; 0 2cf50: 0f 94 e0 63 call 0x2c7c0 ; 0x2c7c0 while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 2cf54: 81 30 cpi r24, 0x01 ; 1 2cf56: 29 f4 brne .+10 ; 0x2cf62 load_filament_final_feed(); 2cf58: 0e 94 c8 65 call 0xcb90 ; 0xcb90 st_synchronize(); 2cf5c: 0f 94 27 58 call 0x2b04e ; 0x2b04e 2cf60: df cf rjmp .-66 ; 0x2cf20 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) { 2cf62: 82 30 cpi r24, 0x02 ; 2 2cf64: 61 f4 brne .+24 ; 0x2cf7e unload_filament(FILAMENTCHANGE_FINALRETRACT); 2cf66: 60 e0 ldi r22, 0x00 ; 0 2cf68: 70 e0 ldi r23, 0x00 ; 0 2cf6a: cb 01 movw r24, r22 } } 2cf6c: df 91 pop r29 2cf6e: cf 91 pop r28 2cf70: 1f 91 pop r17 2cf72: 0f 91 pop r16 2cf74: ff 90 pop r15 2cf76: ef 90 pop r14 2cf78: 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); 2cf7a: 0d 94 d2 15 jmp 0x22ba4 ; 0x22ba4 } } 2cf7e: df 91 pop r29 2cf80: cf 91 pop r28 2cf82: 1f 91 pop r17 2cf84: 0f 91 pop r16 2cf86: ff 90 pop r15 2cf88: ef 90 pop r14 2cf8a: cf 90 pop r12 2cf8c: 08 95 ret 0002cf8e : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 2cf8e: 0f 93 push r16 2cf90: 1f 93 push r17 2cf92: cf 93 push r28 2cf94: df 93 push r29 2cf96: 8c 01 movw r16, r24 2cf98: eb 01 movw r28, r22 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2cf9a: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e 2cf9e: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 2cfa2: 0f 94 de 21 call 0x243bc ; 0x243bc 2cfa6: 81 11 cpse r24, r1 2cfa8: 04 c0 rjmp .+8 ; 0x2cfb2 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2cfaa: d0 93 6c 0e sts 0x0E6C, r29 ; 0x800e6c 2cfae: c0 93 6b 0e sts 0x0E6B, r28 ; 0x800e6b { const FilamentAction action = eFilamentAction; 2cfb2: c0 91 a7 03 lds r28, 0x03A7 ; 0x8003a7 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 2cfb6: 87 ef ldi r24, 0xF7 ; 247 2cfb8: 8c 0f add r24, r28 2cfba: 82 30 cpi r24, 0x02 ; 2 2cfbc: f8 f4 brcc .+62 ; 0x2cffc { lcd_return_to_status(); 2cfbe: 0f 94 4e 26 call 0x24c9c ; 0x24c9c if (action == FilamentAction::Lay1Cal) 2cfc2: ca 30 cpi r28, 0x0A ; 10 2cfc4: 41 f4 brne .+16 ; 0x2cfd6 { lcd_commands_type = LcdCommands::Layer1Cal; 2cfc6: 84 e0 ldi r24, 0x04 ; 4 2cfc8: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 } menu_back(); clearFilamentAction(); } } } 2cfcc: df 91 pop r29 2cfce: cf 91 pop r28 2cfd0: 1f 91 pop r17 2cfd2: 0f 91 pop r16 2cfd4: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 2cfd6: 60 e0 ldi r22, 0x00 ; 0 2cfd8: 70 e0 ldi r23, 0x00 ; 0 2cfda: 80 e2 ldi r24, 0x20 ; 32 2cfdc: 91 e4 ldi r25, 0x41 ; 65 2cfde: 0e 94 95 6f call 0xdf2a ; 0xdf2a if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2cfe2: 8f e5 ldi r24, 0x5F ; 95 2cfe4: 9f e0 ldi r25, 0x0F ; 15 2cfe6: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2cfea: 88 23 and r24, r24 2cfec: 79 f3 breq .-34 ; 0x2cfcc lcd_wizard(WizState::LoadFilHot); 2cfee: 89 e0 ldi r24, 0x09 ; 9 } menu_back(); clearFilamentAction(); } } } 2cff0: df 91 pop r29 2cff2: cf 91 pop r28 2cff4: 1f 91 pop r17 2cff6: 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); 2cff8: 0d 94 dc 64 jmp 0x2c9b8 ; 0x2c9b8 2cffc: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 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) 2d000: 80 91 61 06 lds r24, 0x0661 ; 0x800661 2d004: 81 11 cpse r24, r1 2d006: 12 c0 rjmp .+36 ; 0x2d02c 2d008: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 2d00c: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 2d010: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 2d014: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 2d018: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 2d01c: 60 1b sub r22, r16 2d01e: 71 0b sbc r23, r17 2d020: 6c 5f subi r22, 0xFC ; 252 2d022: 7f 4f sbci r23, 0xFF ; 255 2d024: 69 30 cpi r22, 0x09 ; 9 2d026: 71 05 cpc r23, r1 2d028: 08 f0 brcs .+2 ; 0x2d02c 2d02a: 60 c0 rjmp .+192 ; 0x2d0ec { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 2d02c: c1 50 subi r28, 0x01 ; 1 2d02e: c8 30 cpi r28, 0x08 ; 8 2d030: 88 f5 brcc .+98 ; 0x2d094 2d032: ec 2f mov r30, r28 2d034: f0 e0 ldi r31, 0x00 ; 0 2d036: 88 27 eor r24, r24 2d038: ef 5d subi r30, 0xDF ; 223 2d03a: f7 49 sbci r31, 0x97 ; 151 2d03c: 8e 4f sbci r24, 0xFE ; 254 2d03e: 0d 94 6b de jmp 0x3bcd6 ; 0x3bcd6 <__tablejump2__> 2d042: 40 3b cpi r20, 0xB0 ; 176 2d044: 40 3b cpi r20, 0xB0 ; 176 2d046: 40 3b cpi r20, 0xB0 ; 176 2d048: ea 3a cpi r30, 0xAA ; 170 2d04a: 0e 3a cpi r16, 0xAE ; 174 2d04c: d8 3a cpi r29, 0xA8 ; 168 2d04e: ec 39 cpi r30, 0x9C ; 156 2d050: 9e 3b cpi r25, 0xBE ; 190 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 2d052: cd ea ldi r28, 0xAD ; 173 2d054: d8 ed ldi r29, 0xD8 ; 216 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2d056: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 2d05a: 88 23 and r24, r24 2d05c: 29 f0 breq .+10 ; 0x2d068 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 2d05e: 82 e0 ldi r24, 0x02 ; 2 2d060: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 bFilamentWaitingFlag = false; 2d064: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f } if (filamentActionMenu) { 2d068: 20 97 sbiw r28, 0x00 ; 0 2d06a: 09 f4 brne .+2 ; 0x2d06e 2d06c: af cf rjmp .-162 ; 0x2cfcc // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 2d06e: 0f 94 14 2e call 0x25c28 ; 0x25c28 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 2d072: 61 e0 ldi r22, 0x01 ; 1 2d074: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 2d076: df 91 pop r29 2d078: cf 91 pop r28 2d07a: 1f 91 pop r17 2d07c: 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); 2d07e: 0d 94 47 d0 jmp 0x3a08e ; 0x3a08e switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 2d082: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 2d086: 88 23 and r24, r24 2d088: 41 f0 breq .+16 ; 0x2d09a 2d08a: 61 e0 ldi r22, 0x01 ; 1 2d08c: 8e e8 ldi r24, 0x8E ; 142 2d08e: 9a e3 ldi r25, 0x3A ; 58 2d090: 0f 94 47 d0 call 0x3a08e ; 0x3a08e // 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; 2d094: d0 e0 ldi r29, 0x00 ; 0 2d096: c0 e0 ldi r28, 0x00 ; 0 2d098: de cf rjmp .-68 ; 0x2d056 case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 2d09a: 0f 94 14 2e call 0x25c28 ; 0x25c28 if (eFilamentAction == FilamentAction::AutoLoad) { 2d09e: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2d0a2: 82 30 cpi r24, 0x02 ; 2 2d0a4: 19 f4 brne .+6 ; 0x2d0ac // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2d0a6: 81 e0 ldi r24, 0x01 ; 1 2d0a8: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } if (eFilamentAction == FilamentAction::Load) 2d0ac: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2d0b0: 81 30 cpi r24, 0x01 ; 1 2d0b2: 31 f4 brne .+12 ; 0x2d0c0 enquecommand_P(MSG_M701); // load filament 2d0b4: 61 e0 ldi r22, 0x01 ; 1 2d0b6: 84 e2 ldi r24, 0x24 ; 36 2d0b8: 90 e7 ldi r25, 0x70 ; 112 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 2d0ba: 0e 94 cb 89 call 0x11396 ; 0x11396 2d0be: ea cf rjmp .-44 ; 0x2d094 eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 2d0c0: 83 30 cpi r24, 0x03 ; 3 2d0c2: 41 f7 brne .-48 ; 0x2d094 enquecommand_P(MSG_M702); // unload filament 2d0c4: 61 e0 ldi r22, 0x01 ; 1 2d0c6: 8c eb ldi r24, 0xBC ; 188 2d0c8: 9c e6 ldi r25, 0x6C ; 108 2d0ca: f7 cf rjmp .-18 ; 0x2d0ba break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 2d0cc: c7 e2 ldi r28, 0x27 ; 39 2d0ce: d8 ed ldi r29, 0xD8 ; 216 2d0d0: c2 cf rjmp .-124 ; 0x2d056 break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 2d0d2: 0f 94 14 2e call 0x25c28 ; 0x25c28 MMU2::mmu2.unload(); 2d0d6: 0f 94 37 a0 call 0x3406e ; 0x3406e // 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(); 2d0da: 0f 94 ef 35 call 0x26bde ; 0x26bde 2d0de: da cf rjmp .-76 ; 0x2d094 break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 2d0e0: c5 ea ldi r28, 0xA5 ; 165 2d0e2: d8 ed ldi r29, 0xD8 ; 216 2d0e4: b8 cf rjmp .-144 ; 0x2d056 break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 2d0e6: cd e9 ldi r28, 0x9D ; 157 2d0e8: d8 ed ldi r29, 0xD8 ; 216 2d0ea: b5 cf rjmp .-150 ; 0x2d056 menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 2d0ec: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 2d0f0: 88 23 and r24, r24 2d0f2: 21 f0 breq .+8 ; 0x2d0fc 2d0f4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2d0f8: 88 23 and r24, r24 2d0fa: 71 f1 breq .+92 ; 0x2d158 // 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; 2d0fc: 81 e0 ldi r24, 0x01 ; 1 2d0fe: 80 93 5f 06 sts 0x065F, r24 ; 0x80065f // also force-enable lcd_draw_update (might be 0 when called from outside a menu) lcd_draw_update = 1; 2d102: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_clear(); 2d106: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 3, _T(MSG_CANCEL)); 2d10a: 83 ec ldi r24, 0xC3 ; 195 2d10c: 9f e4 ldi r25, 0x4F ; 79 2d10e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2d112: ac 01 movw r20, r24 2d114: 63 e0 ldi r22, 0x03 ; 3 2d116: 80 e0 ldi r24, 0x00 ; 0 2d118: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(0, 1); 2d11c: 61 e0 ldi r22, 0x01 ; 1 2d11e: 80 e0 ldi r24, 0x00 ; 0 2d120: 0e 94 15 70 call 0xe02a ; 0xe02a switch (eFilamentAction) 2d124: e0 91 a7 03 lds r30, 0x03A7 ; 0x8003a7 2d128: e1 50 subi r30, 0x01 ; 1 2d12a: e8 30 cpi r30, 0x08 ; 8 2d12c: a8 f4 brcc .+42 ; 0x2d158 2d12e: f0 e0 ldi r31, 0x00 ; 0 2d130: 88 27 eor r24, r24 2d132: e2 56 subi r30, 0x62 ; 98 2d134: f7 49 sbci r31, 0x97 ; 151 2d136: 8e 4f sbci r24, 0xFE ; 254 2d138: 0d 94 6b de jmp 0x3bcd6 ; 0x3bcd6 <__tablejump2__> 2d13c: c0 3b cpi r28, 0xB0 ; 176 2d13e: c0 3b cpi r28, 0xB0 ; 176 2d140: 96 3b cpi r25, 0xB6 ; 182 2d142: c0 3b cpi r28, 0xB0 ; 176 2d144: 96 3b cpi r25, 0xB6 ; 182 2d146: 82 3b cpi r24, 0xB2 ; 178 2d148: 18 3a cpi r17, 0xA8 ; 168 2d14a: c0 3b cpi r28, 0xB0 ; 176 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 2d14c: 87 e5 ldi r24, 0x57 ; 87 2d14e: 9c e4 ldi r25, 0x4C ; 76 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2d150: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2d154: 0e 94 00 70 call 0xe000 ; 0xe000 // handled earlier break; } } if (bFilamentWaitingFlag) { 2d158: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 2d15c: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 2d15e: 0f 94 3b 2e call 0x25c76 ; 0x25c76 } if (lcd_clicked()) 2d162: 0e 94 32 72 call 0xe464 ; 0xe464 2d166: 88 23 and r24, r24 2d168: 09 f4 brne .+2 ; 0x2d16c 2d16a: 30 cf rjmp .-416 ; 0x2cfcc { // Filament action canceled while preheating bFilamentWaitingFlag = false; 2d16c: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f if (!bFilamentPreheatState) 2d170: 80 91 60 06 lds r24, 0x0660 ; 0x800660 2d174: 81 11 cpse r24, r1 2d176: 0e c0 rjmp .+28 ; 0x2d194 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2d178: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 2d17c: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 2d180: 0e 94 ba 68 call 0xd174 ; 0xd174 2d184: 81 11 cpse r24, r1 2d186: 04 c0 rjmp .+8 ; 0x2d190 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2d188: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 2d18c: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b menu_back(); 2d190: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 } menu_back(); 2d194: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 clearFilamentAction(); } } } 2d198: df 91 pop r29 2d19a: cf 91 pop r28 2d19c: 1f 91 pop r17 2d19e: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 2d1a0: 0d 94 ef 35 jmp 0x26bde ; 0x26bde 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)); 2d1a4: 80 e4 ldi r24, 0x40 ; 64 2d1a6: 9c e4 ldi r25, 0x4C ; 76 2d1a8: d3 cf rjmp .-90 ; 0x2d150 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 2d1aa: 8a e2 ldi r24, 0x2A ; 42 2d1ac: 9c e4 ldi r25, 0x4C ; 76 2d1ae: d0 cf rjmp .-96 ; 0x2d150 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2d1b0: 86 e1 ldi r24, 0x16 ; 22 2d1b2: 9c e4 ldi r25, 0x4C ; 76 2d1b4: cd cf rjmp .-102 ; 0x2d150 0002d1b6 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2d1b6: 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) ); 2d1ba: 40 91 98 13 lds r20, 0x1398 ; 0x801398 2d1be: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d 2d1c2: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e 2d1c6: 41 30 cpi r20, 0x01 ; 1 2d1c8: 59 f0 breq .+22 ; 0x2d1e0 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() 2d1ca: 10 92 61 06 sts 0x0661, r1 ; 0x800661 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 2d1ce: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 2d1d2: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 2d1d6: 28 17 cp r18, r24 2d1d8: 39 07 cpc r19, r25 2d1da: 5c f4 brge .+22 ; 0x2d1f2 bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 2d1dc: 0d 94 f2 35 jmp 0x26be4 ; 0x26be4 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() 2d1e0: 90 91 6e 13 lds r25, 0x136E ; 0x80136e 2d1e4: 91 11 cpse r25, r1 2d1e6: f1 cf rjmp .-30 ; 0x2d1ca && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2d1e8: 86 50 subi r24, 0x06 ; 6 2d1ea: 82 30 cpi r24, 0x02 ; 2 2d1ec: 70 f7 brcc .-36 ; 0x2d1ca 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() 2d1ee: 40 93 61 06 sts 0x0661, r20 ; 0x800661 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 2d1f2: 81 e0 ldi r24, 0x01 ; 1 2d1f4: 80 93 60 06 sts 0x0660, r24 ; 0x800660 mFilamentItem(target_temperature[0], target_temperature_bed); 2d1f8: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 2d1fc: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 2d200: c9 01 movw r24, r18 2d202: 0f 94 c7 67 call 0x2cf8e ; 0x2cf8e bFilamentSkipPreheat = false; // Reset flag 2d206: 10 92 61 06 sts 0x0661, r1 ; 0x800661 } else { lcd_generic_preheat_menu(); } } 2d20a: 08 95 ret 0002d20c : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 2d20c: 82 e0 ldi r24, 0x02 ; 2 2d20e: 0d 94 db 68 jmp 0x2d1b6 ; 0x2d1b6 0002d212 : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 2d212: 81 e0 ldi r24, 0x01 ; 1 2d214: 0d 94 db 68 jmp 0x2d1b6 ; 0x2d1b6 0002d218 : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 2d218: 83 e0 ldi r24, 0x03 ; 3 2d21a: 0d 94 db 68 jmp 0x2d1b6 ; 0x2d1b6 0002d21e : mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 2d21e: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 2d222: 6c e3 ldi r22, 0x3C ; 60 2d224: 70 e0 ldi r23, 0x00 ; 0 2d226: 87 ed ldi r24, 0xD7 ; 215 2d228: 90 e0 ldi r25, 0x00 ; 0 2d22a: 0d 94 c7 67 jmp 0x2cf8e ; 0x2cf8e 0002d22e : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 2d22e: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 2d232: 65 e5 ldi r22, 0x55 ; 85 2d234: 70 e0 ldi r23, 0x00 ; 0 2d236: 86 ee ldi r24, 0xE6 ; 230 2d238: 90 e0 ldi r25, 0x00 ; 0 2d23a: 0d 94 c7 67 jmp 0x2cf8e ; 0x2cf8e 0002d23e : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 2d23e: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 2d242: 69 e6 ldi r22, 0x69 ; 105 2d244: 70 e0 ldi r23, 0x00 ; 0 2d246: 84 e0 ldi r24, 0x04 ; 4 2d248: 91 e0 ldi r25, 0x01 ; 1 2d24a: 0d 94 c7 67 jmp 0x2cf8e ; 0x2cf8e 0002d24e : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 2d24e: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 2d252: 6e e6 ldi r22, 0x6E ; 110 2d254: 70 e0 ldi r23, 0x00 ; 0 2d256: 83 e1 ldi r24, 0x13 ; 19 2d258: 91 e0 ldi r25, 0x01 ; 1 2d25a: 0d 94 c7 67 jmp 0x2cf8e ; 0x2cf8e 0002d25e : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 2d25e: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 2d262: 6b e4 ldi r22, 0x4B ; 75 2d264: 70 e0 ldi r23, 0x00 ; 0 2d266: 87 ed ldi r24, 0xD7 ; 215 2d268: 90 e0 ldi r25, 0x00 ; 0 2d26a: 0d 94 c7 67 jmp 0x2cf8e ; 0x2cf8e 0002d26e : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 2d26e: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 2d272: 6a e5 ldi r22, 0x5A ; 90 2d274: 70 e0 ldi r23, 0x00 ; 0 2d276: 83 e1 ldi r24, 0x13 ; 19 2d278: 91 e0 ldi r25, 0x01 ; 1 2d27a: 0d 94 c7 67 jmp 0x2cf8e ; 0x2cf8e 0002d27e : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 2d27e: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 2d282: 64 e6 ldi r22, 0x64 ; 100 2d284: 70 e0 ldi r23, 0x00 ; 0 2d286: 8f ef ldi r24, 0xFF ; 255 2d288: 90 e0 ldi r25, 0x00 ; 0 2d28a: 0d 94 c7 67 jmp 0x2cf8e ; 0x2cf8e 0002d28e : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 2d28e: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 2d292: 64 e6 ldi r22, 0x64 ; 100 2d294: 70 e0 ldi r23, 0x00 ; 0 2d296: 8c ed ldi r24, 0xDC ; 220 2d298: 90 e0 ldi r25, 0x00 ; 0 2d29a: 0d 94 c7 67 jmp 0x2cf8e ; 0x2cf8e 0002d29e : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 2d29e: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 2d2a2: 64 e6 ldi r22, 0x64 ; 100 2d2a4: 70 e0 ldi r23, 0x00 ; 0 2d2a6: 8e ef ldi r24, 0xFE ; 254 2d2a8: 90 e0 ldi r25, 0x00 ; 0 2d2aa: 0d 94 c7 67 jmp 0x2cf8e ; 0x2cf8e 0002d2ae : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 2d2ae: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 2d2b2: 62 e3 ldi r22, 0x32 ; 50 2d2b4: 70 e0 ldi r23, 0x00 ; 0 2d2b6: 80 ef ldi r24, 0xF0 ; 240 2d2b8: 90 e0 ldi r25, 0x00 ; 0 2d2ba: 0d 94 c7 67 jmp 0x2cf8e ; 0x2cf8e 0002d2be : } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2d2be: 80 e0 ldi r24, 0x00 ; 0 2d2c0: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 #include "xflash_dump.h" static void lcd_dump_memory() { lcd_beeper_quick_feedback(); xfdump_dump(); 2d2c4: 0e 94 8c e3 call 0x1c718 ; 0x1c718 lcd_return_to_status(); 2d2c8: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 0002d2cc : } 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){ 2d2cc: cf 92 push r12 2d2ce: df 92 push r13 2d2d0: ef 92 push r14 2d2d2: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 2d2d4: 41 11 cpse r20, r1 2d2d6: 04 c0 rjmp .+8 ; 0x2d2e0 2d2d8: 20 91 e1 04 lds r18, 0x04E1 ; 0x8004e1 2d2dc: 22 30 cpi r18, 0x02 ; 2 2d2de: d1 f0 breq .+52 ; 0x2d314 2d2e0: 9b 01 movw r18, r22 2d2e2: 6c 01 movw r12, r24 2d2e4: f1 2c mov r15, r1 2d2e6: e1 2c mov r14, r1 if(!tone_) { 2d2e8: 67 2b or r22, r23 2d2ea: c9 f4 brne .+50 ; 0x2d31e WRITE(BEEPER, HIGH); 2d2ec: 9f b7 in r25, 0x3f ; 63 2d2ee: f8 94 cli 2d2f0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d2f4: 84 60 ori r24, 0x04 ; 4 2d2f6: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d2fa: 9f bf out 0x3f, r25 ; 63 _delay(ms); 2d2fc: c7 01 movw r24, r14 2d2fe: b6 01 movw r22, r12 2d300: 0f 94 8d 3c call 0x2791a ; 0x2791a 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); 2d304: 9f b7 in r25, 0x3f ; 63 2d306: f8 94 cli 2d308: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d30c: 8b 7f andi r24, 0xFB ; 251 2d30e: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d312: 9f bf out 0x3f, r25 ; 63 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 2d314: ff 90 pop r15 2d316: ef 90 pop r14 2d318: df 90 pop r13 2d31a: cf 90 pop r12 2d31c: 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); 2d31e: 22 0f add r18, r18 2d320: 33 1f adc r19, r19 2d322: 50 e0 ldi r21, 0x00 ; 0 2d324: 40 e0 ldi r20, 0x00 ; 0 2d326: 60 e0 ldi r22, 0x00 ; 0 2d328: 74 e2 ldi r23, 0x24 ; 36 2d32a: 84 ef ldi r24, 0xF4 ; 244 2d32c: 90 e0 ldi r25, 0x00 ; 0 2d32e: 0f 94 4c de call 0x3bc98 ; 0x3bc98 <__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; 2d332: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 2d334: 21 15 cp r18, r1 2d336: 31 05 cpc r19, r1 2d338: 81 e0 ldi r24, 0x01 ; 1 2d33a: 48 07 cpc r20, r24 2d33c: 51 05 cpc r21, r1 2d33e: 44 f0 brlt .+16 ; 0x2d350 pwm_freq /= 64; // Increase prescaler to 64 2d340: 86 e0 ldi r24, 0x06 ; 6 2d342: 56 95 lsr r21 2d344: 47 95 ror r20 2d346: 37 95 ror r19 2d348: 27 95 ror r18 2d34a: 8a 95 dec r24 2d34c: d1 f7 brne .-12 ; 0x2d342 prescalarbits = 0b011; 2d34e: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 2d350: 21 50 subi r18, 0x01 ; 1 2d352: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 2d354: 4f b7 in r20, 0x3f ; 63 2d356: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 2d358: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2d35c: 88 7f andi r24, 0xF8 ; 248 2d35e: 89 2b or r24, r25 2d360: 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); 2d364: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2d368: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d36c: 26 9f mul r18, r22 2d36e: c0 01 movw r24, r0 2d370: 27 9f mul r18, r23 2d372: 90 0d add r25, r0 2d374: 36 9f mul r19, r22 2d376: 90 0d add r25, r0 2d378: 11 24 eor r1, r1 2d37a: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d37e: 6f ef ldi r22, 0xFF ; 255 2d380: 70 e0 ldi r23, 0x00 ; 0 2d382: 51 ff sbrs r21, 1 2d384: 04 c0 rjmp .+8 ; 0x2d38e 2d386: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2d38a: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d38e: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 2d392: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d396: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 2d39a: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d39e: 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); 2d3a2: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d3a6: 83 60 ori r24, 0x03 ; 3 2d3a8: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2d3ac: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 2d3ae: c7 01 movw r24, r14 2d3b0: b6 01 movw r22, r12 2d3b2: 0f 94 8d 3c call 0x2791a ; 0x2791a } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 2d3b6: 2f b7 in r18, 0x3f ; 63 2d3b8: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 2d3ba: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2d3be: 88 7f andi r24, 0xF8 ; 248 2d3c0: 85 60 ori r24, 0x05 ; 5 2d3c2: 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); 2d3c6: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2d3ca: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d3ce: 3f ef ldi r19, 0xFF ; 255 2d3d0: 34 9f mul r19, r20 2d3d2: c0 01 movw r24, r0 2d3d4: 35 9f mul r19, r21 2d3d6: 90 0d add r25, r0 2d3d8: 11 24 eor r1, r1 2d3da: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d3de: 6f ef ldi r22, 0xFF ; 255 2d3e0: 70 e0 ldi r23, 0x00 ; 0 2d3e2: 31 ff sbrs r19, 1 2d3e4: 04 c0 rjmp .+8 ; 0x2d3ee 2d3e6: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2d3ea: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d3ee: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 2d3f2: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d3f6: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 2d3fa: 8f ef ldi r24, 0xFF ; 255 2d3fc: 90 e0 ldi r25, 0x00 ; 0 2d3fe: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d402: 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)); 2d406: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d40a: 8c 7f andi r24, 0xFC ; 252 2d40c: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2d410: 2f bf out 0x3f, r18 ; 63 2d412: 78 cf rjmp .-272 ; 0x2d304 0002d414 : /// 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() { 2d414: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 2d416: c0 91 e1 04 lds r28, 0x04E1 ; 0x8004e1 2d41a: c2 30 cpi r28, 0x02 ; 2 2d41c: 59 f1 breq .+86 ; 0x2d474 // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 2d41e: c1 30 cpi r28, 0x01 ; 1 2d420: 69 f4 brne .+26 ; 0x2d43c if (bFirst) return; 2d422: 80 91 6f 05 lds r24, 0x056F ; 0x80056f <_ZL6bFirst.lto_priv.512> 2d426: 81 11 cpse r24, r1 2d428: 25 c0 rjmp .+74 ; 0x2d474 Sound_MakeCustom(80, 0, false); 2d42a: 40 e0 ldi r20, 0x00 ; 0 2d42c: 70 e0 ldi r23, 0x00 ; 0 2d42e: 60 e0 ldi r22, 0x00 ; 0 2d430: 80 e5 ldi r24, 0x50 ; 80 2d432: 90 e0 ldi r25, 0x00 ; 0 2d434: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc bFirst = true; 2d438: c0 93 6f 05 sts 0x056F, r28 ; 0x80056f <_ZL6bFirst.lto_priv.512> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 2d43c: 60 ed ldi r22, 0xD0 ; 208 2d43e: 77 e0 ldi r23, 0x07 ; 7 2d440: 8c e6 ldi r24, 0x6C ; 108 2d442: 95 e0 ldi r25, 0x05 ; 5 2d444: 0f 94 e0 3e call 0x27dc0 ; 0x27dc0 ::expired_cont(unsigned short)> 2d448: 88 23 and r24, r24 2d44a: a1 f0 breq .+40 ; 0x2d474 beep_timer.start(); 2d44c: 8c e6 ldi r24, 0x6C ; 108 2d44e: 95 e0 ldi r25, 0x05 ; 5 2d450: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 2d454: 80 91 e1 04 lds r24, 0x04E1 ; 0x8004e1 2d458: 81 11 cpse r24, r1 2d45a: 08 c0 rjmp .+16 ; 0x2d46c Sound_MakeCustom(80, 0, false); 2d45c: 40 e0 ldi r20, 0x00 ; 0 2d45e: 70 e0 ldi r23, 0x00 ; 0 2d460: 60 e0 ldi r22, 0x00 ; 0 2d462: 80 e5 ldi r24, 0x50 ; 80 2d464: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 2d466: 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); 2d468: 0d 94 66 69 jmp 0x2d2cc ; 0x2d2cc } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2d46c: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 2d46e: 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); 2d470: 0d 94 7a 63 jmp 0x2c6f4 ; 0x2c6f4 } } #endif // BEEPER > 0 } 2d474: cf 91 pop r28 2d476: 08 95 ret 0002d478 : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 2d478: 82 30 cpi r24, 0x02 ; 2 2d47a: b9 f0 breq .+46 ; 0x2d4aa 2d47c: 83 30 cpi r24, 0x03 ; 3 2d47e: e9 f0 breq .+58 ; 0x2d4ba 2d480: 81 30 cpi r24, 0x01 ; 1 2d482: 59 f0 breq .+22 ; 0x2d49a 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; 2d484: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d488: 61 30 cpi r22, 0x01 ; 1 2d48a: 29 f4 brne .+10 ; 0x2d496 2d48c: 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; 2d48e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif } asm("nop"); 2d492: 00 00 nop } 2d494: 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; 2d496: 8e 7f andi r24, 0xFE ; 254 2d498: fa cf rjmp .-12 ; 0x2d48e case 1: if (dir == INVERT_Y_DIR) PORTL |= 2; else PORTL &= ~2; break; 2d49a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d49e: 61 11 cpse r22, r1 2d4a0: 02 c0 rjmp .+4 ; 0x2d4a6 2d4a2: 82 60 ori r24, 0x02 ; 2 2d4a4: f4 cf rjmp .-24 ; 0x2d48e 2d4a6: 8d 7f andi r24, 0xFD ; 253 2d4a8: f2 cf rjmp .-28 ; 0x2d48e case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 2d4aa: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d4ae: 61 30 cpi r22, 0x01 ; 1 2d4b0: 11 f4 brne .+4 ; 0x2d4b6 2d4b2: 84 60 ori r24, 0x04 ; 4 2d4b4: ec cf rjmp .-40 ; 0x2d48e 2d4b6: 8b 7f andi r24, 0xFB ; 251 2d4b8: ea cf rjmp .-44 ; 0x2d48e case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 2d4ba: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d4be: 61 11 cpse r22, r1 2d4c0: 02 c0 rjmp .+4 ; 0x2d4c6 2d4c2: 80 64 ori r24, 0x40 ; 64 2d4c4: e4 cf rjmp .-56 ; 0x2d48e 2d4c6: 8f 7b andi r24, 0xBF ; 191 2d4c8: e2 cf rjmp .-60 ; 0x2d48e 0002d4ca : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 2d4ca: cf 93 push r28 if (cacheDirty_) { 2d4cc: 80 91 77 0e lds r24, 0x0E77 ; 0x800e77 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 2d4d0: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 2d4d2: 88 23 and r24, r24 2d4d4: a1 f0 breq .+40 ; 0x2d4fe if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 2d4d6: 40 91 6f 0e lds r20, 0x0E6F ; 0x800e6f 2d4da: 50 91 70 0e lds r21, 0x0E70 ; 0x800e70 2d4de: 60 91 71 0e lds r22, 0x0E71 ; 0x800e71 2d4e2: 70 91 72 0e lds r23, 0x0E72 ; 0x800e72 2d4e6: 2b e7 ldi r18, 0x7B ; 123 2d4e8: 3e e0 ldi r19, 0x0E ; 14 2d4ea: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 2d4ee: 90 91 79 0e lds r25, 0x0E79 ; 0x800e79 2d4f2: 0f 94 02 a6 call 0x34c04 ; 0x34c04 2d4f6: c8 2f mov r28, r24 2d4f8: 81 11 cpse r24, r1 2d4fa: 04 c0 rjmp .+8 ; 0x2d504 cacheDirty_ = 0; } return true; fail: return false; 2d4fc: c0 e0 ldi r28, 0x00 ; 0 } 2d4fe: 8c 2f mov r24, r28 2d500: cf 91 pop r28 2d502: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 2d504: 40 91 73 0e lds r20, 0x0E73 ; 0x800e73 2d508: 50 91 74 0e lds r21, 0x0E74 ; 0x800e74 2d50c: 60 91 75 0e lds r22, 0x0E75 ; 0x800e75 2d510: 70 91 76 0e lds r23, 0x0E76 ; 0x800e76 2d514: 41 15 cp r20, r1 2d516: 51 05 cpc r21, r1 2d518: 61 05 cpc r22, r1 2d51a: 71 05 cpc r23, r1 2d51c: 91 f0 breq .+36 ; 0x2d542 if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 2d51e: 2b e7 ldi r18, 0x7B ; 123 2d520: 3e e0 ldi r19, 0x0E ; 14 2d522: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 2d526: 90 91 79 0e lds r25, 0x0E79 ; 0x800e79 2d52a: 0f 94 02 a6 call 0x34c04 ; 0x34c04 2d52e: 88 23 and r24, r24 2d530: 29 f3 breq .-54 ; 0x2d4fc goto fail; } cacheMirrorBlock_ = 0; 2d532: 10 92 73 0e sts 0x0E73, r1 ; 0x800e73 2d536: 10 92 74 0e sts 0x0E74, r1 ; 0x800e74 2d53a: 10 92 75 0e sts 0x0E75, r1 ; 0x800e75 2d53e: 10 92 76 0e sts 0x0E76, r1 ; 0x800e76 } cacheDirty_ = 0; 2d542: 10 92 77 0e sts 0x0E77, r1 ; 0x800e77 2d546: db cf rjmp .-74 ; 0x2d4fe 0002d548 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 2d548: cf 92 push r12 2d54a: df 92 push r13 2d54c: ef 92 push r14 2d54e: ff 92 push r15 2d550: cf 93 push r28 2d552: 6b 01 movw r12, r22 2d554: 7c 01 movw r14, r24 2d556: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 2d558: 80 91 6f 0e lds r24, 0x0E6F ; 0x800e6f 2d55c: 90 91 70 0e lds r25, 0x0E70 ; 0x800e70 2d560: a0 91 71 0e lds r26, 0x0E71 ; 0x800e71 2d564: b0 91 72 0e lds r27, 0x0E72 ; 0x800e72 2d568: 8c 15 cp r24, r12 2d56a: 9d 05 cpc r25, r13 2d56c: ae 05 cpc r26, r14 2d56e: bf 05 cpc r27, r15 2d570: 01 f1 breq .+64 ; 0x2d5b2 if (!cacheFlush()) goto fail; 2d572: 0f 94 65 6a call 0x2d4ca ; 0x2d4ca 2d576: 81 11 cpse r24, r1 2d578: 08 c0 rjmp .+16 ; 0x2d58a } if (dirty) cacheDirty_ = true; return true; fail: return false; 2d57a: c0 e0 ldi r28, 0x00 ; 0 } 2d57c: 8c 2f mov r24, r28 2d57e: cf 91 pop r28 2d580: ff 90 pop r15 2d582: ef 90 pop r14 2d584: df 90 pop r13 2d586: cf 90 pop r12 2d588: 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; 2d58a: 2b e7 ldi r18, 0x7B ; 123 2d58c: 3e e0 ldi r19, 0x0E ; 14 2d58e: b7 01 movw r22, r14 2d590: a6 01 movw r20, r12 2d592: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 2d596: 90 91 79 0e lds r25, 0x0E79 ; 0x800e79 2d59a: 0f 94 66 a6 call 0x34ccc ; 0x34ccc 2d59e: 88 23 and r24, r24 2d5a0: 61 f3 breq .-40 ; 0x2d57a cacheBlockNumber_ = blockNumber; 2d5a2: c0 92 6f 0e sts 0x0E6F, r12 ; 0x800e6f 2d5a6: d0 92 70 0e sts 0x0E70, r13 ; 0x800e70 2d5aa: e0 92 71 0e sts 0x0E71, r14 ; 0x800e71 2d5ae: f0 92 72 0e sts 0x0E72, r15 ; 0x800e72 } if (dirty) cacheDirty_ = true; 2d5b2: cc 23 and r28, r28 2d5b4: 21 f0 breq .+8 ; 0x2d5be 2d5b6: 81 e0 ldi r24, 0x01 ; 1 2d5b8: 80 93 77 0e sts 0x0E77, r24 ; 0x800e77 2d5bc: df cf rjmp .-66 ; 0x2d57c return true; 2d5be: c1 e0 ldi r28, 0x01 ; 1 2d5c0: dd cf rjmp .-70 ; 0x2d57c 0002d5c2 : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 2d5c2: 4f 92 push r4 2d5c4: 5f 92 push r5 2d5c6: 6f 92 push r6 2d5c8: 7f 92 push r7 2d5ca: 8f 92 push r8 2d5cc: 9f 92 push r9 2d5ce: af 92 push r10 2d5d0: bf 92 push r11 2d5d2: cf 92 push r12 2d5d4: df 92 push r13 2d5d6: ef 92 push r14 2d5d8: ff 92 push r15 2d5da: 0f 93 push r16 2d5dc: 1f 93 push r17 2d5de: cf 93 push r28 2d5e0: df 93 push r29 2d5e2: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 2d5e4: 42 30 cpi r20, 0x02 ; 2 2d5e6: 51 05 cpc r21, r1 2d5e8: 61 05 cpc r22, r1 2d5ea: 71 05 cpc r23, r1 2d5ec: 90 f4 brcc .+36 ; 0x2d612 // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 2d5ee: 80 e0 ldi r24, 0x00 ; 0 } 2d5f0: df 91 pop r29 2d5f2: cf 91 pop r28 2d5f4: 1f 91 pop r17 2d5f6: 0f 91 pop r16 2d5f8: ff 90 pop r15 2d5fa: ef 90 pop r14 2d5fc: df 90 pop r13 2d5fe: cf 90 pop r12 2d600: bf 90 pop r11 2d602: af 90 pop r10 2d604: 9f 90 pop r9 2d606: 8f 90 pop r8 2d608: 7f 90 pop r7 2d60a: 6f 90 pop r6 2d60c: 5f 90 pop r5 2d60e: 4f 90 pop r4 2d610: 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; 2d612: 89 85 ldd r24, Y+9 ; 0x09 2d614: 9a 85 ldd r25, Y+10 ; 0x0a 2d616: ab 85 ldd r26, Y+11 ; 0x0b 2d618: bc 85 ldd r27, Y+12 ; 0x0c 2d61a: 01 96 adiw r24, 0x01 ; 1 2d61c: a1 1d adc r26, r1 2d61e: b1 1d adc r27, r1 2d620: 84 17 cp r24, r20 2d622: 95 07 cpc r25, r21 2d624: a6 07 cpc r26, r22 2d626: b7 07 cpc r27, r23 2d628: 10 f3 brcs .-60 ; 0x2d5ee tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 2d62a: 8f 89 ldd r24, Y+23 ; 0x17 2d62c: 80 31 cpi r24, 0x10 ; 16 2d62e: c9 f5 brne .+114 ; 0x2d6a2 lba = fatStartBlock_ + (cluster >> 8); 2d630: 85 2e mov r8, r21 2d632: 96 2e mov r9, r22 2d634: a7 2e mov r10, r23 2d636: bb 24 eor r11, r11 2d638: 8b 89 ldd r24, Y+19 ; 0x13 2d63a: 9c 89 ldd r25, Y+20 ; 0x14 2d63c: ad 89 ldd r26, Y+21 ; 0x15 2d63e: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2d640: 88 0e add r8, r24 2d642: 99 1e adc r9, r25 2d644: aa 1e adc r10, r26 2d646: bb 1e adc r11, r27 2d648: 28 01 movw r4, r16 2d64a: 39 01 movw r6, r18 2d64c: 6a 01 movw r12, r20 2d64e: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 2d650: 41 e0 ldi r20, 0x01 ; 1 2d652: c5 01 movw r24, r10 2d654: b4 01 movw r22, r8 2d656: 0f 94 a4 6a call 0x2d548 ; 0x2d548 2d65a: 88 23 and r24, r24 2d65c: 41 f2 breq .-112 ; 0x2d5ee // store entry if (fatType_ == 16) { 2d65e: 9f 89 ldd r25, Y+23 ; 0x17 2d660: 90 31 cpi r25, 0x10 ; 16 2d662: 81 f5 brne .+96 ; 0x2d6c4 cacheBuffer_.fat16[cluster & 0XFF] = value; 2d664: dd 24 eor r13, r13 2d666: ee 24 eor r14, r14 2d668: ff 24 eor r15, r15 2d66a: f6 01 movw r30, r12 2d66c: ee 0f add r30, r30 2d66e: ff 1f adc r31, r31 2d670: e5 58 subi r30, 0x85 ; 133 2d672: f1 4f sbci r31, 0xF1 ; 241 2d674: 11 83 std Z+1, r17 ; 0x01 2d676: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 2d678: 9a 89 ldd r25, Y+18 ; 0x12 2d67a: 92 30 cpi r25, 0x02 ; 2 2d67c: 08 f4 brcc .+2 ; 0x2d680 2d67e: b8 cf rjmp .-144 ; 0x2d5f0 2d680: 4d 81 ldd r20, Y+5 ; 0x05 2d682: 5e 81 ldd r21, Y+6 ; 0x06 2d684: 6f 81 ldd r22, Y+7 ; 0x07 2d686: 78 85 ldd r23, Y+8 ; 0x08 2d688: 84 0e add r8, r20 2d68a: 95 1e adc r9, r21 2d68c: a6 1e adc r10, r22 2d68e: b7 1e adc r11, r23 2d690: 80 92 73 0e sts 0x0E73, r8 ; 0x800e73 2d694: 90 92 74 0e sts 0x0E74, r9 ; 0x800e74 2d698: a0 92 75 0e sts 0x0E75, r10 ; 0x800e75 2d69c: b0 92 76 0e sts 0x0E76, r11 ; 0x800e76 2d6a0: a7 cf rjmp .-178 ; 0x2d5f0 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2d6a2: 80 32 cpi r24, 0x20 ; 32 2d6a4: 09 f0 breq .+2 ; 0x2d6a8 2d6a6: a3 cf rjmp .-186 ; 0x2d5ee lba = fatStartBlock_ + (cluster >> 7); 2d6a8: 8b 89 ldd r24, Y+19 ; 0x13 2d6aa: 9c 89 ldd r25, Y+20 ; 0x14 2d6ac: ad 89 ldd r26, Y+21 ; 0x15 2d6ae: be 89 ldd r27, Y+22 ; 0x16 2d6b0: 4a 01 movw r8, r20 2d6b2: 5b 01 movw r10, r22 2d6b4: e7 e0 ldi r30, 0x07 ; 7 2d6b6: b6 94 lsr r11 2d6b8: a7 94 ror r10 2d6ba: 97 94 ror r9 2d6bc: 87 94 ror r8 2d6be: ea 95 dec r30 2d6c0: d1 f7 brne .-12 ; 0x2d6b6 2d6c2: be cf rjmp .-132 ; 0x2d640 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 2d6c4: e8 94 clt 2d6c6: c7 f8 bld r12, 7 2d6c8: dd 24 eor r13, r13 2d6ca: ee 24 eor r14, r14 2d6cc: ff 24 eor r15, r15 2d6ce: f6 01 movw r30, r12 2d6d0: ee 0f add r30, r30 2d6d2: ff 1f adc r31, r31 2d6d4: ee 0f add r30, r30 2d6d6: ff 1f adc r31, r31 2d6d8: e5 58 subi r30, 0x85 ; 133 2d6da: f1 4f sbci r31, 0xF1 ; 241 2d6dc: 40 82 st Z, r4 2d6de: 51 82 std Z+1, r5 ; 0x01 2d6e0: 62 82 std Z+2, r6 ; 0x02 2d6e2: 73 82 std Z+3, r7 ; 0x03 2d6e4: c9 cf rjmp .-110 ; 0x2d678 0002d6e6 : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 2d6e6: cf 92 push r12 2d6e8: df 92 push r13 2d6ea: ef 92 push r14 2d6ec: ff 92 push r15 2d6ee: 0f 93 push r16 2d6f0: 1f 93 push r17 2d6f2: cf 93 push r28 2d6f4: df 93 push r29 2d6f6: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 2d6f8: 81 85 ldd r24, Z+9 ; 0x09 2d6fa: 92 85 ldd r25, Z+10 ; 0x0a 2d6fc: a3 85 ldd r26, Z+11 ; 0x0b 2d6fe: b4 85 ldd r27, Z+12 ; 0x0c 2d700: 01 96 adiw r24, 0x01 ; 1 2d702: a1 1d adc r26, r1 2d704: b1 1d adc r27, r1 2d706: 84 17 cp r24, r20 2d708: 95 07 cpc r25, r21 2d70a: a6 07 cpc r26, r22 2d70c: b7 07 cpc r27, r23 2d70e: 50 f4 brcc .+20 ; 0x2d724 *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 2d710: 80 e0 ldi r24, 0x00 ; 0 } 2d712: df 91 pop r29 2d714: cf 91 pop r28 2d716: 1f 91 pop r17 2d718: 0f 91 pop r16 2d71a: ff 90 pop r15 2d71c: ef 90 pop r14 2d71e: df 90 pop r13 2d720: cf 90 pop r12 2d722: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 2d724: 87 89 ldd r24, Z+23 ; 0x17 2d726: 80 31 cpi r24, 0x10 ; 16 2d728: a9 f5 brne .+106 ; 0x2d794 lba = fatStartBlock_ + (cluster >> 8); 2d72a: bb 27 eor r27, r27 2d72c: a7 2f mov r26, r23 2d72e: 96 2f mov r25, r22 2d730: 85 2f mov r24, r21 2d732: c3 88 ldd r12, Z+19 ; 0x13 2d734: d4 88 ldd r13, Z+20 ; 0x14 2d736: e5 88 ldd r14, Z+21 ; 0x15 2d738: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2d73a: 8c 0d add r24, r12 2d73c: 9d 1d adc r25, r13 2d73e: ae 1d adc r26, r14 2d740: bf 1d adc r27, r15 2d742: e9 01 movw r28, r18 2d744: 6a 01 movw r12, r20 2d746: 7b 01 movw r14, r22 2d748: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 2d74a: 40 91 6f 0e lds r20, 0x0E6F ; 0x800e6f 2d74e: 50 91 70 0e lds r21, 0x0E70 ; 0x800e70 2d752: 60 91 71 0e lds r22, 0x0E71 ; 0x800e71 2d756: 70 91 72 0e lds r23, 0x0E72 ; 0x800e72 2d75a: 84 17 cp r24, r20 2d75c: 95 07 cpc r25, r21 2d75e: a6 07 cpc r26, r22 2d760: b7 07 cpc r27, r23 2d762: 49 f5 brne .+82 ; 0x2d7b6 if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 2d764: f8 01 movw r30, r16 2d766: 87 89 ldd r24, Z+23 ; 0x17 2d768: 80 31 cpi r24, 0x10 ; 16 2d76a: 69 f5 brne .+90 ; 0x2d7c6 *value = cacheBuffer_.fat16[cluster & 0XFF]; 2d76c: b7 01 movw r22, r14 2d76e: a6 01 movw r20, r12 2d770: 55 27 eor r21, r21 2d772: 66 27 eor r22, r22 2d774: 77 27 eor r23, r23 2d776: 44 0f add r20, r20 2d778: 55 1f adc r21, r21 2d77a: 45 58 subi r20, 0x85 ; 133 2d77c: 51 4f sbci r21, 0xF1 ; 241 2d77e: fa 01 movw r30, r20 2d780: 80 81 ld r24, Z 2d782: 91 81 ldd r25, Z+1 ; 0x01 2d784: b0 e0 ldi r27, 0x00 ; 0 2d786: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2d788: 88 83 st Y, r24 2d78a: 99 83 std Y+1, r25 ; 0x01 2d78c: aa 83 std Y+2, r26 ; 0x02 2d78e: bb 83 std Y+3, r27 ; 0x03 2d790: 81 e0 ldi r24, 0x01 ; 1 2d792: bf cf rjmp .-130 ; 0x2d712 *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2d794: 80 32 cpi r24, 0x20 ; 32 2d796: 09 f0 breq .+2 ; 0x2d79a 2d798: bb cf rjmp .-138 ; 0x2d710 lba = fatStartBlock_ + (cluster >> 7); 2d79a: c3 88 ldd r12, Z+19 ; 0x13 2d79c: d4 88 ldd r13, Z+20 ; 0x14 2d79e: e5 88 ldd r14, Z+21 ; 0x15 2d7a0: f6 88 ldd r15, Z+22 ; 0x16 2d7a2: db 01 movw r26, r22 2d7a4: ca 01 movw r24, r20 2d7a6: c7 e0 ldi r28, 0x07 ; 7 2d7a8: b6 95 lsr r27 2d7aa: a7 95 ror r26 2d7ac: 97 95 ror r25 2d7ae: 87 95 ror r24 2d7b0: ca 95 dec r28 2d7b2: d1 f7 brne .-12 ; 0x2d7a8 2d7b4: c2 cf rjmp .-124 ; 0x2d73a } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 2d7b6: 40 e0 ldi r20, 0x00 ; 0 2d7b8: bc 01 movw r22, r24 2d7ba: cd 01 movw r24, r26 2d7bc: 0f 94 a4 6a call 0x2d548 ; 0x2d548 2d7c0: 81 11 cpse r24, r1 2d7c2: d0 cf rjmp .-96 ; 0x2d764 2d7c4: a5 cf rjmp .-182 ; 0x2d710 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2d7c6: b7 01 movw r22, r14 2d7c8: a6 01 movw r20, r12 2d7ca: 4f 77 andi r20, 0x7F ; 127 2d7cc: 55 27 eor r21, r21 2d7ce: 66 27 eor r22, r22 2d7d0: 77 27 eor r23, r23 2d7d2: 44 0f add r20, r20 2d7d4: 55 1f adc r21, r21 2d7d6: 44 0f add r20, r20 2d7d8: 55 1f adc r21, r21 2d7da: 45 58 subi r20, 0x85 ; 133 2d7dc: 51 4f sbci r21, 0xF1 ; 241 2d7de: fa 01 movw r30, r20 2d7e0: 80 81 ld r24, Z 2d7e2: 91 81 ldd r25, Z+1 ; 0x01 2d7e4: a2 81 ldd r26, Z+2 ; 0x02 2d7e6: b3 81 ldd r27, Z+3 ; 0x03 2d7e8: bf 70 andi r27, 0x0F ; 15 2d7ea: ce cf rjmp .-100 ; 0x2d788 0002d7ec : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 2d7ec: 4f 92 push r4 2d7ee: 5f 92 push r5 2d7f0: 6f 92 push r6 2d7f2: 7f 92 push r7 2d7f4: af 92 push r10 2d7f6: bf 92 push r11 2d7f8: cf 92 push r12 2d7fa: df 92 push r13 2d7fc: ef 92 push r14 2d7fe: ff 92 push r15 2d800: 0f 93 push r16 2d802: 1f 93 push r17 2d804: cf 93 push r28 2d806: df 93 push r29 2d808: 00 d0 rcall .+0 ; 0x2d80a 2d80a: 1f 92 push r1 2d80c: cd b7 in r28, 0x3d ; 61 2d80e: de b7 in r29, 0x3e ; 62 2d810: 8c 01 movw r16, r24 2d812: 49 83 std Y+1, r20 ; 0x01 2d814: 5a 83 std Y+2, r21 ; 0x02 2d816: 6b 83 std Y+3, r22 ; 0x03 2d818: 7c 83 std Y+4, r23 ; 0x04 2d81a: 59 01 movw r10, r18 uint32_t s = 0; 2d81c: c1 2c mov r12, r1 2d81e: d1 2c mov r13, r1 2d820: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 2d822: 41 2c mov r4, r1 2d824: 82 e0 ldi r24, 0x02 ; 2 2d826: 58 2e mov r5, r24 2d828: 61 2c mov r6, r1 2d82a: 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; 2d82c: 49 81 ldd r20, Y+1 ; 0x01 2d82e: 5a 81 ldd r21, Y+2 ; 0x02 2d830: 6b 81 ldd r22, Y+3 ; 0x03 2d832: 7c 81 ldd r23, Y+4 ; 0x04 2d834: 9e 01 movw r18, r28 2d836: 2f 5f subi r18, 0xFF ; 255 2d838: 3f 4f sbci r19, 0xFF ; 255 2d83a: c8 01 movw r24, r16 2d83c: 0f 94 73 6b call 0x2d6e6 ; 0x2d6e6 2d840: 88 23 and r24, r24 2d842: 19 f1 breq .+70 ; 0x2d88a s += 512UL << clusterSizeShift_; 2d844: f8 01 movw r30, r16 2d846: 85 85 ldd r24, Z+13 ; 0x0d 2d848: a3 01 movw r20, r6 2d84a: 92 01 movw r18, r4 2d84c: 04 c0 rjmp .+8 ; 0x2d856 2d84e: 22 0f add r18, r18 2d850: 33 1f adc r19, r19 2d852: 44 1f adc r20, r20 2d854: 55 1f adc r21, r21 2d856: 8a 95 dec r24 2d858: d2 f7 brpl .-12 ; 0x2d84e 2d85a: da 01 movw r26, r20 2d85c: c9 01 movw r24, r18 2d85e: c8 0e add r12, r24 2d860: d9 1e adc r13, r25 2d862: ea 1e adc r14, r26 2d864: fb 1e adc r15, r27 } while (!isEOC(cluster)); 2d866: 49 81 ldd r20, Y+1 ; 0x01 2d868: 5a 81 ldd r21, Y+2 ; 0x02 2d86a: 6b 81 ldd r22, Y+3 ; 0x03 2d86c: 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; 2d86e: 87 89 ldd r24, Z+23 ; 0x17 2d870: 80 31 cpi r24, 0x10 ; 16 2d872: f1 f4 brne .+60 ; 0x2d8b0 2d874: 81 e0 ldi r24, 0x01 ; 1 2d876: 48 3f cpi r20, 0xF8 ; 248 2d878: 5f 4f sbci r21, 0xFF ; 255 2d87a: 61 05 cpc r22, r1 2d87c: 71 05 cpc r23, r1 2d87e: b0 f2 brcs .-84 ; 0x2d82c *size = s; 2d880: f5 01 movw r30, r10 2d882: c0 82 st Z, r12 2d884: d1 82 std Z+1, r13 ; 0x01 2d886: e2 82 std Z+2, r14 ; 0x02 2d888: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 2d88a: 0f 90 pop r0 2d88c: 0f 90 pop r0 2d88e: 0f 90 pop r0 2d890: 0f 90 pop r0 2d892: df 91 pop r29 2d894: cf 91 pop r28 2d896: 1f 91 pop r17 2d898: 0f 91 pop r16 2d89a: ff 90 pop r15 2d89c: ef 90 pop r14 2d89e: df 90 pop r13 2d8a0: cf 90 pop r12 2d8a2: bf 90 pop r11 2d8a4: af 90 pop r10 2d8a6: 7f 90 pop r7 2d8a8: 6f 90 pop r6 2d8aa: 5f 90 pop r5 2d8ac: 4f 90 pop r4 2d8ae: 08 95 ret return cluster >= FAT32EOC_MIN; 2d8b0: 81 e0 ldi r24, 0x01 ; 1 2d8b2: 48 3f cpi r20, 0xF8 ; 248 2d8b4: 5f 4f sbci r21, 0xFF ; 255 2d8b6: 6f 4f sbci r22, 0xFF ; 255 2d8b8: 7f 40 sbci r23, 0x0F ; 15 2d8ba: 08 f4 brcc .+2 ; 0x2d8be 2d8bc: b7 cf rjmp .-146 ; 0x2d82c 2d8be: e0 cf rjmp .-64 ; 0x2d880 0002d8c0 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 2d8c0: cf 92 push r12 2d8c2: df 92 push r13 2d8c4: ef 92 push r14 2d8c6: ff 92 push r15 2d8c8: 1f 93 push r17 2d8ca: cf 93 push r28 2d8cc: df 93 push r29 2d8ce: ec 01 movw r28, r24 2d8d0: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2d8d2: e1 11 cpse r30, r1 2d8d4: 09 c0 rjmp .+18 ; 0x2d8e8 2d8d6: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 2d8d8: df 91 pop r29 2d8da: cf 91 pop r28 2d8dc: 1f 91 pop r17 2d8de: ff 90 pop r15 2d8e0: ef 90 pop r14 2d8e2: df 90 pop r13 2d8e4: cf 90 pop r12 2d8e6: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2d8e8: 89 81 ldd r24, Y+1 ; 0x01 2d8ea: 80 ff sbrs r24, 0 2d8ec: f4 cf rjmp .-24 ; 0x2d8d6 gfOffset = curPosition_ & 0X1FF; // offset in block 2d8ee: 48 85 ldd r20, Y+8 ; 0x08 2d8f0: 59 85 ldd r21, Y+9 ; 0x09 2d8f2: 6a 85 ldd r22, Y+10 ; 0x0a 2d8f4: 7b 85 ldd r23, Y+11 ; 0x0b 2d8f6: 9a 01 movw r18, r20 2d8f8: 31 70 andi r19, 0x01 ; 1 2d8fa: 3a a3 std Y+34, r19 ; 0x22 2d8fc: 29 a3 std Y+33, r18 ; 0x21 2d8fe: 89 8d ldd r24, Y+25 ; 0x19 2d900: 9a 8d ldd r25, Y+26 ; 0x1a 2d902: 6a 01 movw r12, r20 2d904: 7b 01 movw r14, r22 2d906: f9 e0 ldi r31, 0x09 ; 9 2d908: f6 94 lsr r15 2d90a: e7 94 ror r14 2d90c: d7 94 ror r13 2d90e: c7 94 ror r12 2d910: fa 95 dec r31 2d912: d1 f7 brne .-12 ; 0x2d908 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2d914: e2 30 cpi r30, 0x02 ; 2 2d916: 79 f4 brne .+30 ; 0x2d936 // 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); 2d918: fc 01 movw r30, r24 2d91a: 82 8d ldd r24, Z+26 ; 0x1a 2d91c: 93 8d ldd r25, Z+27 ; 0x1b 2d91e: a4 8d ldd r26, Z+28 ; 0x1c 2d920: b5 8d ldd r27, Z+29 ; 0x1d 2d922: 8c 0d add r24, r12 2d924: 9d 1d adc r25, r13 2d926: ae 1d adc r26, r14 2d928: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2d92a: 8d 8f std Y+29, r24 ; 0x1d 2d92c: 9e 8f std Y+30, r25 ; 0x1e 2d92e: af 8f std Y+31, r26 ; 0x1f 2d930: b8 a3 std Y+32, r27 ; 0x20 } return true; 2d932: 81 e0 ldi r24, 0x01 ; 1 2d934: d1 cf rjmp .-94 ; 0x2d8d8 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);} 2d936: fc 01 movw r30, r24 2d938: 14 81 ldd r17, Z+4 ; 0x04 2d93a: 11 50 subi r17, 0x01 ; 1 2d93c: 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) { 2d93e: 23 2b or r18, r19 2d940: 71 f4 brne .+28 ; 0x2d95e 2d942: 11 11 cpse r17, r1 2d944: 0c c0 rjmp .+24 ; 0x2d95e // start of new cluster if (curPosition_ == 0) { 2d946: 45 2b or r20, r21 2d948: 46 2b or r20, r22 2d94a: 47 2b or r20, r23 2d94c: 31 f5 brne .+76 ; 0x2d99a // use first cluster in file curCluster_ = firstCluster_; 2d94e: 8d 89 ldd r24, Y+21 ; 0x15 2d950: 9e 89 ldd r25, Y+22 ; 0x16 2d952: af 89 ldd r26, Y+23 ; 0x17 2d954: b8 8d ldd r27, Y+24 ; 0x18 2d956: 8c 83 std Y+4, r24 ; 0x04 2d958: 9d 83 std Y+5, r25 ; 0x05 2d95a: ae 83 std Y+6, r26 ; 0x06 2d95c: 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; 2d95e: e9 8d ldd r30, Y+25 ; 0x19 2d960: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2d962: 8c 81 ldd r24, Y+4 ; 0x04 2d964: 9d 81 ldd r25, Y+5 ; 0x05 2d966: ae 81 ldd r26, Y+6 ; 0x06 2d968: bf 81 ldd r27, Y+7 ; 0x07 2d96a: 02 97 sbiw r24, 0x02 ; 2 2d96c: a1 09 sbc r26, r1 2d96e: b1 09 sbc r27, r1 2d970: 25 85 ldd r18, Z+13 ; 0x0d 2d972: 04 c0 rjmp .+8 ; 0x2d97c 2d974: 88 0f add r24, r24 2d976: 99 1f adc r25, r25 2d978: aa 1f adc r26, r26 2d97a: bb 1f adc r27, r27 2d97c: 2a 95 dec r18 2d97e: d2 f7 brpl .-12 ; 0x2d974 2d980: 46 85 ldd r20, Z+14 ; 0x0e 2d982: 57 85 ldd r21, Z+15 ; 0x0f 2d984: 60 89 ldd r22, Z+16 ; 0x10 2d986: 71 89 ldd r23, Z+17 ; 0x11 2d988: 84 0f add r24, r20 2d98a: 95 1f adc r25, r21 2d98c: a6 1f adc r26, r22 2d98e: b7 1f adc r27, r23 2d990: 81 0f add r24, r17 2d992: 91 1d adc r25, r1 2d994: a1 1d adc r26, r1 2d996: b1 1d adc r27, r1 2d998: c8 cf rjmp .-112 ; 0x2d92a if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 2d99a: 4c 81 ldd r20, Y+4 ; 0x04 2d99c: 5d 81 ldd r21, Y+5 ; 0x05 2d99e: 6e 81 ldd r22, Y+6 ; 0x06 2d9a0: 7f 81 ldd r23, Y+7 ; 0x07 2d9a2: 9e 01 movw r18, r28 2d9a4: 2c 5f subi r18, 0xFC ; 252 2d9a6: 3f 4f sbci r19, 0xFF ; 255 2d9a8: 0f 94 73 6b call 0x2d6e6 ; 0x2d6e6 2d9ac: 81 11 cpse r24, r1 2d9ae: d7 cf rjmp .-82 ; 0x2d95e 2d9b0: 92 cf rjmp .-220 ; 0x2d8d6 0002d9b2 : * 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) { 2d9b2: df 92 push r13 2d9b4: ef 92 push r14 2d9b6: ff 92 push r15 2d9b8: 0f 93 push r16 2d9ba: 1f 93 push r17 2d9bc: cf 93 push r28 2d9be: df 93 push r29 2d9c0: 8c 01 movw r16, r24 2d9c2: eb 01 movw r28, r22 2d9c4: 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; 2d9c6: 8d e0 ldi r24, 0x0D ; 13 2d9c8: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 2d9ca: 40 e2 ldi r20, 0x20 ; 32 2d9cc: 50 e0 ldi r21, 0x00 ; 0 2d9ce: be 01 movw r22, r28 2d9d0: c8 01 movw r24, r16 2d9d2: 0f 94 1f a7 call 0x34e3e ; 0x34e3e if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 2d9d6: 80 32 cpi r24, 0x20 ; 32 2d9d8: 91 05 cpc r25, r1 2d9da: 71 f0 breq .+28 ; 0x2d9f8 2d9dc: 21 e0 ldi r18, 0x01 ; 1 2d9de: 89 2b or r24, r25 2d9e0: 09 f4 brne .+2 ; 0x2d9e4 2d9e2: 20 e0 ldi r18, 0x00 ; 0 2d9e4: 82 2f mov r24, r18 2d9e6: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 2d9e8: df 91 pop r29 2d9ea: cf 91 pop r28 2d9ec: 1f 91 pop r17 2d9ee: 0f 91 pop r16 2d9f0: ff 90 pop r15 2d9f2: ef 90 pop r14 2d9f4: df 90 pop r13 2d9f6: 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; 2d9f8: 28 81 ld r18, Y 2d9fa: 22 23 and r18, r18 2d9fc: 09 f4 brne .+2 ; 0x2da00 2d9fe: 3f c0 rjmp .+126 ; 0x2da7e // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 2da00: 25 3e cpi r18, 0xE5 ; 229 2da02: 19 f3 breq .-58 ; 0x2d9ca 2da04: 2e 32 cpi r18, 0x2E ; 46 2da06: 09 f3 breq .-62 ; 0x2d9ca //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) 2da08: 3b 85 ldd r19, Y+11 ; 0x0b 2da0a: 3f 73 andi r19, 0x3F ; 63 2da0c: 3f 30 cpi r19, 0x0F ; 15 2da0e: 99 f5 brne .+102 ; 0x2da76 2da10: e1 14 cp r14, r1 2da12: f1 04 cpc r15, r1 2da14: 81 f1 breq .+96 ; 0x2da76 { 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) 2da16: 4a 8d ldd r20, Y+26 ; 0x1a 2da18: 5b 8d ldd r21, Y+27 ; 0x1b 2da1a: 45 2b or r20, r21 2da1c: 61 f5 brne .+88 ; 0x2da76 2da1e: 2f 71 andi r18, 0x1F ; 31 2da20: 3f ef ldi r19, 0xFF ; 255 2da22: 32 0f add r19, r18 2da24: 34 30 cpi r19, 0x04 ; 4 2da26: 38 f5 brcc .+78 ; 0x2da76 { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 2da28: 21 50 subi r18, 0x01 ; 1 2da2a: 33 0b sbc r19, r19 2da2c: d2 9e mul r13, r18 2da2e: c0 01 movw r24, r0 2da30: d3 9e mul r13, r19 2da32: 90 0d add r25, r0 2da34: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 2da36: f7 01 movw r30, r14 2da38: e8 0f add r30, r24 2da3a: f9 1f adc r31, r25 2da3c: 29 81 ldd r18, Y+1 ; 0x01 2da3e: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 2da40: 2b 81 ldd r18, Y+3 ; 0x03 2da42: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 2da44: 2d 81 ldd r18, Y+5 ; 0x05 2da46: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 2da48: 2f 81 ldd r18, Y+7 ; 0x07 2da4a: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 2da4c: 29 85 ldd r18, Y+9 ; 0x09 2da4e: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 2da50: 2e 85 ldd r18, Y+14 ; 0x0e 2da52: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 2da54: 28 89 ldd r18, Y+16 ; 0x10 2da56: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 2da58: 2a 89 ldd r18, Y+18 ; 0x12 2da5a: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 2da5c: 2c 89 ldd r18, Y+20 ; 0x14 2da5e: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 2da60: 2e 89 ldd r18, Y+22 ; 0x16 2da62: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 2da64: 28 8d ldd r18, Y+24 ; 0x18 2da66: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 2da68: 2c 8d ldd r18, Y+28 ; 0x1c 2da6a: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 2da6c: 2e 8d ldd r18, Y+30 ; 0x1e 2da6e: 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) 2da70: 28 81 ld r18, Y 2da72: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 2da74: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 2da76: 2b 85 ldd r18, Y+11 ; 0x0b 2da78: 23 fd sbrc r18, 3 2da7a: a7 cf rjmp .-178 ; 0x2d9ca 2da7c: b5 cf rjmp .-150 ; 0x2d9e8 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; 2da7e: 80 e0 ldi r24, 0x00 ; 0 2da80: b3 cf rjmp .-154 ; 0x2d9e8 0002da82 : * \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() { 2da82: cf 93 push r28 2da84: df 93 push r29 2da86: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 2da88: 8b 81 ldd r24, Y+3 ; 0x03 2da8a: 88 23 and r24, r24 2da8c: 49 f1 breq .+82 ; 0x2dae0 if (flags_ & F_FILE_DIR_DIRTY) { 2da8e: 89 81 ldd r24, Y+1 ; 0x01 2da90: 87 ff sbrs r24, 7 2da92: 22 c0 rjmp .+68 ; 0x2dad8 dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2da94: 61 e0 ldi r22, 0x01 ; 1 2da96: ce 01 movw r24, r28 2da98: 0f 94 47 a4 call 0x3488e ; 0x3488e 2da9c: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 2da9e: 89 2b or r24, r25 2daa0: f9 f0 breq .+62 ; 0x2dae0 2daa2: 80 81 ld r24, Z 2daa4: 85 3e cpi r24, 0xE5 ; 229 2daa6: e1 f0 breq .+56 ; 0x2dae0 // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 2daa8: 8b 81 ldd r24, Y+3 ; 0x03 2daaa: 82 30 cpi r24, 0x02 ; 2 2daac: 40 f4 brcc .+16 ; 0x2dabe 2daae: 89 89 ldd r24, Y+17 ; 0x11 2dab0: 9a 89 ldd r25, Y+18 ; 0x12 2dab2: ab 89 ldd r26, Y+19 ; 0x13 2dab4: bc 89 ldd r27, Y+20 ; 0x14 2dab6: 84 8f std Z+28, r24 ; 0x1c 2dab8: 95 8f std Z+29, r25 ; 0x1d 2daba: a6 8f std Z+30, r26 ; 0x1e 2dabc: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 2dabe: 8d 89 ldd r24, Y+21 ; 0x15 2dac0: 9e 89 ldd r25, Y+22 ; 0x16 2dac2: 93 8f std Z+27, r25 ; 0x1b 2dac4: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 2dac6: 8d 89 ldd r24, Y+21 ; 0x15 2dac8: 9e 89 ldd r25, Y+22 ; 0x16 2daca: af 89 ldd r26, Y+23 ; 0x17 2dacc: b8 8d ldd r27, Y+24 ; 0x18 2dace: b5 8b std Z+21, r27 ; 0x15 2dad0: 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; 2dad2: 89 81 ldd r24, Y+1 ; 0x01 2dad4: 8f 77 andi r24, 0x7F ; 127 2dad6: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 2dad8: df 91 pop r29 2dada: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 2dadc: 0d 94 65 6a jmp 0x2d4ca ; 0x2d4ca fail: writeError = true; 2dae0: 81 e0 ldi r24, 0x01 ; 1 2dae2: 88 83 st Y, r24 return false; } 2dae4: 80 e0 ldi r24, 0x00 ; 0 2dae6: df 91 pop r29 2dae8: cf 91 pop r28 2daea: 08 95 ret 0002daec : * \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) { 2daec: 8f 92 push r8 2daee: 9f 92 push r9 2daf0: af 92 push r10 2daf2: bf 92 push r11 2daf4: cf 92 push r12 2daf6: df 92 push r13 2daf8: ef 92 push r14 2dafa: ff 92 push r15 2dafc: 0f 93 push r16 2dafe: 1f 93 push r17 2db00: cf 93 push r28 2db02: df 93 push r29 2db04: ec 01 movw r28, r24 2db06: 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; 2db08: 81 11 cpse r24, r1 2db0a: 0e c0 rjmp .+28 ; 0x2db28 done: return true; fail: return false; 2db0c: 80 e0 ldi r24, 0x00 ; 0 } 2db0e: df 91 pop r29 2db10: cf 91 pop r28 2db12: 1f 91 pop r17 2db14: 0f 91 pop r16 2db16: ff 90 pop r15 2db18: ef 90 pop r14 2db1a: df 90 pop r13 2db1c: cf 90 pop r12 2db1e: bf 90 pop r11 2db20: af 90 pop r10 2db22: 9f 90 pop r9 2db24: 8f 90 pop r8 2db26: 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; 2db28: 09 89 ldd r16, Y+17 ; 0x11 2db2a: 1a 89 ldd r17, Y+18 ; 0x12 2db2c: 2b 89 ldd r18, Y+19 ; 0x13 2db2e: 3c 89 ldd r19, Y+20 ; 0x14 2db30: 04 17 cp r16, r20 2db32: 15 07 cpc r17, r21 2db34: 26 07 cpc r18, r22 2db36: 37 07 cpc r19, r23 2db38: 48 f3 brcs .-46 ; 0x2db0c 2db3a: 4a 01 movw r8, r20 2db3c: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2db3e: 82 30 cpi r24, 0x02 ; 2 2db40: 31 f4 brne .+12 ; 0x2db4e curPosition_ = pos; 2db42: 88 86 std Y+8, r8 ; 0x08 2db44: 99 86 std Y+9, r9 ; 0x09 2db46: aa 86 std Y+10, r10 ; 0x0a 2db48: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 2db4a: 81 e0 ldi r24, 0x01 ; 1 2db4c: e0 cf rjmp .-64 ; 0x2db0e if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 2db4e: 81 14 cp r8, r1 2db50: 91 04 cpc r9, r1 2db52: a1 04 cpc r10, r1 2db54: b1 04 cpc r11, r1 2db56: 49 f4 brne .+18 ; 0x2db6a // set position to start of file curCluster_ = 0; 2db58: 1c 82 std Y+4, r1 ; 0x04 2db5a: 1d 82 std Y+5, r1 ; 0x05 2db5c: 1e 82 std Y+6, r1 ; 0x06 2db5e: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2db60: 18 86 std Y+8, r1 ; 0x08 2db62: 19 86 std Y+9, r1 ; 0x09 2db64: 1a 86 std Y+10, r1 ; 0x0a 2db66: 1b 86 std Y+11, r1 ; 0x0b 2db68: f0 cf rjmp .-32 ; 0x2db4a goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 2db6a: 08 85 ldd r16, Y+8 ; 0x08 2db6c: 19 85 ldd r17, Y+9 ; 0x09 2db6e: 2a 85 ldd r18, Y+10 ; 0x0a 2db70: 3b 85 ldd r19, Y+11 ; 0x0b 2db72: e9 8d ldd r30, Y+25 ; 0x19 2db74: fa 8d ldd r31, Y+26 ; 0x1a 2db76: 85 85 ldd r24, Z+13 ; 0x0d 2db78: 90 e0 ldi r25, 0x00 ; 0 2db7a: 09 96 adiw r24, 0x09 ; 9 2db7c: b9 01 movw r22, r18 2db7e: a8 01 movw r20, r16 2db80: 41 50 subi r20, 0x01 ; 1 2db82: 51 09 sbc r21, r1 2db84: 61 09 sbc r22, r1 2db86: 71 09 sbc r23, r1 2db88: 08 2e mov r0, r24 2db8a: 04 c0 rjmp .+8 ; 0x2db94 2db8c: 76 95 lsr r23 2db8e: 67 95 ror r22 2db90: 57 95 ror r21 2db92: 47 95 ror r20 2db94: 0a 94 dec r0 2db96: d2 f7 brpl .-12 ; 0x2db8c nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 2db98: 75 01 movw r14, r10 2db9a: 64 01 movw r12, r8 2db9c: e1 e0 ldi r30, 0x01 ; 1 2db9e: ce 1a sub r12, r30 2dba0: d1 08 sbc r13, r1 2dba2: e1 08 sbc r14, r1 2dba4: f1 08 sbc r15, r1 2dba6: 04 c0 rjmp .+8 ; 0x2dbb0 2dba8: f6 94 lsr r15 2dbaa: e7 94 ror r14 2dbac: d7 94 ror r13 2dbae: c7 94 ror r12 2dbb0: 8a 95 dec r24 2dbb2: d2 f7 brpl .-12 ; 0x2dba8 if (nNew < nCur || curPosition_ == 0) { 2dbb4: c4 16 cp r12, r20 2dbb6: d5 06 cpc r13, r21 2dbb8: e6 06 cpc r14, r22 2dbba: f7 06 cpc r15, r23 2dbbc: 20 f0 brcs .+8 ; 0x2dbc6 2dbbe: 01 2b or r16, r17 2dbc0: 02 2b or r16, r18 2dbc2: 03 2b or r16, r19 2dbc4: 11 f5 brne .+68 ; 0x2dc0a // must follow chain from first cluster curCluster_ = firstCluster_; 2dbc6: 8d 89 ldd r24, Y+21 ; 0x15 2dbc8: 9e 89 ldd r25, Y+22 ; 0x16 2dbca: af 89 ldd r26, Y+23 ; 0x17 2dbcc: b8 8d ldd r27, Y+24 ; 0x18 2dbce: 8c 83 std Y+4, r24 ; 0x04 2dbd0: 9d 83 std Y+5, r25 ; 0x05 2dbd2: ae 83 std Y+6, r26 ; 0x06 2dbd4: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2dbd6: 8e 01 movw r16, r28 2dbd8: 0c 5f subi r16, 0xFC ; 252 2dbda: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 2dbdc: c1 14 cp r12, r1 2dbde: d1 04 cpc r13, r1 2dbe0: e1 04 cpc r14, r1 2dbe2: f1 04 cpc r15, r1 2dbe4: 09 f4 brne .+2 ; 0x2dbe8 2dbe6: ad cf rjmp .-166 ; 0x2db42 if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2dbe8: 4c 81 ldd r20, Y+4 ; 0x04 2dbea: 5d 81 ldd r21, Y+5 ; 0x05 2dbec: 6e 81 ldd r22, Y+6 ; 0x06 2dbee: 7f 81 ldd r23, Y+7 ; 0x07 2dbf0: 98 01 movw r18, r16 2dbf2: 89 8d ldd r24, Y+25 ; 0x19 2dbf4: 9a 8d ldd r25, Y+26 ; 0x1a 2dbf6: 0f 94 73 6b call 0x2d6e6 ; 0x2d6e6 2dbfa: 91 e0 ldi r25, 0x01 ; 1 2dbfc: c9 1a sub r12, r25 2dbfe: d1 08 sbc r13, r1 2dc00: e1 08 sbc r14, r1 2dc02: f1 08 sbc r15, r1 2dc04: 81 11 cpse r24, r1 2dc06: ea cf rjmp .-44 ; 0x2dbdc 2dc08: 81 cf rjmp .-254 ; 0x2db0c if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 2dc0a: c4 1a sub r12, r20 2dc0c: d5 0a sbc r13, r21 2dc0e: e6 0a sbc r14, r22 2dc10: f7 0a sbc r15, r23 2dc12: e1 cf rjmp .-62 ; 0x2dbd6 0002dc14 : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 2dc14: 80 91 88 17 lds r24, 0x1788 ; 0x801788 2dc18: 88 23 and r24, r24 2dc1a: 61 f0 breq .+24 ; 0x2dc34 2dc1c: 0e 94 df e3 call 0x1c7be ; 0x1c7be 2dc20: 88 23 and r24, r24 2dc22: 41 f0 breq .+16 ; 0x2dc34 lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 2dc24: 8e e1 ldi r24, 0x1E ; 30 2dc26: 9f e3 ldi r25, 0x3F ; 63 2dc28: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2dc2c: 0f 94 07 35 call 0x26a0e ; 0x26a0e lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 2dc30: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c 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; 2dc34: 86 e0 ldi r24, 0x06 ; 6 2dc36: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 2dc3a: fa cf rjmp .-12 ; 0x2dc30 0002dc3c : 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() { 2dc3c: cf 93 push r28 2dc3e: df 93 push r29 if (MMU2::mmu2.Enabled()) { 2dc40: 80 91 98 13 lds r24, 0x1398 ; 0x801398 2dc44: 81 30 cpi r24, 0x01 ; 1 2dc46: f9 f4 brne .+62 ; 0x2dc86 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 2dc48: 83 ec ldi r24, 0xC3 ; 195 2dc4a: 9f e4 ldi r25, 0x4F ; 79 2dc4c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2dc50: ec 01 movw r28, r24 } void lcd_v2_calibration() { if (MMU2::mmu2.Enabled()) { const uint8_t filament = choose_menu_P( 2dc52: 80 e8 ldi r24, 0x80 ; 128 2dc54: 9f e3 ldi r25, 0x3F ; 63 2dc56: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2dc5a: be 01 movw r22, r28 2dc5c: 6f 5f subi r22, 0xFF ; 255 2dc5e: 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 2dc60: 0e 94 dd d8 call 0x1b1ba ; 0x1b1ba if (filament < MMU_FILAMENT_COUNT) { 2dc64: 85 30 cpi r24, 0x05 ; 5 2dc66: a0 f5 brcc .+104 ; 0x2dcd0 lay1cal_filament = filament; 2dc68: 80 93 f6 03 sts 0x03F6, r24 ; 0x8003f6 <_ZL16lay1cal_filament.lto_priv.454> return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 2dc6c: 8a e0 ldi r24, 0x0A ; 10 2dc6e: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 menu_goto(lcd_generic_preheat_menu, 0, true); 2dc72: 20 e0 ldi r18, 0x00 ; 0 2dc74: 41 e0 ldi r20, 0x01 ; 1 2dc76: 70 e0 ldi r23, 0x00 ; 0 2dc78: 60 e0 ldi r22, 0x00 ; 0 2dc7a: 8c ea ldi r24, 0xAC ; 172 2dc7c: 9b e3 ldi r25, 0x3B ; 59 } 2dc7e: df 91 pop r29 2dc80: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 2dc82: 0d 94 04 cf jmp 0x39e08 ; 0x39e08 menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2dc86: 8f e5 ldi r24, 0x5F ; 95 2dc88: 9f e0 ldi r25, 0x0F ; 15 2dc8a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2dc8e: 81 11 cpse r24, r1 2dc90: ed cf rjmp .-38 ; 0x2dc6c { bool loaded = false; if (fsensor.isReady()) { 2dc92: 80 91 88 17 lds r24, 0x1788 ; 0x801788 2dc96: 82 30 cpi r24, 0x02 ; 2 2dc98: f9 f4 brne .+62 ; 0x2dcd8 loaded = fsensor.getFilamentPresent(); 2dc9a: 0e 94 df e3 call 0x1c7be ; 0x1c7be 2dc9e: 98 2f mov r25, r24 } else { loaded = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), false, LCD_MIDDLE_BUTTON_CHOICE); lcd_update_enabled = true; } if (!loaded) { 2dca0: 91 11 cpse r25, r1 2dca2: e4 cf rjmp .-56 ; 0x2dc6c lcd_display_message_fullscreen_P(_T(MSG_PLEASE_LOAD_PLA)); 2dca4: 85 ea ldi r24, 0xA5 ; 165 2dca6: 9f e4 ldi r25, 0x4F ; 79 2dca8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2dcac: 0f 94 80 34 call 0x26900 ; 0x26900 lcd_consume_click(); 2dcb0: 0e 94 2d 72 call 0xe45a ; 0xe45a 2dcb4: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 2dcb6: 84 e6 ldi r24, 0x64 ; 100 2dcb8: 90 e0 ldi r25, 0x00 ; 0 2dcba: 0e 94 ff 8e call 0x11dfe ; 0x11dfe if (lcd_clicked()) { 2dcbe: 0e 94 32 72 call 0xe464 ; 0xe464 2dcc2: 81 11 cpse r24, r1 2dcc4: 02 c0 rjmp .+4 ; 0x2dcca 2dcc6: 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 2dcc8: b1 f7 brne .-20 ; 0x2dcb6 delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 2dcca: 81 e0 ldi r24, 0x01 ; 1 2dccc: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 2dcd0: df 91 pop r29 2dcd2: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 2dcd4: 0d 94 a2 d1 jmp 0x3a344 ; 0x3a344 { 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); 2dcd8: 89 ec ldi r24, 0xC9 ; 201 2dcda: 94 e5 ldi r25, 0x54 ; 84 2dcdc: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2dce0: 41 e0 ldi r20, 0x01 ; 1 2dce2: 60 e0 ldi r22, 0x00 ; 0 2dce4: 0f 94 b3 64 call 0x2c966 ; 0x2c966 2dce8: 91 e0 ldi r25, 0x01 ; 1 2dcea: 81 11 cpse r24, r1 2dcec: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 2dcee: 81 e0 ldi r24, 0x01 ; 1 2dcf0: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 2dcf4: d5 cf rjmp .-86 ; 0x2dca0 0002dcf6 : 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()") { 2dcf6: cf 93 push r28 2dcf8: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 { //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); 2dcfc: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 2dcfe: 49 ec ldi r20, 0xC9 ; 201 2dd00: 50 e7 ldi r21, 0x70 ; 112 2dd02: 60 e0 ldi r22, 0x00 ; 0 2dd04: 80 e0 ldi r24, 0x00 ; 0 2dd06: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(LCD_WIDTH - 14, 0); 2dd0a: 60 e0 ldi r22, 0x00 ; 0 2dd0c: 86 e0 ldi r24, 0x06 ; 6 2dd0e: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print_state(pinda_state); 2dd12: c4 fb bst r28, 4 2dd14: 88 27 eor r24, r24 2dd16: 80 f9 bld r24, 0 2dd18: 0f 94 3c 26 call 0x24c78 ; 0x24c78 if (MMU2::mmu2.Enabled()) { 2dd1c: 80 91 98 13 lds r24, 0x1398 ; 0x801398 2dd20: 81 30 cpi r24, 0x01 ; 1 2dd22: 99 f4 brne .+38 ; 0x2dd4a inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 2dd24: c1 e0 ldi r28, 0x01 ; 1 2dd26: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 2dd2a: 81 11 cpse r24, r1 2dd2c: 01 c0 rjmp .+2 ; 0x2dd30 2dd2e: 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 2dd30: 43 ec ldi r20, 0xC3 ; 195 2dd32: 50 e7 ldi r21, 0x70 ; 112 2dd34: 60 e0 ldi r22, 0x00 ; 0 2dd36: 8a e0 ldi r24, 0x0A ; 10 2dd38: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(LCD_WIDTH - 3, 0); 2dd3c: 60 e0 ldi r22, 0x00 ; 0 2dd3e: 81 e1 ldi r24, 0x11 ; 17 2dd40: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print_state(finda_state); 2dd44: 8c 2f mov r24, r28 2dd46: 0f 94 3c 26 call 0x24c78 ; 0x24c78 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); 2dd4a: 0e 94 df e3 call 0x1c7be ; 0x1c7be 2dd4e: c8 2f mov r28, r24 lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 2dd50: 89 e1 ldi r24, 0x19 ; 25 2dd52: 9d e3 ldi r25, 0x3D ; 61 2dd54: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2dd58: ac 01 movw r20, r24 2dd5a: 61 e0 ldi r22, 0x01 ; 1 2dd5c: 80 e0 ldi r24, 0x00 ; 0 2dd5e: 0e 94 29 70 call 0xe052 ; 0xe052 lcd_set_cursor(LCD_WIDTH - 3, 1); 2dd62: 61 e0 ldi r22, 0x01 ; 1 2dd64: 81 e1 ldi r24, 0x11 ; 17 2dd66: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print_state(idler_state); 2dd6a: 8c 2f mov r24, r28 2dd6c: 0f 94 3c 26 call 0x24c78 ; 0x24c78 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(); } 2dd70: 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(); 2dd72: 0d 94 44 d2 jmp 0x3a488 ; 0x3a488 0002dd76 : 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){ 2dd76: 2f 92 push r2 2dd78: 3f 92 push r3 2dd7a: 4f 92 push r4 2dd7c: 5f 92 push r5 2dd7e: 6f 92 push r6 2dd80: 7f 92 push r7 2dd82: 8f 92 push r8 2dd84: 9f 92 push r9 2dd86: af 92 push r10 2dd88: bf 92 push r11 2dd8a: cf 92 push r12 2dd8c: df 92 push r13 2dd8e: ef 92 push r14 2dd90: ff 92 push r15 2dd92: 0f 93 push r16 2dd94: 1f 93 push r17 2dd96: cf 93 push r28 2dd98: df 93 push r29 2dd9a: 00 d0 rcall .+0 ; 0x2dd9c 2dd9c: 1f 92 push r1 2dd9e: 1f 92 push r1 2dda0: cd b7 in r28, 0x3d ; 61 2dda2: de b7 in r29, 0x3e ; 62 2dda4: 1c 01 movw r2, r24 2dda6: 2a 01 movw r4, r20 2dda8: 3b 01 movw r6, r22 2ddaa: 00 e2 ldi r16, 0x20 ; 32 2ddac: 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){ 2ddae: 19 82 std Y+1, r1 ; 0x01 2ddb0: 99 81 ldd r25, Y+1 ; 0x01 2ddb2: 89 2f mov r24, r25 2ddb4: 90 e0 ldi r25, 0x00 ; 0 2ddb6: 9b 83 std Y+3, r25 ; 0x03 2ddb8: 8a 83 std Y+2, r24 ; 0x02 2ddba: 80 17 cp r24, r16 2ddbc: 91 07 cpc r25, r17 2ddbe: 9c f5 brge .+102 ; 0x2de26 if (points[j] > points[j + 1]) 2ddc0: 88 0f add r24, r24 2ddc2: 99 1f adc r25, r25 2ddc4: 88 0f add r24, r24 2ddc6: 99 1f adc r25, r25 2ddc8: 9d 83 std Y+5, r25 ; 0x05 2ddca: 8c 83 std Y+4, r24 ; 0x04 2ddcc: 82 0d add r24, r2 2ddce: 93 1d adc r25, r3 2ddd0: 9b 83 std Y+3, r25 ; 0x03 2ddd2: 8a 83 std Y+2, r24 ; 0x02 2ddd4: fc 01 movw r30, r24 2ddd6: c0 80 ld r12, Z 2ddd8: d1 80 ldd r13, Z+1 ; 0x01 2ddda: e2 80 ldd r14, Z+2 ; 0x02 2dddc: f3 80 ldd r15, Z+3 ; 0x03 2ddde: 8c 81 ldd r24, Y+4 ; 0x04 2dde0: 9d 81 ldd r25, Y+5 ; 0x05 2dde2: 04 96 adiw r24, 0x04 ; 4 2dde4: 82 0d add r24, r2 2dde6: 93 1d adc r25, r3 2dde8: 9d 83 std Y+5, r25 ; 0x05 2ddea: 8c 83 std Y+4, r24 ; 0x04 2ddec: fc 01 movw r30, r24 2ddee: 80 80 ld r8, Z 2ddf0: 91 80 ldd r9, Z+1 ; 0x01 2ddf2: a2 80 ldd r10, Z+2 ; 0x02 2ddf4: b3 80 ldd r11, Z+3 ; 0x03 2ddf6: a5 01 movw r20, r10 2ddf8: 94 01 movw r18, r8 2ddfa: c7 01 movw r24, r14 2ddfc: b6 01 movw r22, r12 2ddfe: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 2de02: 18 16 cp r1, r24 2de04: 64 f4 brge .+24 ; 0x2de1e SWAP(points[j], points[j + 1]); 2de06: ea 81 ldd r30, Y+2 ; 0x02 2de08: fb 81 ldd r31, Y+3 ; 0x03 2de0a: 80 82 st Z, r8 2de0c: 91 82 std Z+1, r9 ; 0x01 2de0e: a2 82 std Z+2, r10 ; 0x02 2de10: b3 82 std Z+3, r11 ; 0x03 2de12: ec 81 ldd r30, Y+4 ; 0x04 2de14: fd 81 ldd r31, Y+5 ; 0x05 2de16: c0 82 st Z, r12 2de18: d1 82 std Z+1, r13 ; 0x01 2de1a: e2 82 std Z+2, r14 ; 0x02 2de1c: 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){ 2de1e: f9 81 ldd r31, Y+1 ; 0x01 2de20: ff 5f subi r31, 0xFF ; 255 2de22: f9 83 std Y+1, r31 ; 0x01 2de24: c5 cf rjmp .-118 ; 0x2ddb0 2de26: 01 50 subi r16, 0x01 ; 1 2de28: 11 09 sbc r17, r1 2de2a: 08 f6 brcc .-126 ; 0x2ddae /// 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]; 2de2c: f1 01 movw r30, r2 2de2e: e0 5c subi r30, 0xC0 ; 192 2de30: 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); 2de32: 20 81 ld r18, Z 2de34: 31 81 ldd r19, Z+1 ; 0x01 2de36: 42 81 ldd r20, Z+2 ; 0x02 2de38: 53 81 ldd r21, Z+3 ; 0x03 2de3a: c3 01 movw r24, r6 2de3c: b2 01 movw r22, r4 2de3e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 2de42: 6b 01 movw r12, r22 2de44: 7c 01 movw r14, r24 2de46: 20 e0 ldi r18, 0x00 ; 0 2de48: 30 e0 ldi r19, 0x00 ; 0 2de4a: 40 e0 ldi r20, 0x00 ; 0 2de4c: 5f eb ldi r21, 0xBF ; 191 2de4e: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 2de52: 87 fd sbrc r24, 7 2de54: 10 c0 rjmp .+32 ; 0x2de76 2de56: 20 e0 ldi r18, 0x00 ; 0 2de58: 30 e0 ldi r19, 0x00 ; 0 2de5a: 40 e0 ldi r20, 0x00 ; 0 2de5c: 5f e3 ldi r21, 0x3F ; 63 2de5e: c7 01 movw r24, r14 2de60: b6 01 movw r22, r12 2de62: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 2de66: 18 16 cp r1, r24 2de68: 5c f4 brge .+22 ; 0x2de80 2de6a: c1 2c mov r12, r1 2de6c: d1 2c mov r13, r1 2de6e: e1 2c mov r14, r1 2de70: 8f e3 ldi r24, 0x3F ; 63 2de72: f8 2e mov r15, r24 2de74: 05 c0 rjmp .+10 ; 0x2de80 2de76: c1 2c mov r12, r1 2de78: d1 2c mov r13, r1 2de7a: e1 2c mov r14, r1 2de7c: 9f eb ldi r25, 0xBF ; 191 2de7e: f9 2e mov r15, r25 } 2de80: c7 01 movw r24, r14 2de82: b6 01 movw r22, r12 2de84: 0f 90 pop r0 2de86: 0f 90 pop r0 2de88: 0f 90 pop r0 2de8a: 0f 90 pop r0 2de8c: 0f 90 pop r0 2de8e: df 91 pop r29 2de90: cf 91 pop r28 2de92: 1f 91 pop r17 2de94: 0f 91 pop r16 2de96: ff 90 pop r15 2de98: ef 90 pop r14 2de9a: df 90 pop r13 2de9c: cf 90 pop r12 2de9e: bf 90 pop r11 2dea0: af 90 pop r10 2dea2: 9f 90 pop r9 2dea4: 8f 90 pop r8 2dea6: 7f 90 pop r7 2dea8: 6f 90 pop r6 2deaa: 5f 90 pop r5 2deac: 4f 90 pop r4 2deae: 3f 90 pop r3 2deb0: 2f 90 pop r2 2deb2: 08 95 ret 0002deb4 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 2deb4: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2deb8: 60 93 38 13 sts 0x1338, r22 ; 0x801338 2debc: 70 93 39 13 sts 0x1339, r23 ; 0x801339 2dec0: 80 93 3a 13 sts 0x133A, r24 ; 0x80133a 2dec4: 90 93 3b 13 sts 0x133B, r25 ; 0x80133b } 2dec8: 08 95 ret 0002deca : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2deca: 80 91 7e 13 lds r24, 0x137E ; 0x80137e 2dece: 88 23 and r24, r24 2ded0: 69 f0 breq .+26 ; 0x2deec 2ded2: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 2ded6: 88 23 and r24, r24 2ded8: 49 f0 breq .+18 ; 0x2deec SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2deda: 89 e7 ldi r24, 0x79 ; 121 2dedc: 9a ea ldi r25, 0xAA ; 170 2dede: 0e 94 86 7b call 0xf70c ; 0xf70c retryAttempts--; 2dee2: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 2dee6: 81 50 subi r24, 0x01 ; 1 2dee8: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d } } 2deec: 08 95 ret 0002deee : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2deee: 9f 92 push r9 2def0: af 92 push r10 2def2: bf 92 push r11 2def4: cf 92 push r12 2def6: df 92 push r13 2def8: ef 92 push r14 2defa: ff 92 push r15 2defc: 0f 93 push r16 2defe: 1f 93 push r17 2df00: cf 93 push r28 2df02: df 93 push r29 2df04: cd b7 in r28, 0x3d ; 61 2df06: de b7 in r29, 0x3e ; 62 2df08: e0 97 sbiw r28, 0x30 ; 48 2df0a: 0f b6 in r0, 0x3f ; 63 2df0c: f8 94 cli 2df0e: de bf out 0x3e, r29 ; 62 2df10: 0f be out 0x3f, r0 ; 63 2df12: cd bf out 0x3d, r28 ; 61 2df14: 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()]; 2df16: e0 90 66 13 lds r14, 0x1366 ; 0x801366 2df1a: fe 01 movw r30, r28 2df1c: 31 96 adiw r30, 0x01 ; 1 2df1e: 21 e0 ldi r18, 0x01 ; 1 2df20: 30 e0 ldi r19, 0x00 ; 0 2df22: 5f 01 movw r10, r30 2df24: f1 2c mov r15, r1 2df26: 40 e1 ldi r20, 0x10 ; 16 2df28: c4 2e mov r12, r20 2df2a: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2df2c: 50 e2 ldi r21, 0x20 ; 32 2df2e: 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()]; 2df30: c7 01 movw r24, r14 2df32: 82 1b sub r24, r18 2df34: 93 0b sbc r25, r19 2df36: b6 01 movw r22, r12 2df38: 0f 94 38 de call 0x3bc70 ; 0x3bc70 <__divmodhi4> 2df3c: dc 01 movw r26, r24 2df3e: bb 27 eor r27, r27 2df40: a7 5d subi r26, 0xD7 ; 215 2df42: bc 4e sbci r27, 0xEC ; 236 2df44: 9d 96 adiw r26, 0x2d ; 45 2df46: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2df48: 48 2f mov r20, r24 2df4a: 50 e0 ldi r21, 0x00 ; 0 2df4c: 94 e0 ldi r25, 0x04 ; 4 2df4e: 55 95 asr r21 2df50: 47 95 ror r20 2df52: 9a 95 dec r25 2df54: e1 f7 brne .-8 ; 0x2df4e lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2df56: 96 ef ldi r25, 0xF6 ; 246 2df58: 94 0f add r25, r20 2df5a: 96 30 cpi r25, 0x06 ; 6 2df5c: a8 f1 brcs .+106 ; 0x2dfc8 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2df5e: 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); 2df60: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 2df62: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2df64: 96 ef ldi r25, 0xF6 ; 246 2df66: 98 0f add r25, r24 2df68: 96 30 cpi r25, 0x06 ; 6 2df6a: 80 f1 brcs .+96 ; 0x2dfcc case 5: case 6: case 7: case 8: case 9: return c + '0'; 2df6c: 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); 2df6e: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 2df70: 92 82 std Z+2, r9 ; 0x02 2df72: 2f 5f subi r18, 0xFF ; 255 2df74: 3f 4f sbci r19, 0xFF ; 255 2df76: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2df78: 21 31 cpi r18, 0x11 ; 17 2df7a: 31 05 cpc r19, r1 2df7c: c9 f6 brne .-78 ; 0x2df30 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 2df7e: 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); 2df80: 82 ef ldi r24, 0xF2 ; 242 2df82: 9a ea ldi r25, 0xAA ; 170 2df84: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2df88: 8c ee ldi r24, 0xEC ; 236 2df8a: 9a ea ldi r25, 0xAA ; 170 2df8c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2df90: c8 01 movw r24, r16 2df92: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOPGM(", last bytes: "); 2df96: 84 ea ldi r24, 0xA4 ; 164 2df98: 9a ea ldi r25, 0xAA ; 170 2df9a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN(lrb); 2df9e: c5 01 movw r24, r10 2dfa0: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 } 2dfa4: e0 96 adiw r28, 0x30 ; 48 2dfa6: 0f b6 in r0, 0x3f ; 63 2dfa8: f8 94 cli 2dfaa: de bf out 0x3e, r29 ; 62 2dfac: 0f be out 0x3f, r0 ; 63 2dfae: cd bf out 0x3d, r28 ; 61 2dfb0: df 91 pop r29 2dfb2: cf 91 pop r28 2dfb4: 1f 91 pop r17 2dfb6: 0f 91 pop r16 2dfb8: ff 90 pop r15 2dfba: ef 90 pop r14 2dfbc: df 90 pop r13 2dfbe: cf 90 pop r12 2dfc0: bf 90 pop r11 2dfc2: af 90 pop r10 2dfc4: 9f 90 pop r9 2dfc6: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2dfc8: 49 5a subi r20, 0xA9 ; 169 2dfca: ca cf rjmp .-108 ; 0x2df60 2dfcc: 89 5a subi r24, 0xA9 ; 169 2dfce: cf cf rjmp .-98 ; 0x2df6e 0002dfd0 : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 2dfd0: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 2dfd2: 90 91 3d 13 lds r25, 0x133D ; 0x80133d 2dfd6: 9a 30 cpi r25, 0x0A ; 10 2dfd8: 11 f4 brne .+4 ; 0x2dfde cause = ss; 2dfda: 60 93 3c 13 sts 0x133C, r22 ; 0x80133c } --occurrences; 2dfde: 91 50 subi r25, 0x01 ; 1 2dfe0: 90 93 3d 13 sts 0x133D, r25 ; 0x80133d FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { if (dataTO.Record(ss)) { 2dfe4: 91 11 cpse r25, r1 2dfe6: 0d c0 rjmp .+26 ; 0x2e002 2dfe8: c9 01 movw r24, r18 LogError(msg_P); 2dfea: 0f 94 77 6f call 0x2deee ; 0x2deee SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2dfee: 85 e9 ldi r24, 0x95 ; 149 2dff0: 9a ea ldi r25, 0xAA ; 170 2dff2: 0e 94 86 7b call 0xf70c ; 0xf70c /// @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; } 2dff6: 8a e0 ldi r24, 0x0A ; 10 2dff8: 80 93 3d 13 sts 0x133D, r24 ; 0x80133d 2dffc: 80 91 3c 13 lds r24, 0x133C ; 0x80133c 2e000: 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 2e002: 80 e0 ldi r24, 0x00 ; 0 } } 2e004: 08 95 ret 0002e006 : } *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) { 2e006: cf 93 push r28 2e008: df 93 push r29 2e00a: cd b7 in r28, 0x3d ; 61 2e00c: de b7 in r29, 0x3e ; 62 2e00e: 2e 97 sbiw r28, 0x0e ; 14 2e010: 0f b6 in r0, 0x3f ; 63 2e012: f8 94 cli 2e014: de bf out 0x3e, r29 ; 62 2e016: 0f be out 0x3f, r0 ; 63 2e018: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2e01a: 2e e3 ldi r18, 0x3E ; 62 2e01c: 30 e0 ldi r19, 0x00 ; 0 2e01e: 3a 83 std Y+2, r19 ; 0x02 2e020: 29 83 std Y+1, r18 ; 0x01 2e022: fe 01 movw r30, r28 2e024: 33 96 adiw r30, 0x03 ; 3 2e026: 2c e0 ldi r18, 0x0C ; 12 2e028: df 01 movw r26, r30 2e02a: 1d 92 st X+, r1 2e02c: 2a 95 dec r18 2e02e: e9 f7 brne .-6 ; 0x2e02a 2e030: de 01 movw r26, r28 2e032: 12 96 adiw r26, 0x02 ; 2 2e034: 48 2f mov r20, r24 2e036: fc 01 movw r30, r24 2e038: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2e03a: 8e 2f mov r24, r30 2e03c: 84 1b sub r24, r20 2e03e: 86 17 cp r24, r22 2e040: 40 f4 brcc .+16 ; 0x2e052 uint8_t b = txbuff[i]; 2e042: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 2e044: 90 ee ldi r25, 0xE0 ; 224 2e046: 98 0f add r25, r24 2e048: 90 36 cpi r25, 0x60 ; 96 2e04a: 08 f0 brcs .+2 ; 0x2e04e b = '.'; 2e04c: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2e04e: 8d 93 st X+, r24 2e050: f4 cf rjmp .-24 ; 0x2e03a } tmp[size + 1] = 0; 2e052: f9 01 movw r30, r18 2e054: e6 0f add r30, r22 2e056: f1 1d adc r31, r1 2e058: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2e05a: 4e e0 ldi r20, 0x0E ; 14 2e05c: 50 e0 ldi r21, 0x00 ; 0 2e05e: 68 ef ldi r22, 0xF8 ; 248 2e060: 7a ea ldi r23, 0xAA ; 170 2e062: ce 01 movw r24, r28 2e064: 01 96 adiw r24, 0x01 ; 1 2e066: 0f 94 3a db call 0x3b674 ; 0x3b674 2e06a: 89 2b or r24, r25 2e06c: 59 f4 brne .+22 ; 0x2e084 2e06e: 4e e0 ldi r20, 0x0E ; 14 2e070: 50 e0 ldi r21, 0x00 ; 0 2e072: be 01 movw r22, r28 2e074: 6f 5f subi r22, 0xFF ; 255 2e076: 7f 4f sbci r23, 0xFF ; 255 2e078: 80 e8 ldi r24, 0x80 ; 128 2e07a: 92 e1 ldi r25, 0x12 ; 18 2e07c: 0f 94 cd e3 call 0x3c79a ; 0x3c79a 2e080: 89 2b or r24, r25 2e082: 61 f0 breq .+24 ; 0x2e09c // 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); 2e084: 82 ef ldi r24, 0xF2 ; 242 2e086: 9a ea ldi r25, 0xAA ; 170 2e088: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2e08c: 8c ee ldi r24, 0xEC ; 236 2e08e: 9a ea ldi r25, 0xAA ; 170 2e090: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2e094: ce 01 movw r24, r28 2e096: 01 96 adiw r24, 0x01 ; 1 2e098: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 } strncpy(lastMsg, tmp, rqs); 2e09c: 4e e0 ldi r20, 0x0E ; 14 2e09e: 50 e0 ldi r21, 0x00 ; 0 2e0a0: be 01 movw r22, r28 2e0a2: 6f 5f subi r22, 0xFF ; 255 2e0a4: 7f 4f sbci r23, 0xFF ; 255 2e0a6: 80 e8 ldi r24, 0x80 ; 128 2e0a8: 92 e1 ldi r25, 0x12 ; 18 2e0aa: 0f 94 db e3 call 0x3c7b6 ; 0x3c7b6 } 2e0ae: 2e 96 adiw r28, 0x0e ; 14 2e0b0: 0f b6 in r0, 0x3f ; 63 2e0b2: f8 94 cli 2e0b4: de bf out 0x3e, r29 ; 62 2e0b6: 0f be out 0x3f, r0 ; 63 2e0b8: cd bf out 0x3d, r28 ; 61 2e0ba: df 91 pop r29 2e0bc: cf 91 pop r28 2e0be: 08 95 ret 0002e0c0 : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 2e0c0: cf 92 push r12 2e0c2: df 92 push r13 2e0c4: ef 92 push r14 2e0c6: ff 92 push r15 2e0c8: 1f 93 push r17 2e0ca: cf 93 push r28 2e0cc: df 93 push r29 2e0ce: cd b7 in r28, 0x3d ; 61 2e0d0: de b7 in r29, 0x3e ; 62 2e0d2: 62 97 sbiw r28, 0x12 ; 18 2e0d4: 0f b6 in r0, 0x3f ; 63 2e0d6: f8 94 cli 2e0d8: de bf out 0x3e, r29 ; 62 2e0da: 0f be out 0x3f, r0 ; 63 2e0dc: cd bf out 0x3d, r28 ; 61 2e0de: 4e 87 std Y+14, r20 ; 0x0e 2e0e0: 5f 87 std Y+15, r21 ; 0x0f 2e0e2: 68 8b std Y+16, r22 ; 0x10 2e0e4: 79 8b std Y+17, r23 ; 0x11 2e0e6: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2e0e8: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2e0ea: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e0ec: 51 11 cpse r21, r1 2e0ee: 31 c0 rjmp .+98 ; 0x2e152 *dst = '0'; 2e0f0: 80 e3 ldi r24, 0x30 ; 48 2e0f2: 8a 83 std Y+2, r24 ; 0x02 return 1; 2e0f4: 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); 2e0f6: e1 e0 ldi r30, 0x01 ; 1 2e0f8: e1 0f add r30, r17 2e0fa: 81 e0 ldi r24, 0x01 ; 1 2e0fc: 90 e0 ldi r25, 0x00 ; 0 2e0fe: 8c 0f add r24, r28 2e100: 9d 1f adc r25, r29 2e102: 8e 0f add r24, r30 2e104: 91 1d adc r25, r1 2e106: fc 01 movw r30, r24 2e108: 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 2e10a: 9a e2 ldi r25, 0x2A ; 42 2e10c: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e10e: 81 11 cpse r24, r1 2e110: 27 c0 rjmp .+78 ; 0x2e160 *dst = '0'; 2e112: 80 e3 ldi r24, 0x30 ; 48 2e114: 81 83 std Z+1, r24 ; 0x01 return 1; 2e116: 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); 2e118: 1e 5f subi r17, 0xFE ; 254 2e11a: 18 0f add r17, r24 txbuff[i] = '\n'; 2e11c: e1 e0 ldi r30, 0x01 ; 1 2e11e: f0 e0 ldi r31, 0x00 ; 0 2e120: ec 0f add r30, r28 2e122: fd 1f adc r31, r29 2e124: e1 0f add r30, r17 2e126: f1 1d adc r31, r1 2e128: 8a e0 ldi r24, 0x0A ; 10 2e12a: 80 83 st Z, r24 ++i; 2e12c: 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); 2e12e: fe 01 movw r30, r28 2e130: 31 96 adiw r30, 0x01 ; 1 2e132: 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--){ 2e134: 6f 01 movw r12, r30 2e136: c1 0e add r12, r17 2e138: d1 1c adc r13, r1 2e13a: ec 14 cp r14, r12 2e13c: fd 04 cpc r15, r13 2e13e: b1 f0 breq .+44 ; 0x2e16c fputc(*buffer, uart2io); 2e140: f7 01 movw r30, r14 2e142: 81 91 ld r24, Z+ 2e144: 7f 01 movw r14, r30 2e146: 62 e7 ldi r22, 0x72 ; 114 2e148: 72 e1 ldi r23, 0x12 ; 18 2e14a: 90 e0 ldi r25, 0x00 ; 0 2e14c: 0f 94 c3 db call 0x3b786 ; 0x3b786 2e150: f4 cf rjmp .-24 ; 0x2e13a 2e152: be 01 movw r22, r28 2e154: 6e 5f subi r22, 0xFE ; 254 2e156: 7f 4f sbci r23, 0xFF ; 255 2e158: 0f 94 86 c2 call 0x3850c ; 0x3850c 2e15c: 18 2f mov r17, r24 2e15e: cb cf rjmp .-106 ; 0x2e0f6 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); 2e160: bf 01 movw r22, r30 2e162: 6f 5f subi r22, 0xFF ; 255 2e164: 7f 4f sbci r23, 0xFF ; 255 2e166: 0f 94 86 c2 call 0x3850c ; 0x3850c 2e16a: d6 cf rjmp .-84 ; 0x2e118 LogRequestMsg(txbuff, len); 2e16c: 61 2f mov r22, r17 2e16e: ce 01 movw r24, r28 2e170: 01 96 adiw r24, 0x01 ; 1 2e172: 0f 94 03 70 call 0x2e006 ; 0x2e006 RecordUARTActivity(); 2e176: 0f 94 5a 6f call 0x2deb4 ; 0x2deb4 } 2e17a: 62 96 adiw r28, 0x12 ; 18 2e17c: 0f b6 in r0, 0x3f ; 63 2e17e: f8 94 cli 2e180: de bf out 0x3e, r29 ; 62 2e182: 0f be out 0x3f, r0 ; 63 2e184: cd bf out 0x3d, r28 ; 61 2e186: df 91 pop r29 2e188: cf 91 pop r28 2e18a: 1f 91 pop r17 2e18c: ff 90 pop r15 2e18e: ef 90 pop r14 2e190: df 90 pop r13 2e192: cf 90 pop r12 2e194: 08 95 ret 0002e196 : 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) { 2e196: 8f 92 push r8 2e198: 9f 92 push r9 2e19a: af 92 push r10 2e19c: bf 92 push r11 2e19e: df 92 push r13 2e1a0: ef 92 push r14 2e1a2: ff 92 push r15 2e1a4: 0f 93 push r16 2e1a6: 1f 93 push r17 2e1a8: cf 93 push r28 2e1aa: df 93 push r29 2e1ac: cd b7 in r28, 0x3d ; 61 2e1ae: de b7 in r29, 0x3e ; 62 2e1b0: 67 97 sbiw r28, 0x17 ; 23 2e1b2: 0f b6 in r0, 0x3f ; 63 2e1b4: f8 94 cli 2e1b6: de bf out 0x3e, r29 ; 62 2e1b8: 0f be out 0x3f, r0 ; 63 2e1ba: cd bf out 0x3d, r28 ; 61 2e1bc: 18 2f mov r17, r24 2e1be: 7b 01 movw r14, r22 2e1c0: d4 2e mov r13, r20 2e1c2: 07 e5 ldi r16, 0x57 ; 87 2e1c4: 0b 8b std Y+19, r16 ; 0x13 2e1c6: 8c 8b std Y+20, r24 ; 0x14 2e1c8: 7e 8b std Y+22, r23 ; 0x16 2e1ca: 6d 8b std Y+21, r22 ; 0x15 2e1cc: ce 01 movw r24, r28 2e1ce: 43 96 adiw r24, 0x13 ; 19 2e1d0: 0f 94 b2 c2 call 0x38564 ; 0x38564 2e1d4: 8f 8b std Y+23, r24 ; 0x17 2e1d6: 0e 87 std Y+14, r16 ; 0x0e 2e1d8: 1f 87 std Y+15, r17 ; 0x0f 2e1da: f9 8a std Y+17, r15 ; 0x11 2e1dc: e8 8a std Y+16, r14 ; 0x10 2e1de: ce 01 movw r24, r28 2e1e0: 0e 96 adiw r24, 0x0e ; 14 2e1e2: 0f 94 b2 c2 call 0x38564 ; 0x38564 2e1e6: 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; 2e1e8: 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) { 2e1ea: 11 11 cpse r17, r1 2e1ec: 27 c0 rjmp .+78 ; 0x2e23c *dst = '0'; 2e1ee: 80 e3 ldi r24, 0x30 ; 48 2e1f0: 8a 83 std Y+2, r24 ; 0x02 return 1; 2e1f2: 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); 2e1f4: e1 e0 ldi r30, 0x01 ; 1 2e1f6: e8 0f add r30, r24 dst[i] = ' '; 2e1f8: 21 e0 ldi r18, 0x01 ; 1 2e1fa: 30 e0 ldi r19, 0x00 ; 0 2e1fc: 2c 0f add r18, r28 2e1fe: 3d 1f adc r19, r29 2e200: 2e 0f add r18, r30 2e202: 31 1d adc r19, r1 2e204: f9 01 movw r30, r18 2e206: 90 e2 ldi r25, 0x20 ; 32 2e208: 90 83 st Z, r25 return i + 1; 2e20a: 02 e0 ldi r16, 0x02 ; 2 2e20c: 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); 2e20e: aa 24 eor r10, r10 2e210: a3 94 inc r10 2e212: b1 2c mov r11, r1 2e214: ac 0e add r10, r28 2e216: bd 1e adc r11, r29 2e218: a0 0e add r10, r16 2e21a: 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) { 2e21c: e1 14 cp r14, r1 2e21e: f1 04 cpc r15, r1 2e220: 39 f1 breq .+78 ; 0x2e270 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 2e222: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 2e224: c7 01 movw r24, r14 2e226: 88 27 eor r24, r24 2e228: 90 7f andi r25, 0xF0 ; 240 2e22a: 89 2b or r24, r25 2e22c: 71 f4 brne .+28 ; 0x2e24a value <<= 4U; 2e22e: 24 e0 ldi r18, 0x04 ; 4 2e230: ee 0c add r14, r14 2e232: ff 1c adc r15, r15 2e234: 2a 95 dec r18 2e236: e1 f7 brne .-8 ; 0x2e230 --charsOut; 2e238: 11 50 subi r17, 0x01 ; 1 2e23a: f4 cf rjmp .-24 ; 0x2e224 2e23c: be 01 movw r22, r28 2e23e: 6e 5f subi r22, 0xFE ; 254 2e240: 7f 4f sbci r23, 0xFF ; 255 2e242: 81 2f mov r24, r17 2e244: 0f 94 86 c2 call 0x3850c ; 0x3850c 2e248: d5 cf rjmp .-86 ; 0x2e1f4 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2e24a: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2e24c: 88 2d mov r24, r8 2e24e: 8a 19 sub r24, r10 2e250: 81 17 cp r24, r17 2e252: 90 f4 brcc .+36 ; 0x2e278 uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 2e254: 8f 2d mov r24, r15 2e256: 82 95 swap r24 2e258: 8f 70 andi r24, 0x0F ; 15 2e25a: 94 e0 ldi r25, 0x04 ; 4 2e25c: ee 0c add r14, r14 2e25e: ff 1c adc r15, r15 2e260: 9a 95 dec r25 2e262: e1 f7 brne .-8 ; 0x2e25c 2e264: 0f 94 7c c2 call 0x384f8 ; 0x384f8 2e268: f4 01 movw r30, r8 2e26a: 81 93 st Z+, r24 2e26c: 4f 01 movw r8, r30 2e26e: ee cf rjmp .-36 ; 0x2e24c } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 2e270: 80 e3 ldi r24, 0x30 ; 48 2e272: f5 01 movw r30, r10 2e274: 80 83 st Z, r24 return 1; 2e276: 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); 2e278: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2e27a: e1 e0 ldi r30, 0x01 ; 1 2e27c: f0 e0 ldi r31, 0x00 ; 0 2e27e: ec 0f add r30, r28 2e280: fd 1f adc r31, r29 2e282: e1 0f add r30, r17 2e284: f1 1d adc r31, r1 2e286: 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 2e288: 9a e2 ldi r25, 0x2A ; 42 2e28a: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e28c: 81 11 cpse r24, r1 2e28e: 21 c0 rjmp .+66 ; 0x2e2d2 *dst = '0'; 2e290: 80 e3 ldi r24, 0x30 ; 48 2e292: 81 83 std Z+1, r24 ; 0x01 return 1; 2e294: 81 e0 ldi r24, 0x01 ; 1 2e296: 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); 2e298: 18 0f add r17, r24 txbuff[i] = '\n'; 2e29a: e1 e0 ldi r30, 0x01 ; 1 2e29c: f0 e0 ldi r31, 0x00 ; 0 2e29e: ec 0f add r30, r28 2e2a0: fd 1f adc r31, r29 2e2a2: e1 0f add r30, r17 2e2a4: f1 1d adc r31, r1 2e2a6: 8a e0 ldi r24, 0x0A ; 10 2e2a8: 80 83 st Z, r24 ++i; 2e2aa: 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); 2e2ac: 9e 01 movw r18, r28 2e2ae: 2f 5f subi r18, 0xFF ; 255 2e2b0: 3f 4f sbci r19, 0xFF ; 255 2e2b2: 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--){ 2e2b4: 59 01 movw r10, r18 2e2b6: a1 0e add r10, r17 2e2b8: b1 1c adc r11, r1 2e2ba: ea 14 cp r14, r10 2e2bc: fb 04 cpc r15, r11 2e2be: 79 f0 breq .+30 ; 0x2e2de fputc(*buffer, uart2io); 2e2c0: f7 01 movw r30, r14 2e2c2: 81 91 ld r24, Z+ 2e2c4: 7f 01 movw r14, r30 2e2c6: 62 e7 ldi r22, 0x72 ; 114 2e2c8: 72 e1 ldi r23, 0x12 ; 18 2e2ca: 90 e0 ldi r25, 0x00 ; 0 2e2cc: 0f 94 c3 db call 0x3b786 ; 0x3b786 2e2d0: f4 cf rjmp .-24 ; 0x2e2ba 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); 2e2d2: bf 01 movw r22, r30 2e2d4: 6f 5f subi r22, 0xFF ; 255 2e2d6: 7f 4f sbci r23, 0xFF ; 255 2e2d8: 0f 94 86 c2 call 0x3850c ; 0x3850c 2e2dc: dc cf rjmp .-72 ; 0x2e296 LogRequestMsg(txbuff, len); 2e2de: 61 2f mov r22, r17 2e2e0: ce 01 movw r24, r28 2e2e2: 01 96 adiw r24, 0x01 ; 1 2e2e4: 0f 94 03 70 call 0x2e006 ; 0x2e006 RecordUARTActivity(); 2e2e8: 0f 94 5a 6f call 0x2deb4 ; 0x2deb4 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 2e2ec: d0 92 2c 13 sts 0x132C, r13 ; 0x80132c } 2e2f0: 67 96 adiw r28, 0x17 ; 23 2e2f2: 0f b6 in r0, 0x3f ; 63 2e2f4: f8 94 cli 2e2f6: de bf out 0x3e, r29 ; 62 2e2f8: 0f be out 0x3f, r0 ; 63 2e2fa: cd bf out 0x3d, r28 ; 61 2e2fc: df 91 pop r29 2e2fe: cf 91 pop r28 2e300: 1f 91 pop r17 2e302: 0f 91 pop r16 2e304: ff 90 pop r15 2e306: ef 90 pop r14 2e308: df 90 pop r13 2e30a: bf 90 pop r11 2e30c: af 90 pop r10 2e30e: 9f 90 pop r9 2e310: 8f 90 pop r8 2e312: 08 95 ret 0002e314 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 2e314: 20 91 77 13 lds r18, 0x1377 ; 0x801377 2e318: 2f 5f subi r18, 0xFF ; 255 2e31a: 20 93 77 13 sts 0x1377, r18 ; 0x801377 if (regIndex >= initRegs8Count) { 2e31e: 22 30 cpi r18, 0x02 ; 2 2e320: 78 f4 brcc .+30 ; 0x2e340 return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2e322: 30 e0 ldi r19, 0x00 ; 0 2e324: f9 01 movw r30, r18 2e326: ed 56 subi r30, 0x6D ; 109 2e328: f5 45 sbci r31, 0x55 ; 85 2e32a: 84 91 lpm r24, Z 2e32c: 2b 58 subi r18, 0x8B ; 139 2e32e: 3c 4e sbci r19, 0xEC ; 236 2e330: f9 01 movw r30, r18 2e332: 60 81 ld r22, Z 2e334: 70 e0 ldi r23, 0x00 ; 0 2e336: 49 e0 ldi r20, 0x09 ; 9 2e338: 0f 94 cb 70 call 0x2e196 ; 0x2e196 } return false; 2e33c: 80 e0 ldi r24, 0x00 ; 0 2e33e: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 2e340: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 2e342: 08 95 ret 0002e344 : * \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) { 2e344: 8f 92 push r8 2e346: 9f 92 push r9 2e348: af 92 push r10 2e34a: bf 92 push r11 2e34c: cf 92 push r12 2e34e: df 92 push r13 2e350: ef 92 push r14 2e352: ff 92 push r15 2e354: cf 93 push r28 2e356: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 2e358: 2b ed ldi r18, 0xDB ; 219 2e35a: 36 e1 ldi r19, 0x16 ; 22 2e35c: 30 93 79 0e sts 0x0E79, r19 ; 0x800e79 2e360: 20 93 78 0e sts 0x0E78, r18 ; 0x800e78 fatType_ = 0; 2e364: 10 92 f7 16 sts 0x16F7, r1 ; 0x8016f7 allocSearchStart_ = 2; 2e368: 42 e0 ldi r20, 0x02 ; 2 2e36a: 50 e0 ldi r21, 0x00 ; 0 2e36c: 60 e0 ldi r22, 0x00 ; 0 2e36e: 70 e0 ldi r23, 0x00 ; 0 2e370: 40 93 e0 16 sts 0x16E0, r20 ; 0x8016e0 2e374: 50 93 e1 16 sts 0x16E1, r21 ; 0x8016e1 2e378: 60 93 e2 16 sts 0x16E2, r22 ; 0x8016e2 2e37c: 70 93 e3 16 sts 0x16E3, r23 ; 0x8016e3 cacheDirty_ = 0; // cacheFlush() will write block if true 2e380: 10 92 77 0e sts 0x0E77, r1 ; 0x800e77 cacheMirrorBlock_ = 0; 2e384: 10 92 73 0e sts 0x0E73, r1 ; 0x800e73 2e388: 10 92 74 0e sts 0x0E74, r1 ; 0x800e74 2e38c: 10 92 75 0e sts 0x0E75, r1 ; 0x800e75 2e390: 10 92 76 0e sts 0x0E76, r1 ; 0x800e76 cacheBlockNumber_ = 0XFFFFFFFF; 2e394: 4f ef ldi r20, 0xFF ; 255 2e396: 5f ef ldi r21, 0xFF ; 255 2e398: ba 01 movw r22, r20 2e39a: 40 93 6f 0e sts 0x0E6F, r20 ; 0x800e6f 2e39e: 50 93 70 0e sts 0x0E70, r21 ; 0x800e70 2e3a2: 60 93 71 0e sts 0x0E71, r22 ; 0x800e71 2e3a6: 70 93 72 0e sts 0x0E72, r23 ; 0x800e72 // if part == 0 assume super floppy with FAT boot sector in block zero // if part > 0 assume mbr volume with partition table if (part) { 2e3aa: 88 23 and r24, r24 2e3ac: 09 f4 brne .+2 ; 0x2e3b0 2e3ae: 70 c0 rjmp .+224 ; 0x2e490 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2e3b0: 40 e0 ldi r20, 0x00 ; 0 2e3b2: 60 e0 ldi r22, 0x00 ; 0 2e3b4: 70 e0 ldi r23, 0x00 ; 0 2e3b6: cb 01 movw r24, r22 2e3b8: 0f 94 a4 6a call 0x2d548 ; 0x2d548 2e3bc: 81 11 cpse r24, r1 2e3be: 0d c0 rjmp .+26 ; 0x2e3da fatType_ = 32; } return true; fail: return false; 2e3c0: c0 e0 ldi r28, 0x00 ; 0 } 2e3c2: 8c 2f mov r24, r28 2e3c4: df 91 pop r29 2e3c6: cf 91 pop r28 2e3c8: ff 90 pop r15 2e3ca: ef 90 pop r14 2e3cc: df 90 pop r13 2e3ce: cf 90 pop r12 2e3d0: bf 90 pop r11 2e3d2: af 90 pop r10 2e3d4: 9f 90 pop r9 2e3d6: 8f 90 pop r8 2e3d8: 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 || 2e3da: 80 91 39 10 lds r24, 0x1039 ; 0x801039 2e3de: 8f 77 andi r24, 0x7F ; 127 2e3e0: 79 f7 brne .-34 ; 0x2e3c0 2e3e2: 80 91 45 10 lds r24, 0x1045 ; 0x801045 2e3e6: 90 91 46 10 lds r25, 0x1046 ; 0x801046 2e3ea: a0 91 47 10 lds r26, 0x1047 ; 0x801047 2e3ee: b0 91 48 10 lds r27, 0x1048 ; 0x801048 2e3f2: 84 36 cpi r24, 0x64 ; 100 2e3f4: 91 05 cpc r25, r1 2e3f6: a1 05 cpc r26, r1 2e3f8: b1 05 cpc r27, r1 2e3fa: 10 f3 brcs .-60 ; 0x2e3c0 p->totalSectors < 100 || p->firstSector == 0) { 2e3fc: c0 90 41 10 lds r12, 0x1041 ; 0x801041 2e400: d0 90 42 10 lds r13, 0x1042 ; 0x801042 2e404: e0 90 43 10 lds r14, 0x1043 ; 0x801043 2e408: f0 90 44 10 lds r15, 0x1044 ; 0x801044 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 || 2e40c: c1 14 cp r12, r1 2e40e: d1 04 cpc r13, r1 2e410: e1 04 cpc r14, r1 2e412: f1 04 cpc r15, r1 2e414: a9 f2 breq .-86 ; 0x2e3c0 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2e416: 40 e0 ldi r20, 0x00 ; 0 2e418: c7 01 movw r24, r14 2e41a: b6 01 movw r22, r12 2e41c: 0f 94 a4 6a call 0x2d548 ; 0x2d548 2e420: c8 2f mov r28, r24 2e422: 88 23 and r24, r24 2e424: 69 f2 breq .-102 ; 0x2e3c0 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2e426: 80 91 86 0e lds r24, 0x0E86 ; 0x800e86 2e42a: 90 91 87 0e lds r25, 0x0E87 ; 0x800e87 2e42e: 81 15 cp r24, r1 2e430: 92 40 sbci r25, 0x02 ; 2 2e432: 31 f6 brne .-116 ; 0x2e3c0 fbs->fatCount == 0 || 2e434: a0 91 8b 0e lds r26, 0x0E8B ; 0x800e8b } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2e438: aa 23 and r26, r26 2e43a: 11 f2 breq .-124 ; 0x2e3c0 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2e43c: 60 91 89 0e lds r22, 0x0E89 ; 0x800e89 2e440: 70 91 8a 0e lds r23, 0x0E8A ; 0x800e8a volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || 2e444: 61 15 cp r22, r1 2e446: 71 05 cpc r23, r1 2e448: 09 f4 brne .+2 ; 0x2e44c 2e44a: ba cf rjmp .-140 ; 0x2e3c0 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 2e44c: 20 91 88 0e lds r18, 0x0E88 ; 0x800e88 } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2e450: 22 23 and r18, r18 2e452: 09 f4 brne .+2 ; 0x2e456 2e454: b5 cf rjmp .-150 ; 0x2e3c0 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 2e456: a0 93 f2 16 sts 0x16F2, r26 ; 0x8016f2 blocksPerCluster_ = fbs->sectorsPerCluster; 2e45a: 20 93 e4 16 sts 0x16E4, r18 ; 0x8016e4 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 2e45e: 90 e0 ldi r25, 0x00 ; 0 2e460: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 2e462: 30 e0 ldi r19, 0x00 ; 0 2e464: e1 e0 ldi r30, 0x01 ; 1 2e466: f0 e0 ldi r31, 0x00 ; 0 2e468: d8 2f mov r29, r24 2e46a: af 01 movw r20, r30 2e46c: 08 2e mov r0, r24 2e46e: 02 c0 rjmp .+4 ; 0x2e474 2e470: 44 0f add r20, r20 2e472: 55 1f adc r21, r21 2e474: 0a 94 dec r0 2e476: e2 f7 brpl .-8 ; 0x2e470 2e478: 24 17 cp r18, r20 2e47a: 35 07 cpc r19, r21 2e47c: 69 f0 breq .+26 ; 0x2e498 2e47e: 41 e0 ldi r20, 0x01 ; 1 2e480: 48 0f add r20, r24 2e482: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 2e484: 89 30 cpi r24, 0x09 ; 9 2e486: 91 05 cpc r25, r1 2e488: 79 f7 brne .-34 ; 0x2e468 2e48a: 40 93 ed 16 sts 0x16ED, r20 ; 0x8016ed 2e48e: 98 cf rjmp .-208 ; 0x2e3c0 * 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; 2e490: c1 2c mov r12, r1 2e492: d1 2c mov r13, r1 2e494: 76 01 movw r14, r12 2e496: bf cf rjmp .-130 ; 0x2e416 2e498: 80 93 ed 16 sts 0x16ED, r24 ; 0x8016ed clusterSizeShift_ = 0; while (blocksPerCluster_ != (1 << clusterSizeShift_)) { // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; } blocksPerFat_ = fbs->sectorsPerFat16 ? 2e49c: 20 91 91 0e lds r18, 0x0E91 ; 0x800e91 2e4a0: 30 91 92 0e lds r19, 0x0E92 ; 0x800e92 2e4a4: 50 e0 ldi r21, 0x00 ; 0 2e4a6: 40 e0 ldi r20, 0x00 ; 0 2e4a8: 21 15 cp r18, r1 2e4aa: 31 05 cpc r19, r1 2e4ac: 41 f4 brne .+16 ; 0x2e4be 2e4ae: 20 91 9f 0e lds r18, 0x0E9F ; 0x800e9f 2e4b2: 30 91 a0 0e lds r19, 0x0EA0 ; 0x800ea0 2e4b6: 40 91 a1 0e lds r20, 0x0EA1 ; 0x800ea1 2e4ba: 50 91 a2 0e lds r21, 0x0EA2 ; 0x800ea2 2e4be: 20 93 e5 16 sts 0x16E5, r18 ; 0x8016e5 2e4c2: 30 93 e6 16 sts 0x16E6, r19 ; 0x8016e6 2e4c6: 40 93 e7 16 sts 0x16E7, r20 ; 0x8016e7 2e4ca: 50 93 e8 16 sts 0x16E8, r21 ; 0x8016e8 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 2e4ce: 46 01 movw r8, r12 2e4d0: 57 01 movw r10, r14 2e4d2: 86 0e add r8, r22 2e4d4: 97 1e adc r9, r23 2e4d6: a1 1c adc r10, r1 2e4d8: b1 1c adc r11, r1 2e4da: 80 92 f3 16 sts 0x16F3, r8 ; 0x8016f3 2e4de: 90 92 f4 16 sts 0x16F4, r9 ; 0x8016f4 2e4e2: a0 92 f5 16 sts 0x16F5, r10 ; 0x8016f5 2e4e6: b0 92 f6 16 sts 0x16F6, r11 ; 0x8016f6 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 2e4ea: e0 91 8c 0e lds r30, 0x0E8C ; 0x800e8c 2e4ee: f0 91 8d 0e lds r31, 0x0E8D ; 0x800e8d 2e4f2: f0 93 f9 16 sts 0x16F9, r31 ; 0x8016f9 2e4f6: e0 93 f8 16 sts 0x16F8, r30 ; 0x8016f8 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 2e4fa: b0 e0 ldi r27, 0x00 ; 0 2e4fc: 0f 94 f0 dd call 0x3bbe0 ; 0x3bbe0 <__muluhisi3> 2e500: dc 01 movw r26, r24 2e502: cb 01 movw r24, r22 2e504: 88 0d add r24, r8 2e506: 99 1d adc r25, r9 2e508: aa 1d adc r26, r10 2e50a: bb 1d adc r27, r11 2e50c: 80 93 fa 16 sts 0x16FA, r24 ; 0x8016fa 2e510: 90 93 fb 16 sts 0x16FB, r25 ; 0x8016fb 2e514: a0 93 fc 16 sts 0x16FC, r26 ; 0x8016fc 2e518: b0 93 fd 16 sts 0x16FD, r27 ; 0x8016fd // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 2e51c: 25 e0 ldi r18, 0x05 ; 5 2e51e: ee 0f add r30, r30 2e520: ff 1f adc r31, r31 2e522: 2a 95 dec r18 2e524: e1 f7 brne .-8 ; 0x2e51e 2e526: e1 50 subi r30, 0x01 ; 1 2e528: fe 4f sbci r31, 0xFE ; 254 2e52a: ef 2f mov r30, r31 2e52c: ff 27 eor r31, r31 2e52e: e6 95 lsr r30 2e530: 8e 0f add r24, r30 2e532: 9f 1f adc r25, r31 2e534: a1 1d adc r26, r1 2e536: b1 1d adc r27, r1 2e538: 80 93 ee 16 sts 0x16EE, r24 ; 0x8016ee 2e53c: 90 93 ef 16 sts 0x16EF, r25 ; 0x8016ef 2e540: a0 93 f0 16 sts 0x16F0, r26 ; 0x8016f0 2e544: b0 93 f1 16 sts 0x16F1, r27 ; 0x8016f1 // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 2e548: 80 90 8e 0e lds r8, 0x0E8E ; 0x800e8e 2e54c: 90 90 8f 0e lds r9, 0x0E8F ; 0x800e8f 2e550: b1 2c mov r11, r1 2e552: a1 2c mov r10, r1 2e554: 81 14 cp r8, r1 2e556: 91 04 cpc r9, r1 2e558: 41 f4 brne .+16 ; 0x2e56a 2e55a: 80 90 9b 0e lds r8, 0x0E9B ; 0x800e9b 2e55e: 90 90 9c 0e lds r9, 0x0E9C ; 0x800e9c 2e562: a0 90 9d 0e lds r10, 0x0E9D ; 0x800e9d 2e566: b0 90 9e 0e lds r11, 0x0E9E ; 0x800e9e fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 2e56a: c8 1a sub r12, r24 2e56c: d9 0a sbc r13, r25 2e56e: ea 0a sbc r14, r26 2e570: fb 0a sbc r15, r27 2e572: c8 0c add r12, r8 2e574: d9 1c adc r13, r9 2e576: ea 1c adc r14, r10 2e578: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 2e57a: 04 c0 rjmp .+8 ; 0x2e584 2e57c: f6 94 lsr r15 2e57e: e7 94 ror r14 2e580: d7 94 ror r13 2e582: c7 94 ror r12 2e584: da 95 dec r29 2e586: d2 f7 brpl .-12 ; 0x2e57c 2e588: c0 92 e9 16 sts 0x16E9, r12 ; 0x8016e9 2e58c: d0 92 ea 16 sts 0x16EA, r13 ; 0x8016ea 2e590: e0 92 eb 16 sts 0x16EB, r14 ; 0x8016eb 2e594: f0 92 ec 16 sts 0x16EC, r15 ; 0x8016ec // FAT type is determined by cluster count if (clusterCount_ < 4085) { 2e598: 85 ef ldi r24, 0xF5 ; 245 2e59a: c8 16 cp r12, r24 2e59c: 8f e0 ldi r24, 0x0F ; 15 2e59e: d8 06 cpc r13, r24 2e5a0: e1 04 cpc r14, r1 2e5a2: f1 04 cpc r15, r1 2e5a4: 20 f4 brcc .+8 ; 0x2e5ae fatType_ = 12; 2e5a6: 8c e0 ldi r24, 0x0C ; 12 2e5a8: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 2e5ac: 09 cf rjmp .-494 ; 0x2e3c0 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 2e5ae: 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) { 2e5b0: 25 ef ldi r18, 0xF5 ; 245 2e5b2: c2 16 cp r12, r18 2e5b4: 2f ef ldi r18, 0xFF ; 255 2e5b6: d2 06 cpc r13, r18 2e5b8: e1 04 cpc r14, r1 2e5ba: f1 04 cpc r15, r1 2e5bc: 88 f0 brcs .+34 ; 0x2e5e0 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 2e5be: 80 91 a7 0e lds r24, 0x0EA7 ; 0x800ea7 2e5c2: 90 91 a8 0e lds r25, 0x0EA8 ; 0x800ea8 2e5c6: a0 91 a9 0e lds r26, 0x0EA9 ; 0x800ea9 2e5ca: b0 91 aa 0e lds r27, 0x0EAA ; 0x800eaa 2e5ce: 80 93 fa 16 sts 0x16FA, r24 ; 0x8016fa 2e5d2: 90 93 fb 16 sts 0x16FB, r25 ; 0x8016fb 2e5d6: a0 93 fc 16 sts 0x16FC, r26 ; 0x8016fc 2e5da: b0 93 fd 16 sts 0x16FD, r27 ; 0x8016fd fatType_ = 32; 2e5de: 80 e2 ldi r24, 0x20 ; 32 2e5e0: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 2e5e4: ee ce rjmp .-548 ; 0x2e3c2 0002e5e6 : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 2e5e6: 20 e0 ldi r18, 0x00 ; 0 2e5e8: 30 e0 ldi r19, 0x00 ; 0 2e5ea: 40 ea ldi r20, 0xA0 ; 160 2e5ec: 52 e4 ldi r21, 0x42 ; 66 2e5ee: 60 e0 ldi r22, 0x00 ; 0 2e5f0: 70 e0 ldi r23, 0x00 ; 0 2e5f2: 80 ea ldi r24, 0xA0 ; 160 2e5f4: 92 ec ldi r25, 0xC2 ; 194 2e5f6: 0d 94 fa c2 jmp 0x385f4 ; 0x385f4 0002e5fa : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 2e5fa: 90 91 99 13 lds r25, 0x1399 ; 0x801399 2e5fe: 91 fd sbrc r25, 1 2e600: 17 c0 rjmp .+46 ; 0x2e630 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 2e602: 88 23 and r24, r24 2e604: a9 f0 breq .+42 ; 0x2e630 2e606: 92 fd sbrc r25, 2 2e608: 13 c0 rjmp .+38 ; 0x2e630 Disable_E0(); 2e60a: 0f 94 f8 c2 call 0x385f0 ; 0x385f0 resume_hotend_temp = thermal_degTargetHotend(); 2e60e: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 2e612: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 2e616: 90 93 8e 13 sts 0x138E, r25 ; 0x80138e 2e61a: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d mmu_print_saved |= SavedState::CooldownPending; 2e61e: 80 91 99 13 lds r24, 0x1399 ; 0x801399 2e622: 84 60 ori r24, 0x04 ; 4 2e624: 80 93 99 13 sts 0x1399, r24 ; 0x801399 LogEchoEvent_P(PSTR("Heater cooldown pending")); 2e628: 83 e6 ldi r24, 0x63 ; 99 2e62a: 97 ea ldi r25, 0xA7 ; 167 2e62c: 0d 94 1e c3 jmp 0x3863c ; 0x3863c } } 2e630: 08 95 ret 0002e632 : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 2e632: 80 91 99 13 lds r24, 0x1399 ; 0x801399 2e636: 80 ff sbrs r24, 0 2e638: 47 c0 rjmp .+142 ; 0x2e6c8 LogEchoEvent_P(PSTR("Resuming XYZ")); 2e63a: 8b e7 ldi r24, 0x7B ; 123 2e63c: 97 ea ldi r25, 0xA7 ; 167 2e63e: 0f 94 1e c3 call 0x3863c ; 0x3863c // 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)); 2e642: 80 91 85 13 lds r24, 0x1385 ; 0x801385 2e646: 90 91 86 13 lds r25, 0x1386 ; 0x801386 2e64a: a0 91 87 13 lds r26, 0x1387 ; 0x801387 2e64e: b0 91 88 13 lds r27, 0x1388 ; 0x801388 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; 2e652: 40 91 81 13 lds r20, 0x1381 ; 0x801381 2e656: 50 91 82 13 lds r21, 0x1382 ; 0x801382 2e65a: 60 91 83 13 lds r22, 0x1383 ; 0x801383 2e65e: 70 91 84 13 lds r23, 0x1384 ; 0x801384 2e662: 40 93 43 07 sts 0x0743, r20 ; 0x800743 2e666: 50 93 44 07 sts 0x0744, r21 ; 0x800744 2e66a: 60 93 45 07 sts 0x0745, r22 ; 0x800745 2e66e: 70 93 46 07 sts 0x0746, r23 ; 0x800746 current_position[Y_AXIS] = ry; 2e672: 80 93 47 07 sts 0x0747, r24 ; 0x800747 2e676: 90 93 48 07 sts 0x0748, r25 ; 0x800748 2e67a: a0 93 49 07 sts 0x0749, r26 ; 0x800749 2e67e: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a planner_line_to_current_position_sync(feedRate_mm_s); 2e682: 60 e0 ldi r22, 0x00 ; 0 2e684: 70 e0 ldi r23, 0x00 ; 0 2e686: 88 e4 ldi r24, 0x48 ; 72 2e688: 92 e4 ldi r25, 0x42 ; 66 2e68a: 0f 94 1a c3 call 0x38634 ; 0x38634 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 2e68e: 80 91 89 13 lds r24, 0x1389 ; 0x801389 2e692: 90 91 8a 13 lds r25, 0x138A ; 0x80138a 2e696: a0 91 8b 13 lds r26, 0x138B ; 0x80138b 2e69a: b0 91 8c 13 lds r27, 0x138C ; 0x80138c 2e69e: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 2e6a2: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 2e6a6: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 2e6aa: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e planner_line_to_current_position_sync(feedRate_mm_s); 2e6ae: 60 e0 ldi r22, 0x00 ; 0 2e6b0: 70 e0 ldi r23, 0x00 ; 0 2e6b2: 80 e7 ldi r24, 0x70 ; 112 2e6b4: 91 e4 ldi r25, 0x41 ; 65 2e6b6: 0f 94 1a c3 call 0x38634 ; 0x38634 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 2e6ba: 10 92 53 07 sts 0x0753, r1 ; 0x800753 // 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); 2e6be: 80 91 99 13 lds r24, 0x1399 ; 0x801399 2e6c2: 8e 7f andi r24, 0xFE ; 254 2e6c4: 80 93 99 13 sts 0x1399, r24 ; 0x801399 } } 2e6c8: 08 95 ret 0002e6ca : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2e6ca: 0f 93 push r16 2e6cc: 1f 93 push r17 2e6ce: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 2e6d0: 90 91 99 13 lds r25, 0x1399 ; 0x801399 2e6d4: 91 11 cpse r25, r1 2e6d6: 72 c0 rjmp .+228 ; 0x2e7bc 2e6d8: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2e6da: 80 e5 ldi r24, 0x50 ; 80 2e6dc: 97 ea ldi r25, 0xA7 ; 167 2e6de: 0f 94 1e c3 call 0x3863c ; 0x3863c Disable_E0(); 2e6e2: 0f 94 f8 c2 call 0x385f0 ; 0x385f0 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2e6e6: 0f 94 27 58 call 0x2b04e ; 0x2b04e /// 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; 2e6ea: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 2e6ee: 81 11 cpse r24, r1 2e6f0: 02 c0 rjmp .+4 ; 0x2e6f6 2e6f2: 0e 94 7e 65 call 0xcafc ; 0xcafc // 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) { 2e6f6: cc 23 and r28, r28 2e6f8: 09 f4 brne .+2 ; 0x2e6fc 2e6fa: 60 c0 rjmp .+192 ; 0x2e7bc mmu_print_saved |= SavedState::ParkExtruder; 2e6fc: 80 91 99 13 lds r24, 0x1399 ; 0x801399 2e700: 81 60 ori r24, 0x01 ; 1 2e702: 80 93 99 13 sts 0x1399, r24 ; 0x801399 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]); 2e706: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 2e70a: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 2e70e: a0 91 4d 07 lds r26, 0x074D ; 0x80074d 2e712: b0 91 4e 07 lds r27, 0x074E ; 0x80074e 2e716: 40 91 47 07 lds r20, 0x0747 ; 0x800747 2e71a: 50 91 48 07 lds r21, 0x0748 ; 0x800748 2e71e: 60 91 49 07 lds r22, 0x0749 ; 0x800749 2e722: 70 91 4a 07 lds r23, 0x074A ; 0x80074a resume_position = planner_current_position(); // save current pos 2e726: 00 91 43 07 lds r16, 0x0743 ; 0x800743 2e72a: 10 91 44 07 lds r17, 0x0744 ; 0x800744 2e72e: 20 91 45 07 lds r18, 0x0745 ; 0x800745 2e732: 30 91 46 07 lds r19, 0x0746 ; 0x800746 2e736: 00 93 81 13 sts 0x1381, r16 ; 0x801381 2e73a: 10 93 82 13 sts 0x1382, r17 ; 0x801382 2e73e: 20 93 83 13 sts 0x1383, r18 ; 0x801383 2e742: 30 93 84 13 sts 0x1384, r19 ; 0x801384 2e746: 40 93 85 13 sts 0x1385, r20 ; 0x801385 2e74a: 50 93 86 13 sts 0x1386, r21 ; 0x801386 2e74e: 60 93 87 13 sts 0x1387, r22 ; 0x801387 2e752: 70 93 88 13 sts 0x1388, r23 ; 0x801388 2e756: 80 93 89 13 sts 0x1389, r24 ; 0x801389 2e75a: 90 93 8a 13 sts 0x138A, r25 ; 0x80138a 2e75e: a0 93 8b 13 sts 0x138B, r26 ; 0x80138b 2e762: b0 93 8c 13 sts 0x138C, r27 ; 0x80138c current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } float move_raise_z(float delta) { return raise_z(delta); 2e766: 60 e0 ldi r22, 0x00 ; 0 2e768: 70 e0 ldi r23, 0x00 ; 0 2e76a: 80 ea ldi r24, 0xA0 ; 160 2e76c: 91 e4 ldi r25, 0x41 ; 65 2e76e: 0e 94 16 6f call 0xde2c ; 0xde2c void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2e772: 80 91 40 07 lds r24, 0x0740 ; 0x800740 2e776: 88 23 and r24, r24 2e778: 09 f1 breq .+66 ; 0x2e7bc 2e77a: 80 91 41 07 lds r24, 0x0741 ; 0x800741 2e77e: 88 23 and r24, r24 2e780: e9 f0 breq .+58 ; 0x2e7bc 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; 2e782: 80 e0 ldi r24, 0x00 ; 0 2e784: 90 e0 ldi r25, 0x00 ; 0 2e786: aa ef ldi r26, 0xFA ; 250 2e788: b2 e4 ldi r27, 0x42 ; 66 2e78a: 80 93 43 07 sts 0x0743, r24 ; 0x800743 2e78e: 90 93 44 07 sts 0x0744, r25 ; 0x800744 2e792: a0 93 45 07 sts 0x0745, r26 ; 0x800745 2e796: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2e79a: 10 92 47 07 sts 0x0747, r1 ; 0x800747 2e79e: 10 92 48 07 sts 0x0748, r1 ; 0x800748 2e7a2: 10 92 49 07 sts 0x0749, r1 ; 0x800749 2e7a6: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2e7aa: 60 e0 ldi r22, 0x00 ; 0 2e7ac: 70 e0 ldi r23, 0x00 ; 0 2e7ae: 88 e4 ldi r24, 0x48 ; 72 2e7b0: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2e7b2: cf 91 pop r28 2e7b4: 1f 91 pop r17 2e7b6: 0f 91 pop r16 2e7b8: 0d 94 1a c3 jmp 0x38634 ; 0x38634 2e7bc: cf 91 pop r28 2e7be: 1f 91 pop r17 2e7c0: 0f 91 pop r16 2e7c2: 08 95 ret 0002e7c4 : 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){ 2e7c4: ef 92 push r14 2e7c6: ff 92 push r15 2e7c8: 0f 93 push r16 2e7ca: 1f 93 push r17 2e7cc: cf 93 push r28 2e7ce: df 93 push r29 2e7d0: 1f 92 push r1 2e7d2: 1f 92 push r1 2e7d4: cd b7 in r28, 0x3d ; 61 2e7d6: de b7 in r29, 0x3e ; 62 2e7d8: f8 2e mov r15, r24 2e7da: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2e7dc: 80 e1 ldi r24, 0x10 ; 16 2e7de: 97 e2 ldi r25, 0x27 ; 39 2e7e0: 9a 83 std Y+2, r25 ; 0x02 2e7e2: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 2e7e4: 8a 01 movw r16, r20 2e7e6: 16 95 lsr r17 2e7e8: 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); 2e7ea: 8f 2d mov r24, r15 2e7ec: 0e 94 be e0 call 0x1c17c ; 0x1c17c while (steps--){ 2e7f0: 01 50 subi r16, 0x01 ; 1 2e7f2: 11 09 sbc r17, r1 2e7f4: 78 f0 brcs .+30 ; 0x2e814 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2e7f6: 28 ec ldi r18, 0xC8 ; 200 2e7f8: 30 e0 ldi r19, 0x00 ; 0 2e7fa: ae 01 movw r20, r28 2e7fc: 4f 5f subi r20, 0xFF ; 255 2e7fe: 5f 4f sbci r21, 0xFF ; 255 2e800: 68 ee ldi r22, 0xE8 ; 232 2e802: 73 e0 ldi r23, 0x03 ; 3 2e804: 8f 2d mov r24, r15 2e806: 0e 94 8f df call 0x1bf1e ; 0x1bf1e update_position_1_step(axes, dir); 2e80a: 6e 2d mov r22, r14 2e80c: 8f 2d mov r24, r15 2e80e: 0e 94 d7 e0 call 0x1c1ae ; 0x1c1ae 2e812: ee cf rjmp .-36 ; 0x2e7f0 } /// \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); 2e814: 6e 2d mov r22, r14 2e816: 8f 2d mov r24, r15 2e818: 0e 94 be e0 call 0x1c17c ; 0x1c17c 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); } 2e81c: 0f 90 pop r0 2e81e: 0f 90 pop r0 2e820: df 91 pop r29 2e822: cf 91 pop r28 2e824: 1f 91 pop r17 2e826: 0f 91 pop r16 2e828: ff 90 pop r15 2e82a: ef 90 pop r14 2e82c: 08 95 ret 0002e82e : 2e82e: ef 92 push r14 2e830: ff 92 push r15 2e832: 0f 93 push r16 2e834: 1f 93 push r17 2e836: cf 93 push r28 2e838: df 93 push r29 2e83a: cd b7 in r28, 0x3d ; 61 2e83c: de b7 in r29, 0x3e ; 62 2e83e: 2f 97 sbiw r28, 0x0f ; 15 2e840: 0f b6 in r0, 0x3f ; 63 2e842: f8 94 cli 2e844: de bf out 0x3e, r29 ; 62 2e846: 0f be out 0x3f, r0 ; 63 2e848: cd bf out 0x3d, r28 ; 61 2e84a: ee e8 ldi r30, 0x8E ; 142 2e84c: f2 e1 ldi r31, 0x12 ; 18 2e84e: 10 a2 std Z+32, r1 ; 0x20 2e850: 11 a2 std Z+33, r1 ; 0x21 2e852: 12 a2 std Z+34, r1 ; 0x22 2e854: 13 a2 std Z+35, r1 ; 0x23 2e856: 14 a2 std Z+36, r1 ; 0x24 2e858: 15 a2 std Z+37, r1 ; 0x25 2e85a: 16 a2 std Z+38, r1 ; 0x26 2e85c: 17 a2 std Z+39, r1 ; 0x27 2e85e: 10 a6 std Z+40, r1 ; 0x28 2e860: 11 a6 std Z+41, r1 ; 0x29 2e862: 10 92 27 13 sts 0x1327, r1 ; 0x801327 2e866: 09 e2 ldi r16, 0x29 ; 41 2e868: 13 e1 ldi r17, 0x13 ; 19 2e86a: ee 24 eor r14, r14 2e86c: e3 94 inc r14 2e86e: f1 2c mov r15, r1 2e870: d8 01 movw r26, r16 2e872: 11 96 adiw r26, 0x01 ; 1 2e874: fc 92 st X, r15 2e876: ee 92 st -X, r14 2e878: 12 96 adiw r26, 0x02 ; 2 2e87a: 1c 92 st X, r1 2e87c: 12 97 sbiw r26, 0x02 ; 2 2e87e: 82 e8 ldi r24, 0x82 ; 130 2e880: 13 96 adiw r26, 0x03 ; 3 2e882: 8c 93 st X, r24 2e884: 40 e0 ldi r20, 0x00 ; 0 2e886: 60 e0 ldi r22, 0x00 ; 0 2e888: 8e e2 ldi r24, 0x2E ; 46 2e88a: 93 e1 ldi r25, 0x13 ; 19 2e88c: 0f 94 d6 c2 call 0x385ac ; 0x385ac 2e890: 40 e0 ldi r20, 0x00 ; 0 2e892: 60 e0 ldi r22, 0x00 ; 0 2e894: 83 e3 ldi r24, 0x33 ; 51 2e896: 93 e1 ldi r25, 0x13 ; 19 2e898: 0f 94 d6 c2 call 0x385ac ; 0x385ac 2e89c: f8 01 movw r30, r16 2e89e: 17 86 std Z+15, r1 ; 0x0f 2e8a0: 10 8a std Z+16, r1 ; 0x10 2e8a2: 11 8a std Z+17, r1 ; 0x11 2e8a4: 12 8a std Z+18, r1 ; 0x12 2e8a6: 13 8a std Z+19, r1 ; 0x13 2e8a8: 8a e0 ldi r24, 0x0A ; 10 2e8aa: 84 8b std Z+20, r24 ; 0x14 2e8ac: 40 e0 ldi r20, 0x00 ; 0 2e8ae: 60 e0 ldi r22, 0x00 ; 0 2e8b0: ce 01 movw r24, r28 2e8b2: 01 96 adiw r24, 0x01 ; 1 2e8b4: 0f 94 d6 c2 call 0x385ac ; 0x385ac 2e8b8: 85 e0 ldi r24, 0x05 ; 5 2e8ba: fe 01 movw r30, r28 2e8bc: 31 96 adiw r30, 0x01 ; 1 2e8be: de 01 movw r26, r28 2e8c0: 16 96 adiw r26, 0x06 ; 6 2e8c2: 01 90 ld r0, Z+ 2e8c4: 0d 92 st X+, r0 2e8c6: 8a 95 dec r24 2e8c8: e1 f7 brne .-8 ; 0x2e8c2 2e8ca: 85 e0 ldi r24, 0x05 ; 5 2e8cc: fe 01 movw r30, r28 2e8ce: 36 96 adiw r30, 0x06 ; 6 2e8d0: ae e3 ldi r26, 0x3E ; 62 2e8d2: b3 e1 ldi r27, 0x13 ; 19 2e8d4: 01 90 ld r0, Z+ 2e8d6: 0d 92 st X+, r0 2e8d8: 8a 95 dec r24 2e8da: e1 f7 brne .-8 ; 0x2e8d4 2e8dc: d8 01 movw r26, r16 2e8de: 5a 96 adiw r26, 0x1a ; 26 2e8e0: 1c 92 st X, r1 2e8e2: 5a 97 sbiw r26, 0x1a ; 26 2e8e4: 5c 96 adiw r26, 0x1c ; 28 2e8e6: 1c 92 st X, r1 2e8e8: 1e 92 st -X, r1 2e8ea: 5b 97 sbiw r26, 0x1b ; 27 2e8ec: 8e e3 ldi r24, 0x3E ; 62 2e8ee: 93 e1 ldi r25, 0x13 ; 19 2e8f0: 0f 94 c5 c2 call 0x3858a ; 0x3858a 2e8f4: f8 01 movw r30, r16 2e8f6: 81 8f std Z+25, r24 ; 0x19 2e8f8: 15 8e std Z+29, r1 ; 0x1d 2e8fa: 16 8e std Z+30, r1 ; 0x1e 2e8fc: 40 e0 ldi r20, 0x00 ; 0 2e8fe: 60 e0 ldi r22, 0x00 ; 0 2e900: 88 e4 ldi r24, 0x48 ; 72 2e902: 93 e1 ldi r25, 0x13 ; 19 2e904: 0f 94 d6 c2 call 0x385ac ; 0x385ac 2e908: d8 01 movw r26, r16 2e90a: 94 96 adiw r26, 0x24 ; 36 2e90c: 1c 92 st X, r1 2e90e: 40 e0 ldi r20, 0x00 ; 0 2e910: 60 e0 ldi r22, 0x00 ; 0 2e912: ce 01 movw r24, r28 2e914: 0b 96 adiw r24, 0x0b ; 11 2e916: 0f 94 d6 c2 call 0x385ac ; 0x385ac 2e91a: 85 e0 ldi r24, 0x05 ; 5 2e91c: fe 01 movw r30, r28 2e91e: 3b 96 adiw r30, 0x0b ; 11 2e920: de 01 movw r26, r28 2e922: 11 96 adiw r26, 0x01 ; 1 2e924: 01 90 ld r0, Z+ 2e926: 0d 92 st X+, r0 2e928: 8a 95 dec r24 2e92a: e1 f7 brne .-8 ; 0x2e924 2e92c: 85 e0 ldi r24, 0x05 ; 5 2e92e: fe 01 movw r30, r28 2e930: 31 96 adiw r30, 0x01 ; 1 2e932: ae e4 ldi r26, 0x4E ; 78 2e934: b3 e1 ldi r27, 0x13 ; 19 2e936: 01 90 ld r0, Z+ 2e938: 0d 92 st X+, r0 2e93a: 8a 95 dec r24 2e93c: e1 f7 brne .-8 ; 0x2e936 2e93e: f8 01 movw r30, r16 2e940: 12 a6 std Z+42, r1 ; 0x2a 2e942: 14 a6 std Z+44, r1 ; 0x2c 2e944: 13 a6 std Z+43, r1 ; 0x2b 2e946: 8e e4 ldi r24, 0x4E ; 78 2e948: 93 e1 ldi r25, 0x13 ; 19 2e94a: 0f 94 c5 c2 call 0x3858a ; 0x3858a 2e94e: d8 01 movw r26, r16 2e950: 99 96 adiw r26, 0x29 ; 41 2e952: 8c 93 st X, r24 2e954: 99 97 sbiw r26, 0x29 ; 41 2e956: dd 96 adiw r26, 0x3d ; 61 2e958: 1c 92 st X, r1 2e95a: dd 97 sbiw r26, 0x3d ; 61 2e95c: 88 e2 ldi r24, 0x28 ; 40 2e95e: 93 e1 ldi r25, 0x13 ; 19 2e960: df 96 adiw r26, 0x3f ; 63 2e962: 9c 93 st X, r25 2e964: 8e 93 st -X, r24 2e966: de 97 sbiw r26, 0x3e ; 62 2e968: f0 92 6a 13 sts 0x136A, r15 ; 0x80136a 2e96c: e0 92 69 13 sts 0x1369, r14 ; 0x801369 2e970: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b 2e974: 1f ef ldi r17, 0xFF ; 255 2e976: 10 93 6c 13 sts 0x136C, r17 ; 0x80136c 2e97a: 0f 94 2e c3 call 0x3865c ; 0x3865c 2e97e: 80 93 6d 13 sts 0x136D, r24 ; 0x80136d 2e982: 10 92 6e 13 sts 0x136E, r1 ; 0x80136e 2e986: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f 2e98a: 10 92 70 13 sts 0x1370, r1 ; 0x801370 2e98e: 10 92 72 13 sts 0x1372, r1 ; 0x801372 2e992: 10 92 71 13 sts 0x1371, r1 ; 0x801371 2e996: 10 92 74 13 sts 0x1374, r1 ; 0x801374 2e99a: 10 92 73 13 sts 0x1373, r1 ; 0x801373 2e99e: 10 92 77 13 sts 0x1377, r1 ; 0x801377 2e9a2: 10 92 78 13 sts 0x1378, r1 ; 0x801378 2e9a6: 10 92 79 13 sts 0x1379, r1 ; 0x801379 2e9aa: 10 92 7a 13 sts 0x137A, r1 ; 0x80137a 2e9ae: 83 e0 ldi r24, 0x03 ; 3 2e9b0: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 2e9b4: 10 92 7e 13 sts 0x137E, r1 ; 0x80137e 2e9b8: 85 e0 ldi r24, 0x05 ; 5 2e9ba: 80 93 75 13 sts 0x1375, r24 ; 0x801375 2e9be: 84 e1 ldi r24, 0x14 ; 20 2e9c0: 80 93 76 13 sts 0x1376, r24 ; 0x801376 2e9c4: 83 e6 ldi r24, 0x63 ; 99 2e9c6: 80 93 7f 13 sts 0x137F, r24 ; 0x80137f 2e9ca: 80 93 80 13 sts 0x1380, r24 ; 0x801380 2e9ce: 10 92 81 13 sts 0x1381, r1 ; 0x801381 2e9d2: 10 92 82 13 sts 0x1382, r1 ; 0x801382 2e9d6: 10 92 83 13 sts 0x1383, r1 ; 0x801383 2e9da: 10 92 84 13 sts 0x1384, r1 ; 0x801384 2e9de: 10 92 85 13 sts 0x1385, r1 ; 0x801385 2e9e2: 10 92 86 13 sts 0x1386, r1 ; 0x801386 2e9e6: 10 92 87 13 sts 0x1387, r1 ; 0x801387 2e9ea: 10 92 88 13 sts 0x1388, r1 ; 0x801388 2e9ee: 10 92 89 13 sts 0x1389, r1 ; 0x801389 2e9f2: 10 92 8a 13 sts 0x138A, r1 ; 0x80138a 2e9f6: 10 92 8b 13 sts 0x138B, r1 ; 0x80138b 2e9fa: 10 92 8c 13 sts 0x138C, r1 ; 0x80138c 2e9fe: 10 92 8e 13 sts 0x138E, r1 ; 0x80138e 2ea02: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d 2ea06: 10 92 8f 13 sts 0x138F, r1 ; 0x80138f 2ea0a: 8e e2 ldi r24, 0x2E ; 46 2ea0c: 90 e8 ldi r25, 0x80 ; 128 2ea0e: 90 93 91 13 sts 0x1391, r25 ; 0x801391 2ea12: 80 93 90 13 sts 0x1390, r24 ; 0x801390 2ea16: 10 93 92 13 sts 0x1392, r17 ; 0x801392 2ea1a: 10 93 93 13 sts 0x1393, r17 ; 0x801393 2ea1e: 10 92 95 13 sts 0x1395, r1 ; 0x801395 2ea22: 10 92 94 13 sts 0x1394, r1 ; 0x801394 2ea26: 10 93 96 13 sts 0x1396, r17 ; 0x801396 2ea2a: 82 e0 ldi r24, 0x02 ; 2 2ea2c: 80 93 97 13 sts 0x1397, r24 ; 0x801397 2ea30: 10 92 98 13 sts 0x1398, r1 ; 0x801398 2ea34: 10 92 99 13 sts 0x1399, r1 ; 0x801399 2ea38: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a 2ea3c: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b 2ea40: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d 2ea44: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c 2ea48: 10 92 9f 13 sts 0x139F, r1 ; 0x80139f 2ea4c: 10 92 9e 13 sts 0x139E, r1 ; 0x80139e 2ea50: 0f 94 e9 8b call 0x317d2 ; 0x317d2 2ea54: ec e6 ldi r30, 0x6C ; 108 2ea56: f4 e1 ldi r31, 0x14 ; 20 2ea58: 10 92 f4 14 sts 0x14F4, r1 ; 0x8014f4 2ea5c: 10 92 f7 14 sts 0x14F7, r1 ; 0x8014f7 2ea60: 10 92 19 15 sts 0x1519, r1 ; 0x801519 2ea64: 10 92 1c 15 sts 0x151C, r1 ; 0x80151c 2ea68: 89 e1 ldi r24, 0x19 ; 25 2ea6a: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db 2ea6e: 10 92 de 16 sts 0x16DE, r1 ; 0x8016de 2ea72: 10 92 df 16 sts 0x16DF, r1 ; 0x8016df 2ea76: 10 92 f7 16 sts 0x16F7, r1 ; 0x8016f7 2ea7a: 10 92 fe 16 sts 0x16FE, r1 ; 0x8016fe 2ea7e: 10 92 01 17 sts 0x1701, r1 ; 0x801701 2ea82: 10 92 7f 17 sts 0x177F, r1 ; 0x80177f 2ea86: 10 92 81 17 sts 0x1781, r1 ; 0x801781 2ea8a: 10 92 80 17 sts 0x1780, r1 ; 0x801780 2ea8e: 10 92 10 16 sts 0x1610, r1 ; 0x801610 2ea92: 10 92 0f 16 sts 0x160F, r1 ; 0x80160f 2ea96: 10 92 7b 17 sts 0x177B, r1 ; 0x80177b 2ea9a: 10 92 7c 17 sts 0x177C, r1 ; 0x80177c 2ea9e: 10 92 7d 17 sts 0x177D, r1 ; 0x80177d 2eaa2: 10 92 7e 17 sts 0x177E, r1 ; 0x80177e 2eaa6: 10 92 82 17 sts 0x1782, r1 ; 0x801782 2eaaa: 10 92 83 17 sts 0x1783, r1 ; 0x801783 2eaae: 10 92 84 17 sts 0x1784, r1 ; 0x801784 2eab2: 10 92 85 17 sts 0x1785, r1 ; 0x801785 2eab6: 12 82 std Z+2, r1 ; 0x02 2eab8: 13 82 std Z+3, r1 ; 0x03 2eaba: 10 82 st Z, r1 2eabc: 11 82 std Z+1, r1 ; 0x01 2eabe: 10 92 0e 16 sts 0x160E, r1 ; 0x80160e 2eac2: 10 92 21 17 sts 0x1721, r1 ; 0x801721 2eac6: ec e3 ldi r30, 0x3C ; 60 2eac8: f5 e1 ldi r31, 0x15 ; 21 2eaca: 82 ed ldi r24, 0xD2 ; 210 2eacc: df 01 movw r26, r30 2eace: 1d 92 st X+, r1 2ead0: 8a 95 dec r24 2ead2: e9 f7 brne .-6 ; 0x2eace 2ead4: 10 92 bd 14 sts 0x14BD, r1 ; 0x8014bd 2ead8: 10 92 bc 14 sts 0x14BC, r1 ; 0x8014bc 2eadc: 10 92 bb 14 sts 0x14BB, r1 ; 0x8014bb 2eae0: 8f e7 ldi r24, 0x7F ; 127 2eae2: 97 e1 ldi r25, 0x17 ; 23 2eae4: 0f 94 e7 3e call 0x27dce ; 0x27dce ::start()> 2eae8: e5 e6 ldi r30, 0x65 ; 101 2eaea: f4 e1 ldi r31, 0x14 ; 20 2eaec: 11 82 std Z+1, r1 ; 0x01 2eaee: 12 82 std Z+2, r1 ; 0x02 2eaf0: 13 82 std Z+3, r1 ; 0x03 2eaf2: 14 82 std Z+4, r1 ; 0x04 2eaf4: 15 82 std Z+5, r1 ; 0x05 2eaf6: 16 82 std Z+6, r1 ; 0x06 2eaf8: 10 83 st Z, r17 2eafa: e8 e8 ldi r30, 0x88 ; 136 2eafc: f7 e1 ldi r31, 0x17 ; 23 2eafe: 15 82 std Z+5, r1 ; 0x05 2eb00: 17 82 std Z+7, r1 ; 0x07 2eb02: 16 82 std Z+6, r1 ; 0x06 2eb04: 8a eb ldi r24, 0xBA ; 186 2eb06: 9c e4 ldi r25, 0x4C ; 76 2eb08: 96 87 std Z+14, r25 ; 0x0e 2eb0a: 85 87 std Z+13, r24 ; 0x0d 2eb0c: 10 8a std Z+16, r1 ; 0x10 2eb0e: 17 86 std Z+15, r1 ; 0x0f 2eb10: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2eb14: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c 2eb18: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d 2eb1c: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e 2eb20: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f 2eb24: 2f 96 adiw r28, 0x0f ; 15 2eb26: 0f b6 in r0, 0x3f ; 63 2eb28: f8 94 cli 2eb2a: de bf out 0x3e, r29 ; 62 2eb2c: 0f be out 0x3f, r0 ; 63 2eb2e: cd bf out 0x3d, r28 ; 61 2eb30: df 91 pop r29 2eb32: cf 91 pop r28 2eb34: 1f 91 pop r17 2eb36: 0f 91 pop r16 2eb38: ff 90 pop r15 2eb3a: ef 90 pop r14 2eb3c: 08 95 ret 0002eb3e : 2eb3e: 42 e0 ldi r20, 0x02 ; 2 2eb40: 0f 94 e7 d5 call 0x3abce ; 0x3abce } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2eb44: 0d 94 5d d6 jmp 0x3acba ; 0x3acba 0002eb48 : 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; 2eb48: 80 91 7f 13 lds r24, 0x137F ; 0x80137f 2eb4c: 83 36 cpi r24, 0x63 ; 99 2eb4e: 09 f4 brne .+2 ; 0x2eb52 2eb50: 8f ef ldi r24, 0xFF ; 255 } 2eb52: 08 95 ret 0002eb54 : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2eb54: 9f b7 in r25, 0x3f ; 63 2eb56: f8 94 cli 2eb58: e5 e0 ldi r30, 0x05 ; 5 2eb5a: f1 e0 ldi r31, 0x01 ; 1 2eb5c: 80 81 ld r24, Z 2eb5e: 80 64 ori r24, 0x40 ; 64 2eb60: 80 83 st Z, r24 2eb62: 9f bf out 0x3f, r25 ; 63 } 2eb64: 08 95 ret 0002eb66 : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2eb66: 0f 93 push r16 2eb68: 1f 93 push r17 2eb6a: cf 93 push r28 2eb6c: df 93 push r29 2eb6e: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2eb70: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2eb74: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2eb76: 0f 94 9b a5 call 0x34b36 ; 0x34b36 2eb7a: 8f 3f cpi r24, 0xFF ; 255 2eb7c: 69 f0 breq .+26 ; 0x2eb98 if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2eb7e: 0f 94 86 3e call 0x27d0c ; 0x27d0c 2eb82: 60 1b sub r22, r16 2eb84: 71 0b sbc r23, r17 2eb86: 6c 17 cp r22, r28 2eb88: 7d 07 cpc r23, r29 2eb8a: a8 f3 brcs .-22 ; 0x2eb76 } return true; fail: return false; 2eb8c: 80 e0 ldi r24, 0x00 ; 0 } 2eb8e: df 91 pop r29 2eb90: cf 91 pop r28 2eb92: 1f 91 pop r17 2eb94: 0f 91 pop r16 2eb96: 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; 2eb98: 81 e0 ldi r24, 0x01 ; 1 2eb9a: f9 cf rjmp .-14 ; 0x2eb8e 0002eb9c : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2eb9c: 80 e0 ldi r24, 0x00 ; 0 2eb9e: 9b ea ldi r25, 0xAB ; 171 2eba0: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 2eba4: 60 e0 ldi r22, 0x00 ; 0 2eba6: 8c ea ldi r24, 0xAC ; 172 2eba8: 9c e0 ldi r25, 0x0C ; 12 2ebaa: 0e 94 14 78 call 0xf028 ; 0xf028 if (status == 1) { 2ebae: 81 30 cpi r24, 0x01 ; 1 2ebb0: 21 f4 brne .+8 ; 0x2ebba SERIAL_ECHOLNRPGM(_O(MSG_ON)); 2ebb2: 8c e0 ldi r24, 0x0C ; 12 2ebb4: 9e e5 ldi r25, 0x5E ; 94 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2ebb6: 0c 94 86 7b jmp 0xf70c ; 0xf70c 2ebba: 86 e0 ldi r24, 0x06 ; 6 2ebbc: 9e e5 ldi r25, 0x5E ; 94 2ebbe: fb cf rjmp .-10 ; 0x2ebb6 0002ebc0 : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2ebc0: bc 01 movw r22, r24 2ebc2: 99 0f add r25, r25 2ebc4: 88 0b sbc r24, r24 2ebc6: 99 0b sbc r25, r25 2ebc8: 0f 94 af d2 call 0x3a55e ; 0x3a55e } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2ebcc: 0d 94 5d d6 jmp 0x3acba ; 0x3acba 0002ebd0 : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2ebd0: 0f 93 push r16 2ebd2: 1f 93 push r17 2ebd4: cf 93 push r28 2ebd6: df 93 push r29 2ebd8: ec 01 movw r28, r24 2ebda: 0f 94 19 db call 0x3b632 ; 0x3b632 <__strlen_P> 2ebde: 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) 2ebe0: 80 36 cpi r24, 0x60 ; 96 2ebe2: 91 05 cpc r25, r1 2ebe4: 08 f0 brcs .+2 ; 0x2ebe8 2ebe6: 85 c0 rjmp .+266 ; 0x2ecf2 return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 2ebe8: 80 91 80 10 lds r24, 0x1080 ; 0x801080 2ebec: 81 11 cpse r24, r1 2ebee: 05 c0 rjmp .+10 ; 0x2ebfa cmdqueue_pop_front(); 2ebf0: 0e 94 c7 78 call 0xf18e ; 0xf18e cmdbuffer_front_already_processed = true; 2ebf4: 81 e0 ldi r24, 0x01 ; 1 2ebf6: 80 93 80 10 sts 0x1080, r24 ; 0x801080 } if (bufindr == bufindw && buflen > 0) 2ebfa: 40 91 70 12 lds r20, 0x1270 ; 0x801270 2ebfe: 50 91 71 12 lds r21, 0x1271 ; 0x801271 2ec02: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.569> 2ec06: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.569+0x1> 2ec0a: 48 17 cp r20, r24 2ec0c: 59 07 cpc r21, r25 2ec0e: 41 f4 brne .+16 ; 0x2ec20 2ec10: 20 91 81 10 lds r18, 0x1081 ; 0x801081 2ec14: 30 91 82 10 lds r19, 0x1082 ; 0x801082 2ec18: 12 16 cp r1, r18 2ec1a: 13 06 cpc r1, r19 2ec1c: 0c f4 brge .+2 ; 0x2ec20 2ec1e: 69 c0 rjmp .+210 ; 0x2ecf2 // 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; 2ec20: 20 91 7c 10 lds r18, 0x107C ; 0x80107c 2ec24: 30 91 7d 10 lds r19, 0x107D ; 0x80107d 2ec28: 12 16 cp r1, r18 2ec2a: 13 06 cpc r1, r19 2ec2c: 0c f0 brlt .+2 ; 0x2ec30 2ec2e: 41 c0 rjmp .+130 ; 0x2ecb2 2ec30: 9c 01 movw r18, r24 2ec32: 2f 59 subi r18, 0x9F ; 159 2ec34: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 2ec36: 84 17 cp r24, r20 2ec38: 95 07 cpc r25, r21 2ec3a: e8 f5 brcc .+122 ; 0x2ecb6 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2ec3c: 44 50 subi r20, 0x04 ; 4 2ec3e: 51 09 sbc r21, r1 2ec40: 40 1b sub r20, r16 2ec42: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2ec44: 42 17 cp r20, r18 2ec46: 53 07 cpc r21, r19 2ec48: 0c f4 brge .+2 ; 0x2ec4c 2ec4a: 53 c0 rjmp .+166 ; 0x2ecf2 } } 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); 2ec4c: 50 93 71 12 sts 0x1271, r21 ; 0x801271 2ec50: 40 93 70 12 sts 0x1270, r20 ; 0x801270 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; 2ec54: 80 91 70 12 lds r24, 0x1270 ; 0x801270 2ec58: 90 91 71 12 lds r25, 0x1271 ; 0x801271 2ec5c: fc 01 movw r30, r24 2ec5e: ed 57 subi r30, 0x7D ; 125 2ec60: ff 4e sbci r31, 0xEF ; 239 2ec62: 23 e0 ldi r18, 0x03 ; 3 2ec64: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 2ec66: be 01 movw r22, r28 2ec68: 8a 57 subi r24, 0x7A ; 122 2ec6a: 9f 4e sbci r25, 0xEF ; 239 2ec6c: 0f 94 12 db call 0x3b624 ; 0x3b624 else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2ec70: 80 91 81 10 lds r24, 0x1081 ; 0x801081 2ec74: 90 91 82 10 lds r25, 0x1082 ; 0x801082 2ec78: 01 96 adiw r24, 0x01 ; 1 2ec7a: 90 93 82 10 sts 0x1082, r25 ; 0x801082 2ec7e: 80 93 81 10 sts 0x1081, r24 ; 0x801081 SERIAL_ECHO_START; 2ec82: 82 ef ldi r24, 0xF2 ; 242 2ec84: 9a ea ldi r25, 0xAA ; 170 2ec86: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(enqueingFront); 2ec8a: 83 ed ldi r24, 0xD3 ; 211 2ec8c: 9a ea ldi r25, 0xAA ; 170 2ec8e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2ec92: 80 91 70 12 lds r24, 0x1270 ; 0x801270 2ec96: 90 91 71 12 lds r25, 0x1271 ; 0x801271 } }*/ static FORCE_INLINE void print(const char *str) { write(str); 2ec9a: 8a 57 subi r24, 0x7A ; 122 2ec9c: 9f 4e sbci r25, 0xEF ; 239 2ec9e: 0e 94 bf 89 call 0x1137e ; 0x1137e SERIAL_ECHOLNPGM("\""); 2eca2: 81 ed ldi r24, 0xD1 ; 209 2eca4: 9a ea ldi r25, 0xAA ; 170 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2eca6: df 91 pop r29 2eca8: cf 91 pop r28 2ecaa: 1f 91 pop r17 2ecac: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ecae: 0c 94 86 7b jmp 0xf70c ; 0xf70c // 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) 2ecb2: 9c 01 movw r18, r24 2ecb4: c0 cf rjmp .-128 ; 0x2ec36 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2ecb6: c8 01 movw r24, r16 2ecb8: 04 96 adiw r24, 0x04 ; 4 2ecba: 48 17 cp r20, r24 2ecbc: 59 07 cpc r21, r25 2ecbe: 28 f0 brcs .+10 ; 0x2ecca // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2ecc0: 44 50 subi r20, 0x04 ; 4 2ecc2: 51 09 sbc r21, r1 2ecc4: 40 1b sub r20, r16 2ecc6: 51 0b sbc r21, r17 2ecc8: c1 cf rjmp .-126 ; 0x2ec4c return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 2ecca: 89 ee ldi r24, 0xE9 ; 233 2eccc: 91 e0 ldi r25, 0x01 ; 1 2ecce: bc 01 movw r22, r24 2ecd0: 60 1b sub r22, r16 2ecd2: 71 0b sbc r23, r17 2ecd4: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2ecd6: 62 17 cp r22, r18 2ecd8: 73 07 cpc r23, r19 2ecda: 5c f0 brlt .+22 ; 0x2ecf2 memset(cmdbuffer, 0, bufindr); 2ecdc: 70 e0 ldi r23, 0x00 ; 0 2ecde: 60 e0 ldi r22, 0x00 ; 0 2ece0: 83 e8 ldi r24, 0x83 ; 131 2ece2: 90 e1 ldi r25, 0x10 ; 16 2ece4: 0f 94 8d e3 call 0x3c71a ; 0x3c71a bufindr = bufindr_new; 2ece8: 10 93 71 12 sts 0x1271, r17 ; 0x801271 2ecec: 00 93 70 12 sts 0x1270, r16 ; 0x801270 2ecf0: b1 cf rjmp .-158 ; 0x2ec54 SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2ecf2: 8a ec ldi r24, 0xCA ; 202 2ecf4: 9a ea ldi r25, 0xAA ; 170 2ecf6: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(enqueingFront); 2ecfa: 83 ed ldi r24, 0xD3 ; 211 2ecfc: 9a ea ldi r25, 0xAA ; 170 2ecfe: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2ed02: ce 01 movw r24, r28 2ed04: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ed08: 83 eb ldi r24, 0xB3 ; 179 2ed0a: 9a ea ldi r25, 0xAA ; 170 2ed0c: cc cf rjmp .-104 ; 0x2eca6 0002ed0e : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2ed0e: ab 01 movw r20, r22 2ed10: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2ed12: 8e ef ldi r24, 0xFE ; 254 2ed14: 96 e1 ldi r25, 0x16 ; 22 2ed16: 0f 94 76 6d call 0x2daec ; 0x2daec 2ed1a: 81 11 cpse r24, r1 2ed1c: 02 c0 rjmp .+4 ; 0x2ed22 2ed1e: 80 e0 ldi r24, 0x00 ; 0 2ed20: 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() ) 2ed22: 8e ef ldi r24, 0xFE ; 254 2ed24: 96 e1 ldi r25, 0x16 ; 22 2ed26: 0f 94 60 6c call 0x2d8c0 ; 0x2d8c0 2ed2a: 88 23 and r24, r24 2ed2c: c1 f3 breq .-16 ; 0x2ed1e 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; 2ed2e: 20 91 1f 17 lds r18, 0x171F ; 0x80171f 2ed32: 30 91 20 17 lds r19, 0x1720 ; 0x801720 2ed36: 25 58 subi r18, 0x85 ; 133 2ed38: 31 4f sbci r19, 0xF1 ; 241 2ed3a: 30 93 1a 17 sts 0x171A, r19 ; 0x80171a 2ed3e: 20 93 19 17 sts 0x1719, r18 ; 0x801719 bool SdFile::seekSetFilteredGcode(uint32_t pos){ if(! seekSet(pos) )return false; if(! gfComputeNextFileBlock() )return false; gfReset(); return true; } 2ed42: 08 95 ret 0002ed44 : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2ed44: 8f 92 push r8 2ed46: 9f 92 push r9 2ed48: af 92 push r10 2ed4a: bf 92 push r11 2ed4c: cf 92 push r12 2ed4e: df 92 push r13 2ed50: ef 92 push r14 2ed52: ff 92 push r15 2ed54: 0f 93 push r16 2ed56: 1f 93 push r17 2ed58: cf 93 push r28 2ed5a: df 93 push r29 2ed5c: cd b7 in r28, 0x3d ; 61 2ed5e: de b7 in r29, 0x3e ; 62 2ed60: ee 97 sbiw r28, 0x3e ; 62 2ed62: 0f b6 in r0, 0x3f ; 63 2ed64: f8 94 cli 2ed66: de bf out 0x3e, r29 ; 62 2ed68: 0f be out 0x3f, r0 ; 63 2ed6a: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2ed6c: 80 91 bc 14 lds r24, 0x14BC ; 0x8014bc 2ed70: 8f 93 push r24 2ed72: 80 91 bb 14 lds r24, 0x14BB ; 0x8014bb 2ed76: 8f 93 push r24 2ed78: 8e e6 ldi r24, 0x6E ; 110 2ed7a: 9a ea ldi r25, 0xAA ; 170 2ed7c: 9f 93 push r25 2ed7e: 8f 93 push r24 2ed80: 8e 01 movw r16, r28 2ed82: 0f 5d subi r16, 0xDF ; 223 2ed84: 1f 4f sbci r17, 0xFF ; 255 2ed86: 1f 93 push r17 2ed88: 0f 93 push r16 2ed8a: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 2ed8e: 0f 90 pop r0 2ed90: 0f 90 pop r0 2ed92: 0f 90 pop r0 2ed94: 0f 90 pop r0 2ed96: 0f 90 pop r0 2ed98: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 2ed9a: f1 2c mov r15, r1 2ed9c: f8 01 movw r30, r16 2ed9e: 01 90 ld r0, Z+ 2eda0: 00 20 and r0, r0 2eda2: e9 f7 brne .-6 ; 0x2ed9e 2eda4: 31 97 sbiw r30, 0x01 ; 1 2eda6: e0 1b sub r30, r16 2eda8: f1 0b sbc r31, r17 2edaa: fe 16 cp r15, r30 2edac: 84 f4 brge .+32 ; 0x2edce autoname[i]=tolower(autoname[i]); 2edae: 68 01 movw r12, r16 2edb0: cf 0c add r12, r15 2edb2: d1 1c adc r13, r1 2edb4: f7 fc sbrc r15, 7 2edb6: da 94 dec r13 2edb8: f6 01 movw r30, r12 2edba: 80 81 ld r24, Z 2edbc: 08 2e mov r0, r24 2edbe: 00 0c add r0, r0 2edc0: 99 0b sbc r25, r25 2edc2: 0f 94 6f e3 call 0x3c6de ; 0x3c6de 2edc6: f6 01 movw r30, r12 2edc8: 80 83 st Z, r24 2edca: f3 94 inc r15 2edcc: e7 cf rjmp .-50 ; 0x2ed9c dir_t p; root.rewind(); 2edce: 84 ef ldi r24, 0xF4 ; 244 2edd0: 94 e1 ldi r25, 0x14 ; 20 2edd2: 0e 94 37 79 call 0xf26e ; 0xf26e bool found=false; 2edd6: a1 2c mov r10, r1 2edd8: ce 01 movw r24, r28 2edda: 01 96 adiw r24, 0x01 ; 1 2eddc: 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); 2edde: 81 e9 ldi r24, 0x91 ; 145 2ede0: c8 2e mov r12, r24 2ede2: 81 e7 ldi r24, 0x71 ; 113 2ede4: 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; 2ede6: 80 91 f7 14 lds r24, 0x14F7 ; 0x8014f7 2edea: 82 30 cpi r24, 0x02 ; 2 2edec: 08 f4 brcc .+2 ; 0x2edf0 2edee: 50 c0 rjmp .+160 ; 0x2ee90 2edf0: 80 91 fc 14 lds r24, 0x14FC ; 0x8014fc 2edf4: 90 91 fd 14 lds r25, 0x14FD ; 0x8014fd 2edf8: a0 91 fe 14 lds r26, 0x14FE ; 0x8014fe 2edfc: b0 91 ff 14 lds r27, 0x14FF ; 0x8014ff 2ee00: 8f 71 andi r24, 0x1F ; 31 2ee02: 99 27 eor r25, r25 2ee04: aa 27 eor r26, r26 2ee06: bb 27 eor r27, r27 2ee08: 89 2b or r24, r25 2ee0a: 8a 2b or r24, r26 2ee0c: 8b 2b or r24, r27 2ee0e: 09 f0 breq .+2 ; 0x2ee12 2ee10: 3f c0 rjmp .+126 ; 0x2ee90 2ee12: 50 e0 ldi r21, 0x00 ; 0 2ee14: 40 e0 ldi r20, 0x00 ; 0 2ee16: b7 01 movw r22, r14 2ee18: 84 ef ldi r24, 0xF4 ; 244 2ee1a: 94 e1 ldi r25, 0x14 ; 20 2ee1c: 0f 94 d9 6c call 0x2d9b2 ; 0x2d9b2 dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2ee20: 18 16 cp r1, r24 2ee22: b4 f5 brge .+108 ; 0x2ee90 { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2ee24: b1 2c mov r11, r1 2ee26: f7 01 movw r30, r14 2ee28: 01 90 ld r0, Z+ 2ee2a: 00 20 and r0, r0 2ee2c: e9 f7 brne .-6 ; 0x2ee28 2ee2e: 31 97 sbiw r30, 0x01 ; 1 2ee30: ee 19 sub r30, r14 2ee32: ff 09 sbc r31, r15 2ee34: be 16 cp r11, r30 2ee36: 74 f4 brge .+28 ; 0x2ee54 p.name[i]=tolower(p.name[i]); 2ee38: 47 01 movw r8, r14 2ee3a: 8b 0c add r8, r11 2ee3c: 91 1c adc r9, r1 2ee3e: b7 fc sbrc r11, 7 2ee40: 9a 94 dec r9 2ee42: f4 01 movw r30, r8 2ee44: 80 81 ld r24, Z 2ee46: 90 e0 ldi r25, 0x00 ; 0 2ee48: 0f 94 6f e3 call 0x3c6de ; 0x3c6de 2ee4c: f4 01 movw r30, r8 2ee4e: 80 83 st Z, r24 2ee50: b3 94 inc r11 2ee52: e9 cf rjmp .-46 ; 0x2ee26 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2ee54: 8a 85 ldd r24, Y+10 ; 0x0a 2ee56: 8e 37 cpi r24, 0x7E ; 126 2ee58: 31 f2 breq .-116 ; 0x2ede6 if(strncmp((char*)p.name,autoname,5)==0) 2ee5a: 45 e0 ldi r20, 0x05 ; 5 2ee5c: 50 e0 ldi r21, 0x00 ; 0 2ee5e: b8 01 movw r22, r16 2ee60: c7 01 movw r24, r14 2ee62: 0f 94 cd e3 call 0x3c79a ; 0x3c79a 2ee66: 89 2b or r24, r25 2ee68: 09 f0 breq .+2 ; 0x2ee6c 2ee6a: bd cf rjmp .-134 ; 0x2ede6 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2ee6c: 1f 93 push r17 2ee6e: 0f 93 push r16 2ee70: df 92 push r13 2ee72: cf 92 push r12 2ee74: 0e 94 61 8a call 0x114c2 ; 0x114c2 // M24: Start/resume SD print enquecommand_P(MSG_M24); 2ee78: 61 e0 ldi r22, 0x01 ; 1 2ee7a: 8d e8 ldi r24, 0x8D ; 141 2ee7c: 91 e7 ldi r25, 0x71 ; 113 2ee7e: 0e 94 cb 89 call 0x11396 ; 0x11396 2ee82: 0f 90 pop r0 2ee84: 0f 90 pop r0 2ee86: 0f 90 pop r0 2ee88: 0f 90 pop r0 found=true; 2ee8a: aa 24 eor r10, r10 2ee8c: a3 94 inc r10 2ee8e: ab cf rjmp .-170 ; 0x2ede6 } } if(!found) lastnr=-1; 2ee90: 8f ef ldi r24, 0xFF ; 255 2ee92: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 2ee94: aa 20 and r10, r10 2ee96: 29 f0 breq .+10 ; 0x2eea2 lastnr=-1; else lastnr++; 2ee98: 80 91 bb 14 lds r24, 0x14BB ; 0x8014bb 2ee9c: 90 91 bc 14 lds r25, 0x14BC ; 0x8014bc 2eea0: 01 96 adiw r24, 0x01 ; 1 2eea2: 90 93 bc 14 sts 0x14BC, r25 ; 0x8014bc 2eea6: 80 93 bb 14 sts 0x14BB, r24 ; 0x8014bb } 2eeaa: ee 96 adiw r28, 0x3e ; 62 2eeac: 0f b6 in r0, 0x3f ; 63 2eeae: f8 94 cli 2eeb0: de bf out 0x3e, r29 ; 62 2eeb2: 0f be out 0x3f, r0 ; 63 2eeb4: cd bf out 0x3d, r28 ; 61 2eeb6: df 91 pop r29 2eeb8: cf 91 pop r28 2eeba: 1f 91 pop r17 2eebc: 0f 91 pop r16 2eebe: ff 90 pop r15 2eec0: ef 90 pop r14 2eec2: df 90 pop r13 2eec4: cf 90 pop r12 2eec6: bf 90 pop r11 2eec8: af 90 pop r10 2eeca: 9f 90 pop r9 2eecc: 8f 90 pop r8 2eece: 08 95 ret 0002eed0 : * \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) { 2eed0: 8f 92 push r8 2eed2: 9f 92 push r9 2eed4: af 92 push r10 2eed6: bf 92 push r11 2eed8: cf 92 push r12 2eeda: df 92 push r13 2eedc: ef 92 push r14 2eede: ff 92 push r15 2eee0: 0f 93 push r16 2eee2: 1f 93 push r17 2eee4: cf 93 push r28 2eee6: df 93 push r29 2eee8: 00 d0 rcall .+0 ; 0x2eeea 2eeea: 1f 92 push r1 2eeec: cd b7 in r28, 0x3d ; 61 2eeee: de b7 in r29, 0x3e ; 62 2eef0: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2eef2: 83 81 ldd r24, Z+3 ; 0x03 2eef4: 81 30 cpi r24, 0x01 ; 1 2eef6: 11 f0 breq .+4 ; 0x2eefc // set file to correct position return seekSet(newPos); fail: return false; 2eef8: 80 e0 ldi r24, 0x00 ; 0 2eefa: 60 c0 rjmp .+192 ; 0x2efbc * \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; 2eefc: 81 81 ldd r24, Z+1 ; 0x01 2eefe: 81 ff sbrs r24, 1 2ef00: fb cf rjmp .-10 ; 0x2eef8 // 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; 2ef02: 81 89 ldd r24, Z+17 ; 0x11 2ef04: 92 89 ldd r25, Z+18 ; 0x12 2ef06: a3 89 ldd r26, Z+19 ; 0x13 2ef08: b4 89 ldd r27, Z+20 ; 0x14 2ef0a: 89 2b or r24, r25 2ef0c: 8a 2b or r24, r26 2ef0e: 8b 2b or r24, r27 2ef10: 09 f4 brne .+2 ; 0x2ef14 2ef12: 6e c0 rjmp .+220 ; 0x2eff0 2ef14: 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; 2ef16: 40 e0 ldi r20, 0x00 ; 0 2ef18: 50 e0 ldi r21, 0x00 ; 0 2ef1a: ba 01 movw r22, r20 2ef1c: cf 01 movw r24, r30 2ef1e: 0f 94 76 6d call 0x2daec ; 0x2daec 2ef22: 88 23 and r24, r24 2ef24: 49 f3 breq .-46 ; 0x2eef8 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 2ef26: f7 01 movw r30, r14 2ef28: c1 8c ldd r12, Z+25 ; 0x19 2ef2a: d2 8c ldd r13, Z+26 ; 0x1a 2ef2c: 85 88 ldd r8, Z+21 ; 0x15 2ef2e: 96 88 ldd r9, Z+22 ; 0x16 2ef30: a7 88 ldd r10, Z+23 ; 0x17 2ef32: 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; 2ef34: 82 e0 ldi r24, 0x02 ; 2 2ef36: 90 e0 ldi r25, 0x00 ; 0 2ef38: a0 e0 ldi r26, 0x00 ; 0 2ef3a: b0 e0 ldi r27, 0x00 ; 0 2ef3c: f6 01 movw r30, r12 2ef3e: 80 83 st Z, r24 2ef40: 91 83 std Z+1, r25 ; 0x01 2ef42: a2 83 std Z+2, r26 ; 0x02 2ef44: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 2ef46: 9e 01 movw r18, r28 2ef48: 2f 5f subi r18, 0xFF ; 255 2ef4a: 3f 4f sbci r19, 0xFF ; 255 2ef4c: b5 01 movw r22, r10 2ef4e: a4 01 movw r20, r8 2ef50: c6 01 movw r24, r12 2ef52: 0f 94 73 6b call 0x2d6e6 ; 0x2d6e6 2ef56: 88 23 and r24, r24 2ef58: 79 f2 breq .-98 ; 0x2eef8 // free cluster if (!fatPut(cluster, 0)) goto fail; 2ef5a: 00 e0 ldi r16, 0x00 ; 0 2ef5c: 10 e0 ldi r17, 0x00 ; 0 2ef5e: 98 01 movw r18, r16 2ef60: b5 01 movw r22, r10 2ef62: a4 01 movw r20, r8 2ef64: c6 01 movw r24, r12 2ef66: 0f 94 e1 6a call 0x2d5c2 ; 0x2d5c2 2ef6a: 88 23 and r24, r24 2ef6c: 29 f2 breq .-118 ; 0x2eef8 cluster = next; 2ef6e: 89 80 ldd r8, Y+1 ; 0x01 2ef70: 9a 80 ldd r9, Y+2 ; 0x02 2ef72: ab 80 ldd r10, Y+3 ; 0x03 2ef74: 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; 2ef76: f6 01 movw r30, r12 2ef78: 87 89 ldd r24, Z+23 ; 0x17 2ef7a: 80 31 cpi r24, 0x10 ; 16 2ef7c: 81 f5 brne .+96 ; 0x2efde 2ef7e: f8 ef ldi r31, 0xF8 ; 248 2ef80: 8f 16 cp r8, r31 2ef82: ff ef ldi r31, 0xFF ; 255 2ef84: 9f 06 cpc r9, r31 2ef86: a1 04 cpc r10, r1 2ef88: b1 04 cpc r11, r1 2ef8a: e8 f2 brcs .-70 ; 0x2ef46 firstCluster_ = 0; 2ef8c: f7 01 movw r30, r14 2ef8e: 15 8a std Z+21, r1 ; 0x15 2ef90: 16 8a std Z+22, r1 ; 0x16 2ef92: 17 8a std Z+23, r1 ; 0x17 2ef94: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 2ef96: 11 8a std Z+17, r1 ; 0x11 2ef98: 12 8a std Z+18, r1 ; 0x12 2ef9a: 13 8a std Z+19, r1 ; 0x13 2ef9c: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 2ef9e: 81 81 ldd r24, Z+1 ; 0x01 2efa0: 80 68 ori r24, 0x80 ; 128 2efa2: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 2efa4: c7 01 movw r24, r14 2efa6: 0f 94 41 6d call 0x2da82 ; 0x2da82 2efaa: 88 23 and r24, r24 2efac: 09 f4 brne .+2 ; 0x2efb0 2efae: a4 cf rjmp .-184 ; 0x2eef8 // set file to correct position return seekSet(newPos); 2efb0: 40 e0 ldi r20, 0x00 ; 0 2efb2: 50 e0 ldi r21, 0x00 ; 0 2efb4: ba 01 movw r22, r20 2efb6: c7 01 movw r24, r14 2efb8: 0f 94 76 6d call 0x2daec ; 0x2daec fail: return false; } 2efbc: 0f 90 pop r0 2efbe: 0f 90 pop r0 2efc0: 0f 90 pop r0 2efc2: 0f 90 pop r0 2efc4: df 91 pop r29 2efc6: cf 91 pop r28 2efc8: 1f 91 pop r17 2efca: 0f 91 pop r16 2efcc: ff 90 pop r15 2efce: ef 90 pop r14 2efd0: df 90 pop r13 2efd2: cf 90 pop r12 2efd4: bf 90 pop r11 2efd6: af 90 pop r10 2efd8: 9f 90 pop r9 2efda: 8f 90 pop r8 2efdc: 08 95 ret return cluster >= FAT32EOC_MIN; 2efde: 88 ef ldi r24, 0xF8 ; 248 2efe0: 88 16 cp r8, r24 2efe2: 8f ef ldi r24, 0xFF ; 255 2efe4: 98 06 cpc r9, r24 2efe6: a8 06 cpc r10, r24 2efe8: 8f e0 ldi r24, 0x0F ; 15 2efea: b8 06 cpc r11, r24 2efec: 78 f6 brcc .-98 ; 0x2ef8c 2efee: ab cf rjmp .-170 ; 0x2ef46 // 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; 2eff0: 81 e0 ldi r24, 0x01 ; 1 2eff2: e4 cf rjmp .-56 ; 0x2efbc 0002eff4 : +* 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) { 2eff4: 2f 92 push r2 2eff6: 3f 92 push r3 2eff8: 4f 92 push r4 2effa: 5f 92 push r5 2effc: 6f 92 push r6 2effe: 7f 92 push r7 2f000: 8f 92 push r8 2f002: 9f 92 push r9 2f004: af 92 push r10 2f006: bf 92 push r11 2f008: cf 92 push r12 2f00a: df 92 push r13 2f00c: ef 92 push r14 2f00e: ff 92 push r15 2f010: 0f 93 push r16 2f012: 1f 93 push r17 2f014: cf 93 push r28 2f016: df 93 push r29 2f018: cd b7 in r28, 0x3d ; 61 2f01a: de b7 in r29, 0x3e ; 62 2f01c: c6 57 subi r28, 0x76 ; 118 2f01e: d1 09 sbc r29, r1 2f020: 0f b6 in r0, 0x3f ; 63 2f022: f8 94 cli 2f024: de bf out 0x3e, r29 ; 62 2f026: 0f be out 0x3f, r0 ; 63 2f028: cd bf out 0x3d, r28 ; 61 2f02a: 4c 01 movw r8, r24 2f02c: 6b 01 movw r12, r22 2f02e: 3a 01 movw r6, r20 2f030: e5 96 adiw r28, 0x35 ; 53 2f032: 2f af std Y+63, r18 ; 0x3f 2f034: e5 97 sbiw r28, 0x35 ; 53 2f036: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 2f038: 2d b6 in r2, 0x3d ; 61 2f03a: 3e b6 in r3, 0x3e ; 62 2f03c: 10 2f mov r17, r16 2f03e: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 2f040: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 2f044: 8f 5f subi r24, 0xFF ; 255 2f046: 80 93 7a 0e sts 0x0E7A, r24 ; 0x800e7a } 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()) { 2f04a: fb 01 movw r30, r22 2f04c: 80 85 ldd r24, Z+8 ; 0x08 2f04e: 91 85 ldd r25, Z+9 ; 0x09 2f050: a2 85 ldd r26, Z+10 ; 0x0a 2f052: b3 85 ldd r27, Z+11 ; 0x0b 2f054: 80 93 81 14 sts 0x1481, r24 ; 0x801481 2f058: 90 93 82 14 sts 0x1482, r25 ; 0x801482 2f05c: a0 93 83 14 sts 0x1483, r26 ; 0x801483 2f060: b0 93 84 14 sts 0x1484, r27 ; 0x801484 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 2f064: 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); 2f066: 5e 01 movw r10, r28 2f068: f7 e6 ldi r31, 0x67 ; 103 2f06a: af 0e add r10, r31 2f06c: 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; 2f06e: f6 01 movw r30, r12 2f070: 83 81 ldd r24, Z+3 ; 0x03 2f072: 82 30 cpi r24, 0x02 ; 2 2f074: 08 f4 brcc .+2 ; 0x2f078 2f076: c0 c1 rjmp .+896 ; 0x2f3f8 2f078: 80 85 ldd r24, Z+8 ; 0x08 2f07a: 91 85 ldd r25, Z+9 ; 0x09 2f07c: a2 85 ldd r26, Z+10 ; 0x0a 2f07e: b3 85 ldd r27, Z+11 ; 0x0b 2f080: 8f 71 andi r24, 0x1F ; 31 2f082: 99 27 eor r25, r25 2f084: aa 27 eor r26, r26 2f086: bb 27 eor r27, r27 2f088: 89 2b or r24, r25 2f08a: 8a 2b or r24, r26 2f08c: 8b 2b or r24, r27 2f08e: 09 f0 breq .+2 ; 0x2f092 2f090: b3 c1 rjmp .+870 ; 0x2f3f8 //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'; 2f092: 10 92 85 14 sts 0x1485, r1 ; 0x801485 2f096: 45 e8 ldi r20, 0x85 ; 133 2f098: 54 e1 ldi r21, 0x14 ; 20 2f09a: be 01 movw r22, r28 2f09c: 69 5b subi r22, 0xB9 ; 185 2f09e: 7f 4f sbci r23, 0xFF ; 255 2f0a0: c6 01 movw r24, r12 2f0a2: 0f 94 d9 6c call 0x2d9b2 ; 0x2d9b2 } 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()) { 2f0a6: 18 16 cp r1, r24 2f0a8: 0c f0 brlt .+2 ; 0x2f0ac 2f0aa: a6 c1 rjmp .+844 ; 0x2f3f8 if (recursionCnt > MAX_DIR_DEPTH) 2f0ac: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 2f0b0: 87 30 cpi r24, 0x07 ; 7 2f0b2: 08 f0 brcs .+2 ; 0x2f0b6 2f0b4: a1 c1 rjmp .+834 ; 0x2f3f8 return; uint8_t pn0 = p.name[0]; 2f0b6: 28 96 adiw r28, 0x08 ; 8 2f0b8: 8f ad ldd r24, Y+63 ; 0x3f 2f0ba: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 2f0bc: 88 23 and r24, r24 2f0be: 09 f4 brne .+2 ; 0x2f0c2 2f0c0: 9b c1 rjmp .+822 ; 0x2f3f8 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 2f0c2: 85 3e cpi r24, 0xE5 ; 229 2f0c4: 09 f4 brne .+2 ; 0x2f0c8 2f0c6: 39 c1 rjmp .+626 ; 0x2f33a 2f0c8: 8e 32 cpi r24, 0x2E ; 46 2f0ca: 09 f4 brne .+2 ; 0x2f0ce 2f0cc: 36 c1 rjmp .+620 ; 0x2f33a if (longFilename[0] == '.') continue; 2f0ce: 80 91 85 14 lds r24, 0x1485 ; 0x801485 2f0d2: 8e 32 cpi r24, 0x2E ; 46 2f0d4: 09 f4 brne .+2 ; 0x2f0d8 2f0d6: 31 c1 rjmp .+610 ; 0x2f33a 2f0d8: 63 96 adiw r28, 0x13 ; 19 2f0da: 8f ad ldd r24, Y+63 ; 0x3f 2f0dc: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 2f0de: 98 2f mov r25, r24 2f0e0: 9a 70 andi r25, 0x0A ; 10 2f0e2: 09 f0 breq .+2 ; 0x2f0e6 2f0e4: 2a c1 rjmp .+596 ; 0x2f33a 2f0e6: 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; 2f0e8: 91 e0 ldi r25, 0x01 ; 1 2f0ea: 80 31 cpi r24, 0x10 ; 16 2f0ec: 19 f0 breq .+6 ; 0x2f0f4 2f0ee: 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 2f0f0: 80 31 cpi r24, 0x10 ; 16 2f0f2: 31 f4 brne .+12 ; 0x2f100 2f0f4: e5 96 adiw r28, 0x35 ; 53 2f0f6: ff ad ldd r31, Y+63 ; 0x3f 2f0f8: e5 97 sbiw r28, 0x35 ; 53 2f0fa: ff 23 and r31, r31 2f0fc: 09 f4 brne .+2 ; 0x2f100 2f0fe: 94 c0 rjmp .+296 ; 0x2f228 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 2f100: 90 93 ba 14 sts 0x14BA, r25 ; 0x8014ba if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 2f104: 80 31 cpi r24, 0x10 ; 16 2f106: 61 f0 breq .+24 ; 0x2f120 2f108: 60 96 adiw r28, 0x10 ; 16 2f10a: 8f ad ldd r24, Y+63 ; 0x3f 2f10c: 60 97 sbiw r28, 0x10 ; 16 2f10e: 87 34 cpi r24, 0x47 ; 71 2f110: 09 f0 breq .+2 ; 0x2f114 2f112: 13 c1 rjmp .+550 ; 0x2f33a 2f114: 61 96 adiw r28, 0x11 ; 17 2f116: 8f ad ldd r24, Y+63 ; 0x3f 2f118: 61 97 sbiw r28, 0x11 ; 17 2f11a: 8e 37 cpi r24, 0x7E ; 126 2f11c: 09 f4 brne .+2 ; 0x2f120 2f11e: 0d c1 rjmp .+538 ; 0x2f33a switch (lsAction) { 2f120: e5 96 adiw r28, 0x35 ; 53 2f122: ff ad ldd r31, Y+63 ; 0x3f 2f124: e5 97 sbiw r28, 0x35 ; 53 2f126: f1 30 cpi r31, 0x01 ; 1 2f128: 09 f4 brne .+2 ; 0x2f12c 2f12a: 1b c1 rjmp .+566 ; 0x2f362 2f12c: f2 30 cpi r31, 0x02 ; 2 2f12e: 09 f4 brne .+2 ; 0x2f132 2f130: 25 c1 rjmp .+586 ; 0x2f37c case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 2f132: be 01 movw r22, r28 2f134: 69 5b subi r22, 0xB9 ; 185 2f136: 7f 4f sbci r23, 0xFF ; 255 2f138: 80 e7 ldi r24, 0x70 ; 112 2f13a: 94 e1 ldi r25, 0x14 ; 20 2f13c: 0e 94 21 79 call 0xf242 ; 0xf242 2f140: c4 01 movw r24, r8 2f142: 0e 94 bf 89 call 0x1137e ; 0x1137e 2f146: 80 e7 ldi r24, 0x70 ; 112 2f148: 94 e1 ldi r25, 0x14 ; 20 2f14a: 0e 94 bf 89 call 0x1137e ; 0x1137e SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 2f14e: 80 e2 ldi r24, 0x20 ; 32 2f150: 0e 94 42 79 call 0xf284 ; 0xf284 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2f154: a7 96 adiw r28, 0x27 ; 39 2f156: 6c ad ldd r22, Y+60 ; 0x3c 2f158: 7d ad ldd r23, Y+61 ; 0x3d 2f15a: 8e ad ldd r24, Y+62 ; 0x3e 2f15c: 9f ad ldd r25, Y+63 ; 0x3f 2f15e: a7 97 sbiw r28, 0x27 ; 39 2f160: 4a e0 ldi r20, 0x0A ; 10 2f162: 0f 94 4a d2 call 0x3a494 ; 0x3a494 SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 2f166: 51 fe sbrs r5, 1 2f168: 45 c0 rjmp .+138 ; 0x2f1f4 { crmodDate = p.lastWriteDate; 2f16a: a1 96 adiw r28, 0x21 ; 33 2f16c: 2e ad ldd r18, Y+62 ; 0x3e 2f16e: 3f ad ldd r19, Y+63 ; 0x3f 2f170: a1 97 sbiw r28, 0x21 ; 33 2f172: 30 93 80 14 sts 0x1480, r19 ; 0x801480 2f176: 20 93 7f 14 sts 0x147F, r18 ; 0x80147f crmodTime = p.lastWriteTime; 2f17a: 6f 96 adiw r28, 0x1f ; 31 2f17c: 4e ad ldd r20, Y+62 ; 0x3e 2f17e: 5f ad ldd r21, Y+63 ; 0x3f 2f180: 6f 97 sbiw r28, 0x1f ; 31 2f182: 50 93 7e 14 sts 0x147E, r21 ; 0x80147e 2f186: 40 93 7d 14 sts 0x147D, r20 ; 0x80147d if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2f18a: 69 96 adiw r28, 0x19 ; 25 2f18c: 8e ad ldd r24, Y+62 ; 0x3e 2f18e: 9f ad ldd r25, Y+63 ; 0x3f 2f190: 69 97 sbiw r28, 0x19 ; 25 2f192: 28 17 cp r18, r24 2f194: 39 07 cpc r19, r25 2f196: 50 f0 brcs .+20 ; 0x2f1ac 2f198: 28 17 cp r18, r24 2f19a: 39 07 cpc r19, r25 2f19c: 99 f4 brne .+38 ; 0x2f1c4 2f19e: 67 96 adiw r28, 0x17 ; 23 2f1a0: 2e ad ldd r18, Y+62 ; 0x3e 2f1a2: 3f ad ldd r19, Y+63 ; 0x3f 2f1a4: 67 97 sbiw r28, 0x17 ; 23 2f1a6: 42 17 cp r20, r18 2f1a8: 53 07 cpc r21, r19 2f1aa: 60 f4 brcc .+24 ; 0x2f1c4 crmodDate = p.creationDate; 2f1ac: 90 93 80 14 sts 0x1480, r25 ; 0x801480 2f1b0: 80 93 7f 14 sts 0x147F, r24 ; 0x80147f crmodTime = p.creationTime; 2f1b4: 67 96 adiw r28, 0x17 ; 23 2f1b6: 8e ad ldd r24, Y+62 ; 0x3e 2f1b8: 9f ad ldd r25, Y+63 ; 0x3f 2f1ba: 67 97 sbiw r28, 0x17 ; 23 2f1bc: 90 93 7e 14 sts 0x147E, r25 ; 0x80147e 2f1c0: 80 93 7d 14 sts 0x147D, r24 ; 0x80147d } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 2f1c4: 80 91 80 14 lds r24, 0x1480 ; 0x801480 2f1c8: 8f 93 push r24 2f1ca: 80 91 7f 14 lds r24, 0x147F ; 0x80147f 2f1ce: 8f 93 push r24 2f1d0: 80 91 7e 14 lds r24, 0x147E ; 0x80147e 2f1d4: 8f 93 push r24 2f1d6: 80 91 7d 14 lds r24, 0x147D ; 0x80147d 2f1da: 8f 93 push r24 2f1dc: 2b e4 ldi r18, 0x4B ; 75 2f1de: 3a ea ldi r19, 0xAA ; 170 2f1e0: 3f 93 push r19 2f1e2: 2f 93 push r18 2f1e4: 0f 94 1d dc call 0x3b83a ; 0x3b83a 2f1e8: 0f 90 pop r0 2f1ea: 0f 90 pop r0 2f1ec: 0f 90 pop r0 2f1ee: 0f 90 pop r0 2f1f0: 0f 90 pop r0 2f1f2: 0f 90 pop r0 } if (lsParams.LFN) 2f1f4: 11 23 and r17, r17 2f1f6: 99 f0 breq .+38 ; 0x2f21e printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f1f8: 80 91 85 14 lds r24, 0x1485 ; 0x801485 2f1fc: 88 23 and r24, r24 2f1fe: 09 f4 brne .+2 ; 0x2f202 2f200: ba c0 rjmp .+372 ; 0x2f376 2f202: 85 e8 ldi r24, 0x85 ; 133 2f204: 94 e1 ldi r25, 0x14 ; 20 2f206: 9f 93 push r25 2f208: 8f 93 push r24 2f20a: e5 e4 ldi r30, 0x45 ; 69 2f20c: fa ea ldi r31, 0xAA ; 170 2f20e: ff 93 push r31 2f210: ef 93 push r30 2f212: 0f 94 1d dc call 0x3b83a ; 0x3b83a 2f216: 0f 90 pop r0 2f218: 0f 90 pop r0 2f21a: 0f 90 pop r0 2f21c: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 2f21e: 0f 94 5d d6 call 0x3acba ; 0x3acba manage_heater(); 2f222: 0f 94 9b 4d call 0x29b36 ; 0x29b36 2f226: 89 c0 rjmp .+274 ; 0x2f33a } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 2f228: 2d b7 in r18, 0x3d ; 61 2f22a: 3e b7 in r19, 0x3e ; 62 2f22c: e7 96 adiw r28, 0x37 ; 55 2f22e: 3f af std Y+63, r19 ; 0x3f 2f230: 2e af std Y+62, r18 ; 0x3e 2f232: 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); 2f234: be 01 movw r22, r28 2f236: 69 5b subi r22, 0xB9 ; 185 2f238: 7f 4f sbci r23, 0xFF ; 255 2f23a: c5 01 movw r24, r10 2f23c: 0e 94 21 79 call 0xf242 ; 0xf242 // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 2f240: f4 01 movw r30, r8 2f242: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 2f244: 88 23 and r24, r24 2f246: 09 f4 brne .+2 ; 0x2f24a 2f248: 86 c0 rjmp .+268 ; 0x2f356 2f24a: 01 90 ld r0, Z+ 2f24c: 00 20 and r0, r0 2f24e: e9 f7 brne .-6 ; 0x2f24a 2f250: 31 97 sbiw r30, 0x01 ; 1 2f252: e8 19 sub r30, r8 2f254: f9 09 sbc r31, r9 2f256: d5 01 movw r26, r10 2f258: 0d 90 ld r0, X+ 2f25a: 00 20 and r0, r0 2f25c: e9 f7 brne .-6 ; 0x2f258 2f25e: ea 19 sub r30, r10 2f260: fb 09 sbc r31, r11 char path[len]; 2f262: ea 0f add r30, r26 2f264: fb 1f adc r31, r27 2f266: 31 96 adiw r30, 0x01 ; 1 2f268: 2d b7 in r18, 0x3d ; 61 2f26a: 3e b7 in r19, 0x3e ; 62 2f26c: 2e 1b sub r18, r30 2f26e: 3f 0b sbc r19, r31 2f270: 0f b6 in r0, 0x3f ; 63 2f272: f8 94 cli 2f274: 3e bf out 0x3e, r19 ; 62 2f276: 0f be out 0x3f, r0 ; 63 2f278: 2d bf out 0x3d, r18 ; 61 2f27a: ed b7 in r30, 0x3d ; 61 2f27c: fe b7 in r31, 0x3e ; 62 2f27e: 31 96 adiw r30, 0x01 ; 1 2f280: 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 2f282: 6f e1 ldi r22, 0x1F ; 31 2f284: 73 e0 ldi r23, 0x03 ; 3 2f286: 81 11 cpse r24, r1 2f288: b4 01 movw r22, r8 2f28a: c7 01 movw r24, r14 2f28c: 0f 94 c6 e3 call 0x3c78c ; 0x3c78c strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 2f290: b5 01 movw r22, r10 2f292: c7 01 movw r24, r14 2f294: 0f 94 a7 e3 call 0x3c74e ; 0x3c74e strcat(path, "/"); // 1 character 2f298: 6f e1 ldi r22, 0x1F ; 31 2f29a: 73 e0 ldi r23, 0x03 ; 3 2f29c: c7 01 movw r24, r14 2f29e: 0f 94 a7 e3 call 0x3c74e ; 0x3c74e // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 2f2a2: 11 23 and r17, r17 2f2a4: a9 f0 breq .+42 ; 0x2f2d0 printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 2f2a6: 80 91 85 14 lds r24, 0x1485 ; 0x801485 2f2aa: 81 11 cpse r24, r1 2f2ac: 57 c0 rjmp .+174 ; 0x2f35c 2f2ae: c5 01 movw r24, r10 2f2b0: 9f 93 push r25 2f2b2: 8f 93 push r24 2f2b4: ff 92 push r15 2f2b6: ef 92 push r14 2f2b8: 2a e5 ldi r18, 0x5A ; 90 2f2ba: 3a ea ldi r19, 0xAA ; 170 2f2bc: 3f 93 push r19 2f2be: 2f 93 push r18 2f2c0: 0f 94 1d dc call 0x3b83a ; 0x3b83a 2f2c4: 0f 90 pop r0 2f2c6: 0f 90 pop r0 2f2c8: 0f 90 pop r0 2f2ca: 0f 90 pop r0 2f2cc: 0f 90 pop r0 2f2ce: 0f 90 pop r0 2f2d0: 1c a2 std Y+36, r1 ; 0x24 2f2d2: 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); 2f2d4: 21 e0 ldi r18, 0x01 ; 1 2f2d6: a5 01 movw r20, r10 2f2d8: b6 01 movw r22, r12 2f2da: ce 01 movw r24, r28 2f2dc: 84 96 adiw r24, 0x24 ; 36 2f2de: 0f 94 08 d7 call 0x3ae10 ; 0x3ae10 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); 2f2e2: 83 e2 ldi r24, 0x23 ; 35 2f2e4: fe 01 movw r30, r28 2f2e6: b4 96 adiw r30, 0x24 ; 36 2f2e8: de 01 movw r26, r28 2f2ea: 11 96 adiw r26, 0x01 ; 1 2f2ec: 01 90 ld r0, Z+ 2f2ee: 0d 92 st X+, r0 2f2f0: 8a 95 dec r24 2f2f2: e1 f7 brne .-8 ; 0x2f2ec 2f2f4: 10 fb bst r17, 0 2f2f6: 50 f8 bld r5, 0 2f2f8: 05 2d mov r16, r5 2f2fa: 20 e0 ldi r18, 0x00 ; 0 2f2fc: 50 e0 ldi r21, 0x00 ; 0 2f2fe: 40 e0 ldi r20, 0x00 ; 0 2f300: be 01 movw r22, r28 2f302: 6f 5f subi r22, 0xFF ; 255 2f304: 7f 4f sbci r23, 0xFF ; 255 2f306: c7 01 movw r24, r14 2f308: 0f 94 fa 77 call 0x2eff4 ; 0x2eff4 2f30c: ce 01 movw r24, r28 2f30e: 01 96 adiw r24, 0x01 ; 1 2f310: 0e 94 3c 79 call 0xf278 ; 0xf278 // close() is done automatically by destructor of SdFile if (lsParams.LFN) 2f314: 11 23 and r17, r17 2f316: 21 f0 breq .+8 ; 0x2f320 puts_P(PSTR("DIR_EXIT")); 2f318: 81 e5 ldi r24, 0x51 ; 81 2f31a: 9a ea ldi r25, 0xAA ; 170 2f31c: 0f 94 44 dc call 0x3b888 ; 0x3b888 2f320: ce 01 movw r24, r28 2f322: 84 96 adiw r24, 0x24 ; 36 2f324: 0e 94 3c 79 call 0xf278 ; 0xf278 2f328: e7 96 adiw r28, 0x37 ; 55 2f32a: ee ad ldd r30, Y+62 ; 0x3e 2f32c: ff ad ldd r31, Y+63 ; 0x3f 2f32e: e7 97 sbiw r28, 0x37 ; 55 2f330: 0f b6 in r0, 0x3f ; 63 2f332: f8 94 cli 2f334: fe bf out 0x3e, r31 ; 62 2f336: 0f be out 0x3f, r0 ; 63 2f338: 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()) { 2f33a: f6 01 movw r30, r12 2f33c: 80 85 ldd r24, Z+8 ; 0x08 2f33e: 91 85 ldd r25, Z+9 ; 0x09 2f340: a2 85 ldd r26, Z+10 ; 0x0a 2f342: b3 85 ldd r27, Z+11 ; 0x0b 2f344: 80 93 81 14 sts 0x1481, r24 ; 0x801481 2f348: 90 93 82 14 sts 0x1482, r25 ; 0x801482 2f34c: a0 93 83 14 sts 0x1483, r26 ; 0x801483 2f350: b0 93 84 14 sts 0x1484, r27 ; 0x801484 2f354: 8c ce rjmp .-744 ; 0x2f06e // 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; 2f356: e1 e0 ldi r30, 0x01 ; 1 2f358: f0 e0 ldi r31, 0x00 ; 0 2f35a: 7d cf rjmp .-262 ; 0x2f256 // 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); 2f35c: 85 e8 ldi r24, 0x85 ; 133 2f35e: 94 e1 ldi r25, 0x14 ; 20 2f360: a7 cf rjmp .-178 ; 0x2f2b0 else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 2f362: 80 91 86 17 lds r24, 0x1786 ; 0x801786 2f366: 90 91 87 17 lds r25, 0x1787 ; 0x801787 2f36a: 01 96 adiw r24, 0x01 ; 1 2f36c: 90 93 87 17 sts 0x1787, r25 ; 0x801787 2f370: 80 93 86 17 sts 0x1786, r24 ; 0x801786 2f374: e2 cf rjmp .-60 ; 0x2f33a } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f376: 80 e7 ldi r24, 0x70 ; 112 2f378: 94 e1 ldi r25, 0x14 ; 20 2f37a: 45 cf rjmp .-374 ; 0x2f206 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 2f37c: be 01 movw r22, r28 2f37e: 69 5b subi r22, 0xB9 ; 185 2f380: 7f 4f sbci r23, 0xFF ; 255 2f382: 80 e7 ldi r24, 0x70 ; 112 2f384: 94 e1 ldi r25, 0x14 ; 20 2f386: 0e 94 21 79 call 0xf242 ; 0xf242 SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 2f38a: a1 96 adiw r28, 0x21 ; 33 2f38c: 2e ad ldd r18, Y+62 ; 0x3e 2f38e: 3f ad ldd r19, Y+63 ; 0x3f 2f390: a1 97 sbiw r28, 0x21 ; 33 2f392: 30 93 80 14 sts 0x1480, r19 ; 0x801480 2f396: 20 93 7f 14 sts 0x147F, r18 ; 0x80147f crmodTime = p.lastWriteTime; 2f39a: 6f 96 adiw r28, 0x1f ; 31 2f39c: 4e ad ldd r20, Y+62 ; 0x3e 2f39e: 5f ad ldd r21, Y+63 ; 0x3f 2f3a0: 6f 97 sbiw r28, 0x1f ; 31 2f3a2: 50 93 7e 14 sts 0x147E, r21 ; 0x80147e 2f3a6: 40 93 7d 14 sts 0x147D, r20 ; 0x80147d // 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 ) ){ 2f3aa: 69 96 adiw r28, 0x19 ; 25 2f3ac: 8e ad ldd r24, Y+62 ; 0x3e 2f3ae: 9f ad ldd r25, Y+63 ; 0x3f 2f3b0: 69 97 sbiw r28, 0x19 ; 25 2f3b2: 28 17 cp r18, r24 2f3b4: 39 07 cpc r19, r25 2f3b6: 50 f0 brcs .+20 ; 0x2f3cc 2f3b8: 28 17 cp r18, r24 2f3ba: 39 07 cpc r19, r25 2f3bc: 99 f4 brne .+38 ; 0x2f3e4 2f3be: 67 96 adiw r28, 0x17 ; 23 2f3c0: 2e ad ldd r18, Y+62 ; 0x3e 2f3c2: 3f ad ldd r19, Y+63 ; 0x3f 2f3c4: 67 97 sbiw r28, 0x17 ; 23 2f3c6: 42 17 cp r20, r18 2f3c8: 53 07 cpc r21, r19 2f3ca: 60 f4 brcc .+24 ; 0x2f3e4 crmodDate = p.creationDate; 2f3cc: 90 93 80 14 sts 0x1480, r25 ; 0x801480 2f3d0: 80 93 7f 14 sts 0x147F, r24 ; 0x80147f crmodTime = p.creationTime; 2f3d4: 67 96 adiw r28, 0x17 ; 23 2f3d6: 8e ad ldd r24, Y+62 ; 0x3e 2f3d8: 9f ad ldd r25, Y+63 ; 0x3f 2f3da: 67 97 sbiw r28, 0x17 ; 23 2f3dc: 90 93 7e 14 sts 0x147E, r25 ; 0x80147e 2f3e0: 80 93 7d 14 sts 0x147D, r24 ; 0x80147d } //writeDate = p.lastAccessDate; if (match != NULL) { 2f3e4: 61 14 cp r6, r1 2f3e6: 71 04 cpc r7, r1 2f3e8: 59 f1 breq .+86 ; 0x2f440 if (strcasecmp(match, filename) == 0) return; 2f3ea: 60 e7 ldi r22, 0x70 ; 112 2f3ec: 74 e1 ldi r23, 0x14 ; 20 2f3ee: c3 01 movw r24, r6 2f3f0: 0f 94 94 e3 call 0x3c728 ; 0x3c728 2f3f4: 89 2b or r24, r25 2f3f6: 59 f5 brne .+86 ; 0x2f44e // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 2f3f8: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 2f3fc: 81 50 subi r24, 0x01 ; 1 2f3fe: 80 93 7a 0e sts 0x0E7A, r24 ; 0x800e7a cnt++; break; } } } // while readDir } 2f402: 0f b6 in r0, 0x3f ; 63 2f404: f8 94 cli 2f406: 3e be out 0x3e, r3 ; 62 2f408: 0f be out 0x3f, r0 ; 63 2f40a: 2d be out 0x3d, r2 ; 61 2f40c: ca 58 subi r28, 0x8A ; 138 2f40e: df 4f sbci r29, 0xFF ; 255 2f410: 0f b6 in r0, 0x3f ; 63 2f412: f8 94 cli 2f414: de bf out 0x3e, r29 ; 62 2f416: 0f be out 0x3f, r0 ; 63 2f418: cd bf out 0x3d, r28 ; 61 2f41a: df 91 pop r29 2f41c: cf 91 pop r28 2f41e: 1f 91 pop r17 2f420: 0f 91 pop r16 2f422: ff 90 pop r15 2f424: ef 90 pop r14 2f426: df 90 pop r13 2f428: cf 90 pop r12 2f42a: bf 90 pop r11 2f42c: af 90 pop r10 2f42e: 9f 90 pop r9 2f430: 8f 90 pop r8 2f432: 7f 90 pop r7 2f434: 6f 90 pop r6 2f436: 5f 90 pop r5 2f438: 4f 90 pop r4 2f43a: 3f 90 pop r3 2f43c: 2f 90 pop r2 2f43e: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2f440: 80 91 86 17 lds r24, 0x1786 ; 0x801786 2f444: 90 91 87 17 lds r25, 0x1787 ; 0x801787 2f448: 48 16 cp r4, r24 2f44a: 19 06 cpc r1, r25 2f44c: a9 f2 breq .-86 ; 0x2f3f8 cnt++; 2f44e: 43 94 inc r4 2f450: 74 cf rjmp .-280 ; 0x2f33a 0002f452 : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 2f452: cf 92 push r12 2f454: df 92 push r13 2f456: ef 92 push r14 2f458: ff 92 push r15 2f45a: 0f 93 push r16 2f45c: cf 93 push r28 2f45e: df 93 push r29 2f460: cd b7 in r28, 0x3d ; 61 2f462: de b7 in r29, 0x3e ; 62 2f464: a3 97 sbiw r28, 0x23 ; 35 2f466: 0f b6 in r0, 0x3f ; 63 2f468: f8 94 cli 2f46a: de bf out 0x3e, r29 ; 62 2f46c: 0f be out 0x3f, r0 ; 63 2f46e: cd bf out 0x3d, r28 ; 61 2f470: 6c 01 movw r12, r24 { curDir=&workDir; 2f472: 87 e1 ldi r24, 0x17 ; 23 2f474: e8 2e mov r14, r24 2f476: 85 e1 ldi r24, 0x15 ; 21 2f478: f8 2e mov r15, r24 2f47a: 89 e1 ldi r24, 0x19 ; 25 2f47c: 95 e1 ldi r25, 0x15 ; 21 2f47e: d7 01 movw r26, r14 2f480: 8d 93 st X+, r24 2f482: 9c 93 st X, r25 nrFiles=nr; 2f484: 10 92 87 17 sts 0x1787, r1 ; 0x801787 2f488: 10 92 86 17 sts 0x1786, r1 ; 0x801786 curDir->rewind(); 2f48c: 0e 94 37 79 call 0xf26e ; 0xf26e }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2f490: 00 e0 ldi r16, 0x00 ; 0 2f492: 0e 7f andi r16, 0xFE ; 254 2f494: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2f496: d7 01 movw r26, r14 2f498: ed 91 ld r30, X+ 2f49a: fc 91 ld r31, X 2f49c: 83 e2 ldi r24, 0x23 ; 35 2f49e: de 01 movw r26, r28 2f4a0: 11 96 adiw r26, 0x01 ; 1 2f4a2: 01 90 ld r0, Z+ 2f4a4: 0d 92 st X+, r0 2f4a6: 8a 95 dec r24 2f4a8: e1 f7 brne .-8 ; 0x2f4a2 2f4aa: 22 e0 ldi r18, 0x02 ; 2 2f4ac: a6 01 movw r20, r12 2f4ae: be 01 movw r22, r28 2f4b0: 6f 5f subi r22, 0xFF ; 255 2f4b2: 7f 4f sbci r23, 0xFF ; 255 2f4b4: 84 ef ldi r24, 0xF4 ; 244 2f4b6: 92 e0 ldi r25, 0x02 ; 2 2f4b8: 0f 94 fa 77 call 0x2eff4 ; 0x2eff4 2f4bc: ce 01 movw r24, r28 2f4be: 01 96 adiw r24, 0x01 ; 1 2f4c0: 0e 94 3c 79 call 0xf278 ; 0xf278 } 2f4c4: a3 96 adiw r28, 0x23 ; 35 2f4c6: 0f b6 in r0, 0x3f ; 63 2f4c8: f8 94 cli 2f4ca: de bf out 0x3e, r29 ; 62 2f4cc: 0f be out 0x3f, r0 ; 63 2f4ce: cd bf out 0x3d, r28 ; 61 2f4d0: df 91 pop r29 2f4d2: cf 91 pop r28 2f4d4: 0f 91 pop r16 2f4d6: ff 90 pop r15 2f4d8: ef 90 pop r14 2f4da: df 90 pop r13 2f4dc: cf 90 pop r12 2f4de: 08 95 ret 0002f4e0 : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2f4e0: ef 92 push r14 2f4e2: ff 92 push r15 2f4e4: 0f 93 push r16 2f4e6: cf 93 push r28 2f4e8: df 93 push r29 2f4ea: cd b7 in r28, 0x3d ; 61 2f4ec: de b7 in r29, 0x3e ; 62 2f4ee: a3 97 sbiw r28, 0x23 ; 35 2f4f0: 0f b6 in r0, 0x3f ; 63 2f4f2: f8 94 cli 2f4f4: de bf out 0x3e, r29 ; 62 2f4f6: 0f be out 0x3f, r0 ; 63 2f4f8: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 2f4fa: 27 e1 ldi r18, 0x17 ; 23 2f4fc: e2 2e mov r14, r18 2f4fe: 25 e1 ldi r18, 0x15 ; 21 2f500: f2 2e mov r15, r18 2f502: 29 e1 ldi r18, 0x19 ; 25 2f504: 35 e1 ldi r19, 0x15 ; 21 2f506: d7 01 movw r26, r14 2f508: 2d 93 st X+, r18 2f50a: 3c 93 st X, r19 nrFiles = 0; 2f50c: 10 92 87 17 sts 0x1787, r1 ; 0x801787 2f510: 10 92 86 17 sts 0x1786, r1 ; 0x801786 curDir->seekSet((uint32_t)entry << 5); 2f514: b0 e0 ldi r27, 0x00 ; 0 2f516: a0 e0 ldi r26, 0x00 ; 0 2f518: ac 01 movw r20, r24 2f51a: bd 01 movw r22, r26 2f51c: e5 e0 ldi r30, 0x05 ; 5 2f51e: 44 0f add r20, r20 2f520: 55 1f adc r21, r21 2f522: 66 1f adc r22, r22 2f524: 77 1f adc r23, r23 2f526: ea 95 dec r30 2f528: d1 f7 brne .-12 ; 0x2f51e 2f52a: c9 01 movw r24, r18 2f52c: 0f 94 76 6d call 0x2daec ; 0x2daec 2f530: 00 e0 ldi r16, 0x00 ; 0 2f532: 0e 7f andi r16, 0xFE ; 254 2f534: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2f536: d7 01 movw r26, r14 2f538: ed 91 ld r30, X+ 2f53a: fc 91 ld r31, X 2f53c: 83 e2 ldi r24, 0x23 ; 35 2f53e: de 01 movw r26, r28 2f540: 11 96 adiw r26, 0x01 ; 1 2f542: 01 90 ld r0, Z+ 2f544: 0d 92 st X+, r0 2f546: 8a 95 dec r24 2f548: e1 f7 brne .-8 ; 0x2f542 2f54a: 22 e0 ldi r18, 0x02 ; 2 2f54c: 50 e0 ldi r21, 0x00 ; 0 2f54e: 40 e0 ldi r20, 0x00 ; 0 2f550: be 01 movw r22, r28 2f552: 6f 5f subi r22, 0xFF ; 255 2f554: 7f 4f sbci r23, 0xFF ; 255 2f556: 84 ef ldi r24, 0xF4 ; 244 2f558: 92 e0 ldi r25, 0x02 ; 2 2f55a: 0f 94 fa 77 call 0x2eff4 ; 0x2eff4 2f55e: ce 01 movw r24, r28 2f560: 01 96 adiw r24, 0x01 ; 1 2f562: 0e 94 3c 79 call 0xf278 ; 0xf278 } 2f566: a3 96 adiw r28, 0x23 ; 35 2f568: 0f b6 in r0, 0x3f ; 63 2f56a: f8 94 cli 2f56c: de bf out 0x3e, r29 ; 62 2f56e: 0f be out 0x3f, r0 ; 63 2f570: cd bf out 0x3d, r28 ; 61 2f572: df 91 pop r29 2f574: cf 91 pop r28 2f576: 0f 91 pop r16 2f578: ff 90 pop r15 2f57a: ef 90 pop r14 2f57c: 08 95 ret 0002f57e : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2f57e: cf 92 push r12 2f580: df 92 push r13 2f582: ef 92 push r14 2f584: ff 92 push r15 2f586: 0f 93 push r16 2f588: cf 93 push r28 2f58a: df 93 push r29 2f58c: cd b7 in r28, 0x3d ; 61 2f58e: de b7 in r29, 0x3e ; 62 2f590: a3 97 sbiw r28, 0x23 ; 35 2f592: 0f b6 in r0, 0x3f ; 63 2f594: f8 94 cli 2f596: de bf out 0x3e, r29 ; 62 2f598: 0f be out 0x3f, r0 ; 63 2f59a: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2f59c: 87 e1 ldi r24, 0x17 ; 23 2f59e: c8 2e mov r12, r24 2f5a0: 85 e1 ldi r24, 0x15 ; 21 2f5a2: d8 2e mov r13, r24 2f5a4: 89 e1 ldi r24, 0x19 ; 25 2f5a6: 95 e1 ldi r25, 0x15 ; 21 2f5a8: d6 01 movw r26, r12 2f5aa: 8d 93 st X+, r24 2f5ac: 9c 93 st X, r25 nrFiles=0; 2f5ae: 26 e8 ldi r18, 0x86 ; 134 2f5b0: e2 2e mov r14, r18 2f5b2: 27 e1 ldi r18, 0x17 ; 23 2f5b4: f2 2e mov r15, r18 2f5b6: f7 01 movw r30, r14 2f5b8: 11 82 std Z+1, r1 ; 0x01 2f5ba: 10 82 st Z, r1 curDir->rewind(); 2f5bc: 0e 94 37 79 call 0xf26e ; 0xf26e 2f5c0: 00 e0 ldi r16, 0x00 ; 0 2f5c2: 0e 7f andi r16, 0xFE ; 254 2f5c4: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2f5c6: d6 01 movw r26, r12 2f5c8: ed 91 ld r30, X+ 2f5ca: fc 91 ld r31, X 2f5cc: 83 e2 ldi r24, 0x23 ; 35 2f5ce: de 01 movw r26, r28 2f5d0: 11 96 adiw r26, 0x01 ; 1 2f5d2: 01 90 ld r0, Z+ 2f5d4: 0d 92 st X+, r0 2f5d6: 8a 95 dec r24 2f5d8: e1 f7 brne .-8 ; 0x2f5d2 2f5da: 21 e0 ldi r18, 0x01 ; 1 2f5dc: 50 e0 ldi r21, 0x00 ; 0 2f5de: 40 e0 ldi r20, 0x00 ; 0 2f5e0: be 01 movw r22, r28 2f5e2: 6f 5f subi r22, 0xFF ; 255 2f5e4: 7f 4f sbci r23, 0xFF ; 255 2f5e6: 84 ef ldi r24, 0xF4 ; 244 2f5e8: 92 e0 ldi r25, 0x02 ; 2 2f5ea: 0f 94 fa 77 call 0x2eff4 ; 0x2eff4 2f5ee: ce 01 movw r24, r28 2f5f0: 01 96 adiw r24, 0x01 ; 1 2f5f2: 0e 94 3c 79 call 0xf278 ; 0xf278 //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2f5f6: f7 01 movw r30, r14 2f5f8: 80 81 ld r24, Z 2f5fa: 91 81 ldd r25, Z+1 ; 0x01 2f5fc: a3 96 adiw r28, 0x23 ; 35 2f5fe: 0f b6 in r0, 0x3f ; 63 2f600: f8 94 cli 2f602: de bf out 0x3e, r29 ; 62 2f604: 0f be out 0x3f, r0 ; 63 2f606: cd bf out 0x3d, r28 ; 61 2f608: df 91 pop r29 2f60a: cf 91 pop r28 2f60c: 0f 91 pop r16 2f60e: ff 90 pop r15 2f610: ef 90 pop r14 2f612: df 90 pop r13 2f614: cf 90 pop r12 2f616: 08 95 ret 0002f618 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 2f618: cf 93 push r28 2f61a: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2f61c: 8f e2 ldi r24, 0x2F ; 47 2f61e: 0e 94 42 79 call 0xf284 ; 0xf284 { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f622: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2f624: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f626: 80 91 0e 16 lds r24, 0x160E ; 0x80160e 2f62a: c8 17 cp r28, r24 2f62c: 60 f4 brcc .+24 ; 0x2f646 { SERIAL_PROTOCOL(dir_names[i]); 2f62e: cd 9f mul r28, r29 2f630: c0 01 movw r24, r0 2f632: 11 24 eor r1, r1 2f634: 82 54 subi r24, 0x42 ; 66 2f636: 9b 4e sbci r25, 0xEB ; 235 2f638: 0e 94 bf 89 call 0x1137e ; 0x1137e 2f63c: 8f e2 ldi r24, 0x2F ; 47 2f63e: 0e 94 42 79 call 0xf284 ; 0xf284 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f642: cf 5f subi r28, 0xFF ; 255 2f644: f0 cf rjmp .-32 ; 0x2f626 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f646: 80 91 85 14 lds r24, 0x1485 ; 0x801485 2f64a: 81 11 cpse r24, r1 2f64c: 06 c0 rjmp .+12 ; 0x2f65a 2f64e: 80 e7 ldi r24, 0x70 ; 112 2f650: 94 e1 ldi r25, 0x14 ; 20 } 2f652: df 91 pop r29 2f654: cf 91 pop r28 2f656: 0c 94 bf 89 jmp 0x1137e ; 0x1137e for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f65a: 85 e8 ldi r24, 0x85 ; 133 2f65c: 94 e1 ldi r25, 0x14 ; 20 2f65e: f9 cf rjmp .-14 ; 0x2f652 0002f660 : 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) { 2f660: cf 92 push r12 2f662: df 92 push r13 2f664: ef 92 push r14 2f666: ff 92 push r15 2f668: 6b 01 movw r12, r22 2f66a: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2f66c: 88 ea ldi r24, 0xA8 ; 168 2f66e: 9c e0 ldi r25, 0x0C ; 12 2f670: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 2f674: ab 01 movw r20, r22 2f676: bc 01 movw r22, r24 2f678: 4c 0d add r20, r12 2f67a: 5d 1d adc r21, r13 2f67c: 6e 1d adc r22, r14 2f67e: 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); 2f680: 88 ea ldi r24, 0xA8 ; 168 2f682: 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); } 2f684: ff 90 pop r15 2f686: ef 90 pop r14 2f688: df 90 pop r13 2f68a: 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); 2f68c: 0d 94 b1 dd jmp 0x3bb62 ; 0x3bb62 0002f690 : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2f690: cf 93 push r28 2f692: df 93 push r29 2f694: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2f696: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 if (val == EEPROM_EMPTY_VALUE32) { 2f69a: 6f 3f cpi r22, 0xFF ; 255 2f69c: 2f ef ldi r18, 0xFF ; 255 2f69e: 72 07 cpc r23, r18 2f6a0: 82 07 cpc r24, r18 2f6a2: 92 07 cpc r25, r18 2f6a4: 49 f4 brne .+18 ; 0x2f6b8 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); 2f6a6: 40 e0 ldi r20, 0x00 ; 0 2f6a8: 50 e0 ldi r21, 0x00 ; 0 2f6aa: ba 01 movw r22, r20 2f6ac: ce 01 movw r24, r28 2f6ae: 0f 94 b1 dd call 0x3bb62 ; 0x3bb62 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; 2f6b2: 60 e0 ldi r22, 0x00 ; 0 2f6b4: 70 e0 ldi r23, 0x00 ; 0 2f6b6: cb 01 movw r24, r22 } return val; } 2f6b8: df 91 pop r29 2f6ba: cf 91 pop r28 2f6bc: 08 95 ret 0002f6be : } // 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; 2f6be: e6 e0 ldi r30, 0x06 ; 6 2f6c0: f7 e1 ldi r31, 0x17 ; 23 2f6c2: 40 81 ld r20, Z 2f6c4: 51 81 ldd r21, Z+1 ; 0x01 2f6c6: 62 81 ldd r22, Z+2 ; 0x02 2f6c8: 73 81 ldd r23, Z+3 ; 0x03 2f6ca: 48 0f add r20, r24 2f6cc: 59 1f adc r21, r25 2f6ce: 61 1d adc r22, r1 2f6d0: 71 1d adc r23, r1 2f6d2: 40 83 st Z, r20 2f6d4: 51 83 std Z+1, r21 ; 0x01 2f6d6: 62 83 std Z+2, r22 ; 0x02 2f6d8: 73 83 std Z+3, r23 ; 0x03 } 2f6da: 08 95 ret 0002f6dc : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 2f6dc: 0f 93 push r16 2f6de: 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_ ){ 2f6e0: 60 91 1b 17 lds r22, 0x171B ; 0x80171b 2f6e4: 70 91 1c 17 lds r23, 0x171C ; 0x80171c 2f6e8: 80 91 1d 17 lds r24, 0x171D ; 0x80171d 2f6ec: 90 91 1e 17 lds r25, 0x171E ; 0x80171e 2f6f0: 00 91 6f 0e lds r16, 0x0E6F ; 0x800e6f 2f6f4: 10 91 70 0e lds r17, 0x0E70 ; 0x800e70 2f6f8: 20 91 71 0e lds r18, 0x0E71 ; 0x800e71 2f6fc: 30 91 72 0e lds r19, 0x0E72 ; 0x800e72 2f700: 60 17 cp r22, r16 2f702: 71 07 cpc r23, r17 2f704: 82 07 cpc r24, r18 2f706: 93 07 cpc r25, r19 2f708: 39 f1 breq .+78 ; 0x2f758 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 2f70a: 40 e0 ldi r20, 0x00 ; 0 2f70c: 0f 94 a4 6a call 0x2d548 ; 0x2d548 2f710: 88 23 and r24, r24 2f712: f9 f0 breq .+62 ; 0x2f752 return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 2f714: 20 91 1f 17 lds r18, 0x171F ; 0x80171f 2f718: 30 91 20 17 lds r19, 0x1720 ; 0x801720 2f71c: 40 91 0f 17 lds r20, 0x170F ; 0x80170f 2f720: 50 91 10 17 lds r21, 0x1710 ; 0x801710 2f724: 60 91 11 17 lds r22, 0x1711 ; 0x801711 2f728: 70 91 12 17 lds r23, 0x1712 ; 0x801712 2f72c: 42 1b sub r20, r18 2f72e: 53 0b sbc r21, r19 2f730: 61 09 sbc r22, r1 2f732: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 2f734: 41 30 cpi r20, 0x01 ; 1 2f736: 92 e0 ldi r25, 0x02 ; 2 2f738: 59 07 cpc r21, r25 2f73a: 61 05 cpc r22, r1 2f73c: 71 05 cpc r23, r1 2f73e: 20 f0 brcs .+8 ; 0x2f748 2f740: 40 e0 ldi r20, 0x00 ; 0 2f742: 52 e0 ldi r21, 0x02 ; 2 2f744: 60 e0 ldi r22, 0x00 ; 0 2f746: 70 e0 ldi r23, 0x00 ; 0 2f748: 45 58 subi r20, 0x85 ; 133 2f74a: 51 4f sbci r21, 0xF1 ; 241 2f74c: 9a e0 ldi r25, 0x0A ; 10 2f74e: fa 01 movw r30, r20 2f750: 90 83 st Z, r25 } return true; } 2f752: 1f 91 pop r17 2f754: 0f 91 pop r16 2f756: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 2f758: 81 e0 ldi r24, 0x01 ; 1 2f75a: fb cf rjmp .-10 ; 0x2f752 0002f75c : voltReady = true; } uint16_t IR_sensor_analog::getVoltRaw() { uint16_t ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = voltRaw; } 2f75c: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2f75e: f8 94 cli 2f760: 80 91 93 17 lds r24, 0x1793 ; 0x801793 2f764: 90 91 94 17 lds r25, 0x1794 ; 0x801794 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2f768: 2f bf out 0x3f, r18 ; 63 return ret; } 2f76a: 08 95 ret 0002f76c : const char *IR_sensor_analog::getIRVersionText() { switch (sensorRevision) { 2f76c: 80 91 91 17 lds r24, 0x1791 ; 0x801791 2f770: 88 23 and r24, r24 2f772: 29 f0 breq .+10 ; 0x2f77e 2f774: 81 30 cpi r24, 0x01 ; 1 2f776: 39 f0 breq .+14 ; 0x2f786 case SensorRevision::_Old: return _T(MSG_IR_03_OR_OLDER); case SensorRevision::_Rev04: return _T(MSG_IR_04_OR_NEWER); default: return _T(MSG_IR_UNKNOWN); 2f778: 84 ed ldi r24, 0xD4 ; 212 2f77a: 9d e5 ldi r25, 0x5D ; 93 2f77c: 02 c0 rjmp .+4 ; 0x2f782 } const char *IR_sensor_analog::getIRVersionText() { switch (sensorRevision) { case SensorRevision::_Old: return _T(MSG_IR_03_OR_OLDER); 2f77e: 84 ef ldi r24, 0xF4 ; 244 2f780: 9d e5 ldi r25, 0x5D ; 93 case SensorRevision::_Rev04: return _T(MSG_IR_04_OR_NEWER); default: return _T(MSG_IR_UNKNOWN); 2f782: 0c 94 e1 73 jmp 0xe7c2 ; 0xe7c2 const char *IR_sensor_analog::getIRVersionText() { switch (sensorRevision) { case SensorRevision::_Old: return _T(MSG_IR_03_OR_OLDER); case SensorRevision::_Rev04: return _T(MSG_IR_04_OR_NEWER); 2f786: 84 ee ldi r24, 0xE4 ; 228 2f788: 9d e5 ldi r25, 0x5D ; 93 2f78a: fb cf rjmp .-10 ; 0x2f782 0002f78c : void IR_sensor_analog::clearVoltReady(){ ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ voltReady = false; } } void IR_sensor_analog::IR_ANALOG_Check(SensorRevision isVersion, SensorRevision switchTo) { 2f78c: cf 93 push r28 bool bTemp = (!CHECK_ALL_HEATERS); 2f78e: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d 2f792: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e 2f796: 23 2b or r18, r19 2f798: b9 f4 brne .+46 ; 0x2f7c8 2f79a: 20 91 6b 0e lds r18, 0x0E6B ; 0x800e6b 2f79e: 30 91 6c 0e lds r19, 0x0E6C ; 0x800e6c 2f7a2: 23 2b or r18, r19 2f7a4: 89 f4 brne .+34 ; 0x2f7c8 bTemp = bTemp && (menu_menu == lcd_status_screen); 2f7a6: 20 91 69 0e lds r18, 0x0E69 ; 0x800e69 2f7aa: 30 91 6a 0e lds r19, 0x0E6A ; 0x800e6a 2f7ae: 24 56 subi r18, 0x64 ; 100 2f7b0: 3a 43 sbci r19, 0x3A ; 58 2f7b2: 51 f4 brne .+20 ; 0x2f7c8 bTemp = bTemp && ((sensorRevision == isVersion) || (sensorRevision == SensorRevision::_Undef)); 2f7b4: 90 91 91 17 lds r25, 0x1791 ; 0x801791 2f7b8: 98 17 cp r25, r24 2f7ba: 11 f0 breq .+4 ; 0x2f7c0 2f7bc: 9f 3f cpi r25, 0xFF ; 255 2f7be: 21 f4 brne .+8 ; 0x2f7c8 bTemp = bTemp && (state == State::ready); 2f7c0: 80 91 88 17 lds r24, 0x1788 ; 0x801788 2f7c4: 82 30 cpi r24, 0x02 ; 2 2f7c6: 31 f0 breq .+12 ; 0x2f7d4 default: break; } } } else { nFSCheckCount = 0; 2f7c8: 10 92 9a 17 sts 0x179A, r1 ; 0x80179a 2f7cc: 10 92 99 17 sts 0x1799, r1 ; 0x801799 } } 2f7d0: cf 91 pop r28 2f7d2: 08 95 ret bool bTemp = (!CHECK_ALL_HEATERS); bTemp = bTemp && (menu_menu == lcd_status_screen); bTemp = bTemp && ((sensorRevision == isVersion) || (sensorRevision == SensorRevision::_Undef)); bTemp = bTemp && (state == State::ready); if (bTemp) { nFSCheckCount++; 2f7d4: 80 91 99 17 lds r24, 0x1799 ; 0x801799 2f7d8: 90 91 9a 17 lds r25, 0x179A ; 0x80179a 2f7dc: 01 96 adiw r24, 0x01 ; 1 if (nFSCheckCount > FS_CHECK_COUNT) { 2f7de: 85 30 cpi r24, 0x05 ; 5 2f7e0: 91 05 cpc r25, r1 2f7e2: 28 f4 brcc .+10 ; 0x2f7ee bool bTemp = (!CHECK_ALL_HEATERS); bTemp = bTemp && (menu_menu == lcd_status_screen); bTemp = bTemp && ((sensorRevision == isVersion) || (sensorRevision == SensorRevision::_Undef)); bTemp = bTemp && (state == State::ready); if (bTemp) { nFSCheckCount++; 2f7e4: 90 93 9a 17 sts 0x179A, r25 ; 0x80179a 2f7e8: 80 93 99 17 sts 0x1799, r24 ; 0x801799 2f7ec: f1 cf rjmp .-30 ; 0x2f7d0 2f7ee: c6 2f mov r28, r22 if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary 2f7f0: 10 92 9a 17 sts 0x179A, r1 ; 0x80179a 2f7f4: 10 92 99 17 sts 0x1799, r1 ; 0x801799 return _T(MSG_IR_UNKNOWN); } } void IR_sensor_analog::setSensorRevision(SensorRevision rev, bool updateEEPROM) { sensorRevision = rev; 2f7f8: 60 93 91 17 sts 0x1791, r22 ; 0x801791 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2f7fc: 88 e4 ldi r24, 0x48 ; 72 2f7fe: 9d e0 ldi r25, 0x0D ; 13 2f800: 0f 94 7f dd call 0x3bafe ; 0x3bafe if (bTemp) { nFSCheckCount++; if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary setSensorRevision(switchTo, true); printf_IRSensorAnalogBoardChange(); 2f804: 0f 94 62 14 call 0x228c4 ; 0x228c4 switch (switchTo) { case SensorRevision::_Old: lcd_setstatuspgm(_T(MSG_IR_03_OR_OLDER)); 2f808: 84 ef ldi r24, 0xF4 ; 244 2f80a: 9d e5 ldi r25, 0x5D ; 93 nFSCheckCount++; if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary setSensorRevision(switchTo, true); printf_IRSensorAnalogBoardChange(); switch (switchTo) { 2f80c: c1 30 cpi r28, 0x01 ; 1 2f80e: 11 f4 brne .+4 ; 0x2f814 case SensorRevision::_Old: lcd_setstatuspgm(_T(MSG_IR_03_OR_OLDER)); break; case SensorRevision::_Rev04: lcd_setstatuspgm(_T(MSG_IR_04_OR_NEWER)); 2f810: 84 ee ldi r24, 0xE4 ; 228 2f812: 9d e5 ldi r25, 0x5D ; 93 2f814: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 } } } else { nFSCheckCount = 0; } } 2f818: cf 91 pop r28 switch (switchTo) { case SensorRevision::_Old: lcd_setstatuspgm(_T(MSG_IR_03_OR_OLDER)); break; case SensorRevision::_Rev04: lcd_setstatuspgm(_T(MSG_IR_04_OR_NEWER)); 2f81a: 0d 94 0c 0b jmp 0x21618 ; 0x21618 0002f81e : * 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() { 2f81e: 2f 92 push r2 2f820: 3f 92 push r3 2f822: 4f 92 push r4 2f824: 5f 92 push r5 2f826: 6f 92 push r6 2f828: 7f 92 push r7 2f82a: 8f 92 push r8 2f82c: 9f 92 push r9 2f82e: af 92 push r10 2f830: bf 92 push r11 2f832: cf 92 push r12 2f834: df 92 push r13 2f836: ef 92 push r14 2f838: ff 92 push r15 2f83a: 0f 93 push r16 2f83c: 1f 93 push r17 2f83e: cf 93 push r28 2f840: df 93 push r29 2f842: cd b7 in r28, 0x3d ; 61 2f844: de b7 in r29, 0x3e ; 62 2f846: ed 97 sbiw r28, 0x3d ; 61 2f848: 0f b6 in r0, 0x3f ; 63 2f84a: f8 94 cli 2f84c: de bf out 0x3e, r29 ; 62 2f84e: 0f be out 0x3f, r0 ; 63 2f850: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2f852: 10 92 10 16 sts 0x1610, r1 ; 0x801610 2f856: 10 92 0f 16 sts 0x160F, r1 ; 0x80160f lastSortedFilePosition = 0; 2f85a: 10 92 da 16 sts 0x16DA, r1 ; 0x8016da 2f85e: 10 92 d9 16 sts 0x16D9, r1 ; 0x8016d9 */ void CardReader::presort() { // Throw away old sort index flush_presort(); if (IS_SD_INSERTED == false) return; //sorting is not used in farm mode 2f862: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2f866: 80 fd sbrc r24, 0 2f868: ef c0 rjmp .+478 ; 0x2fa48 uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2f86a: 89 e0 ldi r24, 0x09 ; 9 2f86c: 9f e0 ldi r25, 0x0F ; 15 2f86e: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 2f872: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2f874: 82 e0 ldi r24, 0x02 ; 2 2f876: 80 93 96 02 sts 0x0296, r24 ; 0x800296 // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 2f87a: 0f 94 bf 7a call 0x2f57e ; 0x2f57e 2f87e: 6c 01 movw r12, r24 if (fileCnt > 0) { 2f880: 00 97 sbiw r24, 0x00 ; 0 2f882: 09 f4 brne .+2 ; 0x2f886 2f884: de c0 rjmp .+444 ; 0x2fa42 // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2f886: 85 36 cpi r24, 0x65 ; 101 2f888: 91 05 cpc r25, r1 2f88a: 60 f0 brcs .+24 ; 0x2f8a4 if ((sdSort != SD_SORT_NONE) && !farm_mode) { 2f88c: 32 e0 ldi r19, 0x02 ; 2 2f88e: 33 16 cp r3, r19 2f890: 31 f0 breq .+12 ; 0x2f89e lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 2f892: 81 e8 ldi r24, 0x81 ; 129 2f894: 9d e5 ldi r25, 0x5D ; 93 2f896: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2f89a: 0f 94 07 35 call 0x26a0e ; 0x26a0e } fileCnt = SDSORT_LIMIT; 2f89e: f4 e6 ldi r31, 0x64 ; 100 2f8a0: cf 2e mov r12, r31 2f8a2: d1 2c mov r13, r1 } sort_count = fileCnt; 2f8a4: d0 92 10 16 sts 0x1610, r13 ; 0x801610 2f8a8: c0 92 0f 16 sts 0x160F, r12 ; 0x80160f 2f8ac: 61 e1 ldi r22, 0x11 ; 17 2f8ae: 66 2e mov r6, r22 2f8b0: 66 e1 ldi r22, 0x16 ; 22 2f8b2: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2f8b4: f1 2c mov r15, r1 2f8b6: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2f8b8: 79 e1 ldi r23, 0x19 ; 25 2f8ba: a7 2e mov r10, r23 2f8bc: 75 e1 ldi r23, 0x15 ; 21 2f8be: b7 2e mov r11, r23 nrFiles = 1; 2f8c0: 88 24 eor r8, r8 2f8c2: 83 94 inc r8 2f8c4: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2f8c6: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2f8ca: 80 fd sbrc r24, 0 2f8cc: bd c0 rjmp .+378 ; 0x2fa48 manage_heater(); 2f8ce: 0f 94 9b 4d call 0x29b36 ; 0x29b36 if (i == 0) 2f8d2: e1 14 cp r14, r1 2f8d4: f1 04 cpc r15, r1 2f8d6: 09 f0 breq .+2 ; 0x2f8da 2f8d8: d0 c0 rjmp .+416 ; 0x2fa7a getfilename(0); 2f8da: 90 e0 ldi r25, 0x00 ; 0 2f8dc: 80 e0 ldi r24, 0x00 ; 0 2f8de: 0f 94 29 7a call 0x2f452 ; 0x2f452 else getfilename_next(position); sort_entries[i] = position >> 5; 2f8e2: 80 91 81 14 lds r24, 0x1481 ; 0x801481 2f8e6: 90 91 82 14 lds r25, 0x1482 ; 0x801482 2f8ea: a0 91 83 14 lds r26, 0x1483 ; 0x801483 2f8ee: b0 91 84 14 lds r27, 0x1484 ; 0x801484 2f8f2: 55 e0 ldi r21, 0x05 ; 5 2f8f4: b6 95 lsr r27 2f8f6: a7 95 ror r26 2f8f8: 97 95 ror r25 2f8fa: 87 95 ror r24 2f8fc: 5a 95 dec r21 2f8fe: d1 f7 brne .-12 ; 0x2f8f4 2f900: f3 01 movw r30, r6 2f902: 81 93 st Z+, r24 2f904: 91 93 st Z+, r25 2f906: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2f908: ff ef ldi r31, 0xFF ; 255 2f90a: ef 1a sub r14, r31 2f90c: ff 0a sbc r15, r31 2f90e: ce 14 cp r12, r14 2f910: df 04 cpc r13, r15 2f912: c9 f6 brne .-78 ; 0x2f8c6 else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 2f914: 21 e0 ldi r18, 0x01 ; 1 2f916: e2 16 cp r14, r18 2f918: f1 04 cpc r15, r1 2f91a: 09 f4 brne .+2 ; 0x2f91e 2f91c: 92 c0 rjmp .+292 ; 0x2fa42 2f91e: 32 e0 ldi r19, 0x02 ; 2 2f920: 33 16 cp r3, r19 2f922: 09 f4 brne .+2 ; 0x2f926 2f924: 8e c0 rjmp .+284 ; 0x2fa42 #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2f926: 90 93 da 16 sts 0x16DA, r25 ; 0x8016da 2f92a: 80 93 d9 16 sts 0x16D9, r24 ; 0x8016d9 #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)); 2f92e: 81 e7 ldi r24, 0x71 ; 113 2f930: 9d e5 ldi r25, 0x5D ; 93 2f932: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 2f936: ee 9c mul r14, r14 2f938: 90 01 movw r18, r0 2f93a: ef 9c mul r14, r15 2f93c: 30 0d add r19, r0 2f93e: 30 0d add r19, r0 2f940: 11 24 eor r1, r1 2f942: bc 01 movw r22, r24 2f944: c9 01 movw r24, r18 2f946: 96 95 lsr r25 2f948: 87 95 ror r24 2f94a: 0f 94 3c cd call 0x39a78 ; 0x39a78 2f94e: 33 e1 ldi r19, 0x13 ; 19 2f950: a3 2e mov r10, r19 2f952: 36 e1 ldi r19, 0x16 ; 22 2f954: 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; 2f956: 91 2c mov r9, r1 2f958: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 2f95a: cc 24 eor r12, r12 2f95c: c3 94 inc r12 2f95e: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2f960: c4 01 movw r24, r8 2f962: 0f 94 0d cd call 0x39a1a ; 0x39a1a counter += i; 2f966: 8c 0c add r8, r12 2f968: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 2f96a: f5 01 movw r30, r10 2f96c: 01 90 ld r0, Z+ 2f96e: f0 81 ld r31, Z 2f970: e0 2d mov r30, r0 2f972: f9 af std Y+57, r31 ; 0x39 2f974: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2f976: cf 01 movw r24, r30 2f978: 0f 94 70 7a call 0x2f4e0 ; 0x2f4e0 strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 2f97c: 80 91 85 14 lds r24, 0x1485 ; 0x801485 2f980: 60 e7 ldi r22, 0x70 ; 112 2f982: 74 e1 ldi r23, 0x14 ; 20 2f984: 88 23 and r24, r24 2f986: 11 f0 breq .+4 ; 0x2f98c 2f988: 65 e8 ldi r22, 0x85 ; 133 2f98a: 74 e1 ldi r23, 0x14 ; 20 2f98c: ce 01 movw r24, r28 2f98e: 01 96 adiw r24, 0x01 ; 1 2f990: 0f 94 c6 e3 call 0x3c78c ; 0x3c78c crmod_date_bckp = crmodDate; 2f994: 60 90 7f 14 lds r6, 0x147F ; 0x80147f 2f998: 70 90 80 14 lds r7, 0x1480 ; 0x801480 crmod_time_bckp = crmodTime; 2f99c: 20 91 7d 14 lds r18, 0x147D ; 0x80147d 2f9a0: 30 91 7e 14 lds r19, 0x147E ; 0x80147e 2f9a4: 3b af std Y+59, r19 ; 0x3b 2f9a6: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 2f9a8: 20 90 ba 14 lds r2, 0x14BA ; 0x8014ba 2f9ac: bf aa std Y+55, r11 ; 0x37 2f9ae: ae aa std Y+54, r10 ; 0x36 2f9b0: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2f9b2: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2f9b6: 80 fd sbrc r24, 0 2f9b8: 47 c0 rjmp .+142 ; 0x2fa48 printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 2f9ba: 0f 94 9b 4d call 0x29b36 ; 0x29b36 const uint16_t o2 = sort_entries[j - 1]; 2f9be: c8 01 movw r24, r16 2f9c0: 01 97 sbiw r24, 0x01 ; 1 2f9c2: 9d af std Y+61, r25 ; 0x3d 2f9c4: 8c af std Y+60, r24 ; 0x3c 2f9c6: ee a9 ldd r30, Y+54 ; 0x36 2f9c8: ff a9 ldd r31, Y+55 ; 0x37 2f9ca: 52 90 ld r5, -Z 2f9cc: 42 90 ld r4, -Z 2f9ce: ff ab std Y+55, r31 ; 0x37 2f9d0: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2f9d2: c2 01 movw r24, r4 2f9d4: 0f 94 70 7a call 0x2f4e0 ; 0x2f4e0 char *name2 = LONGEST_FILENAME; // use the string in-place 2f9d8: 80 91 85 14 lds r24, 0x1485 ; 0x801485 2f9dc: 60 e7 ldi r22, 0x70 ; 112 2f9de: 74 e1 ldi r23, 0x14 ; 20 2f9e0: 88 23 and r24, r24 2f9e2: 11 f0 breq .+4 ; 0x2f9e8 2f9e4: 65 e8 ldi r22, 0x85 ; 133 2f9e6: 74 e1 ldi r23, 0x14 ; 20 // Sort the current pair according to settings. if ( 2f9e8: 31 10 cpse r3, r1 2f9ea: 8a c0 rjmp .+276 ; 0x2fb00 2f9ec: 80 91 ba 14 lds r24, 0x14BA ; 0x8014ba 2f9f0: 28 12 cpse r2, r24 2f9f2: 83 c0 rjmp .+262 ; 0x2fafa #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2f9f4: 80 91 7f 14 lds r24, 0x147F ; 0x80147f 2f9f8: 90 91 80 14 lds r25, 0x1480 ; 0x801480 2f9fc: 68 16 cp r6, r24 2f9fe: 79 06 cpc r7, r25 2fa00: 09 f0 breq .+2 ; 0x2fa04 2fa02: 6c c0 rjmp .+216 ; 0x2fadc 2fa04: 80 91 7d 14 lds r24, 0x147D ; 0x80147d 2fa08: 90 91 7e 14 lds r25, 0x147E ; 0x80147e 2fa0c: 2a ad ldd r18, Y+58 ; 0x3a 2fa0e: 3b ad ldd r19, Y+59 ; 0x3b 2fa10: 82 17 cp r24, r18 2fa12: 93 07 cpc r25, r19 2fa14: 08 f0 brcs .+2 ; 0x2fa18 2fa16: 66 c0 rjmp .+204 ; 0x2fae4 #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2fa18: 00 0f add r16, r16 2fa1a: 11 1f adc r17, r17 2fa1c: f8 01 movw r30, r16 2fa1e: ef 5e subi r30, 0xEF ; 239 2fa20: f9 4e sbci r31, 0xE9 ; 233 2fa22: 28 ad ldd r18, Y+56 ; 0x38 2fa24: 39 ad ldd r19, Y+57 ; 0x39 2fa26: 31 83 std Z+1, r19 ; 0x01 2fa28: 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){ 2fa2a: 3f ef ldi r19, 0xFF ; 255 2fa2c: c3 1a sub r12, r19 2fa2e: d3 0a sbc r13, r19 2fa30: 82 e0 ldi r24, 0x02 ; 2 2fa32: a8 0e add r10, r24 2fa34: b1 1c adc r11, r1 2fa36: ec 14 cp r14, r12 2fa38: fd 04 cpc r15, r13 2fa3a: 09 f0 breq .+2 ; 0x2fa3e 2fa3c: 91 cf rjmp .-222 ; 0x2f960 for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 2fa3e: 0f 94 2e cd call 0x39a5c ; 0x39a5c } } KEEPALIVE_STATE(NOT_BUSY); 2fa42: 81 e0 ldi r24, 0x01 ; 1 2fa44: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } 2fa48: ed 96 adiw r28, 0x3d ; 61 2fa4a: 0f b6 in r0, 0x3f ; 63 2fa4c: f8 94 cli 2fa4e: de bf out 0x3e, r29 ; 62 2fa50: 0f be out 0x3f, r0 ; 63 2fa52: cd bf out 0x3d, r28 ; 61 2fa54: df 91 pop r29 2fa56: cf 91 pop r28 2fa58: 1f 91 pop r17 2fa5a: 0f 91 pop r16 2fa5c: ff 90 pop r15 2fa5e: ef 90 pop r14 2fa60: df 90 pop r13 2fa62: cf 90 pop r12 2fa64: bf 90 pop r11 2fa66: af 90 pop r10 2fa68: 9f 90 pop r9 2fa6a: 8f 90 pop r8 2fa6c: 7f 90 pop r7 2fa6e: 6f 90 pop r6 2fa70: 5f 90 pop r5 2fa72: 4f 90 pop r4 2fa74: 3f 90 pop r3 2fa76: 2f 90 pop r2 2fa78: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 2fa7a: 40 91 81 14 lds r20, 0x1481 ; 0x801481 2fa7e: 50 91 82 14 lds r21, 0x1482 ; 0x801482 2fa82: 60 91 83 14 lds r22, 0x1483 ; 0x801483 2fa86: 70 91 84 14 lds r23, 0x1484 ; 0x801484 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2fa8a: b0 92 18 15 sts 0x1518, r11 ; 0x801518 2fa8e: a0 92 17 15 sts 0x1517, r10 ; 0x801517 nrFiles = 1; 2fa92: 90 92 87 17 sts 0x1787, r9 ; 0x801787 2fa96: 80 92 86 17 sts 0x1786, r8 ; 0x801786 curDir->seekSet(position); 2fa9a: 89 e1 ldi r24, 0x19 ; 25 2fa9c: 95 e1 ldi r25, 0x15 ; 21 2fa9e: 0f 94 76 6d call 0x2daec ; 0x2daec 2faa2: 1e 7f andi r17, 0xFE ; 254 2faa4: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2faa6: e0 91 17 15 lds r30, 0x1517 ; 0x801517 2faaa: f0 91 18 15 lds r31, 0x1518 ; 0x801518 2faae: 83 e2 ldi r24, 0x23 ; 35 2fab0: de 01 movw r26, r28 2fab2: 11 96 adiw r26, 0x01 ; 1 2fab4: 01 90 ld r0, Z+ 2fab6: 0d 92 st X+, r0 2fab8: 8a 95 dec r24 2faba: e1 f7 brne .-8 ; 0x2fab4 2fabc: 01 2f mov r16, r17 2fabe: 22 e0 ldi r18, 0x02 ; 2 2fac0: 50 e0 ldi r21, 0x00 ; 0 2fac2: 40 e0 ldi r20, 0x00 ; 0 2fac4: be 01 movw r22, r28 2fac6: 6f 5f subi r22, 0xFF ; 255 2fac8: 7f 4f sbci r23, 0xFF ; 255 2faca: 84 ef ldi r24, 0xF4 ; 244 2facc: 92 e0 ldi r25, 0x02 ; 2 2face: 0f 94 fa 77 call 0x2eff4 ; 0x2eff4 2fad2: ce 01 movw r24, r28 2fad4: 01 96 adiw r24, 0x01 ; 1 2fad6: 0e 94 3c 79 call 0xf278 ; 0xf278 2fada: 03 cf rjmp .-506 ; 0x2f8e2 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)) 2fadc: 86 15 cp r24, r6 2fade: 97 05 cpc r25, r7 2fae0: 08 f4 brcc .+2 ; 0x2fae4 2fae2: 9a cf rjmp .-204 ; 0x2fa18 break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2fae4: ee a9 ldd r30, Y+54 ; 0x36 2fae6: ff a9 ldd r31, Y+55 ; 0x37 2fae8: 53 82 std Z+3, r5 ; 0x03 2faea: 42 82 std Z+2, r4 ; 0x02 2faec: 0c ad ldd r16, Y+60 ; 0x3c 2faee: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2faf0: 01 15 cp r16, r1 2faf2: 11 05 cpc r17, r1 2faf4: 09 f0 breq .+2 ; 0x2faf8 2faf6: 5d cf rjmp .-326 ; 0x2f9b2 2faf8: 8f cf rjmp .-226 ; 0x2fa18 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)) 2fafa: 22 20 and r2, r2 2fafc: 99 f3 breq .-26 ; 0x2fae4 2fafe: 8c cf rjmp .-232 ; 0x2fa18 2fb00: 31 e0 ldi r19, 0x01 ; 1 2fb02: 33 12 cpse r3, r19 2fb04: ef cf rjmp .-34 ; 0x2fae4 getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2fb06: 80 91 ba 14 lds r24, 0x14BA ; 0x8014ba 2fb0a: 28 12 cpse r2, r24 2fb0c: 07 c0 rjmp .+14 ; 0x2fb1c #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fb0e: ce 01 movw r24, r28 2fb10: 01 96 adiw r24, 0x01 ; 1 2fb12: 0f 94 94 e3 call 0x3c728 ; 0x3c728 2fb16: 97 fd sbrc r25, 7 2fb18: e5 cf rjmp .-54 ; 0x2fae4 2fb1a: 7e cf rjmp .-260 ; 0x2fa18 2fb1c: 21 10 cpse r2, r1 2fb1e: e2 cf rjmp .-60 ; 0x2fae4 2fb20: 7b cf rjmp .-266 ; 0x2fa18 0002fb22 : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2fb22: cf 92 push r12 2fb24: df 92 push r13 2fb26: ef 92 push r14 2fb28: ff 92 push r15 2fb2a: 0f 93 push r16 2fb2c: 1f 93 push r17 2fb2e: cf 93 push r28 2fb30: df 93 push r29 2fb32: cd b7 in r28, 0x3d ; 61 2fb34: de b7 in r29, 0x3e ; 62 2fb36: a3 97 sbiw r28, 0x23 ; 35 2fb38: 0f b6 in r0, 0x3f ; 63 2fb3a: f8 94 cli 2fb3c: de bf out 0x3e, r29 ; 62 2fb3e: 0f be out 0x3f, r0 ; 63 2fb40: cd bf out 0x3d, r28 ; 61 2fb42: 7c 01 movw r14, r24 2fb44: 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) {} 2fb46: 19 82 std Y+1, r1 ; 0x01 2fb48: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fb4a: 80 91 1c 15 lds r24, 0x151C ; 0x80151c parent=&workDir; 2fb4e: 99 e1 ldi r25, 0x19 ; 25 2fb50: c9 2e mov r12, r25 2fb52: 95 e1 ldi r25, 0x15 ; 21 2fb54: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fb56: 81 11 cpse r24, r1 2fb58: 04 c0 rjmp .+8 ; 0x2fb62 } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 2fb5a: 84 ef ldi r24, 0xF4 ; 244 2fb5c: c8 2e mov r12, r24 2fb5e: 84 e1 ldi r24, 0x14 ; 20 2fb60: 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); 2fb62: 21 e0 ldi r18, 0x01 ; 1 2fb64: a7 01 movw r20, r14 2fb66: b6 01 movw r22, r12 2fb68: ce 01 movw r24, r28 2fb6a: 01 96 adiw r24, 0x01 ; 1 2fb6c: 0f 94 08 d7 call 0x3ae10 ; 0x3ae10 2fb70: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2fb72: 88 23 and r24, r24 2fb74: 21 f1 breq .+72 ; 0x2fbbe 2fb76: 80 91 0e 16 lds r24, 0x160E ; 0x80160e 2fb7a: 85 30 cpi r24, 0x05 ; 5 2fb7c: 00 f5 brcc .+64 ; 0x2fbbe SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 2fb7e: 29 e0 ldi r18, 0x09 ; 9 2fb80: 82 9f mul r24, r18 2fb82: c0 01 movw r24, r0 2fb84: 11 24 eor r1, r1 2fb86: b7 01 movw r22, r14 2fb88: 82 54 subi r24, 0x42 ; 66 2fb8a: 9b 4e sbci r25, 0xEB ; 235 2fb8c: 0f 94 c6 e3 call 0x3c78c ; 0x3c78c puts(relpath); 2fb90: c7 01 movw r24, r14 2fb92: 0f 94 ea e3 call 0x3c7d4 ; 0x3c7d4 if (workDirDepth < MAX_DIR_DEPTH) { 2fb96: 80 91 0e 16 lds r24, 0x160E ; 0x80160e 2fb9a: 86 30 cpi r24, 0x06 ; 6 2fb9c: 80 f1 brcs .+96 ; 0x2fbfe for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2fb9e: 83 e2 ldi r24, 0x23 ; 35 2fba0: fe 01 movw r30, r28 2fba2: 31 96 adiw r30, 0x01 ; 1 2fba4: a9 e1 ldi r26, 0x19 ; 25 2fba6: b5 e1 ldi r27, 0x15 ; 21 2fba8: 01 90 ld r0, Z+ 2fbaa: 0d 92 st X+, r0 2fbac: 8a 95 dec r24 2fbae: e1 f7 brne .-8 ; 0x2fba8 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fbb0: 00 23 and r16, r16 2fbb2: 09 f4 brne .+2 ; 0x2fbb6 2fbb4: 4c c0 rjmp .+152 ; 0x2fc4e presort(); 2fbb6: 0f 94 0f 7c call 0x2f81e ; 0x2f81e else presort_flag = true; #endif return 1; 2fbba: 10 2f mov r17, r16 2fbbc: 0c c0 rjmp .+24 ; 0x2fbd6 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2fbbe: 82 ef ldi r24, 0xF2 ; 242 2fbc0: 9a ea ldi r25, 0xAA ; 170 2fbc2: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2fbc6: 87 e7 ldi r24, 0x77 ; 119 2fbc8: 91 e7 ldi r25, 0x71 ; 113 2fbca: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN(relpath); 2fbce: c7 01 movw r24, r14 2fbd0: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 return 0; 2fbd4: 10 e0 ldi r17, 0x00 ; 0 2fbd6: ce 01 movw r24, r28 2fbd8: 01 96 adiw r24, 0x01 ; 1 2fbda: 0e 94 3c 79 call 0xf278 ; 0xf278 else presort_flag = true; #endif return 1; } } 2fbde: 81 2f mov r24, r17 2fbe0: a3 96 adiw r28, 0x23 ; 35 2fbe2: 0f b6 in r0, 0x3f ; 63 2fbe4: f8 94 cli 2fbe6: de bf out 0x3e, r29 ; 62 2fbe8: 0f be out 0x3f, r0 ; 63 2fbea: cd bf out 0x3d, r28 ; 61 2fbec: df 91 pop r29 2fbee: cf 91 pop r28 2fbf0: 1f 91 pop r17 2fbf2: 0f 91 pop r16 2fbf4: ff 90 pop r15 2fbf6: ef 90 pop r14 2fbf8: df 90 pop r13 2fbfa: cf 90 pop r12 2fbfc: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fbfe: 8f 5f subi r24, 0xFF ; 255 2fc00: 80 93 0e 16 sts 0x160E, r24 ; 0x80160e workDirParents[d+1] = workDirParents[d]; 2fc04: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fc06: 81 50 subi r24, 0x01 ; 1 2fc08: c8 f0 brcs .+50 ; 0x2fc3c workDirParents[d+1] = workDirParents[d]; 2fc0a: 28 2f mov r18, r24 2fc0c: 30 e0 ldi r19, 0x00 ; 0 2fc0e: a9 01 movw r20, r18 2fc10: 4f 5f subi r20, 0xFF ; 255 2fc12: 5f 4f sbci r21, 0xFF ; 255 2fc14: 94 9f mul r25, r20 2fc16: d0 01 movw r26, r0 2fc18: 95 9f mul r25, r21 2fc1a: b0 0d add r27, r0 2fc1c: 11 24 eor r1, r1 2fc1e: a4 5c subi r26, 0xC4 ; 196 2fc20: ba 4e sbci r27, 0xEA ; 234 2fc22: 92 9f mul r25, r18 2fc24: f0 01 movw r30, r0 2fc26: 93 9f mul r25, r19 2fc28: f0 0d add r31, r0 2fc2a: 11 24 eor r1, r1 2fc2c: e4 5c subi r30, 0xC4 ; 196 2fc2e: fa 4e sbci r31, 0xEA ; 234 2fc30: 29 2f mov r18, r25 2fc32: 01 90 ld r0, Z+ 2fc34: 0d 92 st X+, r0 2fc36: 2a 95 dec r18 2fc38: e1 f7 brne .-8 ; 0x2fc32 2fc3a: e5 cf rjmp .-54 ; 0x2fc06 workDirParents[0]=*parent; 2fc3c: 83 e2 ldi r24, 0x23 ; 35 2fc3e: f6 01 movw r30, r12 2fc40: ac e3 ldi r26, 0x3C ; 60 2fc42: b5 e1 ldi r27, 0x15 ; 21 2fc44: 01 90 ld r0, Z+ 2fc46: 0d 92 st X+, r0 2fc48: 8a 95 dec r24 2fc4a: e1 f7 brne .-8 ; 0x2fc44 2fc4c: a8 cf rjmp .-176 ; 0x2fb9e #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 2fc4e: 81 e0 ldi r24, 0x01 ; 1 2fc50: 80 93 bd 14 sts 0x14BD, r24 ; 0x8014bd 2fc54: c0 cf rjmp .-128 ; 0x2fbd6 0002fc56 : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2fc56: 93 e2 ldi r25, 0x23 ; 35 2fc58: e4 ef ldi r30, 0xF4 ; 244 2fc5a: f4 e1 ldi r31, 0x14 ; 20 2fc5c: a9 e1 ldi r26, 0x19 ; 25 2fc5e: b5 e1 ldi r27, 0x15 ; 21 2fc60: 01 90 ld r0, Z+ 2fc62: 0d 92 st X+, r0 2fc64: 9a 95 dec r25 2fc66: e1 f7 brne .-8 ; 0x2fc60 workDirDepth = 0; 2fc68: 10 92 0e 16 sts 0x160E, r1 ; 0x80160e curDir=&workDir; 2fc6c: 29 e1 ldi r18, 0x19 ; 25 2fc6e: 35 e1 ldi r19, 0x15 ; 21 2fc70: 30 93 18 15 sts 0x1518, r19 ; 0x801518 2fc74: 20 93 17 15 sts 0x1517, r18 ; 0x801517 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fc78: 81 11 cpse r24, r1 presort(); 2fc7a: 0d 94 0f 7c jmp 0x2f81e ; 0x2f81e else presort_flag = true; 2fc7e: 81 e0 ldi r24, 0x01 ; 1 2fc80: 80 93 bd 14 sts 0x14BD, r24 ; 0x8014bd #endif } 2fc84: 08 95 ret 0002fc86 : * * @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) 2fc86: 8f 92 push r8 2fc88: 9f 92 push r9 2fc8a: af 92 push r10 2fc8c: bf 92 push r11 2fc8e: cf 92 push r12 2fc90: df 92 push r13 2fc92: ef 92 push r14 2fc94: ff 92 push r15 2fc96: 0f 93 push r16 2fc98: 1f 93 push r17 2fc9a: cf 93 push r28 2fc9c: df 93 push r29 2fc9e: cd b7 in r28, 0x3d ; 61 2fca0: de b7 in r29, 0x3e ; 62 2fca2: 2d 97 sbiw r28, 0x0d ; 13 2fca4: 0f b6 in r0, 0x3f ; 63 2fca6: f8 94 cli 2fca8: de bf out 0x3e, r29 ; 62 2fcaa: 0f be out 0x3f, r0 ; 63 2fcac: cd bf out 0x3d, r28 ; 61 { curDir=&root; 2fcae: 24 ef ldi r18, 0xF4 ; 244 2fcb0: 34 e1 ldi r19, 0x14 ; 20 2fcb2: 30 93 18 15 sts 0x1518, r19 ; 0x801518 2fcb6: 20 93 17 15 sts 0x1517, r18 ; 0x801517 if (!fileName) 2fcba: dc 01 movw r26, r24 2fcbc: ed 91 ld r30, X+ 2fcbe: fc 91 ld r31, X 2fcc0: 30 97 sbiw r30, 0x00 ; 0 2fcc2: a1 f4 brne .+40 ; 0x2fcec } else //relative path { curDir = &workDir; } return 1; 2fcc4: 81 e0 ldi r24, 0x01 ; 1 } 2fcc6: 2d 96 adiw r28, 0x0d ; 13 2fcc8: 0f b6 in r0, 0x3f ; 63 2fcca: f8 94 cli 2fccc: de bf out 0x3e, r29 ; 62 2fcce: 0f be out 0x3f, r0 ; 63 2fcd0: cd bf out 0x3d, r28 ; 61 2fcd2: df 91 pop r29 2fcd4: cf 91 pop r28 2fcd6: 1f 91 pop r17 2fcd8: 0f 91 pop r16 2fcda: ff 90 pop r15 2fcdc: ef 90 pop r14 2fcde: df 90 pop r13 2fce0: cf 90 pop r12 2fce2: bf 90 pop r11 2fce4: af 90 pop r10 2fce6: 9f 90 pop r9 2fce8: 8f 90 pop r8 2fcea: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 2fcec: 20 81 ld r18, Z 2fcee: 2f 32 cpi r18, 0x2F ; 47 2fcf0: 09 f0 breq .+2 ; 0x2fcf4 2fcf2: 47 c0 rjmp .+142 ; 0x2fd82 2fcf4: 6c 01 movw r12, r24 { cdroot(false); 2fcf6: 80 e0 ldi r24, 0x00 ; 0 2fcf8: 0f 94 2b 7e call 0x2fc56 ; 0x2fc56 dirname_start = fileName + 1; 2fcfc: f6 01 movw r30, r12 2fcfe: 00 81 ld r16, Z 2fd00: 11 81 ldd r17, Z+1 ; 0x01 2fd02: 0f 5f subi r16, 0xFF ; 255 2fd04: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 2fd06: 99 e1 ldi r25, 0x19 ; 25 2fd08: 89 2e mov r8, r25 2fd0a: 95 e1 ldi r25, 0x15 ; 21 2fd0c: 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) 2fd0e: d8 01 movw r26, r16 2fd10: 8c 91 ld r24, X 2fd12: 88 23 and r24, r24 2fd14: b9 f2 breq .-82 ; 0x2fcc4 { dirname_end = strchr(dirname_start, '/'); 2fd16: 6f e2 ldi r22, 0x2F ; 47 2fd18: 70 e0 ldi r23, 0x00 ; 0 2fd1a: c8 01 movw r24, r16 2fd1c: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 2fd20: 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) 2fd22: 00 97 sbiw r24, 0x00 ; 0 2fd24: 51 f1 breq .+84 ; 0x2fd7a 2fd26: 08 17 cp r16, r24 2fd28: 19 07 cpc r17, r25 2fd2a: 38 f5 brcc .+78 ; 0x2fd7a { 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); 2fd2c: 7c 01 movw r14, r24 2fd2e: e0 1a sub r14, r16 2fd30: f1 0a sbc r15, r17 2fd32: bd e0 ldi r27, 0x0D ; 13 2fd34: eb 16 cp r14, r27 2fd36: f1 04 cpc r15, r1 2fd38: 18 f0 brcs .+6 ; 0x2fd40 2fd3a: 8c e0 ldi r24, 0x0C ; 12 2fd3c: e8 2e mov r14, r24 2fd3e: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 2fd40: a7 01 movw r20, r14 2fd42: b8 01 movw r22, r16 2fd44: ce 01 movw r24, r28 2fd46: 01 96 adiw r24, 0x01 ; 1 2fd48: 0f 94 db e3 call 0x3c7b6 ; 0x3c7b6 subdirname[len] = 0; 2fd4c: e1 e0 ldi r30, 0x01 ; 1 2fd4e: f0 e0 ldi r31, 0x00 ; 0 2fd50: ec 0f add r30, r28 2fd52: fd 1f adc r31, r29 2fd54: ee 0d add r30, r14 2fd56: ff 1d adc r31, r15 2fd58: 10 82 st Z, r1 if (!chdir(subdirname, false)) 2fd5a: 60 e0 ldi r22, 0x00 ; 0 2fd5c: ce 01 movw r24, r28 2fd5e: 01 96 adiw r24, 0x01 ; 1 2fd60: 0f 94 91 7d call 0x2fb22 ; 0x2fb22 2fd64: 88 23 and r24, r24 2fd66: 09 f4 brne .+2 ; 0x2fd6a 2fd68: ae cf rjmp .-164 ; 0x2fcc6 return 0; curDir = &workDir; 2fd6a: 90 92 18 15 sts 0x1518, r9 ; 0x801518 2fd6e: 80 92 17 15 sts 0x1517, r8 ; 0x801517 dirname_start = dirname_end + 1; 2fd72: 85 01 movw r16, r10 2fd74: 0f 5f subi r16, 0xFF ; 255 2fd76: 1f 4f sbci r17, 0xFF ; 255 2fd78: ca cf rjmp .-108 ; 0x2fd0e } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 2fd7a: f6 01 movw r30, r12 2fd7c: 11 83 std Z+1, r17 ; 0x01 2fd7e: 00 83 st Z, r16 2fd80: a1 cf rjmp .-190 ; 0x2fcc4 } } else //relative path { curDir = &workDir; 2fd82: 89 e1 ldi r24, 0x19 ; 25 2fd84: 95 e1 ldi r25, 0x15 ; 21 2fd86: 90 93 18 15 sts 0x1518, r25 ; 0x801518 2fd8a: 80 93 17 15 sts 0x1517, r24 ; 0x801517 2fd8e: 9a cf rjmp .-204 ; 0x2fcc4 0002fd90 : 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*/){ 2fd90: bf 92 push r11 2fd92: cf 92 push r12 2fd94: df 92 push r13 2fd96: ef 92 push r14 2fd98: ff 92 push r15 2fd9a: 0f 93 push r16 2fd9c: 1f 93 push r17 2fd9e: cf 93 push r28 2fda0: df 93 push r29 2fda2: 1f 92 push r1 2fda4: 1f 92 push r1 2fda6: cd b7 in r28, 0x3d ; 61 2fda8: de b7 in r29, 0x3e ; 62 if(!mounted) 2fdaa: 20 91 6f 14 lds r18, 0x146F ; 0x80146f 2fdae: 22 23 and r18, r18 2fdb0: 09 f4 brne .+2 ; 0x2fdb4 2fdb2: ef c0 rjmp .+478 ; 0x2ff92 2fdb4: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2fdb6: 80 91 01 17 lds r24, 0x1701 ; 0x801701 2fdba: 88 23 and r24, r24 2fdbc: 09 f4 brne .+2 ; 0x2fdc0 2fdbe: 04 c1 rjmp .+520 ; 0x2ffc8 if(!replace_current){ 2fdc0: 61 11 cpse r22, r1 2fdc2: f6 c0 rjmp .+492 ; 0x2ffb0 if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 2fdc4: d0 90 21 17 lds r13, 0x1721 ; 0x801721 2fdc8: dd 20 and r13, r13 2fdca: 21 f0 breq .+8 ; 0x2fdd4 // 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); 2fdcc: 80 e1 ldi r24, 0x10 ; 16 2fdce: 9a ea ldi r25, 0xAA ; 170 2fdd0: 0e 94 15 7c call 0xf82a ; 0xf82a return; } SERIAL_ECHO_START; 2fdd4: 82 ef ldi r24, 0xF2 ; 242 2fdd6: 9a ea ldi r25, 0xAA ; 170 2fdd8: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(ofSubroutineCallTgt); 2fddc: 87 ef ldi r24, 0xF7 ; 247 2fdde: 99 ea ldi r25, 0xA9 ; 169 2fde0: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2fde4: c7 01 movw r24, r14 2fde6: 0e 94 bf 89 call 0x1137e ; 0x1137e SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 2fdea: 8c ee ldi r24, 0xEC ; 236 2fdec: 99 ea ldi r25, 0xA9 ; 169 2fdee: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 2fdf2: 00 91 21 17 lds r16, 0x1721 ; 0x801721 2fdf6: 25 e5 ldi r18, 0x55 ; 85 2fdf8: 02 9f mul r16, r18 2fdfa: 80 01 movw r16, r0 2fdfc: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 2fdfe: 0a 5d subi r16, 0xDA ; 218 2fe00: 18 4e sbci r17, 0xE8 ; 232 2fe02: 8f e2 ldi r24, 0x2F ; 47 2fe04: f8 01 movw r30, r16 2fe06: 81 93 st Z+, r24 2fe08: 8f 01 movw r16, r30 2fe0a: cc 24 eor r12, r12 2fe0c: c3 94 inc r12 for(uint8_t i=0;i 2fe16: d8 16 cp r13, r24 2fe18: b0 f4 brcc .+44 ; 0x2fe46 { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 2fe1a: db 9c mul r13, r11 2fe1c: c0 01 movw r24, r0 2fe1e: 11 24 eor r1, r1 2fe20: b8 01 movw r22, r16 2fe22: 84 5c subi r24, 0xC4 ; 196 2fe24: 9a 4e sbci r25, 0xEA ; 234 2fe26: 0f 94 61 a4 call 0x348c2 ; 0x348c2 2fe2a: c8 01 movw r24, r16 2fe2c: 8c 01 movw r16, r24 2fe2e: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 2fe30: f8 01 movw r30, r16 2fe32: 20 81 ld r18, Z 2fe34: 22 23 and r18, r18 2fe36: 29 f0 breq .+10 ; 0x2fe42 2fe38: f4 e5 ldi r31, 0x54 ; 84 2fe3a: fc 15 cp r31, r12 2fe3c: 10 f0 brcs .+4 ; 0x2fe42 {t++;cnt++;} //crawl counter forward. 2fe3e: c3 94 inc r12 2fe40: f5 cf rjmp .-22 ; 0x2fe2c 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) 2fe46: 27 e4 ldi r18, 0x47 ; 71 2fe48: 2c 15 cp r18, r12 2fe4a: 08 f4 brcc .+2 ; 0x2fe4e 2fe4c: ae c0 rjmp .+348 ; 0x2ffaa file.getFilename(t); 2fe4e: b8 01 movw r22, r16 2fe50: 8e ef ldi r24, 0xFE ; 254 2fe52: 96 e1 ldi r25, 0x16 ; 22 2fe54: 0f 94 61 a4 call 0x348c2 ; 0x348c2 SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 2fe58: 80 91 21 17 lds r24, 0x1721 ; 0x801721 2fe5c: f5 e5 ldi r31, 0x55 ; 85 2fe5e: 8f 9f mul r24, r31 2fe60: c0 01 movw r24, r0 2fe62: 11 24 eor r1, r1 2fe64: 8a 5d subi r24, 0xDA ; 218 2fe66: 98 4e sbci r25, 0xE8 ; 232 2fe68: 0e 94 bf 89 call 0x1137e ; 0x1137e SERIAL_ECHORPGM(ofPos); 2fe6c: 86 ee ldi r24, 0xE6 ; 230 2fe6e: 99 ea ldi r25, 0xA9 ; 169 2fe70: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2fe74: 60 91 82 17 lds r22, 0x1782 ; 0x801782 2fe78: 70 91 83 17 lds r23, 0x1783 ; 0x801783 2fe7c: 80 91 84 17 lds r24, 0x1784 ; 0x801784 2fe80: 90 91 85 17 lds r25, 0x1785 ; 0x801785 2fe84: 4a e0 ldi r20, 0x0A ; 10 2fe86: 0f 94 4a d2 call 0x3a494 ; 0x3a494 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2fe8a: 0f 94 5d d6 call 0x3acba ; 0x3acba SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 2fe8e: 80 91 21 17 lds r24, 0x1721 ; 0x801721 2fe92: 24 e0 ldi r18, 0x04 ; 4 2fe94: 82 9f mul r24, r18 2fe96: f0 01 movw r30, r0 2fe98: 11 24 eor r1, r1 2fe9a: ee 5d subi r30, 0xDE ; 222 2fe9c: f8 4e sbci r31, 0xE8 ; 232 2fe9e: 40 91 82 17 lds r20, 0x1782 ; 0x801782 2fea2: 50 91 83 17 lds r21, 0x1783 ; 0x801783 2fea6: 60 91 84 17 lds r22, 0x1784 ; 0x801784 2feaa: 70 91 85 17 lds r23, 0x1785 ; 0x801785 2feae: 40 83 st Z, r20 2feb0: 51 83 std Z+1, r21 ; 0x01 2feb2: 62 83 std Z+2, r22 ; 0x02 2feb4: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 2feb6: 8f 5f subi r24, 0xFF ; 255 2feb8: 80 93 21 17 sts 0x1721, r24 ; 0x801721 } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 2febc: 8e ef ldi r24, 0xFE ; 254 2febe: 96 e1 ldi r25, 0x16 ; 22 2fec0: 0f 94 3e a4 call 0x3487c ; 0x3487c 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; 2fec4: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e const char *fname=name; 2fec8: fa 82 std Y+2, r15 ; 0x02 2feca: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 2fecc: ce 01 movw r24, r28 2fece: 01 96 adiw r24, 0x01 ; 1 2fed0: 0f 94 43 7e call 0x2fc86 ; 0x2fc86 2fed4: 88 23 and r24, r24 2fed6: 09 f4 brne .+2 ; 0x2feda 2fed8: 5c c0 rjmp .+184 ; 0x2ff92 */ 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) ){ 2feda: 49 81 ldd r20, Y+1 ; 0x01 2fedc: 5a 81 ldd r21, Y+2 ; 0x02 2fede: 60 91 17 15 lds r22, 0x1517 ; 0x801517 2fee2: 70 91 18 15 lds r23, 0x1518 ; 0x801518 2fee6: 21 e0 ldi r18, 0x01 ; 1 2fee8: 8e ef ldi r24, 0xFE ; 254 2feea: 96 e1 ldi r25, 0x16 ; 22 2feec: 0f 94 08 d7 call 0x3ae10 ; 0x3ae10 2fef0: 88 23 and r24, r24 2fef2: 09 f4 brne .+2 ; 0x2fef6 2fef4: 77 c0 rjmp .+238 ; 0x2ffe4 // compute the block to start with if( ! gfComputeNextFileBlock() ) 2fef6: 8e ef ldi r24, 0xFE ; 254 2fef8: 96 e1 ldi r25, 0x16 ; 22 2fefa: 0f 94 60 6c call 0x2d8c0 ; 0x2d8c0 2fefe: 88 23 and r24, r24 2ff00: 09 f4 brne .+2 ; 0x2ff04 2ff02: 70 c0 rjmp .+224 ; 0x2ffe4 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; 2ff04: 80 91 1f 17 lds r24, 0x171F ; 0x80171f 2ff08: 90 91 20 17 lds r25, 0x1720 ; 0x801720 2ff0c: 85 58 subi r24, 0x85 ; 133 2ff0e: 91 4f sbci r25, 0xF1 ; 241 2ff10: 90 93 1a 17 sts 0x171A, r25 ; 0x80171a 2ff14: 80 93 19 17 sts 0x1719, r24 ; 0x801719 return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 2ff18: 89 81 ldd r24, Y+1 ; 0x01 2ff1a: 9a 81 ldd r25, Y+2 ; 0x02 2ff1c: 0f 94 29 7a call 0x2f452 ; 0x2f452 filesize = file.fileSize(); 2ff20: 80 91 0f 17 lds r24, 0x170F ; 0x80170f 2ff24: 90 91 10 17 lds r25, 0x1710 ; 0x801710 2ff28: a0 91 11 17 lds r26, 0x1711 ; 0x801711 2ff2c: b0 91 12 17 lds r27, 0x1712 ; 0x801712 2ff30: 80 93 7b 17 sts 0x177B, r24 ; 0x80177b 2ff34: 90 93 7c 17 sts 0x177C, r25 ; 0x80177c 2ff38: a0 93 7d 17 sts 0x177D, r26 ; 0x80177d 2ff3c: b0 93 7e 17 sts 0x177E, r27 ; 0x80177e SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 2ff40: 86 eb ldi r24, 0xB6 ; 182 2ff42: 99 ea ldi r25, 0xA9 ; 169 2ff44: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 printAbsFilenameFast(); 2ff48: 0f 94 0c 7b call 0x2f618 ; 0x2f618 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 2ff4c: 8e ea ldi r24, 0xAE ; 174 2ff4e: 99 ea ldi r25, 0xA9 ; 169 2ff50: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2ff54: 60 91 7b 17 lds r22, 0x177B ; 0x80177b 2ff58: 70 91 7c 17 lds r23, 0x177C ; 0x80177c 2ff5c: 80 91 7d 17 lds r24, 0x177D ; 0x80177d 2ff60: 90 91 7e 17 lds r25, 0x177E ; 0x80177e 2ff64: 4a e0 ldi r20, 0x0A ; 10 2ff66: 0f 94 4a d2 call 0x3a494 ; 0x3a494 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2ff6a: 0f 94 5d d6 call 0x3acba ; 0x3acba SERIAL_PROTOCOLLN(filesize); sdpos = 0; 2ff6e: 10 92 82 17 sts 0x1782, r1 ; 0x801782 2ff72: 10 92 83 17 sts 0x1783, r1 ; 0x801783 2ff76: 10 92 84 17 sts 0x1784, r1 ; 0x801784 2ff7a: 10 92 85 17 sts 0x1785, r1 ; 0x801785 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2ff7e: 80 ea ldi r24, 0xA0 ; 160 2ff80: 99 ea ldi r25, 0xA9 ; 169 2ff82: 0e 94 86 7b call 0xf70c ; 0xf70c lcd_setstatuspgm(ofFileSelected); 2ff86: 80 ea ldi r24, 0xA0 ; 160 2ff88: 99 ea ldi r25, 0xA9 ; 169 2ff8a: 0f 94 0c 0b call 0x21618 ; 0x21618 scrollstuff = 0; 2ff8e: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 2ff92: 0f 90 pop r0 2ff94: 0f 90 pop r0 2ff96: df 91 pop r29 2ff98: cf 91 pop r28 2ff9a: 1f 91 pop r17 2ff9c: 0f 91 pop r16 2ff9e: ff 90 pop r15 2ffa0: ef 90 pop r14 2ffa2: df 90 pop r13 2ffa4: cf 90 pop r12 2ffa6: bf 90 pop r11 2ffa8: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 2ffaa: f8 01 movw r30, r16 2ffac: 10 82 st Z, r1 2ffae: 54 cf rjmp .-344 ; 0x2fe58 SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 2ffb0: 82 ef ldi r24, 0xF2 ; 242 2ffb2: 9a ea ldi r25, 0xAA ; 170 2ffb4: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(ofNowDoingFile); 2ffb8: 85 ed ldi r24, 0xD5 ; 213 2ffba: 99 ea ldi r25, 0xA9 ; 169 2ffbc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN(name); 2ffc0: c7 01 movw r24, r14 2ffc2: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 2ffc6: 7a cf rjmp .-268 ; 0x2febc } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 2ffc8: 10 92 21 17 sts 0x1721, r1 ; 0x801721 SERIAL_ECHO_START; 2ffcc: 82 ef ldi r24, 0xF2 ; 242 2ffce: 9a ea ldi r25, 0xAA ; 170 2ffd0: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(ofNowFreshFile); 2ffd4: 84 ec ldi r24, 0xC4 ; 196 2ffd6: 99 ea ldi r25, 0xA9 ; 169 2ffd8: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN(name); 2ffdc: c7 01 movw r24, r14 2ffde: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 2ffe2: 70 cf rjmp .-288 ; 0x2fec4 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2ffe4: 83 e6 ldi r24, 0x63 ; 99 2ffe6: 91 e7 ldi r25, 0x71 ; 113 2ffe8: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 2ffec: 89 81 ldd r24, Y+1 ; 0x01 2ffee: 9a 81 ldd r25, Y+2 ; 0x02 2fff0: 0e 94 bf 89 call 0x1137e ; 0x1137e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2fff4: 8e e2 ldi r24, 0x2E ; 46 2fff6: 0e 94 42 79 call 0xf284 ; 0xf284 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2fffa: 0f 94 5d d6 call 0x3acba ; 0x3acba 2fffe: c9 cf rjmp .-110 ; 0x2ff92 00030000 : void CardReader::printingHasFinished() { st_synchronize(); 30000: 0f 94 27 58 call 0x2b04e ; 0x2b04e file.close(); 30004: 8e ef ldi r24, 0xFE ; 254 30006: 96 e1 ldi r25, 0x16 ; 22 30008: 0f 94 3e a4 call 0x3487c ; 0x3487c if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 3000c: 80 91 21 17 lds r24, 0x1721 ; 0x801721 30010: 88 23 and r24, r24 30012: 69 f1 breq .+90 ; 0x3006e { file_subcall_ctr--; 30014: 81 50 subi r24, 0x01 ; 1 30016: 80 93 21 17 sts 0x1721, r24 ; 0x801721 openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 3001a: 25 e5 ldi r18, 0x55 ; 85 3001c: 82 9f mul r24, r18 3001e: c0 01 movw r24, r0 30020: 11 24 eor r1, r1 30022: 61 e0 ldi r22, 0x01 ; 1 30024: 8a 5d subi r24, 0xDA ; 218 30026: 98 4e sbci r25, 0xE8 ; 232 30028: 0f 94 c8 7e call 0x2fd90 ; 0x2fd90 setIndex(filespos[file_subcall_ctr]); 3002c: e0 91 21 17 lds r30, 0x1721 ; 0x801721 30030: 84 e0 ldi r24, 0x04 ; 4 30032: e8 9f mul r30, r24 30034: f0 01 movw r30, r0 30036: 11 24 eor r1, r1 30038: ee 5d subi r30, 0xDE ; 222 3003a: f8 4e sbci r31, 0xE8 ; 232 3003c: 60 81 ld r22, Z 3003e: 71 81 ldd r23, Z+1 ; 0x01 30040: 82 81 ldd r24, Z+2 ; 0x02 30042: 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);}; 30044: 60 93 82 17 sts 0x1782, r22 ; 0x801782 30048: 70 93 83 17 sts 0x1783, r23 ; 0x801783 3004c: 80 93 84 17 sts 0x1784, r24 ; 0x801784 30050: 90 93 85 17 sts 0x1785, r25 ; 0x801785 30054: 0f 94 87 76 call 0x2ed0e ; 0x2ed0e SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 30058: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 3005c: 88 23 and r24, r24 3005e: 71 f0 breq .+28 ; 0x3007c { sdprinting = true; 30060: 81 e0 ldi r24, 0x01 ; 1 30062: 80 93 6e 14 sts 0x146E, r24 ; 0x80146e 30066: 85 e0 ldi r24, 0x05 ; 5 30068: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.395> 3006c: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 3006e: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e 30072: 83 e0 ldi r24, 0x03 ; 3 30074: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 30078: 0c 94 13 84 jmp 0x10826 ; 0x10826 autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 3007c: 08 95 ret 0003007e : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 3007e: cf 92 push r12 30080: df 92 push r13 30082: ef 92 push r14 30084: ff 92 push r15 30086: 0f 93 push r16 30088: 1f 93 push r17 3008a: cf 93 push r28 3008c: df 93 push r29 3008e: 08 2f mov r16, r24 { mounted = false; 30090: 10 92 6f 14 sts 0x146F, r1 ; 0x80146f if(root.isOpen()) 30094: 80 91 f7 14 lds r24, 0x14F7 ; 0x8014f7 30098: 88 23 and r24, r24 3009a: 21 f0 breq .+8 ; 0x300a4 root.close(); 3009c: 84 ef ldi r24, 0xF4 ; 244 3009e: 94 e1 ldi r25, 0x14 ; 20 300a0: 0f 94 3e a4 call 0x3487c ; 0x3487c * \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; 300a4: 10 92 de 16 sts 0x16DE, r1 ; 0x8016de 300a8: 10 92 db 16 sts 0x16DB, r1 ; 0x8016db // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 300ac: 0f 94 86 3e call 0x27d0c ; 0x27d0c 300b0: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 300b2: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 SET_OUTPUT(SDSS); 300b6: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 300ba: 80 64 ori r24, 0x40 ; 64 300bc: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(MISO); 300c0: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 300c2: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 300c4: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 300c6: 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); 300c8: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 300ca: 85 e0 ldi r24, 0x05 ; 5 300cc: 80 93 dc 16 sts 0x16DC, r24 ; 0x8016dc * 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); 300d0: 82 e5 ldi r24, 0x52 ; 82 300d2: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 300d4: 1d bc out 0x2d, r1 ; 45 300d6: 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); 300d8: 8f ef ldi r24, 0xFF ; 255 300da: 0f 94 96 a5 call 0x34b2c ; 0x34b2c 300de: 11 50 subi r17, 0x01 ; 1 300e0: d9 f7 brne .-10 ; 0x300d8 WRITE(MISO, 1); // temporarily enable the MISO line pullup 300e2: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 300e4: 20 e0 ldi r18, 0x00 ; 0 300e6: 30 e0 ldi r19, 0x00 ; 0 300e8: a9 01 movw r20, r18 300ea: 60 e0 ldi r22, 0x00 ; 0 300ec: 8b ed ldi r24, 0xDB ; 219 300ee: 96 e1 ldi r25, 0x16 ; 22 300f0: 0f 94 a2 a5 call 0x34b44 ; 0x34b44 300f4: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 300f8: 81 30 cpi r24, 0x01 ; 1 300fa: 61 f0 breq .+24 ; 0x30114 if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 300fc: 0f 94 86 3e call 0x27d0c ; 0x27d0c 30100: 6c 1b sub r22, r28 30102: 7d 0b sbc r23, r29 30104: 61 3d cpi r22, 0xD1 ; 209 30106: 77 40 sbci r23, 0x07 ; 7 30108: 68 f3 brcs .-38 ; 0x300e4 WRITE(MISO, 0); // disable the MISO line pullup 3010a: 2b 98 cbi 0x05, 3 ; 5 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 3010c: 81 e0 ldi r24, 0x01 ; 1 3010e: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db 30112: 22 c0 rjmp .+68 ; 0x30158 error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 30114: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 30116: 0f 94 86 3e call 0x27d0c ; 0x27d0c 3011a: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 3011c: 83 e9 ldi r24, 0x93 ; 147 3011e: 99 ea ldi r25, 0xA9 ; 169 30120: 0e 94 86 7b call 0xf70c ; 0xf70c spiSend(0XFF); 30124: 8f ef ldi r24, 0xFF ; 255 30126: 0f 94 96 a5 call 0x34b2c ; 0x34b2c while ((status_ = spiRec()) != 0xFF) 3012a: 0f 94 9b a5 call 0x34b36 ; 0x34b36 3012e: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 30132: 8f 3f cpi r24, 0xFF ; 255 30134: 59 f1 breq .+86 ; 0x3018c { spiSend(0XFF); 30136: 8f ef ldi r24, 0xFF ; 255 30138: 0f 94 96 a5 call 0x34b2c ; 0x34b2c if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 3013c: 0f 94 86 3e call 0x27d0c ; 0x27d0c 30140: 6c 1b sub r22, r28 30142: 7d 0b sbc r23, r29 30144: 62 32 cpi r22, 0x22 ; 34 30146: 71 05 cpc r23, r1 30148: 80 f3 brcs .-32 ; 0x3012a 3014a: 82 e0 ldi r24, 0x02 ; 2 3014c: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 30150: 82 e8 ldi r24, 0x82 ; 130 30152: 99 ea ldi r25, 0xA9 ; 169 30154: 0e 94 86 7b call 0xf70c ; 0xf70c #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 30158: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 3015c: 82 ef ldi r24, 0xF2 ; 242 3015e: 9a ea ldi r25, 0xAA ; 170 30160: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 30164: 86 e5 ldi r24, 0x56 ; 86 30166: 91 e7 ldi r25, 0x71 ; 113 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 30168: 0e 94 86 7b call 0xf70c ; 0xf70c } if (mounted) 3016c: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 30170: 88 23 and r24, r24 30172: 09 f4 brne .+2 ; 0x30176 30174: 9a c0 rjmp .+308 ; 0x302aa { cdroot(doPresort); 30176: 80 2f mov r24, r16 } } 30178: df 91 pop r29 3017a: cf 91 pop r28 3017c: 1f 91 pop r17 3017e: 0f 91 pop r16 30180: ff 90 pop r15 30182: ef 90 pop r14 30184: df 90 pop r13 30186: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 30188: 0d 94 2b 7e jmp 0x2fc56 ; 0x2fc56 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 3018c: 2a ea ldi r18, 0xAA ; 170 3018e: 31 e0 ldi r19, 0x01 ; 1 30190: 40 e0 ldi r20, 0x00 ; 0 30192: 50 e0 ldi r21, 0x00 ; 0 30194: 68 e0 ldi r22, 0x08 ; 8 30196: 8b ed ldi r24, 0xDB ; 219 30198: 96 e1 ldi r25, 0x16 ; 22 3019a: 0f 94 a2 a5 call 0x34b44 ; 0x34b44 3019e: 82 ff sbrs r24, 2 301a0: 2b c0 rjmp .+86 ; 0x301f8 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;} 301a2: 81 e0 ldi r24, 0x01 ; 1 301a4: 80 93 de 16 sts 0x16DE, r24 ; 0x8016de goto fail; } type(SD_CARD_TYPE_SD2); } // initialize card and send host supports SDHC if SD2 arg = type() == SD_CARD_TYPE_SD2 ? 0X40000000 : 0; 301a8: 80 91 de 16 lds r24, 0x16DE ; 0x8016de 301ac: c1 2c mov r12, r1 301ae: d1 2c mov r13, r1 301b0: 76 01 movw r14, r12 301b2: 82 30 cpi r24, 0x02 ; 2 301b4: 29 f4 brne .+10 ; 0x301c0 301b6: c1 2c mov r12, r1 301b8: d1 2c mov r13, r1 301ba: e1 2c mov r14, r1 301bc: 80 e4 ldi r24, 0x40 ; 64 301be: 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); 301c0: 20 e0 ldi r18, 0x00 ; 0 301c2: 30 e0 ldi r19, 0x00 ; 0 301c4: a9 01 movw r20, r18 301c6: 67 e3 ldi r22, 0x37 ; 55 301c8: 8b ed ldi r24, 0xDB ; 219 301ca: 96 e1 ldi r25, 0x16 ; 22 301cc: 0f 94 a2 a5 call 0x34b44 ; 0x34b44 return cardCommand(cmd, arg); 301d0: a7 01 movw r20, r14 301d2: 96 01 movw r18, r12 301d4: 69 e2 ldi r22, 0x29 ; 41 301d6: 8b ed ldi r24, 0xDB ; 219 301d8: 96 e1 ldi r25, 0x16 ; 22 301da: 0f 94 a2 a5 call 0x34b44 ; 0x34b44 while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 301de: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 301e2: 88 23 and r24, r24 301e4: b1 f0 breq .+44 ; 0x30212 // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 301e6: 0f 94 86 3e call 0x27d0c ; 0x27d0c 301ea: 6c 1b sub r22, r28 301ec: 7d 0b sbc r23, r29 301ee: 61 3d cpi r22, 0xD1 ; 209 301f0: 77 40 sbci r23, 0x07 ; 7 301f2: 30 f3 brcs .-52 ; 0x301c0 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 301f4: 8a e0 ldi r24, 0x0A ; 10 301f6: 8b cf rjmp .-234 ; 0x3010e goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 301f8: 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(); 301fa: 0f 94 9b a5 call 0x34b36 ; 0x34b36 301fe: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 30202: 11 50 subi r17, 0x01 ; 1 30204: d1 f7 brne .-12 ; 0x301fa if (status_ != 0XAA) { 30206: 8a 3a cpi r24, 0xAA ; 170 30208: 11 f0 breq .+4 ; 0x3020e 3020a: 82 e0 ldi r24, 0x02 ; 2 3020c: 80 cf rjmp .-256 ; 0x3010e 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;} 3020e: 82 e0 ldi r24, 0x02 ; 2 30210: c9 cf rjmp .-110 ; 0x301a4 error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 30212: 80 91 de 16 lds r24, 0x16DE ; 0x8016de 30216: 82 30 cpi r24, 0x02 ; 2 30218: d1 f4 brne .+52 ; 0x3024e if (cardCommand(CMD58, 0)) { 3021a: 20 e0 ldi r18, 0x00 ; 0 3021c: 30 e0 ldi r19, 0x00 ; 0 3021e: a9 01 movw r20, r18 30220: 6a e3 ldi r22, 0x3A ; 58 30222: 8b ed ldi r24, 0xDB ; 219 30224: 96 e1 ldi r25, 0x16 ; 22 30226: 0f 94 a2 a5 call 0x34b44 ; 0x34b44 3022a: 88 23 and r24, r24 3022c: 11 f0 breq .+4 ; 0x30232 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 3022e: 88 e0 ldi r24, 0x08 ; 8 30230: 6e cf rjmp .-292 ; 0x3010e error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 30232: 0f 94 9b a5 call 0x34b36 ; 0x34b36 30236: 80 7c andi r24, 0xC0 ; 192 30238: 80 3c cpi r24, 0xC0 ; 192 3023a: 19 f4 brne .+6 ; 0x30242 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;} 3023c: 83 e0 ldi r24, 0x03 ; 3 3023e: 80 93 de 16 sts 0x16DE, r24 ; 0x8016de // discard rest of ocr - contains allowed voltage range for (uint8_t i = 0; i < 3; i++) spiRec(); 30242: 0f 94 9b a5 call 0x34b36 ; 0x34b36 30246: 0f 94 9b a5 call 0x34b36 ; 0x34b36 3024a: 0f 94 9b a5 call 0x34b36 ; 0x34b36 } chipSelectHigh(); 3024e: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 30252: 10 92 dc 16 sts 0x16DC, r1 ; 0x8016dc * \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);} 30256: 81 e0 ldi r24, 0x01 ; 1 30258: 0f 94 a2 71 call 0x2e344 ; 0x2e344 3025c: 81 11 cpse r24, r1 3025e: 0c c0 rjmp .+24 ; 0x30278 30260: 80 e0 ldi r24, 0x00 ; 0 30262: 0f 94 a2 71 call 0x2e344 ; 0x2e344 #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 30266: 81 11 cpse r24, r1 30268: 07 c0 rjmp .+14 ; 0x30278 { SERIAL_ERROR_START; 3026a: 8a ec ldi r24, 0xCA ; 202 3026c: 9a ea ldi r25, 0xAA ; 170 3026e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 30272: 83 e4 ldi r24, 0x43 ; 67 30274: 91 e7 ldi r25, 0x71 ; 113 30276: 78 cf rjmp .-272 ; 0x30168 } else if (!root.openRoot(&volume)) 30278: 60 ee ldi r22, 0xE0 ; 224 3027a: 76 e1 ldi r23, 0x16 ; 22 3027c: 84 ef ldi r24, 0xF4 ; 244 3027e: 94 e1 ldi r25, 0x14 ; 20 30280: 0f 94 ee a3 call 0x347dc ; 0x347dc 30284: 81 11 cpse r24, r1 30286: 07 c0 rjmp .+14 ; 0x30296 { SERIAL_ERROR_START; 30288: 8a ec ldi r24, 0xCA ; 202 3028a: 9a ea ldi r25, 0xAA ; 170 3028c: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 30290: 83 e3 ldi r24, 0x33 ; 51 30292: 91 e7 ldi r25, 0x71 ; 113 30294: 69 cf rjmp .-302 ; 0x30168 } else { mounted = true; 30296: 81 e0 ldi r24, 0x01 ; 1 30298: 80 93 6f 14 sts 0x146F, r24 ; 0x80146f SERIAL_ECHO_START; 3029c: 82 ef ldi r24, 0xF2 ; 242 3029e: 9a ea ldi r25, 0xAA ; 170 302a0: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 302a4: 88 e2 ldi r24, 0x28 ; 40 302a6: 91 e7 ldi r25, 0x71 ; 113 302a8: 5f cf rjmp .-322 ; 0x30168 if (mounted) { cdroot(doPresort); } } 302aa: df 91 pop r29 302ac: cf 91 pop r28 302ae: 1f 91 pop r17 302b0: 0f 91 pop r16 302b2: ff 90 pop r15 302b4: ef 90 pop r14 302b6: df 90 pop r13 302b8: cf 90 pop r12 302ba: 08 95 ret 000302bc : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 302bc: 4f 92 push r4 302be: 5f 92 push r5 302c0: 6f 92 push r6 302c2: 7f 92 push r7 302c4: 8f 92 push r8 302c6: 9f 92 push r9 302c8: af 92 push r10 302ca: bf 92 push r11 302cc: cf 92 push r12 302ce: df 92 push r13 302d0: ef 92 push r14 302d2: ff 92 push r15 302d4: 4b 01 movw r8, r22 302d6: 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]; 302d8: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 302dc: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 302e0: 07 2e mov r0, r23 302e2: 00 0c add r0, r0 302e4: 88 0b sbc r24, r24 302e6: 99 0b sbc r25, r25 302e8: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> if (!degTargetHotend(extruder)) 302ec: 20 e0 ldi r18, 0x00 ; 0 302ee: 30 e0 ldi r19, 0x00 ; 0 302f0: a9 01 movw r20, r18 302f2: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 302f6: 88 23 and r24, r24 302f8: d1 f0 breq .+52 ; 0x3032e #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; 302fa: 10 92 66 0e sts 0x0E66, r1 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.402> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 302fe: cc 24 eor r12, r12 30300: ca 94 dec r12 30302: dc 2c mov r13, r12 30304: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 30306: 98 ee ldi r25, 0xE8 ; 232 30308: 49 2e mov r4, r25 3030a: 93 e0 ldi r25, 0x03 ; 3 3030c: 59 2e mov r5, r25 3030e: 61 2c mov r6, r1 30310: 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) || 30312: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.402> 30316: 81 11 cpse r24, r1 30318: 0a c0 rjmp .+20 ; 0x3032e 3031a: 2f ef ldi r18, 0xFF ; 255 3031c: c2 16 cp r12, r18 3031e: d2 06 cpc r13, r18 30320: e2 06 cpc r14, r18 30322: f2 06 cpc r15, r18 30324: 89 f4 brne .+34 ; 0x30348 (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) { 30326: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 3032a: 82 30 cpi r24, 0x02 ; 2 3032c: b9 f4 brne .+46 ; 0x3035c { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 3032e: ff 90 pop r15 30330: ef 90 pop r14 30332: df 90 pop r13 30334: cf 90 pop r12 30336: bf 90 pop r11 30338: af 90 pop r10 3033a: 9f 90 pop r9 3033c: 8f 90 pop r8 3033e: 7f 90 pop r7 30340: 6f 90 pop r6 30342: 5f 90 pop r5 30344: 4f 90 pop r4 30346: 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) || 30348: f7 fc sbrc r15, 7 3034a: f1 cf rjmp .-30 ; 0x3032e (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 3034c: 0f 94 86 3e call 0x27d0c ; 0x27d0c 30350: 6c 19 sub r22, r12 30352: 7d 09 sbc r23, r13 30354: 68 3b cpi r22, 0xB8 ; 184 30356: 7b 40 sbci r23, 0x0B ; 11 30358: 30 f3 brcs .-52 ; 0x30326 3035a: e9 cf rjmp .-46 ; 0x3032e 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) 3035c: 0f 94 86 3e call 0x27d0c ; 0x27d0c 30360: 68 19 sub r22, r8 30362: 79 09 sbc r23, r9 30364: 8a 09 sbc r24, r10 30366: 9b 09 sbc r25, r11 30368: 69 3e cpi r22, 0xE9 ; 233 3036a: 73 40 sbci r23, 0x03 ; 3 3036c: 81 05 cpc r24, r1 3036e: 91 05 cpc r25, r1 30370: f0 f1 brcs .+124 ; 0x303ee { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { SERIAL_PROTOCOLPGM("T:"); 30372: 8f e7 ldi r24, 0x7F ; 127 30374: 99 ea ldi r25, 0xA9 ; 169 30376: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 3037a: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 3037e: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 30382: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 30386: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 3038a: 41 e0 ldi r20, 0x01 ; 1 3038c: 0f 94 e7 d5 call 0x3abce ; 0x3abce SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 30390: 8b e7 ldi r24, 0x7B ; 123 30392: 99 ea ldi r25, 0xA9 ; 169 30394: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 30398: 60 e0 ldi r22, 0x00 ; 0 3039a: 70 e0 ldi r23, 0x00 ; 0 3039c: cb 01 movw r24, r22 3039e: 0f 94 af d2 call 0x3a55e ; 0x3a55e SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 303a2: 87 e7 ldi r24, 0x77 ; 119 303a4: 99 ea ldi r25, 0xA9 ; 169 303a6: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 if (residencyStart > -1) 303aa: f7 fc sbrc r15, 7 303ac: 52 c0 rjmp .+164 ; 0x30452 { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 303ae: 0f 94 86 3e call 0x27d0c ; 0x27d0c 303b2: 46 01 movw r8, r12 303b4: 57 01 movw r10, r14 303b6: 58 eb ldi r21, 0xB8 ; 184 303b8: 85 0e add r8, r21 303ba: 5b e0 ldi r21, 0x0B ; 11 303bc: 95 1e adc r9, r21 303be: a1 1c adc r10, r1 303c0: b1 1c adc r11, r1 303c2: a5 01 movw r20, r10 303c4: 94 01 movw r18, r8 303c6: 26 1b sub r18, r22 303c8: 37 0b sbc r19, r23 303ca: 48 0b sbc r20, r24 303cc: 59 0b sbc r21, r25 303ce: ca 01 movw r24, r20 303d0: b9 01 movw r22, r18 303d2: a3 01 movw r20, r6 303d4: 92 01 movw r18, r4 303d6: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 303da: ca 01 movw r24, r20 303dc: b9 01 movw r22, r18 303de: 0f 94 af d2 call 0x3a55e ; 0x3a55e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 303e2: 0f 94 5d d6 call 0x3acba ; 0x3acba } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 303e6: 0f 94 86 3e call 0x27d0c ; 0x27d0c 303ea: 4b 01 movw r8, r22 303ec: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 303ee: 90 e0 ldi r25, 0x00 ; 0 303f0: 80 e0 ldi r24, 0x00 ; 0 303f2: 0e 94 ff 8e call 0x11dfe ; 0x11dfe #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))) || 303f6: 3f ef ldi r19, 0xFF ; 255 303f8: c3 16 cp r12, r19 303fa: d3 06 cpc r13, r19 303fc: e3 06 cpc r14, r19 303fe: f3 06 cpc r15, r19 30400: 09 f0 breq .+2 ; 0x30404 30402: 46 c0 rjmp .+140 ; 0x30490 } 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))) || 30404: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 <_ZL16target_direction.lto_priv.551> 30408: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 3040c: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 30410: 88 23 and r24, r24 30412: 19 f1 breq .+70 ; 0x3045a 30414: 07 2e mov r0, r23 30416: 00 0c add r0, r0 30418: 88 0b sbc r24, r24 3041a: 99 0b sbc r25, r25 3041c: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 30420: 20 e0 ldi r18, 0x00 ; 0 30422: 30 e0 ldi r19, 0x00 ; 0 30424: 40 e8 ldi r20, 0x80 ; 128 30426: 5f e3 ldi r21, 0x3F ; 63 30428: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 3042c: 9b 01 movw r18, r22 3042e: ac 01 movw r20, r24 30430: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 30434: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 30438: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 3043c: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 30440: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 30444: 87 fd sbrc r24, 7 30446: 65 cf rjmp .-310 ; 0x30312 (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 30448: 0f 94 86 3e call 0x27d0c ; 0x27d0c 3044c: 6b 01 movw r12, r22 3044e: 7c 01 movw r14, r24 30450: 60 cf rjmp .-320 ; 0x30312 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 30452: 8f e3 ldi r24, 0x3F ; 63 30454: 0e 94 42 79 call 0xf284 ; 0xf284 30458: c4 cf rjmp .-120 ; 0x303e2 3045a: 07 2e mov r0, r23 3045c: 00 0c add r0, r0 3045e: 88 0b sbc r24, r24 30460: 99 0b sbc r25, r25 30462: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__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))) || 30466: 20 e0 ldi r18, 0x00 ; 0 30468: 30 e0 ldi r19, 0x00 ; 0 3046a: 40 e8 ldi r20, 0x80 ; 128 3046c: 5f e3 ldi r21, 0x3F ; 63 3046e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 30472: 9b 01 movw r18, r22 30474: ac 01 movw r20, r24 30476: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 3047a: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 3047e: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 30482: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 30486: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 3048a: 18 16 cp r1, r24 3048c: ec f6 brge .-70 ; 0x30448 3048e: 41 cf rjmp .-382 ; 0x30312 30490: f7 fc sbrc r15, 7 30492: 3f cf rjmp .-386 ; 0x30312 30494: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 30498: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 3049c: 07 2e mov r0, r23 3049e: 00 0c add r0, r0 304a0: 88 0b sbc r24, r24 304a2: 99 0b sbc r25, r25 304a4: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 304a8: 9b 01 movw r18, r22 304aa: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 304ac: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 304b0: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 304b4: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 304b8: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 304bc: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 304c0: 9f 77 andi r25, 0x7F ; 127 304c2: 20 e0 ldi r18, 0x00 ; 0 304c4: 30 e0 ldi r19, 0x00 ; 0 304c6: 40 ea ldi r20, 0xA0 ; 160 304c8: 50 e4 ldi r21, 0x40 ; 64 304ca: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 304ce: 18 16 cp r1, r24 304d0: 0c f0 brlt .+2 ; 0x304d4 304d2: 1f cf rjmp .-450 ; 0x30312 304d4: b9 cf rjmp .-142 ; 0x30448 000304d6 : // 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) { 304d6: 1f 93 push r17 304d8: cf 93 push r28 304da: df 93 push r29 304dc: ec 01 movw r28, r24 304de: 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()) { 304e0: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 304e4: 83 30 cpi r24, 0x03 ; 3 304e6: 09 f4 brne .+2 ; 0x304ea 304e8: 4e c0 rjmp .+156 ; 0x30586 304ea: 8c 31 cpi r24, 0x1C ; 28 304ec: 09 f4 brne .+2 ; 0x304f0 304ee: 52 c0 rjmp .+164 ; 0x30594 break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 304f0: 80 91 90 13 lds r24, 0x1390 ; 0x801390 304f4: 90 91 91 13 lds r25, 0x1391 ; 0x801391 304f8: 8c 17 cp r24, r28 304fa: 9d 07 cpc r25, r29 304fc: 79 f1 breq .+94 ; 0x3055c lastErrorCode = ec; 304fe: d0 93 91 13 sts 0x1391, r29 ; 0x801391 30502: c0 93 90 13 sts 0x1390, r28 ; 0x801390 lastErrorSource = res; 30506: 10 93 92 13 sts 0x1392, r17 ; 0x801392 LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 3050a: ce 01 movw r24, r28 3050c: 0f 94 30 c3 call 0x38660 ; 0x38660 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); 30510: e8 2f mov r30, r24 30512: f0 e0 ldi r31, 0x00 ; 0 30514: ee 0f add r30, r30 30516: ff 1f adc r31, r31 30518: e5 55 subi r30, 0x55 ; 85 3051a: f7 45 sbci r31, 0x57 ; 87 3051c: 85 91 lpm r24, Z+ 3051e: 94 91 lpm r25, Z 30520: 02 96 adiw r24, 0x02 ; 2 30522: 0f 94 1e c3 call 0x3863c ; 0x3863c if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 30526: c1 30 cpi r28, 0x01 ; 1 30528: d1 05 cpc r29, r1 3052a: c1 f0 breq .+48 ; 0x3055c 3052c: cc 30 cpi r28, 0x0C ; 12 3052e: 80 e8 ldi r24, 0x80 ; 128 30530: d8 07 cpc r29, r24 30532: a1 f0 breq .+40 ; 0x3055c 30534: c9 32 cpi r28, 0x29 ; 41 30536: 80 e8 ldi r24, 0x80 ; 128 30538: d8 07 cpc r29, r24 3053a: 81 f0 breq .+32 ; 0x3055c IncrementMMUFails(); 3053c: 0f 94 3a c2 call 0x38474 ; 0x38474 | (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 30540: ce 01 movw r24, r28 30542: 88 27 eor r24, r24 30544: 9e 77 andi r25, 0x7E ; 126 30546: 89 2b or r24, r25 30548: 49 f0 breq .+18 ; 0x3055c /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 3054a: 80 91 9e 13 lds r24, 0x139E ; 0x80139e 3054e: 90 91 9f 13 lds r25, 0x139F ; 0x80139f 30552: 01 96 adiw r24, 0x01 ; 1 30554: 90 93 9f 13 sts 0x139F, r25 ; 0x80139f 30558: 80 93 9e 13 sts 0x139E, r24 ; 0x80139e return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 3055c: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 30560: 88 23 and r24, r24 30562: d9 f0 breq .+54 ; 0x3059a return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 30564: 11 e0 ldi r17, 0x01 ; 1 30566: 10 93 5f 0e sts 0x0E5F, r17 ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 3056a: ce 01 movw r24, r28 3056c: 0f 94 bb c5 call 0x38b76 ; 0x38b76 30570: 8f 3f cpi r24, 0xFF ; 255 30572: 99 f0 breq .+38 ; 0x3059a void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 30574: 10 93 7e 13 sts 0x137E, r17 ; 0x80137e logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 30578: 88 e9 ldi r24, 0x98 ; 152 3057a: 98 ea ldi r25, 0xA8 ; 168 && mmu2Magic[2] == 'U' && mmu2Magic[3] == '2' && mmu2Magic[4] == ':' && strlen_constexpr(mmu2Magic) == 5, "MMU2 logging prefix mismatch, must be updated at various spots"); } 3057c: df 91 pop r29 3057e: cf 91 pop r28 30580: 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"); 30582: 0c 94 86 7b jmp 0xf70c ; 0xf70c // 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; 30586: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 3058a: 0f 94 d7 bb call 0x377ae ; 0x377ae // 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; 3058e: 10 92 5d 0e sts 0x0E5D, r1 ; 0x800e5d 30592: ae cf rjmp .-164 ; 0x304f0 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; 30594: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a 30598: f8 cf rjmp .-16 ; 0x3058a 3059a: 10 92 7e 13 sts 0x137E, r1 ; 0x80137e bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 3059e: 80 91 5e 0e lds r24, 0x0E5E ; 0x800e5e <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.513> 305a2: 81 11 cpse r24, r1 305a4: 06 c0 rjmp .+12 ; 0x305b2 305a6: 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"); } 305a8: df 91 pop r29 305aa: cf 91 pop r28 305ac: 1f 91 pop r17 305ae: 0d 94 81 c4 jmp 0x38902 ; 0x38902 305b2: df 91 pop r29 305b4: cf 91 pop r28 305b6: 1f 91 pop r17 305b8: 08 95 ret 000305ba : * \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) { 305ba: 2f 92 push r2 305bc: 3f 92 push r3 305be: 4f 92 push r4 305c0: 5f 92 push r5 305c2: 6f 92 push r6 305c4: 7f 92 push r7 305c6: 8f 92 push r8 305c8: 9f 92 push r9 305ca: af 92 push r10 305cc: bf 92 push r11 305ce: cf 92 push r12 305d0: df 92 push r13 305d2: ef 92 push r14 305d4: ff 92 push r15 305d6: 0f 93 push r16 305d8: 1f 93 push r17 305da: cf 93 push r28 305dc: df 93 push r29 305de: 00 d0 rcall .+0 ; 0x305e0 305e0: 1f 92 push r1 305e2: cd b7 in r28, 0x3d ; 61 305e4: de b7 in r29, 0x3e ; 62 305e6: 5c 01 movw r10, r24 305e8: 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; 305ea: 80 91 01 17 lds r24, 0x1701 ; 0x801701 305ee: 81 30 cpi r24, 0x01 ; 1 305f0: 09 f0 breq .+2 ; 0x305f4 305f2: de c0 rjmp .+444 ; 0x307b0 305f4: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 305f8: 81 ff sbrs r24, 1 305fa: da c0 rjmp .+436 ; 0x307b0 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 305fc: 82 fd sbrc r24, 2 305fe: bc c0 rjmp .+376 ; 0x30778 * \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) { 30600: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 30602: 21 2c mov r2, r1 30604: 32 e0 ldi r19, 0x02 ; 2 30606: 33 2e mov r3, r19 30608: 00 91 06 17 lds r16, 0x1706 ; 0x801706 3060c: 10 91 07 17 lds r17, 0x1707 ; 0x801707 30610: 20 91 08 17 lds r18, 0x1708 ; 0x801708 30614: 30 91 09 17 lds r19, 0x1709 ; 0x801709 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { if (!seekEnd()) goto fail; } while (nToWrite > 0) { 30618: e1 14 cp r14, r1 3061a: f1 04 cpc r15, r1 3061c: 09 f4 brne .+2 ; 0x30620 3061e: 30 c1 rjmp .+608 ; 0x30880 uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 30620: 80 91 17 17 lds r24, 0x1717 ; 0x801717 30624: 90 91 18 17 lds r25, 0x1718 ; 0x801718 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);} 30628: dc 01 movw r26, r24 3062a: 14 96 adiw r26, 0x04 ; 4 3062c: 7c 90 ld r7, X 3062e: 7a 94 dec r7 30630: b9 01 movw r22, r18 30632: a8 01 movw r20, r16 30634: 29 e0 ldi r18, 0x09 ; 9 30636: 76 95 lsr r23 30638: 67 95 ror r22 3063a: 57 95 ror r21 3063c: 47 95 ror r20 3063e: 2a 95 dec r18 30640: d1 f7 brne .-12 ; 0x30636 30642: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 30644: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 30646: 71 10 cpse r7, r1 30648: 25 c0 rjmp .+74 ; 0x30694 3064a: 01 15 cp r16, r1 3064c: 11 05 cpc r17, r1 3064e: 11 f5 brne .+68 ; 0x30694 30650: 40 91 02 17 lds r20, 0x1702 ; 0x801702 30654: 50 91 03 17 lds r21, 0x1703 ; 0x801703 30658: 60 91 04 17 lds r22, 0x1704 ; 0x801704 3065c: 70 91 05 17 lds r23, 0x1705 ; 0x801705 // start of new cluster if (curCluster_ == 0) { 30660: 41 15 cp r20, r1 30662: 51 05 cpc r21, r1 30664: 61 05 cpc r22, r1 30666: 71 05 cpc r23, r1 30668: 09 f0 breq .+2 ; 0x3066c 3066a: a8 c0 rjmp .+336 ; 0x307bc if (firstCluster_ == 0) { 3066c: 80 91 13 17 lds r24, 0x1713 ; 0x801713 30670: 90 91 14 17 lds r25, 0x1714 ; 0x801714 30674: a0 91 15 17 lds r26, 0x1715 ; 0x801715 30678: b0 91 16 17 lds r27, 0x1716 ; 0x801716 3067c: 00 97 sbiw r24, 0x00 ; 0 3067e: a1 05 cpc r26, r1 30680: b1 05 cpc r27, r1 30682: 09 f0 breq .+2 ; 0x30686 30684: b4 c0 rjmp .+360 ; 0x307ee } 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; 30686: 8e ef ldi r24, 0xFE ; 254 30688: 96 e1 ldi r25, 0x16 ; 22 3068a: 0f 94 9b a4 call 0x34936 ; 0x34936 3068e: 88 23 and r24, r24 30690: 09 f4 brne .+2 ; 0x30694 30692: 8e c0 rjmp .+284 ; 0x307b0 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 30694: c1 01 movw r24, r2 30696: 80 1b sub r24, r16 30698: 91 0b sbc r25, r17 3069a: 67 01 movw r12, r14 3069c: 8e 15 cp r24, r14 3069e: 9f 05 cpc r25, r15 306a0: 08 f4 brcc .+2 ; 0x306a4 306a2: 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; 306a4: e0 91 17 17 lds r30, 0x1717 ; 0x801717 306a8: f0 91 18 17 lds r31, 0x1718 ; 0x801718 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 306ac: 80 91 02 17 lds r24, 0x1702 ; 0x801702 306b0: 90 91 03 17 lds r25, 0x1703 ; 0x801703 306b4: a0 91 04 17 lds r26, 0x1704 ; 0x801704 306b8: b0 91 05 17 lds r27, 0x1705 ; 0x801705 306bc: 02 97 sbiw r24, 0x02 ; 2 306be: a1 09 sbc r26, r1 306c0: b1 09 sbc r27, r1 306c2: 25 85 ldd r18, Z+13 ; 0x0d 306c4: 04 c0 rjmp .+8 ; 0x306ce 306c6: 88 0f add r24, r24 306c8: 99 1f adc r25, r25 306ca: aa 1f adc r26, r26 306cc: bb 1f adc r27, r27 306ce: 2a 95 dec r18 306d0: d2 f7 brpl .-12 ; 0x306c6 306d2: 46 85 ldd r20, Z+14 ; 0x0e 306d4: 57 85 ldd r21, Z+15 ; 0x0f 306d6: 60 89 ldd r22, Z+16 ; 0x10 306d8: 71 89 ldd r23, Z+17 ; 0x11 306da: 84 0f add r24, r20 306dc: 95 1f adc r25, r21 306de: a6 1f adc r26, r22 306e0: b7 1f adc r27, r23 306e2: 9c 01 movw r18, r24 306e4: ad 01 movw r20, r26 306e6: 27 0d add r18, r7 306e8: 31 1d adc r19, r1 306ea: 41 1d adc r20, r1 306ec: 51 1d adc r21, r1 306ee: 29 01 movw r4, r18 306f0: 3a 01 movw r6, r20 if (n == 512) { 306f2: c1 14 cp r12, r1 306f4: 32 e0 ldi r19, 0x02 ; 2 306f6: d3 06 cpc r13, r19 306f8: 09 f0 breq .+2 ; 0x306fc 306fa: 8a c0 rjmp .+276 ; 0x30810 // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 306fc: 80 91 6f 0e lds r24, 0x0E6F ; 0x800e6f 30700: 90 91 70 0e lds r25, 0x0E70 ; 0x800e70 30704: a0 91 71 0e lds r26, 0x0E71 ; 0x800e71 30708: b0 91 72 0e lds r27, 0x0E72 ; 0x800e72 3070c: 48 16 cp r4, r24 3070e: 59 06 cpc r5, r25 30710: 6a 06 cpc r6, r26 30712: 7b 06 cpc r7, r27 30714: 69 f4 brne .+26 ; 0x30730 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; 30716: 10 92 77 0e sts 0x0E77, r1 ; 0x800e77 cacheBlockNumber_ = blockNumber; 3071a: 8f ef ldi r24, 0xFF ; 255 3071c: 9f ef ldi r25, 0xFF ; 255 3071e: dc 01 movw r26, r24 30720: 80 93 6f 0e sts 0x0E6F, r24 ; 0x800e6f 30724: 90 93 70 0e sts 0x0E70, r25 ; 0x800e70 30728: a0 93 71 0e sts 0x0E71, r26 ; 0x800e71 3072c: b0 93 72 0e sts 0x0E72, r27 ; 0x800e72 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); 30730: 95 01 movw r18, r10 30732: b3 01 movw r22, r6 30734: a2 01 movw r20, r4 30736: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 3073a: 90 91 79 0e lds r25, 0x0E79 ; 0x800e79 3073e: 0f 94 02 a6 call 0x34c04 ; 0x34c04 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 30742: 88 23 and r24, r24 30744: a9 f1 breq .+106 ; 0x307b0 if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 30746: 80 91 06 17 lds r24, 0x1706 ; 0x801706 3074a: 90 91 07 17 lds r25, 0x1707 ; 0x801707 3074e: a0 91 08 17 lds r26, 0x1708 ; 0x801708 30752: b0 91 09 17 lds r27, 0x1709 ; 0x801709 30756: 8c 0d add r24, r12 30758: 9d 1d adc r25, r13 3075a: a1 1d adc r26, r1 3075c: b1 1d adc r27, r1 3075e: 80 93 06 17 sts 0x1706, r24 ; 0x801706 30762: 90 93 07 17 sts 0x1707, r25 ; 0x801707 30766: a0 93 08 17 sts 0x1708, r26 ; 0x801708 3076a: b0 93 09 17 sts 0x1709, r27 ; 0x801709 src += n; 3076e: ac 0c add r10, r12 30770: bd 1c adc r11, r13 nToWrite -= n; 30772: ec 18 sub r14, r12 30774: fd 08 sbc r15, r13 30776: 48 cf rjmp .-368 ; 0x30608 // 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_) { 30778: 40 91 0f 17 lds r20, 0x170F ; 0x80170f 3077c: 50 91 10 17 lds r21, 0x1710 ; 0x801710 30780: 60 91 11 17 lds r22, 0x1711 ; 0x801711 30784: 70 91 12 17 lds r23, 0x1712 ; 0x801712 30788: 80 91 06 17 lds r24, 0x1706 ; 0x801706 3078c: 90 91 07 17 lds r25, 0x1707 ; 0x801707 30790: a0 91 08 17 lds r26, 0x1708 ; 0x801708 30794: b0 91 09 17 lds r27, 0x1709 ; 0x801709 30798: 48 17 cp r20, r24 3079a: 59 07 cpc r21, r25 3079c: 6a 07 cpc r22, r26 3079e: 7b 07 cpc r23, r27 307a0: 09 f4 brne .+2 ; 0x307a4 307a2: 2e cf rjmp .-420 ; 0x30600 } /** 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);} 307a4: 8e ef ldi r24, 0xFE ; 254 307a6: 96 e1 ldi r25, 0x16 ; 22 307a8: 0f 94 76 6d call 0x2daec ; 0x2daec if (!seekEnd()) goto fail; 307ac: 81 11 cpse r24, r1 307ae: 28 cf rjmp .-432 ; 0x30600 } return nbyte; fail: // return for write error writeError = true; 307b0: 81 e0 ldi r24, 0x01 ; 1 307b2: 80 93 fe 16 sts 0x16FE, r24 ; 0x8016fe return -1; 307b6: 8f ef ldi r24, 0xFF ; 255 307b8: 9f ef ldi r25, 0xFF ; 255 307ba: 81 c0 rjmp .+258 ; 0x308be } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 307bc: 9e 01 movw r18, r28 307be: 2f 5f subi r18, 0xFF ; 255 307c0: 3f 4f sbci r19, 0xFF ; 255 307c2: 0f 94 73 6b call 0x2d6e6 ; 0x2d6e6 307c6: 88 23 and r24, r24 307c8: 99 f3 breq .-26 ; 0x307b0 if (vol_->isEOC(next)) { 307ca: 89 81 ldd r24, Y+1 ; 0x01 307cc: 9a 81 ldd r25, Y+2 ; 0x02 307ce: ab 81 ldd r26, Y+3 ; 0x03 307d0: 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; 307d2: e0 91 17 17 lds r30, 0x1717 ; 0x801717 307d6: f0 91 18 17 lds r31, 0x1718 ; 0x801718 307da: 27 89 ldd r18, Z+23 ; 0x17 307dc: 20 31 cpi r18, 0x10 ; 16 307de: 81 f4 brne .+32 ; 0x30800 307e0: 88 3f cpi r24, 0xF8 ; 248 307e2: ef ef ldi r30, 0xFF ; 255 307e4: 9e 07 cpc r25, r30 307e6: a1 05 cpc r26, r1 307e8: b1 05 cpc r27, r1 307ea: 08 f0 brcs .+2 ; 0x307ee 307ec: 4c cf rjmp .-360 ; 0x30686 // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 307ee: 80 93 02 17 sts 0x1702, r24 ; 0x801702 307f2: 90 93 03 17 sts 0x1703, r25 ; 0x801703 307f6: a0 93 04 17 sts 0x1704, r26 ; 0x801704 307fa: b0 93 05 17 sts 0x1705, r27 ; 0x801705 307fe: 4a cf rjmp .-364 ; 0x30694 return cluster >= FAT32EOC_MIN; 30800: 88 3f cpi r24, 0xF8 ; 248 30802: ff ef ldi r31, 0xFF ; 255 30804: 9f 07 cpc r25, r31 30806: af 07 cpc r26, r31 30808: ff e0 ldi r31, 0x0F ; 15 3080a: bf 07 cpc r27, r31 3080c: 80 f3 brcs .-32 ; 0x307ee 3080e: 3b cf rjmp .-394 ; 0x30686 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 30810: 01 15 cp r16, r1 30812: 11 05 cpc r17, r1 30814: 69 f5 brne .+90 ; 0x30870 30816: 40 91 06 17 lds r20, 0x1706 ; 0x801706 3081a: 50 91 07 17 lds r21, 0x1707 ; 0x801707 3081e: 60 91 08 17 lds r22, 0x1708 ; 0x801708 30822: 70 91 09 17 lds r23, 0x1709 ; 0x801709 30826: 80 91 0f 17 lds r24, 0x170F ; 0x80170f 3082a: 90 91 10 17 lds r25, 0x1710 ; 0x801710 3082e: a0 91 11 17 lds r26, 0x1711 ; 0x801711 30832: b0 91 12 17 lds r27, 0x1712 ; 0x801712 30836: 48 17 cp r20, r24 30838: 59 07 cpc r21, r25 3083a: 6a 07 cpc r22, r26 3083c: 7b 07 cpc r23, r27 3083e: c0 f0 brcs .+48 ; 0x30870 // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 30840: 0f 94 65 6a call 0x2d4ca ; 0x2d4ca 30844: 88 23 and r24, r24 30846: 09 f4 brne .+2 ; 0x3084a 30848: b3 cf rjmp .-154 ; 0x307b0 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; 3084a: 81 e0 ldi r24, 0x01 ; 1 3084c: 80 93 77 0e sts 0x0E77, r24 ; 0x800e77 cacheBlockNumber_ = blockNumber; 30850: 40 92 6f 0e sts 0x0E6F, r4 ; 0x800e6f 30854: 50 92 70 0e sts 0x0E70, r5 ; 0x800e70 30858: 60 92 71 0e sts 0x0E71, r6 ; 0x800e71 3085c: 70 92 72 0e sts 0x0E72, r7 ; 0x800e72 } 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); 30860: a6 01 movw r20, r12 30862: b5 01 movw r22, r10 30864: c8 01 movw r24, r16 30866: 85 58 subi r24, 0x85 ; 133 30868: 91 4f sbci r25, 0xF1 ; 241 3086a: 0f 94 84 e3 call 0x3c708 ; 0x3c708 3086e: 6b cf rjmp .-298 ; 0x30746 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; 30870: 41 e0 ldi r20, 0x01 ; 1 30872: c3 01 movw r24, r6 30874: b2 01 movw r22, r4 30876: 0f 94 a4 6a call 0x2d548 ; 0x2d548 3087a: 81 11 cpse r24, r1 3087c: f1 cf rjmp .-30 ; 0x30860 3087e: 98 cf rjmp .-208 ; 0x307b0 } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 30880: 80 91 0f 17 lds r24, 0x170F ; 0x80170f 30884: 90 91 10 17 lds r25, 0x1710 ; 0x801710 30888: a0 91 11 17 lds r26, 0x1711 ; 0x801711 3088c: b0 91 12 17 lds r27, 0x1712 ; 0x801712 30890: 80 17 cp r24, r16 30892: 91 07 cpc r25, r17 30894: a2 07 cpc r26, r18 30896: b3 07 cpc r27, r19 30898: 68 f4 brcc .+26 ; 0x308b4 3089a: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 3089e: 00 93 0f 17 sts 0x170F, r16 ; 0x80170f 308a2: 10 93 10 17 sts 0x1710, r17 ; 0x801710 308a6: 20 93 11 17 sts 0x1711, r18 ; 0x801711 308aa: 30 93 12 17 sts 0x1712, r19 ; 0x801712 flags_ |= F_FILE_DIR_DIRTY; 308ae: 80 68 ori r24, 0x80 ; 128 308b0: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff } else if (dateTime_ && nbyte) { // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { 308b4: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 308b8: 83 fd sbrc r24, 3 308ba: 18 c0 rjmp .+48 ; 0x308ec if (!sync()) goto fail; } return nbyte; 308bc: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 308be: 0f 90 pop r0 308c0: 0f 90 pop r0 308c2: 0f 90 pop r0 308c4: 0f 90 pop r0 308c6: df 91 pop r29 308c8: cf 91 pop r28 308ca: 1f 91 pop r17 308cc: 0f 91 pop r16 308ce: ff 90 pop r15 308d0: ef 90 pop r14 308d2: df 90 pop r13 308d4: cf 90 pop r12 308d6: bf 90 pop r11 308d8: af 90 pop r10 308da: 9f 90 pop r9 308dc: 8f 90 pop r8 308de: 7f 90 pop r7 308e0: 6f 90 pop r6 308e2: 5f 90 pop r5 308e4: 4f 90 pop r4 308e6: 3f 90 pop r3 308e8: 2f 90 pop r2 308ea: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 308ec: 8e ef ldi r24, 0xFE ; 254 308ee: 96 e1 ldi r25, 0x16 ; 22 308f0: 0f 94 41 6d call 0x2da82 ; 0x2da82 308f4: 81 11 cpse r24, r1 308f6: e2 cf rjmp .-60 ; 0x308bc 308f8: 5b cf rjmp .-330 ; 0x307b0 000308fa : #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) { 308fa: 0f 93 push r16 308fc: cf 93 push r28 308fe: df 93 push r29 30900: cd b7 in r28, 0x3d ; 61 30902: de b7 in r29, 0x3e ; 62 30904: a3 97 sbiw r28, 0x23 ; 35 30906: 0f b6 in r0, 0x3f ; 63 30908: f8 94 cli 3090a: de bf out 0x3e, r29 ; 62 3090c: 0f be out 0x3f, r0 ; 63 3090e: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 30910: 20 91 0f 16 lds r18, 0x160F ; 0x80160f 30914: 30 91 10 16 lds r19, 0x1610 ; 0x801610 30918: 82 17 cp r24, r18 3091a: 93 07 cpc r25, r19 3091c: d8 f4 brcc .+54 ; 0x30954 getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 3091e: 61 30 cpi r22, 0x01 ; 1 30920: 31 f4 brne .+12 ; 0x3092e 30922: 21 50 subi r18, 0x01 ; 1 30924: 31 09 sbc r19, r1 30926: a9 01 movw r20, r18 30928: 48 1b sub r20, r24 3092a: 59 0b sbc r21, r25 3092c: ca 01 movw r24, r20 3092e: 88 0f add r24, r24 30930: 99 1f adc r25, r25 30932: fc 01 movw r30, r24 30934: ef 5e subi r30, 0xEF ; 239 30936: f9 4e sbci r31, 0xE9 ; 233 30938: 80 81 ld r24, Z 3093a: 91 81 ldd r25, Z+1 ; 0x01 3093c: 0f 94 70 7a call 0x2f4e0 ; 0x2f4e0 else getfilename_afterMaxSorting(nr); } 30940: a3 96 adiw r28, 0x23 ; 35 30942: 0f b6 in r0, 0x3f ; 63 30944: f8 94 cli 30946: de bf out 0x3e, r29 ; 62 30948: 0f be out 0x3f, r0 ; 63 3094a: cd bf out 0x3d, r28 ; 61 3094c: df 91 pop r29 3094e: cf 91 pop r28 30950: 0f 91 pop r16 30952: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 30954: 49 e1 ldi r20, 0x19 ; 25 30956: 55 e1 ldi r21, 0x15 ; 21 30958: 50 93 18 15 sts 0x1518, r21 ; 0x801518 3095c: 40 93 17 15 sts 0x1517, r20 ; 0x801517 nrFiles = entry - sort_count + 1; 30960: 82 1b sub r24, r18 30962: 93 0b sbc r25, r19 30964: 01 96 adiw r24, 0x01 ; 1 30966: 90 93 87 17 sts 0x1787, r25 ; 0x801787 3096a: 80 93 86 17 sts 0x1786, r24 ; 0x801786 curDir->seekSet(lastSortedFilePosition << 5); 3096e: 40 91 d9 16 lds r20, 0x16D9 ; 0x8016d9 30972: 50 91 da 16 lds r21, 0x16DA ; 0x8016da 30976: 85 e0 ldi r24, 0x05 ; 5 30978: 44 0f add r20, r20 3097a: 55 1f adc r21, r21 3097c: 8a 95 dec r24 3097e: e1 f7 brne .-8 ; 0x30978 30980: 70 e0 ldi r23, 0x00 ; 0 30982: 60 e0 ldi r22, 0x00 ; 0 30984: 89 e1 ldi r24, 0x19 ; 25 30986: 95 e1 ldi r25, 0x15 ; 21 30988: 0f 94 76 6d call 0x2daec ; 0x2daec }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 3098c: 00 e0 ldi r16, 0x00 ; 0 3098e: 0e 7f andi r16, 0xFE ; 254 30990: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 30992: e0 91 17 15 lds r30, 0x1517 ; 0x801517 30996: f0 91 18 15 lds r31, 0x1518 ; 0x801518 3099a: 83 e2 ldi r24, 0x23 ; 35 3099c: de 01 movw r26, r28 3099e: 11 96 adiw r26, 0x01 ; 1 309a0: 01 90 ld r0, Z+ 309a2: 0d 92 st X+, r0 309a4: 8a 95 dec r24 309a6: e1 f7 brne .-8 ; 0x309a0 309a8: 22 e0 ldi r18, 0x02 ; 2 309aa: 50 e0 ldi r21, 0x00 ; 0 309ac: 40 e0 ldi r20, 0x00 ; 0 309ae: be 01 movw r22, r28 309b0: 6f 5f subi r22, 0xFF ; 255 309b2: 7f 4f sbci r23, 0xFF ; 255 309b4: 84 ef ldi r24, 0xF4 ; 244 309b6: 92 e0 ldi r25, 0x02 ; 2 309b8: 0f 94 fa 77 call 0x2eff4 ; 0x2eff4 309bc: ce 01 movw r24, r28 309be: 01 96 adiw r24, 0x01 ; 1 309c0: 0e 94 3c 79 call 0xf278 ; 0xf278 309c4: bd cf rjmp .-134 ; 0x30940 000309c6 : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 309c6: 0f 93 push r16 309c8: 1f 93 push r17 309ca: cf 93 push r28 309cc: df 93 push r29 309ce: 1f 92 push r1 309d0: 1f 92 push r1 309d2: cd b7 in r28, 0x3d ; 61 309d4: de b7 in r29, 0x3e ; 62 { if(!mounted) 309d6: 20 91 6f 14 lds r18, 0x146F ; 0x80146f 309da: 22 23 and r18, r18 309dc: 69 f1 breq .+90 ; 0x30a38 309de: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 309e0: 80 91 01 17 lds r24, 0x1701 ; 0x801701 309e4: 88 23 and r24, r24 309e6: 79 f1 breq .+94 ; 0x30a46 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 309e8: 8f eb ldi r24, 0xBF ; 191 309ea: 97 ea ldi r25, 0xA7 ; 167 309ec: 0e 94 86 7b call 0xf70c ; 0xf70c 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; 309f0: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e const char *fname=name; 309f4: 1a 83 std Y+2, r17 ; 0x02 309f6: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 309f8: ce 01 movw r24, r28 309fa: 01 96 adiw r24, 0x01 ; 1 309fc: 0f 94 43 7e call 0x2fc86 ; 0x2fc86 30a00: 88 23 and r24, r24 30a02: d1 f0 breq .+52 ; 0x30a38 return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 30a04: 49 81 ldd r20, Y+1 ; 0x01 30a06: 5a 81 ldd r21, Y+2 ; 0x02 30a08: 60 91 17 15 lds r22, 0x1517 ; 0x801517 30a0c: 70 91 18 15 lds r23, 0x1518 ; 0x801518 30a10: 26 e5 ldi r18, 0x56 ; 86 30a12: 8e ef ldi r24, 0xFE ; 254 30a14: 96 e1 ldi r25, 0x16 ; 22 30a16: 0f 94 08 d7 call 0x3ae10 ; 0x3ae10 30a1a: 81 11 cpse r24, r1 30a1c: 22 c0 rjmp .+68 ; 0x30a62 SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30a1e: 83 e6 ldi r24, 0x63 ; 99 30a20: 91 e7 ldi r25, 0x71 ; 113 30a22: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 30a26: 89 81 ldd r24, Y+1 ; 0x01 30a28: 9a 81 ldd r25, Y+2 ; 0x02 30a2a: 0e 94 bf 89 call 0x1137e ; 0x1137e 30a2e: 8e e2 ldi r24, 0x2E ; 46 30a30: 0e 94 42 79 call 0xf284 ; 0xf284 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30a34: 0f 94 5d d6 call 0x3acba ; 0x3acba SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 30a38: 0f 90 pop r0 30a3a: 0f 90 pop r0 30a3c: df 91 pop r29 30a3e: cf 91 pop r28 30a40: 1f 91 pop r17 30a42: 0f 91 pop r16 30a44: 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 30a46: 10 92 21 17 sts 0x1721, r1 ; 0x801721 SERIAL_ECHO_START; 30a4a: 82 ef ldi r24, 0xF2 ; 242 30a4c: 9a ea ldi r25, 0xAA ; 170 30a4e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHORPGM(ofNowFreshFile); 30a52: 84 ec ldi r24, 0xC4 ; 196 30a54: 99 ea ldi r25, 0xA9 ; 169 30a56: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN(name); 30a5a: c8 01 movw r24, r16 30a5c: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 30a60: c7 cf rjmp .-114 ; 0x309f0 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; 30a62: 81 e0 ldi r24, 0x01 ; 1 30a64: 80 93 6c 14 sts 0x146C, r24 ; 0x80146c getfilename(0, fname); 30a68: 89 81 ldd r24, Y+1 ; 0x01 30a6a: 9a 81 ldd r25, Y+2 ; 0x02 30a6c: 0f 94 29 7a call 0x2f452 ; 0x2f452 SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 30a70: 8d ea ldi r24, 0xAD ; 173 30a72: 97 ea ldi r25, 0xA7 ; 167 30a74: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 printAbsFilenameFast(); 30a78: 0f 94 0c 7b call 0x2f618 ; 0x2f618 SERIAL_PROTOCOLLN(); 30a7c: 0f 94 5d d6 call 0x3acba ; 0x3acba SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 30a80: 80 ea ldi r24, 0xA0 ; 160 30a82: 99 ea ldi r25, 0xA9 ; 169 30a84: 0e 94 86 7b call 0xf70c ; 0xf70c lcd_setstatuspgm(ofFileSelected); 30a88: 80 ea ldi r24, 0xA0 ; 160 30a8a: 99 ea ldi r25, 0xA9 ; 169 30a8c: 0f 94 0c 0b call 0x21618 ; 0x21618 scrollstuff = 0; 30a90: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 30a94: d1 cf rjmp .-94 ; 0x30a38 00030a96 : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 30a96: 0f 93 push r16 30a98: 1f 93 push r17 30a9a: cf 93 push r28 30a9c: df 93 push r29 30a9e: ec 01 movw r28, r24 { memset(ip, 0, 4); 30aa0: 84 e0 ldi r24, 0x04 ; 4 30aa2: fe 01 movw r30, r28 30aa4: 11 92 st Z+, r1 30aa6: 8a 95 dec r24 30aa8: e9 f7 brne .-6 ; 0x30aa4 /** 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 30aaa: 23 e0 ldi r18, 0x03 ; 3 30aac: 30 ea ldi r19, 0xA0 ; 160 30aae: 4a e0 ldi r20, 0x0A ; 10 30ab0: 50 e9 ldi r21, 0x90 ; 144 30ab2: 60 e3 ldi r22, 0x30 ; 48 30ab4: 8b ed ldi r24, 0xDB ; 219 30ab6: 96 e1 ldi r25, 0x16 ; 22 30ab8: 0f 94 a2 a5 call 0x34b44 ; 0x34b44 30abc: 88 23 and r24, r24 30abe: 91 f0 breq .+36 ; 0x30ae4 30ac0: 23 e0 ldi r18, 0x03 ; 3 30ac2: 30 ea ldi r19, 0xA0 ; 160 30ac4: 4a e0 ldi r20, 0x0A ; 10 30ac6: 50 e9 ldi r21, 0x90 ; 144 30ac8: 61 e1 ldi r22, 0x11 ; 17 30aca: 8b ed ldi r24, 0xDB ; 219 30acc: 96 e1 ldi r25, 0x16 ; 22 30ace: 0f 94 a2 a5 call 0x34b44 ; 0x34b44 30ad2: 88 23 and r24, r24 30ad4: 39 f0 breq .+14 ; 0x30ae4 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30ad6: 80 e8 ldi r24, 0x80 ; 128 30ad8: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 30adc: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 return false; 30ae0: 80 e0 ldi r24, 0x00 ; 0 30ae2: 2f c0 rjmp .+94 ; 0x30b42 //------------------------------------------------------------------------------ /** 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(); 30ae4: 0f 94 86 3e call 0x27d0c ; 0x27d0c 30ae8: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 30aea: 0f 94 9b a5 call 0x34b36 ; 0x34b36 30aee: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 30af2: 8f 3f cpi r24, 0xFF ; 255 30af4: 69 f4 brne .+26 ; 0x30b10 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 30af6: 0f 94 86 3e call 0x27d0c ; 0x27d0c 30afa: 60 1b sub r22, r16 30afc: 71 0b sbc r23, r17 30afe: 6d 32 cpi r22, 0x2D ; 45 30b00: 71 40 sbci r23, 0x01 ; 1 30b02: 98 f3 brcs .-26 ; 0x30aea 30b04: 81 e1 ldi r24, 0x11 ; 17 30b06: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db goto fail; } return true; fail: chipSelectHigh(); 30b0a: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 30b0e: e6 cf rjmp .-52 ; 0x30adc if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 30b10: 8e 3f cpi r24, 0xFE ; 254 30b12: 11 f0 breq .+4 ; 0x30b18 30b14: 8f e0 ldi r24, 0x0F ; 15 30b16: f7 cf rjmp .-18 ; 0x30b06 30b18: 8e 01 movw r16, r28 30b1a: 0c 5f subi r16, 0xFC ; 252 30b1c: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 30b1e: 0f 94 9b a5 call 0x34b36 ; 0x34b36 30b22: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 30b24: c0 17 cp r28, r16 30b26: d1 07 cpc r29, r17 30b28: d1 f7 brne .-12 ; 0x30b1e 30b2a: ce ef ldi r28, 0xFE ; 254 30b2c: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 30b2e: 0f 94 9b a5 call 0x34b36 ; 0x34b36 30b32: 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) { 30b34: e1 f7 brne .-8 ; 0x30b2e spiRec(); } chipSelectHigh(); 30b36: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 spiSend(0xFF); // dummy clock to force FlashAir finish the command. 30b3a: 8f ef ldi r24, 0xFF ; 255 30b3c: 0f 94 96 a5 call 0x34b2c ; 0x34b2c 30b40: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 30b42: df 91 pop r29 30b44: cf 91 pop r28 30b46: 1f 91 pop r17 30b48: 0f 91 pop r16 30b4a: 08 95 ret 00030b4c : } 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) 30b4c: 8f 92 push r8 30b4e: 9f 92 push r9 30b50: af 92 push r10 30b52: bf 92 push r11 30b54: cf 92 push r12 30b56: df 92 push r13 30b58: ef 92 push r14 30b5a: ff 92 push r15 30b5c: 0f 93 push r16 30b5e: 1f 93 push r17 30b60: cf 93 push r28 30b62: df 93 push r29 30b64: 1f 92 push r1 30b66: cd b7 in r28, 0x3d ; 61 30b68: de b7 in r29, 0x3e ; 62 30b6a: 6b 01 movw r12, r22 30b6c: 7c 01 movw r14, r24 30b6e: 49 01 movw r8, r18 30b70: 5a 01 movw r10, r20 { #if defined(DEBUG_DCODE6) || defined(DEBUG_DCODES) || defined(XFLASH_DUMP) if(type == dcode_mem_t::xflash) 30b72: 03 30 cpi r16, 0x03 ; 3 30b74: 19 f4 brne .+6 ; 0x30b7c SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 30b76: 8c e5 ldi r24, 0x5C ; 92 30b78: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 30b7a: 1d bc out 0x2d, r1 ; 45 XFLASH_SPI_ENTER(); #endif while (count) 30b7c: 81 14 cp r8, r1 30b7e: 91 04 cpc r9, r1 30b80: a1 04 cpc r10, r1 30b82: b1 04 cpc r11, r1 30b84: 09 f4 brne .+2 ; 0x30b88 30b86: 59 c0 rjmp .+178 ; 0x30c3a #endif void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); 30b88: 8e 2d mov r24, r14 30b8a: 0e 94 bc 78 call 0xf178 ; 0xf178 #endif print_hex_byte((val >> 8) & 0xFF); 30b8e: 8d 2d mov r24, r13 30b90: 0e 94 bc 78 call 0xf178 ; 0xf178 print_hex_byte(val & 0xFF); 30b94: 8c 2d mov r24, r12 30b96: 0e 94 bc 78 call 0xf178 ; 0xf178 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 30b9a: 60 91 15 18 lds r22, 0x1815 ; 0x801815 <__iob+0x2> 30b9e: 70 91 16 18 lds r23, 0x1816 ; 0x801816 <__iob+0x3> 30ba2: 80 e2 ldi r24, 0x20 ; 32 30ba4: 90 e0 ldi r25, 0x00 ; 0 30ba6: 0f 94 c3 db call 0x3b786 ; 0x3b786 uint8_t count_line = countperline; 30baa: 10 e1 ldi r17, 0x10 ; 16 while (count && count_line) { uint8_t data = 0; 30bac: 19 82 std Y+1, r1 ; 0x01 switch (type) 30bae: 01 30 cpi r16, 0x01 ; 1 30bb0: b1 f1 breq .+108 ; 0x30c1e 30bb2: 88 f1 brcs .+98 ; 0x30c16 30bb4: 03 30 cpi r16, 0x03 ; 3 30bb6: b9 f1 breq .+110 ; 0x30c26 case dcode_mem_t::xflash: xflash_rd_data(address, &data, 1); break; #else case dcode_mem_t::xflash: break; #endif } ++address; 30bb8: 8f ef ldi r24, 0xFF ; 255 30bba: c8 1a sub r12, r24 30bbc: d8 0a sbc r13, r24 30bbe: e8 0a sbc r14, r24 30bc0: f8 0a sbc r15, r24 putchar(' '); 30bc2: 60 91 15 18 lds r22, 0x1815 ; 0x801815 <__iob+0x2> 30bc6: 70 91 16 18 lds r23, 0x1816 ; 0x801816 <__iob+0x3> 30bca: 80 e2 ldi r24, 0x20 ; 32 30bcc: 90 e0 ldi r25, 0x00 ; 0 30bce: 0f 94 c3 db call 0x3b786 ; 0x3b786 print_hex_byte(data); 30bd2: 89 81 ldd r24, Y+1 ; 0x01 30bd4: 0e 94 bc 78 call 0xf178 ; 0xf178 count_line--; 30bd8: 11 50 subi r17, 0x01 ; 1 count--; 30bda: 81 e0 ldi r24, 0x01 ; 1 30bdc: 88 1a sub r8, r24 30bde: 91 08 sbc r9, r1 30be0: a1 08 sbc r10, r1 30be2: 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)) 30be4: 0f b6 in r0, 0x3f ; 63 30be6: 07 fe sbrs r0, 7 30be8: 06 c0 rjmp .+12 ; 0x30bf6 30bea: c4 01 movw r24, r8 30bec: 9f 71 andi r25, 0x1F ; 31 30bee: 89 2b or r24, r25 30bf0: 11 f4 brne .+4 ; 0x30bf6 manage_heater(); 30bf2: 0f 94 9b 4d call 0x29b36 ; 0x29b36 while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 30bf6: 81 14 cp r8, r1 30bf8: 91 04 cpc r9, r1 30bfa: a1 04 cpc r10, r1 30bfc: b1 04 cpc r11, r1 30bfe: 11 f0 breq .+4 ; 0x30c04 30c00: 11 11 cpse r17, r1 30c02: d4 cf rjmp .-88 ; 0x30bac // 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'); 30c04: 60 91 15 18 lds r22, 0x1815 ; 0x801815 <__iob+0x2> 30c08: 70 91 16 18 lds r23, 0x1816 ; 0x801816 <__iob+0x3> 30c0c: 8a e0 ldi r24, 0x0A ; 10 30c0e: 90 e0 ldi r25, 0x00 ; 0 30c10: 0f 94 c3 db call 0x3b786 ; 0x3b786 30c14: b3 cf rjmp .-154 ; 0x30b7c while (count && count_line) { uint8_t data = 0; switch (type) { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 30c16: f6 01 movw r30, r12 30c18: 80 81 ld r24, Z case dcode_mem_t::eeprom: data = eeprom_read_byte((uint8_t*)address); break; 30c1a: 89 83 std Y+1, r24 ; 0x01 30c1c: cd cf rjmp .-102 ; 0x30bb8 30c1e: c6 01 movw r24, r12 30c20: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 30c24: fa cf rjmp .-12 ; 0x30c1a 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; 30c26: 21 e0 ldi r18, 0x01 ; 1 30c28: 30 e0 ldi r19, 0x00 ; 0 30c2a: ae 01 movw r20, r28 30c2c: 4f 5f subi r20, 0xFF ; 255 30c2e: 5f 4f sbci r21, 0xFF ; 255 30c30: c7 01 movw r24, r14 30c32: b6 01 movw r22, r12 30c34: 0e 94 89 e2 call 0x1c512 ; 0x1c512 30c38: bf cf rjmp .-130 ; 0x30bb8 if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 30c3a: 0f 90 pop r0 30c3c: df 91 pop r29 30c3e: cf 91 pop r28 30c40: 1f 91 pop r17 30c42: 0f 91 pop r16 30c44: ff 90 pop r15 30c46: ef 90 pop r14 30c48: df 90 pop r13 30c4a: cf 90 pop r12 30c4c: bf 90 pop r11 30c4e: af 90 pop r10 30c50: 9f 90 pop r9 30c52: 8f 90 pop r8 30c54: 08 95 ret 00030c56 : settings_init(); // also sets the state to State::initializing } void IR_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); SET_INPUT(IR_SENSOR_PIN); // input mode 30c56: e7 e0 ldi r30, 0x07 ; 7 30c58: f1 e0 ldi r31, 0x01 ; 1 30c5a: 80 81 ld r24, Z 30c5c: 8e 7f andi r24, 0xFE ; 254 30c5e: 80 83 st Z, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup 30c60: 9f b7 in r25, 0x3f ; 63 30c62: f8 94 cli 30c64: e8 e0 ldi r30, 0x08 ; 8 30c66: f1 e0 ldi r31, 0x01 ; 1 30c68: 80 81 ld r24, Z 30c6a: 8e 7f andi r24, 0xFE ; 254 30c6c: 80 83 st Z, r24 30c6e: 9f bf out 0x3f, r25 ; 63 state = State::disabled; 30c70: 10 92 88 17 sts 0x1788, r1 ; 0x801788 } 30c74: 08 95 ret 00030c76 : ; // } #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) void IR_sensor::init() { if (state == State::error) { 30c76: 80 91 88 17 lds r24, 0x1788 ; 0x801788 30c7a: 83 30 cpi r24, 0x03 ; 3 30c7c: 11 f4 brne .+4 ; 0x30c82 fsensor.deinit(); // deinit first if there was an error. 30c7e: 0f 94 2b 86 call 0x30c56 ; 0x30c56 } // puts_P(PSTR("fsensor::init()")); SET_INPUT(IR_SENSOR_PIN); // input mode 30c82: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 30c86: 8e 7f andi r24, 0xFE ; 254 30c88: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(IR_SENSOR_PIN, 1); // pullup 30c8c: 9f b7 in r25, 0x3f ; 63 30c8e: f8 94 cli 30c90: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 30c94: 81 60 ori r24, 0x01 ; 1 30c96: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 30c9a: 9f bf out 0x3f, r25 ; 63 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 30c9c: 88 e8 ldi r24, 0x88 ; 136 30c9e: 97 e1 ldi r25, 0x17 ; 23 30ca0: 0e 94 04 76 call 0xec08 ; 0xec08 30ca4: 88 e8 ldi r24, 0x88 ; 136 30ca6: 97 e1 ldi r25, 0x17 ; 23 30ca8: 0e 94 04 76 call 0xec08 ; 0xec08 #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) void IR_sensor_analog::init() { IR_sensor::init(); IR_sensor::settings_init(); sensorRevision = (SensorRevision)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_PCB); 30cac: 88 e4 ldi r24, 0x48 ; 72 30cae: 9d e0 ldi r25, 0x0D ; 13 30cb0: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 30cb4: 80 93 91 17 sts 0x1791, r24 ; 0x801791 } 30cb8: 08 95 ret 00030cba : //! //! @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) 30cba: cf 92 push r12 30cbc: df 92 push r13 30cbe: ef 92 push r14 30cc0: ff 92 push r15 30cc2: 69 01 movw r12, r18 30cc4: 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); 30cc6: 2d ec ldi r18, 0xCD ; 205 30cc8: 3c ec ldi r19, 0xCC ; 204 30cca: 4c e4 ldi r20, 0x4C ; 76 30ccc: 5e e3 ldi r21, 0x3E ; 62 30cce: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 30cd2: 2d ec ldi r18, 0xCD ; 205 30cd4: 3c ec ldi r19, 0xCC ; 204 30cd6: 4c e4 ldi r20, 0x4C ; 76 30cd8: 5e e3 ldi r21, 0x3E ; 62 30cda: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 30cde: 2d ef ldi r18, 0xFD ; 253 30ce0: 3d ea ldi r19, 0xAD ; 173 30ce2: 40 e0 ldi r20, 0x00 ; 0 30ce4: 5d e3 ldi r21, 0x3D ; 61 30ce6: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 30cea: a7 01 movw r20, r14 30cec: 96 01 movw r18, r12 30cee: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 30cf2: 24 e2 ldi r18, 0x24 ; 36 30cf4: 30 ef ldi r19, 0xF0 ; 240 30cf6: 49 e1 ldi r20, 0x19 ; 25 30cf8: 50 e4 ldi r21, 0x40 ; 64 30cfa: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> } 30cfe: ff 90 pop r15 30d00: ef 90 pop r14 30d02: df 90 pop r13 30d04: cf 90 pop r12 30d06: 08 95 ret 00030d08 : //! //! 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) 30d08: 2f 92 push r2 30d0a: 3f 92 push r3 30d0c: 4f 92 push r4 30d0e: 5f 92 push r5 30d10: 6f 92 push r6 30d12: 7f 92 push r7 30d14: 8f 92 push r8 30d16: 9f 92 push r9 30d18: af 92 push r10 30d1a: bf 92 push r11 30d1c: cf 92 push r12 30d1e: df 92 push r13 30d20: ef 92 push r14 30d22: ff 92 push r15 30d24: 0f 93 push r16 30d26: 1f 93 push r17 30d28: cf 93 push r28 30d2a: df 93 push r29 30d2c: 00 d0 rcall .+0 ; 0x30d2e 30d2e: 1f 92 push r1 30d30: 1f 92 push r1 30d32: cd b7 in r28, 0x3d ; 61 30d34: de b7 in r29, 0x3e ; 62 30d36: 8c 83 std Y+4, r24 ; 0x04 30d38: 4a 01 movw r8, r20 30d3a: 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); 30d3c: 23 e4 ldi r18, 0x43 ; 67 30d3e: 3d ec ldi r19, 0xCD ; 205 30d40: 4f e2 ldi r20, 0x2F ; 47 30d42: 5d e3 ldi r21, 0x3D ; 61 30d44: cb 01 movw r24, r22 30d46: b4 01 movw r22, r8 30d48: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 30d4c: 6b 01 movw r12, r22 30d4e: 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); 30d50: 20 e0 ldi r18, 0x00 ; 0 30d52: 30 e0 ldi r19, 0x00 ; 0 30d54: 40 ea ldi r20, 0xA0 ; 160 30d56: 51 e4 ldi r21, 0x41 ; 65 30d58: c5 01 movw r24, r10 30d5a: b4 01 movw r22, r8 30d5c: 0f 94 5d 86 call 0x30cba ; 0x30cba 30d60: 56 2e mov r5, r22 30d62: 47 2e mov r4, r23 30d64: 38 2e mov r3, r24 30d66: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 30d68: a7 01 movw r20, r14 30d6a: 96 01 movw r18, r12 30d6c: c5 01 movw r24, r10 30d6e: b4 01 movw r22, r8 30d70: 0f 94 5d 86 call 0x30cba ; 0x30cba 30d74: 69 83 std Y+1, r22 ; 0x01 30d76: 7a 83 std Y+2, r23 ; 0x02 30d78: 8b 83 std Y+3, r24 ; 0x03 30d7a: 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) 30d7c: bc 80 ldd r11, Y+4 ; 0x04 30d7e: 8b 2d mov r24, r11 30d80: 90 e0 ldi r25, 0x00 ; 0 30d82: 9c 01 movw r18, r24 30d84: 2d 5f subi r18, 0xFD ; 253 30d86: 3f 4f sbci r19, 0xFF ; 255 30d88: 3d 83 std Y+5, r19 ; 0x05 30d8a: 2c 83 std Y+4, r18 ; 0x04 30d8c: 0b 2d mov r16, r11 30d8e: 10 e0 ldi r17, 0x00 ; 0 30d90: 8c 81 ldd r24, Y+4 ; 0x04 30d92: 9d 81 ldd r25, Y+5 ; 0x05 30d94: 80 17 cp r24, r16 30d96: 91 07 cpc r25, r17 30d98: 0c f4 brge .+2 ; 0x30d9c 30d9a: a1 c0 rjmp .+322 ; 0x30ede { enquecommandf_P(fmt1, 70, (35 - i*short_length * 2), long_extrusion); 30d9c: 2f 92 push r2 30d9e: 3f 92 push r3 30da0: 4f 92 push r4 30da2: 5f 92 push r5 30da4: b8 01 movw r22, r16 30da6: 01 2e mov r0, r17 30da8: 00 0c add r0, r0 30daa: 88 0b sbc r24, r24 30dac: 99 0b sbc r25, r25 30dae: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 30db2: a7 01 movw r20, r14 30db4: 96 01 movw r18, r12 30db6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 30dba: 9b 01 movw r18, r22 30dbc: ac 01 movw r20, r24 30dbe: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 30dc2: 9b 01 movw r18, r22 30dc4: ac 01 movw r20, r24 30dc6: 60 e0 ldi r22, 0x00 ; 0 30dc8: 70 e0 ldi r23, 0x00 ; 0 30dca: 8c e0 ldi r24, 0x0C ; 12 30dcc: 92 e4 ldi r25, 0x42 ; 66 30dce: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 30dd2: 9f 93 push r25 30dd4: 8f 93 push r24 30dd6: 7f 93 push r23 30dd8: 6f 93 push r22 30dda: 1f 92 push r1 30ddc: 96 e4 ldi r25, 0x46 ; 70 30dde: 9f 93 push r25 30de0: 28 e9 ldi r18, 0x98 ; 152 30de2: 37 ea ldi r19, 0xA7 ; 167 30de4: 3f 93 push r19 30de6: 2f 93 push r18 30de8: 0e 94 61 8a call 0x114c2 ; 0x114c2 enquecommandf_P(fmt1, 70, (35 - (2 * i + 1)*short_length), short_extrusion); 30dec: b8 01 movw r22, r16 30dee: 66 0f add r22, r22 30df0: 77 1f adc r23, r23 30df2: 6f 5f subi r22, 0xFF ; 255 30df4: 7f 4f sbci r23, 0xFF ; 255 30df6: 07 2e mov r0, r23 30df8: 00 0c add r0, r0 30dfa: 88 0b sbc r24, r24 30dfc: 99 0b sbc r25, r25 30dfe: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 30e02: a7 01 movw r20, r14 30e04: 96 01 movw r18, r12 30e06: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 30e0a: 9b 01 movw r18, r22 30e0c: ac 01 movw r20, r24 30e0e: 60 e0 ldi r22, 0x00 ; 0 30e10: 70 e0 ldi r23, 0x00 ; 0 30e12: 8c e0 ldi r24, 0x0C ; 12 30e14: 92 e4 ldi r25, 0x42 ; 66 30e16: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 30e1a: 96 2e mov r9, r22 30e1c: 87 2e mov r8, r23 30e1e: 78 2e mov r7, r24 30e20: 69 2e mov r6, r25 30e22: af 92 push r10 30e24: 9b 81 ldd r25, Y+3 ; 0x03 30e26: 9f 93 push r25 30e28: 2a 81 ldd r18, Y+2 ; 0x02 30e2a: 2f 93 push r18 30e2c: 39 81 ldd r19, Y+1 ; 0x01 30e2e: 3f 93 push r19 30e30: 6f 92 push r6 30e32: 7f 92 push r7 30e34: 8f 92 push r8 30e36: 9f 92 push r9 30e38: 1f 92 push r1 30e3a: 86 e4 ldi r24, 0x46 ; 70 30e3c: 8f 93 push r24 30e3e: 28 e9 ldi r18, 0x98 ; 152 30e40: 37 ea ldi r19, 0xA7 ; 167 30e42: 3f 93 push r19 30e44: 2f 93 push r18 30e46: 0e 94 61 8a call 0x114c2 ; 0x114c2 enquecommandf_P(fmt1, 50, (35 - (2 * i + 1)*short_length), long_extrusion); 30e4a: 2f 92 push r2 30e4c: 3f 92 push r3 30e4e: 4f 92 push r4 30e50: 5f 92 push r5 30e52: 6f 92 push r6 30e54: 7f 92 push r7 30e56: 8f 92 push r8 30e58: 9f 92 push r9 30e5a: 1f 92 push r1 30e5c: 92 e3 ldi r25, 0x32 ; 50 30e5e: 9f 93 push r25 30e60: 28 e9 ldi r18, 0x98 ; 152 30e62: 37 ea ldi r19, 0xA7 ; 167 30e64: 3f 93 push r19 30e66: 2f 93 push r18 30e68: 0e 94 61 8a call 0x114c2 ; 0x114c2 enquecommandf_P(fmt1, 50, (35 - (i + 1)*short_length * 2), short_extrusion); 30e6c: 0f b6 in r0, 0x3f ; 63 30e6e: f8 94 cli 30e70: de bf out 0x3e, r29 ; 62 30e72: 0f be out 0x3f, r0 ; 63 30e74: cd bf out 0x3d, r28 ; 61 30e76: af 92 push r10 30e78: 3b 81 ldd r19, Y+3 ; 0x03 30e7a: 3f 93 push r19 30e7c: 8a 81 ldd r24, Y+2 ; 0x02 30e7e: 8f 93 push r24 30e80: 99 81 ldd r25, Y+1 ; 0x01 30e82: 9f 93 push r25 30e84: b8 01 movw r22, r16 30e86: 6f 5f subi r22, 0xFF ; 255 30e88: 7f 4f sbci r23, 0xFF ; 255 30e8a: 07 2e mov r0, r23 30e8c: 00 0c add r0, r0 30e8e: 88 0b sbc r24, r24 30e90: 99 0b sbc r25, r25 30e92: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 30e96: a7 01 movw r20, r14 30e98: 96 01 movw r18, r12 30e9a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 30e9e: 9b 01 movw r18, r22 30ea0: ac 01 movw r20, r24 30ea2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 30ea6: 9b 01 movw r18, r22 30ea8: ac 01 movw r20, r24 30eaa: 60 e0 ldi r22, 0x00 ; 0 30eac: 70 e0 ldi r23, 0x00 ; 0 30eae: 8c e0 ldi r24, 0x0C ; 12 30eb0: 92 e4 ldi r25, 0x42 ; 66 30eb2: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 30eb6: 9f 93 push r25 30eb8: 8f 93 push r24 30eba: 7f 93 push r23 30ebc: 6f 93 push r22 30ebe: 1f 92 push r1 30ec0: 22 e3 ldi r18, 0x32 ; 50 30ec2: 2f 93 push r18 30ec4: 88 e9 ldi r24, 0x98 ; 152 30ec6: 97 ea ldi r25, 0xA7 ; 167 30ec8: 9f 93 push r25 30eca: 8f 93 push r24 30ecc: 0e 94 61 8a call 0x114c2 ; 0x114c2 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) 30ed0: b3 94 inc r11 30ed2: 0f b6 in r0, 0x3f ; 63 30ed4: f8 94 cli 30ed6: de bf out 0x3e, r29 ; 62 30ed8: 0f be out 0x3f, r0 ; 63 30eda: cd bf out 0x3d, r28 ; 61 30edc: 57 cf rjmp .-338 ; 0x30d8c 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); } } 30ede: 0f 90 pop r0 30ee0: 0f 90 pop r0 30ee2: 0f 90 pop r0 30ee4: 0f 90 pop r0 30ee6: 0f 90 pop r0 30ee8: df 91 pop r29 30eea: cf 91 pop r28 30eec: 1f 91 pop r17 30eee: 0f 91 pop r16 30ef0: ff 90 pop r15 30ef2: ef 90 pop r14 30ef4: df 90 pop r13 30ef6: cf 90 pop r12 30ef8: bf 90 pop r11 30efa: af 90 pop r10 30efc: 9f 90 pop r9 30efe: 8f 90 pop r8 30f00: 7f 90 pop r7 30f02: 6f 90 pop r6 30f04: 5f 90 pop r5 30f06: 4f 90 pop r4 30f08: 3f 90 pop r3 30f0a: 2f 90 pop r2 30f0c: 08 95 ret 00030f0e : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 30f0e: 9f b7 in r25, 0x3f ; 63 30f10: 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)); 30f12: 80 e1 ldi r24, 0x10 ; 16 30f14: e4 e5 ldi r30, 0x54 ; 84 30f16: f7 e0 ldi r31, 0x07 ; 7 30f18: a4 e6 ldi r26, 0x64 ; 100 30f1a: b7 e0 ldi r27, 0x07 ; 7 30f1c: 01 90 ld r0, Z+ 30f1e: 0d 92 st X+, r0 30f20: 8a 95 dec r24 30f22: e1 f7 brne .-8 ; 0x30f1c CRITICAL_SECTION_END; 30f24: 9f bf out 0x3f, r25 ; 63 } 30f26: 08 95 ret 00030f28 : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 30f28: 89 e0 ldi r24, 0x09 ; 9 30f2a: 80 93 75 07 sts 0x0775, r24 ; 0x800775 }; 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])) 30f2e: e5 ed ldi r30, 0xD5 ; 213 30f30: f7 ea ldi r31, 0xA7 ; 167 30f32: 85 91 lpm r24, Z+ 30f34: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 30f36: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 30f3a: 0d 94 0c 0b jmp 0x21618 ; 0x21618 00030f3e : 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){ 30f3e: cf 93 push r28 30f40: c8 2f mov r28, r24 extruder = ex; 30f42: 80 93 7f 13 sts 0x137F, r24 ; 0x80137f MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 30f46: 82 ef ldi r24, 0xF2 ; 242 30f48: 9a ea ldi r25, 0xAA ; 170 30f4a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 30f4e: 82 e9 ldi r24, 0x92 ; 146 30f50: 97 ea ldi r25, 0xA7 ; 167 30f52: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 30f56: 88 e8 ldi r24, 0x88 ; 136 30f58: 97 ea ldi r25, 0xA7 ; 167 30f5a: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN((int)ex); 30f5e: 8c 2f mov r24, r28 30f60: 90 e0 ldi r25, 0x00 ; 0 } 30f62: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 30f64: 0d 94 e0 75 jmp 0x2ebc0 ; 0x2ebc0 00030f68 : tmc2130_sg_measure = 0xff; return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; } bool tmc2130_wait_standstill_xy(int timeout) 30f68: 0f 93 push r16 30f6a: 1f 93 push r17 30f6c: cf 93 push r28 30f6e: df 93 push r29 30f70: 00 d0 rcall .+0 ; 0x30f72 30f72: 00 d0 rcall .+0 ; 0x30f74 30f74: 1f 92 push r1 30f76: 1f 92 push r1 30f78: cd b7 in r28, 0x3d ; 61 30f7a: de b7 in r29, 0x3e ; 62 30f7c: 08 ee ldi r16, 0xE8 ; 232 30f7e: 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; 30f80: 1d 82 std Y+5, r1 ; 0x05 30f82: 1e 82 std Y+6, r1 ; 0x06 30f84: 1f 82 std Y+7, r1 ; 0x07 30f86: 18 86 std Y+8, r1 ; 0x08 uint32_t drv_status_y = 0; 30f88: 19 82 std Y+1, r1 ; 0x01 30f8a: 1a 82 std Y+2, r1 ; 0x02 30f8c: 1b 82 std Y+3, r1 ; 0x03 30f8e: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(X_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_x); 30f90: ae 01 movw r20, r28 30f92: 4b 5f subi r20, 0xFB ; 251 30f94: 5f 4f sbci r21, 0xFF ; 255 30f96: 6f e6 ldi r22, 0x6F ; 111 30f98: 80 e0 ldi r24, 0x00 ; 0 30f9a: 0f 94 a7 38 call 0x2714e ; 0x2714e tmc2130_rd(Y_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_y); 30f9e: ae 01 movw r20, r28 30fa0: 4f 5f subi r20, 0xFF ; 255 30fa2: 5f 4f sbci r21, 0xFF ; 255 30fa4: 6f e6 ldi r22, 0x6F ; 111 30fa6: 81 e0 ldi r24, 0x01 ; 1 30fa8: 0f 94 a7 38 call 0x2714e ; 0x2714e // 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); 30fac: 8d 81 ldd r24, Y+5 ; 0x05 30fae: 9e 81 ldd r25, Y+6 ; 0x06 30fb0: af 81 ldd r26, Y+7 ; 0x07 30fb2: b8 85 ldd r27, Y+8 ; 0x08 30fb4: b7 fd sbrc r27, 7 30fb6: 07 c0 rjmp .+14 ; 0x30fc6 tmc2130_check_overtemp(); 30fb8: 0f 94 21 3f call 0x27e42 ; 0x27e42 30fbc: 01 50 subi r16, 0x01 ; 1 30fbe: 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)) 30fc0: f9 f6 brne .-66 ; 0x30f80 30fc2: 80 e0 ldi r24, 0x00 ; 0 30fc4: 09 c0 rjmp .+18 ; 0x30fd8 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); 30fc6: 89 81 ldd r24, Y+1 ; 0x01 30fc8: 9a 81 ldd r25, Y+2 ; 0x02 30fca: ab 81 ldd r26, Y+3 ; 0x03 30fcc: bc 81 ldd r27, Y+4 ; 0x04 30fce: b7 ff sbrs r27, 7 30fd0: f3 cf rjmp .-26 ; 0x30fb8 tmc2130_check_overtemp(); 30fd2: 0f 94 21 3f call 0x27e42 ; 0x27e42 30fd6: 81 e0 ldi r24, 0x01 ; 1 timeout--; } return standstill; } 30fd8: 28 96 adiw r28, 0x08 ; 8 30fda: 0f b6 in r0, 0x3f ; 63 30fdc: f8 94 cli 30fde: de bf out 0x3e, r29 ; 62 30fe0: 0f be out 0x3f, r0 ; 63 30fe2: cd bf out 0x3d, r28 ; 61 30fe4: df 91 pop r29 30fe6: cf 91 pop r28 30fe8: 1f 91 pop r17 30fea: 0f 91 pop r16 30fec: 08 95 ret 00030fee : 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) { 30fee: 1f 93 push r17 30ff0: cf 93 push r28 30ff2: df 93 push r29 30ff4: ec 01 movw r28, r24 30ff6: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 30ff8: 0f 94 27 58 call 0x2b04e ; 0x2b04e 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))); 30ffc: fe 01 movw r30, r28 30ffe: 34 96 adiw r30, 0x04 ; 4 31000: 25 91 lpm r18, Z+ 31002: 35 91 lpm r19, Z+ 31004: 45 91 lpm r20, Z+ 31006: 54 91 lpm r21, Z 31008: fe 01 movw r30, r28 3100a: 65 91 lpm r22, Z+ 3100c: 75 91 lpm r23, Z+ 3100e: 85 91 lpm r24, Z+ 31010: 94 91 lpm r25, Z 31012: 0f 94 fa c2 call 0x385f4 ; 0x385f4 step++; 31016: 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) { 31018: 11 50 subi r17, 0x01 ; 1 3101a: 81 f7 brne .-32 ; 0x30ffc 3101c: 0f 94 27 58 call 0x2b04e ; 0x2b04e // 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(); } 31020: df 91 pop r29 31022: cf 91 pop r28 31024: 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(); 31026: 0d 94 f8 c2 jmp 0x385f0 ; 0x385f0 0003102a : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 3102a: 0e 94 c5 68 call 0xd18a ; 0xd18a 3102e: 81 11 cpse r24, r1 31030: 04 c0 rjmp .+8 ; 0x3103a lcd_setstatuspgm(MSG_WELCOME); 31032: 8e e0 ldi r24, 0x0E ; 14 31034: 91 e7 ldi r25, 0x71 ; 113 31036: 0f 94 0c 0b call 0x21618 ; 0x21618 } custom_message_type = CustomMsg::Status; 3103a: 10 92 75 07 sts 0x0775, r1 ; 0x800775 } 3103e: 08 95 ret 00031040 : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 31040: 80 91 98 13 lds r24, 0x1398 ; 0x801398 31044: 88 23 and r24, r24 31046: 11 f0 breq .+4 ; 0x3104c 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; 31048: 81 e0 ldi r24, 0x01 ; 1 3104a: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 3104c: 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; } } 3104e: 08 95 ret 00031050 : } 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) 31050: 2f 92 push r2 31052: 3f 92 push r3 31054: 4f 92 push r4 31056: 5f 92 push r5 31058: 6f 92 push r6 3105a: 7f 92 push r7 3105c: 8f 92 push r8 3105e: 9f 92 push r9 31060: af 92 push r10 31062: bf 92 push r11 31064: cf 92 push r12 31066: df 92 push r13 31068: ef 92 push r14 3106a: ff 92 push r15 3106c: 0f 93 push r16 3106e: 1f 93 push r17 31070: cf 93 push r28 31072: df 93 push r29 31074: cd b7 in r28, 0x3d ; 61 31076: de b7 in r29, 0x3e ; 62 31078: 2d 97 sbiw r28, 0x0d ; 13 3107a: 0f b6 in r0, 0x3f ; 63 3107c: f8 94 cli 3107e: de bf out 0x3e, r29 ; 62 31080: 0f be out 0x3f, r0 ; 63 31082: cd bf out 0x3d, r28 ; 61 31084: 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; 31086: 41 2c mov r4, r1 31088: 51 2c mov r5, r1 3108a: 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; 3108c: 6e 31 cpi r22, 0x1E ; 30 3108e: 90 f0 brcs .+36 ; 0x310b4 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 31090: 69 3c cpi r22, 0xC9 ; 201 31092: 08 f0 brcs .+2 ; 0x31096 31094: 68 ec ldi r22, 0xC8 ; 200 31096: 70 e0 ldi r23, 0x00 ; 0 31098: 68 51 subi r22, 0x18 ; 24 3109a: 7c 4f sbci r23, 0xFC ; 252 3109c: 90 e0 ldi r25, 0x00 ; 0 3109e: 80 e0 ldi r24, 0x00 ; 0 310a0: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 310a4: 20 e0 ldi r18, 0x00 ; 0 310a6: 30 e0 ldi r19, 0x00 ; 0 310a8: 4a e7 ldi r20, 0x7A ; 122 310aa: 54 e4 ldi r21, 0x44 ; 68 310ac: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 310b0: 2b 01 movw r4, r22 310b2: 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) 310b4: 80 91 bf 02 lds r24, 0x02BF ; 0x8002bf 310b8: 90 91 c0 02 lds r25, 0x02C0 ; 0x8002c0 310bc: a0 91 c1 02 lds r26, 0x02C1 ; 0x8002c1 310c0: b0 91 c2 02 lds r27, 0x02C2 ; 0x8002c2 310c4: 89 83 std Y+1, r24 ; 0x01 310c6: 9a 83 std Y+2, r25 ; 0x02 310c8: ab 83 std Y+3, r26 ; 0x03 310ca: bc 83 std Y+4, r27 ; 0x04 uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) 310cc: 80 91 c3 02 lds r24, 0x02C3 ; 0x8002c3 310d0: 90 91 c4 02 lds r25, 0x02C4 ; 0x8002c4 310d4: a0 91 c5 02 lds r26, 0x02C5 ; 0x8002c5 310d8: 8d 83 std Y+5, r24 ; 0x05 310da: 9e 83 std Y+6, r25 ; 0x06 310dc: 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); 310de: 20 e0 ldi r18, 0x00 ; 0 310e0: 30 e0 ldi r19, 0x00 ; 0 310e2: 47 ef ldi r20, 0xF7 ; 247 310e4: 50 e0 ldi r21, 0x00 ; 0 310e6: 69 ee ldi r22, 0xE9 ; 233 310e8: 8e 2d mov r24, r14 310ea: 0f 94 01 39 call 0x27202 ; 0x27202 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 310ee: 81 2c mov r8, r1 310f0: 91 2c mov r9, r1 310f2: 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 310f4: 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 310f6: 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 310f8: 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 310fa: 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 310fc: 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) 310fe: 2f 2c mov r2, r15 31100: 31 2c mov r3, r1 31102: 8f 2d mov r24, r15 31104: 8f 71 andi r24, 0x1F ; 31 31106: 88 87 std Y+8, r24 ; 0x08 31108: 81 11 cpse r24, r1 3110a: 03 c0 rjmp .+6 ; 0x31112 reg = 0; 3110c: 81 2c mov r8, r1 3110e: 91 2c mov r9, r1 31110: 54 01 movw r10, r8 31112: b1 01 movw r22, r2 31114: 03 2c mov r0, r3 31116: 00 0c add r0, r0 31118: 88 0b sbc r24, r24 3111a: 99 0b sbc r25, r25 3111c: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 31120: 2b ed ldi r18, 0xDB ; 219 31122: 3f e0 ldi r19, 0x0F ; 15 31124: 49 ec ldi r20, 0xC9 ; 201 31126: 50 e4 ldi r21, 0x40 ; 64 31128: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3112c: 6a 87 std Y+10, r22 ; 0x0a 3112e: 7b 87 std Y+11, r23 ; 0x0b 31130: 8c 87 std Y+12, r24 ; 0x0c 31132: 9d 87 std Y+13, r25 ; 0x0d // calculate value if (fac == 0) // default TMC wave 31134: 20 e0 ldi r18, 0x00 ; 0 31136: 30 e0 ldi r19, 0x00 ; 0 31138: a9 01 movw r20, r18 3113a: c3 01 movw r24, r6 3113c: b2 01 movw r22, r4 3113e: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 31142: 81 11 cpse r24, r1 31144: 4d c0 rjmp .+154 ; 0x311e0 vA = (uint8_t)((amp+1) * sin((2*PI*i + PI)/1024) + 0.5) - 1; 31146: 2b ed ldi r18, 0xDB ; 219 31148: 3f e0 ldi r19, 0x0F ; 15 3114a: 49 e4 ldi r20, 0x49 ; 73 3114c: 50 e4 ldi r21, 0x40 ; 64 3114e: 6a 85 ldd r22, Y+10 ; 0x0a 31150: 7b 85 ldd r23, Y+11 ; 0x0b 31152: 8c 85 ldd r24, Y+12 ; 0x0c 31154: 9d 85 ldd r25, Y+13 ; 0x0d 31156: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3115a: 20 e0 ldi r18, 0x00 ; 0 3115c: 30 e0 ldi r19, 0x00 ; 0 3115e: 40 e8 ldi r20, 0x80 ; 128 31160: 5a e3 ldi r21, 0x3A ; 58 31162: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31166: 0f 94 43 e2 call 0x3c486 ; 0x3c486 3116a: 20 e0 ldi r18, 0x00 ; 0 3116c: 30 e0 ldi r19, 0x00 ; 0 3116e: 48 e7 ldi r20, 0x78 ; 120 31170: 53 e4 ldi r21, 0x43 ; 67 31172: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31176: 20 e0 ldi r18, 0x00 ; 0 31178: 30 e0 ldi r19, 0x00 ; 0 3117a: 40 e0 ldi r20, 0x00 ; 0 3117c: 5f e3 ldi r21, 0x3F ; 63 3117e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 31182: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 31186: cc 24 eor r12, r12 31188: ca 94 dec r12 3118a: 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 3118c: 8c 2d mov r24, r12 3118e: 99 85 ldd r25, Y+9 ; 0x09 31190: 89 1b sub r24, r25 va = vA; b = -1; if (dA == d0) b = 0; //delta == delta0 => bit=0 31192: 8d 15 cp r24, r13 31194: f9 f0 breq .+62 ; 0x311d4 else if (dA == d1) b = 1; //delta == delta1 => bit=1 31196: 80 17 cp r24, r16 31198: 09 f4 brne .+2 ; 0x3119c 3119a: 71 c0 rjmp .+226 ; 0x3127e else { if (dA < d0) // delta < delta0 => switch wbit down 3119c: 8d 15 cp r24, r13 3119e: 0c f0 brlt .+2 ; 0x311a2 311a0: 53 c0 rjmp .+166 ; 0x31248 { //printf("dn\n"); b = 0; switch (dA) 311a2: 88 23 and r24, r24 311a4: e9 f1 breq .+122 ; 0x31220 311a6: 81 30 cpi r24, 0x01 ; 1 311a8: 09 f4 brne .+2 ; 0x311ac 311aa: 44 c0 rjmp .+136 ; 0x31234 311ac: 8f 3f cpi r24, 0xFF ; 255 311ae: 09 f0 breq .+2 ; 0x311b2 311b0: 81 c0 rjmp .+258 ; 0x312b4 { case -1: d0 = -1; d1 = 0; w[s+1] = 0; break; 311b2: e2 e0 ldi r30, 0x02 ; 2 311b4: f0 e0 ldi r31, 0x00 ; 0 311b6: ec 0f add r30, r28 311b8: fd 1f adc r31, r29 311ba: e1 0f add r30, r17 311bc: f1 1d adc r31, r1 311be: 10 82 st Z, r1 311c0: 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++; } 311c2: e5 e0 ldi r30, 0x05 ; 5 311c4: f0 e0 ldi r31, 0x00 ; 0 311c6: ec 0f add r30, r28 311c8: fd 1f adc r31, r29 311ca: e1 0f add r30, r17 311cc: f1 1d adc r31, r1 311ce: f0 82 st Z, r15 311d0: 1f 5f subi r17, 0xFF ; 255 311d2: 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) 311d4: 14 30 cpi r17, 0x04 ; 4 311d6: 08 f4 brcc .+2 ; 0x311da 311d8: 56 c0 rjmp .+172 ; 0x31286 311da: 6c c0 rjmp .+216 ; 0x312b4 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); 311dc: f8 2e mov r15, r24 311de: 8f cf rjmp .-226 ; 0x310fe 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); 311e0: 20 e0 ldi r18, 0x00 ; 0 311e2: 30 e0 ldi r19, 0x00 ; 0 311e4: 40 e8 ldi r20, 0x80 ; 128 311e6: 5a e3 ldi r21, 0x3A ; 58 311e8: 6a 85 ldd r22, Y+10 ; 0x0a 311ea: 7b 85 ldd r23, Y+11 ; 0x0b 311ec: 8c 85 ldd r24, Y+12 ; 0x0c 311ee: 9d 85 ldd r25, Y+13 ; 0x0d 311f0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 311f4: 0f 94 43 e2 call 0x3c486 ; 0x3c486 311f8: a3 01 movw r20, r6 311fa: 92 01 movw r18, r4 311fc: 0f 94 f3 e1 call 0x3c3e6 ; 0x3c3e6 31200: 20 e0 ldi r18, 0x00 ; 0 31202: 30 e0 ldi r19, 0x00 ; 0 31204: 47 e7 ldi r20, 0x77 ; 119 31206: 53 e4 ldi r21, 0x43 ; 67 31208: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3120c: 20 e0 ldi r18, 0x00 ; 0 3120e: 30 e0 ldi r19, 0x00 ; 0 31210: 40 e0 ldi r20, 0x00 ; 0 31212: 5f e3 ldi r21, 0x3F ; 63 31214: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 31218: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 3121c: c6 2e mov r12, r22 3121e: b6 cf rjmp .-148 ; 0x3118c //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; 31220: e2 e0 ldi r30, 0x02 ; 2 31222: f0 e0 ldi r31, 0x00 ; 0 31224: ec 0f add r30, r28 31226: fd 1f adc r31, r29 31228: e1 0f add r30, r17 3122a: f1 1d adc r31, r1 3122c: 91 e0 ldi r25, 0x01 ; 1 3122e: 90 83 st Z, r25 31230: 01 e0 ldi r16, 0x01 ; 1 31232: c7 cf rjmp .-114 ; 0x311c2 case 1: d0 = 1; d1 = 2; w[s+1] = 2; break; 31234: e2 e0 ldi r30, 0x02 ; 2 31236: f0 e0 ldi r31, 0x00 ; 0 31238: ec 0f add r30, r28 3123a: fd 1f adc r31, r29 3123c: e1 0f add r30, r17 3123e: f1 1d adc r31, r1 31240: 92 e0 ldi r25, 0x02 ; 2 31242: 90 83 st Z, r25 31244: 02 e0 ldi r16, 0x02 ; 2 31246: bd cf rjmp .-134 ; 0x311c2 default: b = -1; break; } if (b >= 0) { x[s] = i; s++; } } else if (dA > d1) // delta > delta0 => switch wbit up 31248: 08 17 cp r16, r24 3124a: a4 f5 brge .+104 ; 0x312b4 { //printf("up\n"); b = 1; switch (dA) 3124c: 82 30 cpi r24, 0x02 ; 2 3124e: 09 f4 brne .+2 ; 0x31252 31250: 80 c0 rjmp .+256 ; 0x31352 31252: 83 30 cpi r24, 0x03 ; 3 31254: 09 f4 brne .+2 ; 0x31258 31256: 88 c0 rjmp .+272 ; 0x31368 31258: 81 30 cpi r24, 0x01 ; 1 3125a: 61 f5 brne .+88 ; 0x312b4 { case 1: d0 = 0; d1 = 1; w[s+1] = 1; break; 3125c: e2 e0 ldi r30, 0x02 ; 2 3125e: f0 e0 ldi r31, 0x00 ; 0 31260: ec 0f add r30, r28 31262: fd 1f adc r31, r29 31264: e1 0f add r30, r17 31266: f1 1d adc r31, r1 31268: 80 83 st Z, r24 3126a: 01 e0 ldi r16, 0x01 ; 1 3126c: 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++; } 3126e: e5 e0 ldi r30, 0x05 ; 5 31270: f0 e0 ldi r31, 0x00 ; 0 31272: ec 0f add r30, r28 31274: fd 1f adc r31, r29 31276: e1 0f add r30, r17 31278: f1 1d adc r31, r1 3127a: f0 82 st Z, r15 3127c: 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) 3127e: 14 30 cpi r17, 0x04 ; 4 31280: c8 f4 brcc .+50 ; 0x312b4 //printf("%d\n", vA); if (b == 1) reg |= 0x80000000; 31282: 68 94 set 31284: b7 f8 bld r11, 7 if ((i & 31) == 31) 31286: 88 85 ldd r24, Y+8 ; 0x08 31288: 8f 31 cpi r24, 0x1F ; 31 3128a: 09 f0 breq .+2 ; 0x3128e 3128c: 78 c0 rjmp .+240 ; 0x3137e tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); 3128e: b1 01 movw r22, r2 31290: e5 e0 ldi r30, 0x05 ; 5 31292: 75 95 asr r23 31294: 67 95 ror r22 31296: ea 95 dec r30 31298: e1 f7 brne .-8 ; 0x31292 //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); 3129a: 60 5a subi r22, 0xA0 ; 160 3129c: 60 68 ori r22, 0x80 ; 128 3129e: a5 01 movw r20, r10 312a0: 94 01 movw r18, r8 312a2: 8e 2d mov r24, r14 312a4: 0f 94 01 39 call 0x27202 ; 0x27202 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); 312a8: 81 e0 ldi r24, 0x01 ; 1 312aa: 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; 312ac: 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); 312ae: 9f ef ldi r25, 0xFF ; 255 312b0: f9 12 cpse r15, r25 312b2: 94 cf rjmp .-216 ; 0x311dc 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; 312b4: 2a 81 ldd r18, Y+2 ; 0x02 312b6: 30 e0 ldi r19, 0x00 ; 0 312b8: 50 e0 ldi r21, 0x00 ; 0 312ba: 40 e0 ldi r20, 0x00 ; 0 312bc: 82 e0 ldi r24, 0x02 ; 2 312be: 22 0f add r18, r18 312c0: 33 1f adc r19, r19 312c2: 44 1f adc r20, r20 312c4: 55 1f adc r21, r21 312c6: 8a 95 dec r24 312c8: d1 f7 brne .-12 ; 0x312be val |= ((uint32_t)w2) << 4; 312ca: 8b 80 ldd r8, Y+3 ; 0x03 312cc: 91 2c mov r9, r1 312ce: b1 2c mov r11, r1 312d0: a1 2c mov r10, r1 312d2: 94 e0 ldi r25, 0x04 ; 4 312d4: 88 0c add r8, r8 312d6: 99 1c adc r9, r9 312d8: aa 1c adc r10, r10 312da: bb 1c adc r11, r11 312dc: 9a 95 dec r25 312de: d1 f7 brne .-12 ; 0x312d4 312e0: 82 2a or r8, r18 312e2: 93 2a or r9, r19 312e4: a4 2a or r10, r20 312e6: 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); 312e8: 89 81 ldd r24, Y+1 ; 0x01 val |= ((uint32_t)w1) << 2; val |= ((uint32_t)w2) << 4; 312ea: 88 2a or r8, r24 val |= ((uint32_t)w3) << 6; 312ec: 8c 81 ldd r24, Y+4 ; 0x04 312ee: 90 e0 ldi r25, 0x00 ; 0 312f0: b0 e0 ldi r27, 0x00 ; 0 312f2: a0 e0 ldi r26, 0x00 ; 0 312f4: 9c 01 movw r18, r24 312f6: ad 01 movw r20, r26 312f8: 66 e0 ldi r22, 0x06 ; 6 312fa: 22 0f add r18, r18 312fc: 33 1f adc r19, r19 312fe: 44 1f adc r20, r20 31300: 55 1f adc r21, r21 31302: 6a 95 dec r22 31304: d1 f7 brne .-12 ; 0x312fa 31306: 28 29 or r18, r8 31308: 39 29 or r19, r9 3130a: 4a 29 or r20, r10 3130c: 5b 29 or r21, r11 val |= ((uint32_t)x1) << 8; 3130e: 8d 81 ldd r24, Y+5 ; 0x05 31310: 38 2b or r19, r24 val |= ((uint32_t)x2) << 16; 31312: 8e 81 ldd r24, Y+6 ; 0x06 31314: 48 2b or r20, r24 val |= ((uint32_t)x3) << 24; 31316: 8f 81 ldd r24, Y+7 ; 0x07 31318: 58 2b or r21, r24 tmc2130_wr(axis, TMC2130_REG_MSLUTSEL, val); 3131a: 68 ee ldi r22, 0xE8 ; 232 3131c: 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]); } 3131e: 2d 96 adiw r28, 0x0d ; 13 31320: 0f b6 in r0, 0x3f ; 63 31322: f8 94 cli 31324: de bf out 0x3e, r29 ; 62 31326: 0f be out 0x3f, r0 ; 63 31328: cd bf out 0x3d, r28 ; 61 3132a: df 91 pop r29 3132c: cf 91 pop r28 3132e: 1f 91 pop r17 31330: 0f 91 pop r16 31332: ff 90 pop r15 31334: ef 90 pop r14 31336: df 90 pop r13 31338: cf 90 pop r12 3133a: bf 90 pop r11 3133c: af 90 pop r10 3133e: 9f 90 pop r9 31340: 8f 90 pop r8 31342: 7f 90 pop r7 31344: 6f 90 pop r6 31346: 5f 90 pop r5 31348: 4f 90 pop r4 3134a: 3f 90 pop r3 3134c: 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); 3134e: 0d 94 01 39 jmp 0x27202 ; 0x27202 //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; 31352: e2 e0 ldi r30, 0x02 ; 2 31354: f0 e0 ldi r31, 0x00 ; 0 31356: ec 0f add r30, r28 31358: fd 1f adc r31, r29 3135a: e1 0f add r30, r17 3135c: f1 1d adc r31, r1 3135e: 80 83 st Z, r24 31360: 02 e0 ldi r16, 0x02 ; 2 31362: dd 24 eor r13, r13 31364: d3 94 inc r13 31366: 83 cf rjmp .-250 ; 0x3126e case 3: d0 = 2; d1 = 3; w[s+1] = 3; break; 31368: e2 e0 ldi r30, 0x02 ; 2 3136a: f0 e0 ldi r31, 0x00 ; 0 3136c: ec 0f add r30, r28 3136e: fd 1f adc r31, r29 31370: e1 0f add r30, r17 31372: f1 1d adc r31, r1 31374: 80 83 st Z, r24 31376: 03 e0 ldi r16, 0x03 ; 3 31378: f2 e0 ldi r31, 0x02 ; 2 3137a: df 2e mov r13, r31 3137c: 78 cf rjmp .-272 ; 0x3126e //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; 3137e: b6 94 lsr r11 31380: a7 94 ror r10 31382: 97 94 ror r9 31384: 87 94 ror r8 31386: 90 cf rjmp .-224 ; 0x312a8 00031388 : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 31388: 8f 92 push r8 3138a: 9f 92 push r9 3138c: af 92 push r10 3138e: bf 92 push r11 31390: cf 92 push r12 31392: df 92 push r13 31394: ef 92 push r14 31396: ff 92 push r15 31398: 90 91 3f 07 lds r25, 0x073F ; 0x80073f // 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]) { 3139c: 88 23 and r24, r24 3139e: 09 f4 brne .+2 ; 0x313a2 313a0: 9d c0 rjmp .+314 ; 0x314dc 313a2: 91 11 cpse r25, r1 313a4: 92 c0 rjmp .+292 ; 0x314ca st_synchronize(); 313a6: 0f 94 27 58 call 0x2b04e ; 0x2b04e set_destination_to_current(); 313aa: 0e 94 6f 69 call 0xd2de ; 0xd2de current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 313ae: 60 91 94 02 lds r22, 0x0294 ; 0x800294 313b2: 70 91 95 02 lds r23, 0x0295 ; 0x800295 313b6: 07 2e mov r0, r23 313b8: 00 0c add r0, r0 313ba: 88 0b sbc r24, r24 313bc: 99 0b sbc r25, r25 313be: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 313c2: 20 91 f1 06 lds r18, 0x06F1 ; 0x8006f1 313c6: 30 91 f2 06 lds r19, 0x06F2 ; 0x8006f2 313ca: 40 91 f3 06 lds r20, 0x06F3 ; 0x8006f3 313ce: 50 91 f4 06 lds r21, 0x06F4 ; 0x8006f4 313d2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 313d6: 2a e0 ldi r18, 0x0A ; 10 313d8: 37 ed ldi r19, 0xD7 ; 215 313da: 43 e2 ldi r20, 0x23 ; 35 313dc: 5c e3 ldi r21, 0x3C ; 60 313de: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 313e2: 20 91 4f 07 lds r18, 0x074F ; 0x80074f 313e6: 30 91 50 07 lds r19, 0x0750 ; 0x800750 313ea: 40 91 51 07 lds r20, 0x0751 ; 0x800751 313ee: 50 91 52 07 lds r21, 0x0752 ; 0x800752 313f2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 313f6: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 313fa: 70 93 50 07 sts 0x0750, r23 ; 0x800750 313fe: 80 93 51 07 sts 0x0751, r24 ; 0x800751 31402: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_set_e_position(current_position[E_AXIS]); 31406: 8f e4 ldi r24, 0x4F ; 79 31408: 97 e0 ldi r25, 0x07 ; 7 3140a: 0f 94 ae aa call 0x3555c ; 0x3555c float oldFeedrate = feedrate; 3140e: c0 90 90 02 lds r12, 0x0290 ; 0x800290 31412: d0 90 91 02 lds r13, 0x0291 ; 0x800291 31416: e0 90 92 02 lds r14, 0x0292 ; 0x800292 3141a: f0 90 93 02 lds r15, 0x0293 ; 0x800293 feedrate=cs.retract_feedrate*60; 3141e: 20 e0 ldi r18, 0x00 ; 0 31420: 30 e0 ldi r19, 0x00 ; 0 31422: 40 e7 ldi r20, 0x70 ; 112 31424: 52 e4 ldi r21, 0x42 ; 66 31426: 60 91 f5 06 lds r22, 0x06F5 ; 0x8006f5 3142a: 70 91 f6 06 lds r23, 0x06F6 ; 0x8006f6 3142e: 80 91 f7 06 lds r24, 0x06F7 ; 0x8006f7 31432: 90 91 f8 06 lds r25, 0x06F8 ; 0x8006f8 31436: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3143a: 60 93 90 02 sts 0x0290, r22 ; 0x800290 3143e: 70 93 91 02 sts 0x0291, r23 ; 0x800291 31442: 80 93 92 02 sts 0x0292, r24 ; 0x800292 31446: 90 93 93 02 sts 0x0293, r25 ; 0x800293 retracted[active_extruder]=true; 3144a: 81 e0 ldi r24, 0x01 ; 1 3144c: 80 93 3f 07 sts 0x073F, r24 ; 0x80073f prepare_move(); 31450: 90 e0 ldi r25, 0x00 ; 0 31452: 80 e0 ldi r24, 0x00 ; 0 31454: 0e 94 3d 6d call 0xda7a ; 0xda7a if(cs.retract_zlift) { 31458: 20 e0 ldi r18, 0x00 ; 0 3145a: 30 e0 ldi r19, 0x00 ; 0 3145c: a9 01 movw r20, r18 3145e: 60 91 f9 06 lds r22, 0x06F9 ; 0x8006f9 31462: 70 91 fa 06 lds r23, 0x06FA ; 0x8006fa 31466: 80 91 fb 06 lds r24, 0x06FB ; 0x8006fb 3146a: 90 91 fc 06 lds r25, 0x06FC ; 0x8006fc 3146e: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 31472: 88 23 and r24, r24 31474: 11 f1 breq .+68 ; 0x314ba st_synchronize(); 31476: 0f 94 27 58 call 0x2b04e ; 0x2b04e current_position[Z_AXIS]-=cs.retract_zlift; 3147a: 20 91 f9 06 lds r18, 0x06F9 ; 0x8006f9 3147e: 30 91 fa 06 lds r19, 0x06FA ; 0x8006fa 31482: 40 91 fb 06 lds r20, 0x06FB ; 0x8006fb 31486: 50 91 fc 06 lds r21, 0x06FC ; 0x8006fc 3148a: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 3148e: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 31492: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 31496: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 3149a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 3149e: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 314a2: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 314a6: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 314aa: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e plan_set_position_curposXYZE(); 314ae: 0f 94 1d b9 call 0x3723a ; 0x3723a prepare_move(); 314b2: 90 e0 ldi r25, 0x00 ; 0 314b4: 80 e0 ldi r24, 0x00 ; 0 314b6: 0e 94 3d 6d call 0xda7a ; 0xda7a } feedrate = oldFeedrate; 314ba: c0 92 90 02 sts 0x0290, r12 ; 0x800290 314be: d0 92 91 02 sts 0x0291, r13 ; 0x800291 314c2: e0 92 92 02 sts 0x0292, r14 ; 0x800292 314c6: f0 92 93 02 sts 0x0293, r15 ; 0x800293 plan_set_e_position(current_position[E_AXIS]); retracted[active_extruder]=false; prepare_move(); feedrate = oldFeedrate; } } //retract 314ca: ff 90 pop r15 314cc: ef 90 pop r14 314ce: df 90 pop r13 314d0: cf 90 pop r12 314d2: bf 90 pop r11 314d4: af 90 pop r10 314d6: 9f 90 pop r9 314d8: 8f 90 pop r8 314da: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 314dc: 99 23 and r25, r25 314de: a9 f3 breq .-22 ; 0x314ca st_synchronize(); 314e0: 0f 94 27 58 call 0x2b04e ; 0x2b04e set_destination_to_current(); 314e4: 0e 94 6f 69 call 0xd2de ; 0xd2de float oldFeedrate = feedrate; 314e8: 80 90 90 02 lds r8, 0x0290 ; 0x800290 314ec: 90 90 91 02 lds r9, 0x0291 ; 0x800291 314f0: a0 90 92 02 lds r10, 0x0292 ; 0x800292 314f4: b0 90 93 02 lds r11, 0x0293 ; 0x800293 feedrate=cs.retract_recover_feedrate*60; 314f8: 20 e0 ldi r18, 0x00 ; 0 314fa: 30 e0 ldi r19, 0x00 ; 0 314fc: 40 e7 ldi r20, 0x70 ; 112 314fe: 52 e4 ldi r21, 0x42 ; 66 31500: 60 91 01 07 lds r22, 0x0701 ; 0x800701 31504: 70 91 02 07 lds r23, 0x0702 ; 0x800702 31508: 80 91 03 07 lds r24, 0x0703 ; 0x800703 3150c: 90 91 04 07 lds r25, 0x0704 ; 0x800704 31510: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31514: 60 93 90 02 sts 0x0290, r22 ; 0x800290 31518: 70 93 91 02 sts 0x0291, r23 ; 0x800291 3151c: 80 93 92 02 sts 0x0292, r24 ; 0x800292 31520: 90 93 93 02 sts 0x0293, r25 ; 0x800293 if(cs.retract_zlift) { 31524: c0 90 f9 06 lds r12, 0x06F9 ; 0x8006f9 31528: d0 90 fa 06 lds r13, 0x06FA ; 0x8006fa 3152c: e0 90 fb 06 lds r14, 0x06FB ; 0x8006fb 31530: f0 90 fc 06 lds r15, 0x06FC ; 0x8006fc 31534: 20 e0 ldi r18, 0x00 ; 0 31536: 30 e0 ldi r19, 0x00 ; 0 31538: a9 01 movw r20, r18 3153a: c7 01 movw r24, r14 3153c: b6 01 movw r22, r12 3153e: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 31542: 88 23 and r24, r24 31544: e1 f0 breq .+56 ; 0x3157e current_position[Z_AXIS]+=cs.retract_zlift; 31546: a7 01 movw r20, r14 31548: 96 01 movw r18, r12 3154a: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 3154e: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 31552: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 31556: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 3155a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3155e: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 31562: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 31566: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 3156a: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e plan_set_position_curposXYZE(); 3156e: 0f 94 1d b9 call 0x3723a ; 0x3723a prepare_move(); 31572: 90 e0 ldi r25, 0x00 ; 0 31574: 80 e0 ldi r24, 0x00 ; 0 31576: 0e 94 3d 6d call 0xda7a ; 0xda7a st_synchronize(); 3157a: 0f 94 27 58 call 0x2b04e ; 0x2b04e } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 3157e: 20 91 fd 06 lds r18, 0x06FD ; 0x8006fd 31582: 30 91 fe 06 lds r19, 0x06FE ; 0x8006fe 31586: 40 91 ff 06 lds r20, 0x06FF ; 0x8006ff 3158a: 50 91 00 07 lds r21, 0x0700 ; 0x800700 3158e: 60 91 f1 06 lds r22, 0x06F1 ; 0x8006f1 31592: 70 91 f2 06 lds r23, 0x06F2 ; 0x8006f2 31596: 80 91 f3 06 lds r24, 0x06F3 ; 0x8006f3 3159a: 90 91 f4 06 lds r25, 0x06F4 ; 0x8006f4 3159e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 315a2: 6b 01 movw r12, r22 315a4: 7c 01 movw r14, r24 315a6: 60 91 94 02 lds r22, 0x0294 ; 0x800294 315aa: 70 91 95 02 lds r23, 0x0295 ; 0x800295 315ae: 07 2e mov r0, r23 315b0: 00 0c add r0, r0 315b2: 88 0b sbc r24, r24 315b4: 99 0b sbc r25, r25 315b6: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 315ba: 9b 01 movw r18, r22 315bc: ac 01 movw r20, r24 315be: c7 01 movw r24, r14 315c0: b6 01 movw r22, r12 315c2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 315c6: 2a e0 ldi r18, 0x0A ; 10 315c8: 37 ed ldi r19, 0xD7 ; 215 315ca: 43 e2 ldi r20, 0x23 ; 35 315cc: 5c e3 ldi r21, 0x3C ; 60 315ce: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 315d2: 9b 01 movw r18, r22 315d4: ac 01 movw r20, r24 315d6: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 315da: 70 91 50 07 lds r23, 0x0750 ; 0x800750 315de: 80 91 51 07 lds r24, 0x0751 ; 0x800751 315e2: 90 91 52 07 lds r25, 0x0752 ; 0x800752 315e6: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 315ea: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 315ee: 70 93 50 07 sts 0x0750, r23 ; 0x800750 315f2: 80 93 51 07 sts 0x0751, r24 ; 0x800751 315f6: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_set_e_position(current_position[E_AXIS]); 315fa: 8f e4 ldi r24, 0x4F ; 79 315fc: 97 e0 ldi r25, 0x07 ; 7 315fe: 0f 94 ae aa call 0x3555c ; 0x3555c retracted[active_extruder]=false; 31602: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f prepare_move(); 31606: 90 e0 ldi r25, 0x00 ; 0 31608: 80 e0 ldi r24, 0x00 ; 0 3160a: 0e 94 3d 6d call 0xda7a ; 0xda7a feedrate = oldFeedrate; 3160e: 80 92 90 02 sts 0x0290, r8 ; 0x800290 31612: 90 92 91 02 sts 0x0291, r9 ; 0x800291 31616: a0 92 92 02 sts 0x0292, r10 ; 0x800292 3161a: b0 92 93 02 sts 0x0293, r11 ; 0x800293 3161e: 55 cf rjmp .-342 ; 0x314ca 00031620 : 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) 31620: ef 92 push r14 31622: ff 92 push r15 31624: 0f 93 push r16 31626: 1f 93 push r17 31628: cf 93 push r28 3162a: c8 2f mov r28, r24 3162c: 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; 3162e: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> return 0; } uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) 31632: c1 30 cpi r28, 0x01 ; 1 31634: b9 f0 breq .+46 ; 0x31664 31636: c2 30 cpi r28, 0x02 ; 2 31638: c1 f0 breq .+48 ; 0x3166a { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 3163a: 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) 3163c: 48 17 cp r20, r24 3163e: 21 f0 breq .+8 ; 0x31648 tmc2130_set_dir(axis, dir); 31640: 64 2f mov r22, r20 31642: 8c 2f mov r24, r28 31644: 0f 94 64 38 call 0x270c8 ; 0x270c8 31648: 8b e9 ldi r24, 0x9B ; 155 3164a: e8 2e mov r14, r24 3164c: 8f e0 ldi r24, 0x0F ; 15 3164e: f8 2e mov r15, r24 while (steps--) 31650: 01 50 subi r16, 0x01 ; 1 31652: 11 09 sbc r17, r1 31654: 70 f0 brcs .+28 ; 0x31672 { tmc2130_do_step(axis); 31656: 8c 2f mov r24, r28 31658: 0f 94 53 38 call 0x270a6 ; 0x270a6 3165c: c7 01 movw r24, r14 3165e: 01 97 sbiw r24, 0x01 ; 1 31660: f1 f7 brne .-4 ; 0x3165e 31662: f6 cf rjmp .-20 ; 0x31650 uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 31664: 86 95 lsr r24 31666: 8c 27 eor r24, r28 31668: e8 cf rjmp .-48 ; 0x3163a case Z_AXIS: return _GET_DIR_Z; 3166a: 82 fb bst r24, 2 3166c: 88 27 eor r24, r24 3166e: 80 f9 bld r24, 0 31670: e5 cf rjmp .-54 ; 0x3163c while (steps--) { tmc2130_do_step(axis); delayMicroseconds(delay_us); } } 31672: cf 91 pop r28 31674: 1f 91 pop r17 31676: 0f 91 pop r16 31678: ff 90 pop r15 3167a: ef 90 pop r14 3167c: 08 95 ret 0003167e : void tmc2130_goto_step(uint8_t axis, uint8_t step, uint8_t dir, uint16_t delay_us, uint16_t microstep_resolution) 3167e: 8f 92 push r8 31680: 9f 92 push r9 31682: af 92 push r10 31684: bf 92 push r11 31686: cf 92 push r12 31688: df 92 push r13 3168a: ef 92 push r14 3168c: ff 92 push r15 3168e: 0f 93 push r16 31690: 1f 93 push r17 31692: cf 93 push r28 31694: c8 2f mov r28, r24 31696: 8a 01 movw r16, r20 { printf_P(PSTR("tmc2130_goto_step %d %d %d %d \n"), axis, step, dir, delay_us, microstep_resolution); 31698: c6 2e mov r12, r22 3169a: d1 2c mov r13, r1 3169c: 1f 93 push r17 3169e: 4f 93 push r20 316a0: 83 e0 ldi r24, 0x03 ; 3 316a2: 8f 93 push r24 316a4: 88 ee ldi r24, 0xE8 ; 232 316a6: 8f 93 push r24 316a8: 1f 92 push r1 316aa: 82 e0 ldi r24, 0x02 ; 2 316ac: 8f 93 push r24 316ae: 1f 92 push r1 316b0: 6f 93 push r22 316b2: 1f 92 push r1 316b4: cf 93 push r28 316b6: 8f e4 ldi r24, 0x4F ; 79 316b8: 96 ea ldi r25, 0xA6 ; 166 316ba: 9f 93 push r25 316bc: 8f 93 push r24 316be: 0f 94 1d dc call 0x3b83a ; 0x3b83a 316c2: 8d b7 in r24, 0x3d ; 61 316c4: 9e b7 in r25, 0x3e ; 62 316c6: 0c 96 adiw r24, 0x0c ; 12 316c8: 0f b6 in r0, 0x3f ; 63 316ca: f8 94 cli 316cc: 9e bf out 0x3e, r25 ; 62 316ce: 0f be out 0x3f, r0 ; 63 316d0: 8d bf out 0x3d, r24 ; 61 316d2: 90 e0 ldi r25, 0x00 ; 0 316d4: 80 e0 ldi r24, 0x00 ; 0 uint8_t shift; for (shift = 0; shift < 8; shift++) if (microstep_resolution == (256u >> shift)) break; 316d6: 40 e0 ldi r20, 0x00 ; 0 316d8: 51 e0 ldi r21, 0x01 ; 1 316da: 28 2f mov r18, r24 316dc: ba 01 movw r22, r20 316de: 08 2e mov r0, r24 316e0: 02 c0 rjmp .+4 ; 0x316e6 316e2: 76 95 lsr r23 316e4: 67 95 ror r22 316e6: 0a 94 dec r0 316e8: e2 f7 brpl .-8 ; 0x316e2 316ea: 06 17 cp r16, r22 316ec: 17 07 cpc r17, r23 316ee: 29 f0 breq .+10 ; 0x316fa 316f0: 01 96 adiw r24, 0x01 ; 1 316f2: 88 30 cpi r24, 0x08 ; 8 316f4: 91 05 cpc r25, r1 316f6: 89 f7 brne .-30 ; 0x316da 316f8: 28 e0 ldi r18, 0x08 ; 8 uint16_t cnt = 4 * (1 << (8 - shift)); 316fa: e2 2e mov r14, r18 316fc: f1 2c mov r15, r1 316fe: 88 e0 ldi r24, 0x08 ; 8 31700: 90 e0 ldi r25, 0x00 ; 0 31702: 8e 19 sub r24, r14 31704: 9f 09 sbc r25, r15 31706: 24 e0 ldi r18, 0x04 ; 4 31708: 30 e0 ldi r19, 0x00 ; 0 3170a: 59 01 movw r10, r18 3170c: 02 c0 rjmp .+4 ; 0x31712 3170e: aa 0c add r10, r10 31710: bb 1c adc r11, r11 31712: 8a 95 dec r24 31714: e2 f7 brpl .-8 ; 0x3170e uint16_t mscnt = tmc2130_rd_MSCNT(axis); 31716: 8c 2f mov r24, r28 31718: 0f 94 2b 39 call 0x27256 ; 0x27256 3171c: 9c 01 movw r18, r24 3171e: 90 e0 ldi r25, 0x00 ; 0 31720: c4 30 cpi r28, 0x04 ; 4 31722: 28 f4 brcc .+10 ; 0x3172e 31724: ec 2f mov r30, r28 31726: f0 e0 ldi r31, 0x00 ; 0 31728: ef 5d subi r30, 0xDF ; 223 3172a: fc 4f sbci r31, 0xFC ; 252 3172c: 90 81 ld r25, Z if (dir == 2) { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); 3172e: 0e 2c mov r0, r14 31730: 02 c0 rjmp .+4 ; 0x31736 31732: 36 95 lsr r19 31734: 27 95 ror r18 31736: 0a 94 dec r0 31738: e2 f7 brpl .-8 ; 0x31732 3173a: 86 01 movw r16, r12 3173c: 02 1b sub r16, r18 3173e: 13 0b sbc r17, r19 if (steps > static_cast(cnt / 2)) 31740: 95 01 movw r18, r10 31742: 36 95 lsr r19 31744: 27 95 ror r18 { dir ^= 1; 31746: 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)) 31748: 20 17 cp r18, r16 3174a: 31 07 cpc r19, r17 3174c: 74 f1 brlt .+92 ; 0x317aa 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; 3174e: 91 11 cpse r25, r1 31750: 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) 31752: 17 ff sbrs r17, 7 31754: 05 c0 rjmp .+10 ; 0x31760 { dir ^= 1; 31756: 81 e0 ldi r24, 0x01 ; 1 31758: 68 27 eor r22, r24 steps = -steps; 3175a: 11 95 neg r17 3175c: 01 95 neg r16 3175e: 11 09 sbc r17, r1 } cnt = steps; } tmc2130_set_dir(axis, dir); 31760: 8c 2f mov r24, r28 31762: 0f 94 64 38 call 0x270c8 ; 0x270c8 mscnt = tmc2130_rd_MSCNT(axis); 31766: 8c 2f mov r24, r28 31768: 0f 94 2b 39 call 0x27256 ; 0x27256 3176c: b1 2c mov r11, r1 3176e: a1 2c mov r10, r1 31770: 2b e9 ldi r18, 0x9B ; 155 31772: 82 2e mov r8, r18 31774: 2f e0 ldi r18, 0x0F ; 15 31776: 92 2e mov r9, r18 while ((cnt--) && ((mscnt >> shift) != step)) 31778: 0a 15 cp r16, r10 3177a: 1b 05 cpc r17, r11 3177c: f1 f0 breq .+60 ; 0x317ba 3177e: 2f ef ldi r18, 0xFF ; 255 31780: a2 1a sub r10, r18 31782: b2 0a sbc r11, r18 31784: 0e 2c mov r0, r14 31786: 02 c0 rjmp .+4 ; 0x3178c 31788: 96 95 lsr r25 3178a: 87 95 ror r24 3178c: 0a 94 dec r0 3178e: e2 f7 brpl .-8 ; 0x31788 31790: 8c 15 cp r24, r12 31792: 9d 05 cpc r25, r13 31794: 91 f0 breq .+36 ; 0x317ba { tmc2130_do_step(axis); 31796: 8c 2f mov r24, r28 31798: 0f 94 53 38 call 0x270a6 ; 0x270a6 3179c: c4 01 movw r24, r8 3179e: 01 97 sbiw r24, 0x01 ; 1 317a0: f1 f7 brne .-4 ; 0x3179e delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); 317a2: 8c 2f mov r24, r28 317a4: 0f 94 2b 39 call 0x27256 ; 0x27256 317a8: e7 cf rjmp .-50 ; 0x31778 { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); if (steps > static_cast(cnt / 2)) { dir ^= 1; 317aa: 91 11 cpse r25, r1 317ac: 01 c0 rjmp .+2 ; 0x317b0 317ae: 60 e0 ldi r22, 0x00 ; 0 steps = cnt - steps; // This can create a negative step value 317b0: c5 01 movw r24, r10 317b2: 80 1b sub r24, r16 317b4: 91 0b sbc r25, r17 317b6: 8c 01 movw r16, r24 317b8: cc cf rjmp .-104 ; 0x31752 { tmc2130_do_step(axis); delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); } } 317ba: cf 91 pop r28 317bc: 1f 91 pop r17 317be: 0f 91 pop r16 317c0: ff 90 pop r15 317c2: ef 90 pop r14 317c4: df 90 pop r13 317c6: cf 90 pop r12 317c8: bf 90 pop r11 317ca: af 90 pop r10 317cc: 9f 90 pop r9 317ce: 8f 90 pop r8 317d0: 08 95 ret 000317d2 : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 317d2: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 memset(z_values, 0, sizeof(z_values)); 317d6: e1 ea ldi r30, 0xA1 ; 161 317d8: f3 e1 ldi r31, 0x13 ; 19 317da: 84 ec ldi r24, 0xC4 ; 196 317dc: df 01 movw r26, r30 317de: 1d 92 st X+, r1 317e0: 8a 95 dec r24 317e2: e9 f7 brne .-6 ; 0x317de } 317e4: 08 95 ret 000317e6 : 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 317e6: 2f 92 push r2 317e8: 3f 92 push r3 317ea: 4f 92 push r4 317ec: 5f 92 push r5 317ee: 6f 92 push r6 317f0: 7f 92 push r7 317f2: 8f 92 push r8 317f4: 9f 92 push r9 317f6: af 92 push r10 317f8: bf 92 push r11 317fa: cf 92 push r12 317fc: df 92 push r13 317fe: ef 92 push r14 31800: ff 92 push r15 31802: 0f 93 push r16 31804: 1f 93 push r17 31806: cf 93 push r28 31808: df 93 push r29 3180a: 00 d0 rcall .+0 ; 0x3180c 3180c: 1f 92 push r1 3180e: cd b7 in r28, 0x3d ; 61 31810: de b7 in r29, 0x3e ; 62 31812: 4b 01 movw r8, r22 31814: 5c 01 movw r10, r24 31816: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 31818: 81 e0 ldi r24, 0x01 ; 1 3181a: 80 93 6d 06 sts 0x066D, r24 ; 0x80066d #ifdef TMC2130 bool bHighPowerForced = false; if (tmc2130_mode == TMC2130_MODE_SILENT) 3181e: 80 91 6c 06 lds r24, 0x066C ; 0x80066c ) { bool high_deviation_occured = false; bedPWMDisabled = 1; #ifdef TMC2130 bool bHighPowerForced = false; 31822: 10 e0 ldi r17, 0x00 ; 0 if (tmc2130_mode == TMC2130_MODE_SILENT) 31824: 81 30 cpi r24, 0x01 ; 1 31826: 19 f4 brne .+6 ; 0x3182e { FORCE_HIGH_POWER_START; 31828: 0e 94 e5 67 call 0xcfca ; 0xcfca bHighPowerForced = true; 3182c: 11 e0 ldi r17, 0x01 ; 1 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 3182e: 20 91 8f 02 lds r18, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 31832: 2a 83 std Y+2, r18 ; 0x02 check_endstops = check; 31834: 81 e0 ldi r24, 0x01 ; 1 31836: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> //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); 3183a: 80 e0 ldi r24, 0x00 ; 0 3183c: 0f 94 55 63 call 0x2c6aa ; 0x2c6aa 31840: 89 83 std Y+1, r24 ; 0x01 float z = 0.f; endstop_z_hit_on_purpose(); 31842: 0f 94 63 63 call 0x2c6c6 ; 0x2c6c6 // move down until you find the bed current_position[Z_AXIS] = minimum_z; 31846: 80 92 4b 07 sts 0x074B, r8 ; 0x80074b 3184a: 90 92 4c 07 sts 0x074C, r9 ; 0x80074c 3184e: a0 92 4d 07 sts 0x074D, r10 ; 0x80074d 31852: b0 92 4e 07 sts 0x074E, r11 ; 0x80074e go_to_current(homing_feedrate[Z_AXIS]/60); 31856: 65 e5 ldi r22, 0x55 ; 85 31858: 75 e5 ldi r23, 0x55 ; 85 3185a: 85 e5 ldi r24, 0x55 ; 85 3185c: 91 e4 ldi r25, 0x41 ; 65 3185e: 0f 94 1a c3 call 0x38634 ; 0x38634 // 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(); 31862: 0f 94 6e c9 call 0x392dc ; 0x392dc if (! endstop_z_hit_on_purpose()) 31866: 0f 94 63 63 call 0x2c6c6 ; 0x2c6c6 3186a: 8c 83 std Y+4, r24 ; 0x04 3186c: 88 23 and r24, r24 3186e: 09 f4 brne .+2 ; 0x31872 31870: f9 c0 rjmp .+498 ; 0x31a64 { //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)) 31872: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 31876: 86 ff sbrs r24, 6 31878: f5 c0 rjmp .+490 ; 0x31a64 { //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) 3187a: 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; 3187c: c1 2c mov r12, r1 3187e: d1 2c mov r13, r1 31880: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 31882: 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) 31884: 8b 81 ldd r24, Y+3 ; 0x03 31886: 80 17 cp r24, r16 31888: 08 f0 brcs .+2 ; 0x3188c 3188a: a8 c0 rjmp .+336 ; 0x319dc { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 3188c: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 31890: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 31894: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 31898: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 3189c: 20 e0 ldi r18, 0x00 ; 0 3189e: 30 e0 ldi r19, 0x00 ; 0 318a0: 40 e0 ldi r20, 0x00 ; 0 318a2: 5f e3 ldi r21, 0x3F ; 63 318a4: 31 10 cpse r3, r1 318a6: 04 c0 rjmp .+8 ; 0x318b0 318a8: 2d ec ldi r18, 0xCD ; 205 318aa: 3c ec ldi r19, 0xCC ; 204 318ac: 4c e4 ldi r20, 0x4C ; 76 318ae: 5e e3 ldi r21, 0x3E ; 62 318b0: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 318b4: 2b 01 movw r4, r22 318b6: 3c 01 movw r6, r24 318b8: 40 92 4b 07 sts 0x074B, r4 ; 0x80074b 318bc: 50 92 4c 07 sts 0x074C, r5 ; 0x80074c 318c0: 60 92 4d 07 sts 0x074D, r6 ; 0x80074d 318c4: 70 92 4e 07 sts 0x074E, r7 ; 0x80074e float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 318c8: 65 e5 ldi r22, 0x55 ; 85 318ca: 75 e5 ldi r23, 0x55 ; 85 318cc: 85 e5 ldi r24, 0x55 ; 85 318ce: 91 e4 ldi r25, 0x41 ; 65 318d0: 0f 94 1a c3 call 0x38634 ; 0x38634 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 318d4: 80 92 4b 07 sts 0x074B, r8 ; 0x80074b 318d8: 90 92 4c 07 sts 0x074C, r9 ; 0x80074c 318dc: a0 92 4d 07 sts 0x074D, r10 ; 0x80074d 318e0: b0 92 4e 07 sts 0x074E, r11 ; 0x80074e //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)); 318e4: 65 e5 ldi r22, 0x55 ; 85 318e6: 75 e5 ldi r23, 0x55 ; 85 318e8: 85 e5 ldi r24, 0x55 ; 85 318ea: 90 e4 ldi r25, 0x40 ; 64 318ec: 0f 94 1a c3 call 0x38634 ; 0x38634 // 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(); 318f0: 0f 94 6e c9 call 0x392dc ; 0x392dc //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) { 318f4: a3 01 movw r20, r6 318f6: 92 01 movw r18, r4 318f8: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 318fc: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 31900: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 31904: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 31908: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 3190c: 9f 77 andi r25, 0x7F ; 127 3190e: 2d ec ldi r18, 0xCD ; 205 31910: 3c ec ldi r19, 0xCC ; 204 31912: 4c ec ldi r20, 0xCC ; 204 31914: 5c e3 ldi r21, 0x3C ; 60 31916: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 3191a: 87 ff sbrs r24, 7 3191c: 16 c0 rjmp .+44 ; 0x3194a //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 3191e: 60 e0 ldi r22, 0x00 ; 0 31920: 70 e0 ldi r23, 0x00 ; 0 31922: 80 e0 ldi r24, 0x00 ; 0 31924: 9f e3 ldi r25, 0x3F ; 63 31926: 0e 94 16 6f call 0xde2c ; 0xde2c current_position[Z_AXIS] = minimum_z; 3192a: 80 92 4b 07 sts 0x074B, r8 ; 0x80074b 3192e: 90 92 4c 07 sts 0x074C, r9 ; 0x80074c 31932: a0 92 4d 07 sts 0x074D, r10 ; 0x80074d 31936: b0 92 4e 07 sts 0x074E, r11 ; 0x80074e go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 3193a: 65 e5 ldi r22, 0x55 ; 85 3193c: 75 e5 ldi r23, 0x55 ; 85 3193e: 85 e5 ldi r24, 0x55 ; 85 31940: 90 e4 ldi r25, 0x40 ; 64 31942: 0f 94 1a c3 call 0x38634 ; 0x38634 // 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(); 31946: 0f 94 6e c9 call 0x392dc ; 0x392dc } if (!endstop_z_hit_on_purpose()) 3194a: 0f 94 63 63 call 0x2c6c6 ; 0x2c6c6 3194e: 28 2e mov r2, r24 31950: 88 23 and r24, r24 31952: 09 f4 brne .+2 ; 0x31956 31954: 87 c0 rjmp .+270 ; 0x31a64 { //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)) { 31956: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 3195a: 86 ff sbrs r24, 6 3195c: 83 c0 rjmp .+262 ; 0x31a64 3195e: 40 90 4b 07 lds r4, 0x074B ; 0x80074b 31962: 50 90 4c 07 lds r5, 0x074C ; 0x80074c 31966: 60 90 4d 07 lds r6, 0x074D ; 0x80074d 3196a: 70 90 4e 07 lds r7, 0x074E ; 0x80074e } #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; 3196e: 2b 81 ldd r18, Y+3 ; 0x03 31970: 22 23 and r18, r18 31972: d9 f0 breq .+54 ; 0x319aa 31974: 62 2f mov r22, r18 31976: 70 e0 ldi r23, 0x00 ; 0 31978: 90 e0 ldi r25, 0x00 ; 0 3197a: 80 e0 ldi r24, 0x00 ; 0 3197c: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 31980: 9b 01 movw r18, r22 31982: ac 01 movw r20, r24 31984: c7 01 movw r24, r14 31986: b6 01 movw r22, r12 31988: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 3198c: 9b 01 movw r18, r22 3198e: ac 01 movw r20, r24 31990: c3 01 movw r24, r6 31992: b2 01 movw r22, r4 31994: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 31998: 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 3199a: 2d ec ldi r18, 0xCD ; 205 3199c: 3c ec ldi r19, 0xCC ; 204 3199e: 4c e4 ldi r20, 0x4C ; 76 319a0: 5d e3 ldi r21, 0x3D ; 61 319a2: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 319a6: 18 16 cp r1, r24 319a8: 64 f0 brlt .+24 ; 0x319c2 #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]; 319aa: a3 01 movw r20, r6 319ac: 92 01 movw r18, r4 319ae: c7 01 movw r24, r14 319b0: b6 01 movw r22, r12 319b2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 319b6: 6b 01 movw r12, r22 319b8: 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) 319ba: 2b 81 ldd r18, Y+3 ; 0x03 319bc: 2f 5f subi r18, 0xFF ; 255 319be: 2b 83 std Y+3, r18 ; 0x03 319c0: 61 cf rjmp .-318 ; 0x31884 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 319c2: 31 10 cpse r3, r1 319c4: 4f c0 rjmp .+158 ; 0x31a64 //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 319c6: 84 ef ldi r24, 0xF4 ; 244 319c8: 91 e0 ldi r25, 0x01 ; 1 319ca: 0e 94 ff 8e call 0x11dfe ; 0x11dfe //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; 319ce: 32 2c mov r3, r2 i = -1; 319d0: 8f ef ldi r24, 0xFF ; 255 319d2: 8b 83 std Y+3, r24 ; 0x03 z = 0; 319d4: c1 2c mov r12, r1 319d6: d1 2c mov r13, r1 319d8: 76 01 movw r14, r12 319da: ef cf rjmp .-34 ; 0x319ba } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 319dc: 02 30 cpi r16, 0x02 ; 2 319de: 68 f5 brcc .+90 ; 0x31a3a goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 319e0: c0 92 4b 07 sts 0x074B, r12 ; 0x80074b 319e4: d0 92 4c 07 sts 0x074C, r13 ; 0x80074c 319e8: e0 92 4d 07 sts 0x074D, r14 ; 0x80074d 319ec: f0 92 4e 07 sts 0x074E, r15 ; 0x80074e 319f0: 8a 81 ldd r24, Y+2 ; 0x02 319f2: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> if (n_iter > 1) current_position[Z_AXIS] /= float(n_iter); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 319f6: 89 81 ldd r24, Y+1 ; 0x01 319f8: 0f 94 55 63 call 0x2c6aa ; 0x2c6aa // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 319fc: 11 23 and r17, r17 319fe: 19 f0 breq .+6 ; 0x31a06 31a00: 80 e0 ldi r24, 0x00 ; 0 31a02: 0e 94 e5 67 call 0xcfca ; 0xcfca #endif bedPWMDisabled = 0; 31a06: 10 92 6d 06 sts 0x066D, r1 ; 0x80066d #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 31a0a: 8c 81 ldd r24, Y+4 ; 0x04 31a0c: 0f 90 pop r0 31a0e: 0f 90 pop r0 31a10: 0f 90 pop r0 31a12: 0f 90 pop r0 31a14: df 91 pop r29 31a16: cf 91 pop r28 31a18: 1f 91 pop r17 31a1a: 0f 91 pop r16 31a1c: ff 90 pop r15 31a1e: ef 90 pop r14 31a20: df 90 pop r13 31a22: cf 90 pop r12 31a24: bf 90 pop r11 31a26: af 90 pop r10 31a28: 9f 90 pop r9 31a2a: 8f 90 pop r8 31a2c: 7f 90 pop r7 31a2e: 6f 90 pop r6 31a30: 5f 90 pop r5 31a32: 4f 90 pop r4 31a34: 3f 90 pop r3 31a36: 2f 90 pop r2 31a38: 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); 31a3a: 60 2f mov r22, r16 31a3c: 70 e0 ldi r23, 0x00 ; 0 31a3e: 90 e0 ldi r25, 0x00 ; 0 31a40: 80 e0 ldi r24, 0x00 ; 0 31a42: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 31a46: 9b 01 movw r18, r22 31a48: ac 01 movw r20, r24 31a4a: c7 01 movw r24, r14 31a4c: b6 01 movw r22, r12 31a4e: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 31a52: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 31a56: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 31a5a: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 31a5e: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e 31a62: c6 cf rjmp .-116 ; 0x319f0 31a64: 2a 81 ldd r18, Y+2 ; 0x02 31a66: 20 93 8f 02 sts 0x028F, r18 ; 0x80028f <_ZL14check_endstops.lto_priv.389> return true; error: // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 4"); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 31a6a: 89 81 ldd r24, Y+1 ; 0x01 31a6c: 0f 94 55 63 call 0x2c6aa ; 0x2c6aa #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31a70: 11 23 and r17, r17 31a72: 19 f0 breq .+6 ; 0x31a7a 31a74: 80 e0 ldi r24, 0x00 ; 0 31a76: 0e 94 e5 67 call 0xcfca ; 0xcfca #endif bedPWMDisabled = 0; 31a7a: 10 92 6d 06 sts 0x066D, r1 ; 0x80066d return false; 31a7e: 1c 82 std Y+4, r1 ; 0x04 31a80: c4 cf rjmp .-120 ; 0x31a0a 00031a82 : /// 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){ 31a82: 2f 92 push r2 31a84: 3f 92 push r3 31a86: 4f 92 push r4 31a88: 5f 92 push r5 31a8a: 6f 92 push r6 31a8c: 7f 92 push r7 31a8e: 8f 92 push r8 31a90: 9f 92 push r9 31a92: af 92 push r10 31a94: bf 92 push r11 31a96: cf 92 push r12 31a98: df 92 push r13 31a9a: ef 92 push r14 31a9c: ff 92 push r15 31a9e: 0f 93 push r16 31aa0: 1f 93 push r17 31aa2: cf 93 push r28 31aa4: df 93 push r29 31aa6: cd b7 in r28, 0x3d ; 61 31aa8: de b7 in r29, 0x3e ; 62 31aaa: cd 5b subi r28, 0xBD ; 189 31aac: d1 40 sbci r29, 0x01 ; 1 31aae: 0f b6 in r0, 0x3f ; 63 31ab0: f8 94 cli 31ab2: de bf out 0x3e, r29 ; 62 31ab4: 0f be out 0x3f, r0 ; 63 31ab6: cd bf out 0x3d, r28 ; 61 31ab8: c3 57 subi r28, 0x73 ; 115 31aba: de 4f sbci r29, 0xFE ; 254 31abc: 99 83 std Y+1, r25 ; 0x01 31abe: 88 83 st Y, r24 31ac0: cd 58 subi r28, 0x8D ; 141 31ac2: d1 40 sbci r29, 0x01 ; 1 31ac4: c1 57 subi r28, 0x71 ; 113 31ac6: de 4f sbci r29, 0xFE ; 254 31ac8: 79 83 std Y+1, r23 ; 0x01 31aca: 68 83 st Y, r22 31acc: cf 58 subi r28, 0x8F ; 143 31ace: d1 40 sbci r29, 0x01 ; 1 31ad0: ce 56 subi r28, 0x6E ; 110 31ad2: de 4f sbci r29, 0xFE ; 254 31ad4: 59 83 std Y+1, r21 ; 0x01 31ad6: 48 83 st Y, r20 31ad8: c2 59 subi r28, 0x92 ; 146 31ada: d1 40 sbci r29, 0x01 ; 1 31adc: 84 e1 ldi r24, 0x14 ; 20 31ade: cf 56 subi r28, 0x6F ; 111 31ae0: de 4f sbci r29, 0xFE ; 254 31ae2: 88 83 st Y, r24 31ae4: c1 59 subi r28, 0x91 ; 145 31ae6: 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; 31ae8: ce 56 subi r28, 0x6E ; 110 31aea: de 4f sbci r29, 0xFE ; 254 31aec: a8 81 ld r26, Y 31aee: b9 81 ldd r27, Y+1 ; 0x01 31af0: c2 59 subi r28, 0x92 ; 146 31af2: d1 40 sbci r29, 0x01 ; 1 31af4: 8d 91 ld r24, X+ 31af6: 9d 91 ld r25, X+ 31af8: 0d 90 ld r0, X+ 31afa: bc 91 ld r27, X 31afc: a0 2d mov r26, r0 31afe: c6 56 subi r28, 0x66 ; 102 31b00: de 4f sbci r29, 0xFE ; 254 31b02: 88 83 st Y, r24 31b04: 99 83 std Y+1, r25 ; 0x01 31b06: aa 83 std Y+2, r26 ; 0x02 31b08: bb 83 std Y+3, r27 ; 0x03 31b0a: ca 59 subi r28, 0x9A ; 154 31b0c: d1 40 sbci r29, 0x01 ; 1 31b0e: c1 57 subi r28, 0x71 ; 113 31b10: de 4f sbci r29, 0xFE ; 254 31b12: a8 81 ld r26, Y 31b14: b9 81 ldd r27, Y+1 ; 0x01 31b16: cf 58 subi r28, 0x8F ; 143 31b18: d1 40 sbci r29, 0x01 ; 1 31b1a: 8d 91 ld r24, X+ 31b1c: 9d 91 ld r25, X+ 31b1e: 0d 90 ld r0, X+ 31b20: bc 91 ld r27, X 31b22: a0 2d mov r26, r0 31b24: ca 54 subi r28, 0x4A ; 74 31b26: de 4f sbci r29, 0xFE ; 254 31b28: 88 83 st Y, r24 31b2a: 99 83 std Y+1, r25 ; 0x01 31b2c: aa 83 std Y+2, r26 ; 0x02 31b2e: bb 83 std Y+3, r27 ; 0x03 31b30: c6 5b subi r28, 0xB6 ; 182 31b32: d1 40 sbci r29, 0x01 ; 1 31b34: c3 57 subi r28, 0x73 ; 115 31b36: de 4f sbci r29, 0xFE ; 254 31b38: a8 81 ld r26, Y 31b3a: b9 81 ldd r27, Y+1 ; 0x01 31b3c: cd 58 subi r28, 0x8D ; 141 31b3e: d1 40 sbci r29, 0x01 ; 1 31b40: 8d 91 ld r24, X+ 31b42: 9d 91 ld r25, X+ 31b44: 0d 90 ld r0, X+ 31b46: bc 91 ld r27, X 31b48: a0 2d mov r26, r0 31b4a: c6 54 subi r28, 0x46 ; 70 31b4c: de 4f sbci r29, 0xFE ; 254 31b4e: 88 83 st Y, r24 31b50: 99 83 std Y+1, r25 ; 0x01 31b52: aa 83 std Y+2, r26 ; 0x02 31b54: bb 83 std Y+3, r27 ; 0x03 31b56: ca 5b subi r28, 0xBA ; 186 31b58: d1 40 sbci r29, 0x01 ; 1 31b5a: fe 01 movw r30, r28 31b5c: e7 5f subi r30, 0xF7 ; 247 31b5e: fe 4f sbci r31, 0xFE ; 254 31b60: c8 55 subi r28, 0x58 ; 88 31b62: de 4f sbci r29, 0xFE ; 254 31b64: f9 83 std Y+1, r31 ; 0x01 31b66: e8 83 st Y, r30 31b68: c8 5a subi r28, 0xA8 ; 168 31b6a: d1 40 sbci r29, 0x01 ; 1 31b6c: ce 01 movw r24, r28 31b6e: 8b 57 subi r24, 0x7B ; 123 31b70: 9f 4f sbci r25, 0xFF ; 255 31b72: ca 55 subi r28, 0x5A ; 90 31b74: de 4f sbci r29, 0xFE ; 254 31b76: 99 83 std Y+1, r25 ; 0x01 31b78: 88 83 st Y, r24 31b7a: c6 5a subi r28, 0xA6 ; 166 31b7c: d1 40 sbci r29, 0x01 ; 1 31b7e: de 01 movw r26, r28 31b80: 11 96 adiw r26, 0x01 ; 1 31b82: c8 56 subi r28, 0x68 ; 104 31b84: de 4f sbci r29, 0xFE ; 254 31b86: b9 83 std Y+1, r27 ; 0x01 31b88: a8 83 st Y, r26 31b8a: c8 59 subi r28, 0x98 ; 152 31b8c: d1 40 sbci r29, 0x01 ; 1 31b8e: 31 2c mov r3, r1 31b90: 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; 31b92: b1 01 movw r22, r2 31b94: 03 2c mov r0, r3 31b96: 00 0c add r0, r0 31b98: 88 0b sbc r24, r24 31b9a: 99 0b sbc r25, r25 31b9c: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 31ba0: 2a e1 ldi r18, 0x1A ; 26 31ba2: 38 ef ldi r19, 0xF8 ; 248 31ba4: 42 e4 ldi r20, 0x42 ; 66 31ba6: 5e e3 ldi r21, 0x3E ; 62 31ba8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31bac: 6b 01 movw r12, r22 31bae: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 31bb0: 0f 94 43 e2 call 0x3c486 ; 0x3c486 31bb4: c2 56 subi r28, 0x62 ; 98 31bb6: de 4f sbci r29, 0xFE ; 254 31bb8: 68 83 st Y, r22 31bba: 79 83 std Y+1, r23 ; 0x01 31bbc: 8a 83 std Y+2, r24 ; 0x02 31bbe: 9b 83 std Y+3, r25 ; 0x03 31bc0: ce 59 subi r28, 0x9E ; 158 31bc2: d1 40 sbci r29, 0x01 ; 1 31bc4: c7 01 movw r24, r14 31bc6: b6 01 movw r22, r12 31bc8: 0f 94 7d df call 0x3befa ; 0x3befa 31bcc: ce 55 subi r28, 0x5E ; 94 31bce: de 4f sbci r29, 0xFE ; 254 31bd0: 68 83 st Y, r22 31bd2: 79 83 std Y+1, r23 ; 0x01 31bd4: 8a 83 std Y+2, r24 ; 0x02 31bd6: 9b 83 std Y+3, r25 ; 0x03 31bd8: c2 5a subi r28, 0xA2 ; 162 31bda: d1 40 sbci r29, 0x01 ; 1 31bdc: 9b 01 movw r18, r22 31bde: ac 01 movw r20, r24 31be0: c6 56 subi r28, 0x66 ; 102 31be2: de 4f sbci r29, 0xFE ; 254 31be4: 68 81 ld r22, Y 31be6: 79 81 ldd r23, Y+1 ; 0x01 31be8: 8a 81 ldd r24, Y+2 ; 0x02 31bea: 9b 81 ldd r25, Y+3 ; 0x03 31bec: ca 59 subi r28, 0x9A ; 154 31bee: d1 40 sbci r29, 0x01 ; 1 31bf0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31bf4: c6 54 subi r28, 0x46 ; 70 31bf6: de 4f sbci r29, 0xFE ; 254 31bf8: 28 81 ld r18, Y 31bfa: 39 81 ldd r19, Y+1 ; 0x01 31bfc: 4a 81 ldd r20, Y+2 ; 0x02 31bfe: 5b 81 ldd r21, Y+3 ; 0x03 31c00: ca 5b subi r28, 0xBA ; 186 31c02: d1 40 sbci r29, 0x01 ; 1 31c04: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 31c08: 6b 01 movw r12, r22 31c0a: 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) 31c0c: 20 e0 ldi r18, 0x00 ; 0 31c0e: 30 e0 ldi r19, 0x00 ; 0 31c10: a9 01 movw r20, r18 31c12: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 31c16: 18 16 cp r1, r24 31c18: 0c f0 brlt .+2 ; 0x31c1c 31c1a: 7a c2 rjmp .+1268 ; 0x32110 // 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; 31c1c: c2 56 subi r28, 0x62 ; 98 31c1e: de 4f sbci r29, 0xFE ; 254 31c20: 28 81 ld r18, Y 31c22: 39 81 ldd r19, Y+1 ; 0x01 31c24: 4a 81 ldd r20, Y+2 ; 0x02 31c26: 5b 81 ldd r21, Y+3 ; 0x03 31c28: ce 59 subi r28, 0x9E ; 158 31c2a: d1 40 sbci r29, 0x01 ; 1 31c2c: c6 56 subi r28, 0x66 ; 102 31c2e: de 4f sbci r29, 0xFE ; 254 31c30: 68 81 ld r22, Y 31c32: 79 81 ldd r23, Y+1 ; 0x01 31c34: 8a 81 ldd r24, Y+2 ; 0x02 31c36: 9b 81 ldd r25, Y+3 ; 0x03 31c38: ca 59 subi r28, 0x9A ; 154 31c3a: d1 40 sbci r29, 0x01 ; 1 31c3c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31c40: ca 54 subi r28, 0x4A ; 74 31c42: de 4f sbci r29, 0xFE ; 254 31c44: 28 81 ld r18, Y 31c46: 39 81 ldd r19, Y+1 ; 0x01 31c48: 4a 81 ldd r20, Y+2 ; 0x02 31c4a: 5b 81 ldd r21, Y+3 ; 0x03 31c4c: c6 5b subi r28, 0xB6 ; 182 31c4e: d1 40 sbci r29, 0x01 ; 1 31c50: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 31c54: 4b 01 movw r8, r22 31c56: 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) 31c58: 20 e0 ldi r18, 0x00 ; 0 31c5a: 30 e0 ldi r19, 0x00 ; 0 31c5c: a9 01 movw r20, r18 31c5e: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 31c62: 18 16 cp r1, r24 31c64: 0c f0 brlt .+2 ; 0x31c68 31c66: 54 c2 rjmp .+1192 ; 0x32110 31c68: 20 e0 ldi r18, 0x00 ; 0 31c6a: 30 e0 ldi r19, 0x00 ; 0 31c6c: 48 ef ldi r20, 0xF8 ; 248 31c6e: 51 e4 ldi r21, 0x41 ; 65 31c70: c7 01 movw r24, r14 31c72: b6 01 movw r22, r12 31c74: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 31c78: 87 ff sbrs r24, 7 31c7a: 4a c2 rjmp .+1172 ; 0x32110 31c7c: 20 e0 ldi r18, 0x00 ; 0 31c7e: 30 e0 ldi r19, 0x00 ; 0 31c80: 48 ef ldi r20, 0xF8 ; 248 31c82: 51 e4 ldi r21, 0x41 ; 65 31c84: c5 01 movw r24, r10 31c86: b4 01 movw r22, r8 31c88: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 31c8c: 87 ff sbrs r24, 7 31c8e: 40 c2 rjmp .+1152 ; 0x32110 return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 31c90: c7 01 movw r24, r14 31c92: b6 01 movw r22, r12 31c94: 0f 94 2a e0 call 0x3c054 ; 0x3c054 31c98: 9b 01 movw r18, r22 31c9a: ac 01 movw r20, r24 31c9c: c7 01 movw r24, r14 31c9e: b6 01 movw r22, r12 31ca0: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 31ca4: 2b 01 movw r4, r22 31ca6: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 31ca8: c5 01 movw r24, r10 31caa: b4 01 movw r22, r8 31cac: 0f 94 2a e0 call 0x3c054 ; 0x3c054 31cb0: 9b 01 movw r18, r22 31cb2: ac 01 movw r20, r24 31cb4: c5 01 movw r24, r10 31cb6: b4 01 movw r22, r8 31cb8: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 31cbc: cc 56 subi r28, 0x6C ; 108 31cbe: de 4f sbci r29, 0xFE ; 254 31cc0: 68 83 st Y, r22 31cc2: 79 83 std Y+1, r23 ; 0x01 31cc4: 8a 83 std Y+2, r24 ; 0x02 31cc6: 9b 83 std Y+3, r25 ; 0x03 31cc8: c4 59 subi r28, 0x94 ; 148 31cca: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 31ccc: a3 01 movw r20, r6 31cce: 92 01 movw r18, r4 31cd0: 60 e0 ldi r22, 0x00 ; 0 31cd2: 70 e0 ldi r23, 0x00 ; 0 31cd4: 80 e8 ldi r24, 0x80 ; 128 31cd6: 9f e3 ldi r25, 0x3F ; 63 31cd8: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 31cdc: c2 55 subi r28, 0x52 ; 82 31cde: de 4f sbci r29, 0xFE ; 254 31ce0: 68 83 st Y, r22 31ce2: 79 83 std Y+1, r23 ; 0x01 31ce4: 8a 83 std Y+2, r24 ; 0x02 31ce6: 9b 83 std Y+3, r25 ; 0x03 31ce8: ce 5a subi r28, 0xAE ; 174 31cea: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 31cec: cc 56 subi r28, 0x6C ; 108 31cee: de 4f sbci r29, 0xFE ; 254 31cf0: 28 81 ld r18, Y 31cf2: 39 81 ldd r19, Y+1 ; 0x01 31cf4: 4a 81 ldd r20, Y+2 ; 0x02 31cf6: 5b 81 ldd r21, Y+3 ; 0x03 31cf8: c4 59 subi r28, 0x94 ; 148 31cfa: d1 40 sbci r29, 0x01 ; 1 31cfc: 60 e0 ldi r22, 0x00 ; 0 31cfe: 70 e0 ldi r23, 0x00 ; 0 31d00: 80 e8 ldi r24, 0x80 ; 128 31d02: 9f e3 ldi r25, 0x3F ; 63 31d04: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 31d08: ce 54 subi r28, 0x4E ; 78 31d0a: de 4f sbci r29, 0xFE ; 254 31d0c: 68 83 st Y, r22 31d0e: 79 83 std Y+1, r23 ; 0x01 31d10: 8a 83 std Y+2, r24 ; 0x02 31d12: 9b 83 std Y+3, r25 ; 0x03 31d14: c2 5b subi r28, 0xB2 ; 178 31d16: 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; 31d18: c7 01 movw r24, r14 31d1a: b6 01 movw r22, r12 31d1c: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 31d20: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 31d22: fb 01 movw r30, r22 31d24: 31 96 adiw r30, 0x01 ; 1 31d26: c6 55 subi r28, 0x56 ; 86 31d28: de 4f sbci r29, 0xFE ; 254 31d2a: f9 83 std Y+1, r31 ; 0x01 31d2c: e8 83 st Y, r30 31d2e: ca 5a subi r28, 0xAA ; 170 31d30: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 31d32: c5 01 movw r24, r10 31d34: b4 01 movw r22, r8 31d36: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 31d3a: 8b 01 movw r16, r22 31d3c: 95 e0 ldi r25, 0x05 ; 5 31d3e: 00 0f add r16, r16 31d40: 11 1f adc r17, r17 31d42: 9a 95 dec r25 31d44: e1 f7 brne .-8 ; 0x31d3e const uint16_t idx01 = c0 + 32 * r1; 31d46: c8 01 movw r24, r16 31d48: 80 96 adiw r24, 0x20 ; 32 31d4a: c4 55 subi r28, 0x54 ; 84 31d4c: de 4f sbci r29, 0xFE ; 254 31d4e: 99 83 std Y+1, r25 ; 0x01 31d50: 88 83 st Y, r24 31d52: cc 5a subi r28, 0xAC ; 172 31d54: 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]; 31d56: f8 01 movw r30, r16 31d58: ec 0d add r30, r12 31d5a: fd 1d adc r31, r13 31d5c: ea 58 subi r30, 0x8A ; 138 31d5e: f8 4f sbci r31, 0xF8 ; 248 31d60: 60 81 ld r22, Z 31d62: 70 e0 ldi r23, 0x00 ; 0 31d64: 90 e0 ldi r25, 0x00 ; 0 31d66: 80 e0 ldi r24, 0x00 ; 0 31d68: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 31d6c: 4b 01 movw r8, r22 31d6e: 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; 31d70: ce 54 subi r28, 0x4E ; 78 31d72: de 4f sbci r29, 0xFE ; 254 31d74: 28 81 ld r18, Y 31d76: 39 81 ldd r19, Y+1 ; 0x01 31d78: 4a 81 ldd r20, Y+2 ; 0x02 31d7a: 5b 81 ldd r21, Y+3 ; 0x03 31d7c: c2 5b subi r28, 0xB2 ; 178 31d7e: d1 40 sbci r29, 0x01 ; 1 31d80: c2 55 subi r28, 0x52 ; 82 31d82: de 4f sbci r29, 0xFE ; 254 31d84: 68 81 ld r22, Y 31d86: 79 81 ldd r23, Y+1 ; 0x01 31d88: 8a 81 ldd r24, Y+2 ; 0x02 31d8a: 9b 81 ldd r25, Y+3 ; 0x03 31d8c: ce 5a subi r28, 0xAE ; 174 31d8e: d1 40 sbci r29, 0x01 ; 1 31d90: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31d94: 9b 01 movw r18, r22 31d96: 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]; 31d98: c5 01 movw r24, r10 31d9a: b4 01 movw r22, r8 31d9c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31da0: 4b 01 movw r8, r22 31da2: 5c 01 movw r10, r24 31da4: c4 55 subi r28, 0x54 ; 84 31da6: de 4f sbci r29, 0xFE ; 254 31da8: e8 81 ld r30, Y 31daa: f9 81 ldd r31, Y+1 ; 0x01 31dac: cc 5a subi r28, 0xAC ; 172 31dae: d1 40 sbci r29, 0x01 ; 1 31db0: ec 0d add r30, r12 31db2: fd 1d adc r31, r13 31db4: ea 58 subi r30, 0x8A ; 138 31db6: f8 4f sbci r31, 0xF8 ; 248 31db8: 60 81 ld r22, Z 31dba: 70 e0 ldi r23, 0x00 ; 0 31dbc: 90 e0 ldi r25, 0x00 ; 0 31dbe: 80 e0 ldi r24, 0x00 ; 0 31dc0: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 31dc4: 6b 01 movw r12, r22 31dc6: 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; 31dc8: c2 55 subi r28, 0x52 ; 82 31dca: de 4f sbci r29, 0xFE ; 254 31dcc: 28 81 ld r18, Y 31dce: 39 81 ldd r19, Y+1 ; 0x01 31dd0: 4a 81 ldd r20, Y+2 ; 0x02 31dd2: 5b 81 ldd r21, Y+3 ; 0x03 31dd4: ce 5a subi r28, 0xAE ; 174 31dd6: d1 40 sbci r29, 0x01 ; 1 31dd8: cc 56 subi r28, 0x6C ; 108 31dda: de 4f sbci r29, 0xFE ; 254 31ddc: 68 81 ld r22, Y 31dde: 79 81 ldd r23, Y+1 ; 0x01 31de0: 8a 81 ldd r24, Y+2 ; 0x02 31de2: 9b 81 ldd r25, Y+3 ; 0x03 31de4: c4 59 subi r28, 0x94 ; 148 31de6: d1 40 sbci r29, 0x01 ; 1 31de8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31dec: 9b 01 movw r18, r22 31dee: 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]; 31df0: c7 01 movw r24, r14 31df2: b6 01 movw r22, r12 31df4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31df8: 9b 01 movw r18, r22 31dfa: ac 01 movw r20, r24 31dfc: c5 01 movw r24, r10 31dfe: b4 01 movw r22, r8 31e00: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 31e04: 6b 01 movw r12, r22 31e06: 7c 01 movw r14, r24 31e08: c6 55 subi r28, 0x56 ; 86 31e0a: de 4f sbci r29, 0xFE ; 254 31e0c: a8 81 ld r26, Y 31e0e: b9 81 ldd r27, Y+1 ; 0x01 31e10: ca 5a subi r28, 0xAA ; 170 31e12: d1 40 sbci r29, 0x01 ; 1 31e14: 0a 0f add r16, r26 31e16: 1b 1f adc r17, r27 31e18: f8 01 movw r30, r16 31e1a: ea 58 subi r30, 0x8A ; 138 31e1c: f8 4f sbci r31, 0xF8 ; 248 31e1e: 60 81 ld r22, Z 31e20: 70 e0 ldi r23, 0x00 ; 0 31e22: 90 e0 ldi r25, 0x00 ; 0 31e24: 80 e0 ldi r24, 0x00 ; 0 31e26: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 31e2a: 4b 01 movw r8, r22 31e2c: 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; 31e2e: ce 54 subi r28, 0x4E ; 78 31e30: de 4f sbci r29, 0xFE ; 254 31e32: 28 81 ld r18, Y 31e34: 39 81 ldd r19, Y+1 ; 0x01 31e36: 4a 81 ldd r20, Y+2 ; 0x02 31e38: 5b 81 ldd r21, Y+3 ; 0x03 31e3a: c2 5b subi r28, 0xB2 ; 178 31e3c: d1 40 sbci r29, 0x01 ; 1 31e3e: c3 01 movw r24, r6 31e40: b2 01 movw r22, r4 31e42: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31e46: 9b 01 movw r18, r22 31e48: 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]; 31e4a: c5 01 movw r24, r10 31e4c: b4 01 movw r22, r8 31e4e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31e52: 9b 01 movw r18, r22 31e54: ac 01 movw r20, r24 31e56: c7 01 movw r24, r14 31e58: b6 01 movw r22, r12 31e5a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 31e5e: 6b 01 movw r12, r22 31e60: 7c 01 movw r14, r24 31e62: c6 55 subi r28, 0x56 ; 86 31e64: de 4f sbci r29, 0xFE ; 254 31e66: e8 81 ld r30, Y 31e68: f9 81 ldd r31, Y+1 ; 0x01 31e6a: ca 5a subi r28, 0xAA ; 170 31e6c: d1 40 sbci r29, 0x01 ; 1 31e6e: c4 55 subi r28, 0x54 ; 84 31e70: de 4f sbci r29, 0xFE ; 254 31e72: 88 81 ld r24, Y 31e74: 99 81 ldd r25, Y+1 ; 0x01 31e76: cc 5a subi r28, 0xAC ; 172 31e78: d1 40 sbci r29, 0x01 ; 1 31e7a: e8 0f add r30, r24 31e7c: f9 1f adc r31, r25 31e7e: ea 58 subi r30, 0x8A ; 138 31e80: f8 4f sbci r31, 0xF8 ; 248 31e82: 60 81 ld r22, Z 31e84: 70 e0 ldi r23, 0x00 ; 0 31e86: 90 e0 ldi r25, 0x00 ; 0 31e88: 80 e0 ldi r24, 0x00 ; 0 31e8a: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 31e8e: 4b 01 movw r8, r22 31e90: 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; 31e92: cc 56 subi r28, 0x6C ; 108 31e94: de 4f sbci r29, 0xFE ; 254 31e96: 28 81 ld r18, Y 31e98: 39 81 ldd r19, Y+1 ; 0x01 31e9a: 4a 81 ldd r20, Y+2 ; 0x02 31e9c: 5b 81 ldd r21, Y+3 ; 0x03 31e9e: c4 59 subi r28, 0x94 ; 148 31ea0: d1 40 sbci r29, 0x01 ; 1 31ea2: c3 01 movw r24, r6 31ea4: b2 01 movw r22, r4 31ea6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31eaa: 9b 01 movw r18, r22 31eac: 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]; 31eae: c5 01 movw r24, r10 31eb0: b4 01 movw r22, r8 31eb2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31eb6: 9b 01 movw r18, r22 31eb8: ac 01 movw r20, r24 31eba: c7 01 movw r24, r14 31ebc: b6 01 movw r22, r12 31ebe: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__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; 31ec2: 20 e0 ldi r18, 0x00 ; 0 31ec4: 30 e0 ldi r19, 0x00 ; 0 31ec6: 40 e0 ldi r20, 0x00 ; 0 31ec8: 52 e4 ldi r21, 0x42 ; 66 31eca: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 31ece: 6b 01 movw r12, r22 31ed0: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 31ed2: ac 01 movw r20, r24 31ed4: 9b 01 movw r18, r22 31ed6: ce 55 subi r28, 0x5E ; 94 31ed8: de 4f sbci r29, 0xFE ; 254 31eda: 68 81 ld r22, Y 31edc: 79 81 ldd r23, Y+1 ; 0x01 31ede: 8a 81 ldd r24, Y+2 ; 0x02 31ee0: 9b 81 ldd r25, Y+3 ; 0x03 31ee2: c2 5a subi r28, 0xA2 ; 162 31ee4: d1 40 sbci r29, 0x01 ; 1 31ee6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31eea: c8 55 subi r28, 0x58 ; 88 31eec: de 4f sbci r29, 0xFE ; 254 31eee: a8 81 ld r26, Y 31ef0: b9 81 ldd r27, Y+1 ; 0x01 31ef2: c8 5a subi r28, 0xA8 ; 168 31ef4: d1 40 sbci r29, 0x01 ; 1 31ef6: 6d 93 st X+, r22 31ef8: 7d 93 st X+, r23 31efa: 8d 93 st X+, r24 31efc: 9d 93 st X+, r25 31efe: c8 55 subi r28, 0x58 ; 88 31f00: de 4f sbci r29, 0xFE ; 254 31f02: b9 83 std Y+1, r27 ; 0x01 31f04: a8 83 st Y, r26 31f06: c8 5a subi r28, 0xA8 ; 168 31f08: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 31f0a: a7 01 movw r20, r14 31f0c: 96 01 movw r18, r12 31f0e: c2 56 subi r28, 0x62 ; 98 31f10: de 4f sbci r29, 0xFE ; 254 31f12: 68 81 ld r22, Y 31f14: 79 81 ldd r23, Y+1 ; 0x01 31f16: 8a 81 ldd r24, Y+2 ; 0x02 31f18: 9b 81 ldd r25, Y+3 ; 0x03 31f1a: ce 59 subi r28, 0x9E ; 158 31f1c: d1 40 sbci r29, 0x01 ; 1 31f1e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 31f22: ca 55 subi r28, 0x5A ; 90 31f24: de 4f sbci r29, 0xFE ; 254 31f26: e8 81 ld r30, Y 31f28: f9 81 ldd r31, Y+1 ; 0x01 31f2a: c6 5a subi r28, 0xA6 ; 166 31f2c: d1 40 sbci r29, 0x01 ; 1 31f2e: 61 93 st Z+, r22 31f30: 71 93 st Z+, r23 31f32: 81 93 st Z+, r24 31f34: 91 93 st Z+, r25 31f36: ca 55 subi r28, 0x5A ; 90 31f38: de 4f sbci r29, 0xFE ; 254 31f3a: f9 83 std Y+1, r31 ; 0x01 31f3c: e8 83 st Y, r30 31f3e: c6 5a subi r28, 0xA6 ; 166 31f40: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 31f42: c8 56 subi r28, 0x68 ; 104 31f44: de 4f sbci r29, 0xFE ; 254 31f46: a8 81 ld r26, Y 31f48: b9 81 ldd r27, Y+1 ; 0x01 31f4a: c8 59 subi r28, 0x98 ; 152 31f4c: d1 40 sbci r29, 0x01 ; 1 31f4e: cd 92 st X+, r12 31f50: dd 92 st X+, r13 31f52: ed 92 st X+, r14 31f54: fd 92 st X+, r15 31f56: c8 56 subi r28, 0x68 ; 104 31f58: de 4f sbci r29, 0xFE ; 254 31f5a: b9 83 std Y+1, r27 ; 0x01 31f5c: a8 83 st Y, r26 31f5e: c8 59 subi r28, 0x98 ; 152 31f60: d1 40 sbci r29, 0x01 ; 1 31f62: bf ef ldi r27, 0xFF ; 255 31f64: 2b 1a sub r2, r27 31f66: 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){ 31f68: e1 e2 ldi r30, 0x21 ; 33 31f6a: 2e 16 cp r2, r30 31f6c: 31 04 cpc r3, r1 31f6e: 09 f0 breq .+2 ; 0x31f72 31f70: 10 ce rjmp .-992 ; 0x31b92 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); 31f72: 40 e0 ldi r20, 0x00 ; 0 31f74: 50 e0 ldi r21, 0x00 ; 0 31f76: 60 e0 ldi r22, 0x00 ; 0 31f78: 7d e3 ldi r23, 0x3D ; 61 31f7a: ce 01 movw r24, r28 31f7c: 87 5f subi r24, 0xF7 ; 247 31f7e: 9e 4f sbci r25, 0xFE ; 254 31f80: 0f 94 bb 6e call 0x2dd76 ; 0x2dd76 31f84: 9b 01 movw r18, r22 31f86: ac 01 movw r20, r24 31f88: c3 57 subi r28, 0x73 ; 115 31f8a: de 4f sbci r29, 0xFE ; 254 31f8c: a8 81 ld r26, Y 31f8e: b9 81 ldd r27, Y+1 ; 0x01 31f90: cd 58 subi r28, 0x8D ; 141 31f92: d1 40 sbci r29, 0x01 ; 1 31f94: 6d 91 ld r22, X+ 31f96: 7d 91 ld r23, X+ 31f98: 8d 91 ld r24, X+ 31f9a: 9c 91 ld r25, X 31f9c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 31fa0: c3 57 subi r28, 0x73 ; 115 31fa2: de 4f sbci r29, 0xFE ; 254 31fa4: e8 81 ld r30, Y 31fa6: f9 81 ldd r31, Y+1 ; 0x01 31fa8: cd 58 subi r28, 0x8D ; 141 31faa: d1 40 sbci r29, 0x01 ; 1 31fac: 60 83 st Z, r22 31fae: 71 83 std Z+1, r23 ; 0x01 31fb0: 82 83 std Z+2, r24 ; 0x02 31fb2: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 31fb4: 40 e0 ldi r20, 0x00 ; 0 31fb6: 50 e0 ldi r21, 0x00 ; 0 31fb8: 60 e0 ldi r22, 0x00 ; 0 31fba: 7d e3 ldi r23, 0x3D ; 61 31fbc: ce 01 movw r24, r28 31fbe: 8b 57 subi r24, 0x7B ; 123 31fc0: 9f 4f sbci r25, 0xFF ; 255 31fc2: 0f 94 bb 6e call 0x2dd76 ; 0x2dd76 31fc6: 9b 01 movw r18, r22 31fc8: ac 01 movw r20, r24 31fca: c1 57 subi r28, 0x71 ; 113 31fcc: de 4f sbci r29, 0xFE ; 254 31fce: a8 81 ld r26, Y 31fd0: b9 81 ldd r27, Y+1 ; 0x01 31fd2: cf 58 subi r28, 0x8F ; 143 31fd4: d1 40 sbci r29, 0x01 ; 1 31fd6: 6d 91 ld r22, X+ 31fd8: 7d 91 ld r23, X+ 31fda: 8d 91 ld r24, X+ 31fdc: 9c 91 ld r25, X 31fde: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 31fe2: c1 57 subi r28, 0x71 ; 113 31fe4: de 4f sbci r29, 0xFE ; 254 31fe6: e8 81 ld r30, Y 31fe8: f9 81 ldd r31, Y+1 ; 0x01 31fea: cf 58 subi r28, 0x8F ; 143 31fec: d1 40 sbci r29, 0x01 ; 1 31fee: 60 83 st Z, r22 31ff0: 71 83 std Z+1, r23 ; 0x01 31ff2: 82 83 std Z+2, r24 ; 0x02 31ff4: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 31ff6: 40 e0 ldi r20, 0x00 ; 0 31ff8: 50 e0 ldi r21, 0x00 ; 0 31ffa: 60 e8 ldi r22, 0x80 ; 128 31ffc: 7c e3 ldi r23, 0x3C ; 60 31ffe: ce 01 movw r24, r28 32000: 01 96 adiw r24, 0x01 ; 1 32002: 0f 94 bb 6e call 0x2dd76 ; 0x2dd76 32006: ce 56 subi r28, 0x6E ; 110 32008: de 4f sbci r29, 0xFE ; 254 3200a: a8 81 ld r26, Y 3200c: b9 81 ldd r27, Y+1 ; 0x01 3200e: c2 59 subi r28, 0x92 ; 146 32010: d1 40 sbci r29, 0x01 ; 1 32012: 2d 91 ld r18, X+ 32014: 3d 91 ld r19, X+ 32016: 4d 91 ld r20, X+ 32018: 5c 91 ld r21, X 3201a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3201e: 16 2f mov r17, r22 32020: 07 2f mov r16, r23 32022: f8 2e mov r15, r24 32024: e9 2e mov r14, r25 r = MAX(2, r); 32026: 20 e0 ldi r18, 0x00 ; 0 32028: 30 e0 ldi r19, 0x00 ; 0 3202a: 40 e0 ldi r20, 0x00 ; 0 3202c: 50 e4 ldi r21, 0x40 ; 64 3202e: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 32032: 18 16 cp r1, r24 32034: 2c f0 brlt .+10 ; 0x32040 32036: 10 e0 ldi r17, 0x00 ; 0 32038: 00 e0 ldi r16, 0x00 ; 0 3203a: f1 2c mov r15, r1 3203c: 80 e4 ldi r24, 0x40 ; 64 3203e: e8 2e mov r14, r24 32040: a8 01 movw r20, r16 32042: 97 01 movw r18, r14 32044: 85 2f mov r24, r21 32046: 90 2f mov r25, r16 32048: a3 2f mov r26, r19 3204a: be 2d mov r27, r14 3204c: ce 56 subi r28, 0x6E ; 110 3204e: de 4f sbci r29, 0xFE ; 254 32050: e8 81 ld r30, Y 32052: f9 81 ldd r31, Y+1 ; 0x01 32054: c2 59 subi r28, 0x92 ; 146 32056: d1 40 sbci r29, 0x01 ; 1 32058: 80 83 st Z, r24 3205a: 91 83 std Z+1, r25 ; 0x01 3205c: a2 83 std Z+2, r26 ; 0x02 3205e: b3 83 std Z+3, r27 ; 0x03 32060: cf 56 subi r28, 0x6F ; 111 32062: de 4f sbci r29, 0xFE ; 254 32064: f8 81 ld r31, Y 32066: c1 59 subi r28, 0x91 ; 145 32068: d1 40 sbci r29, 0x01 ; 1 3206a: f1 50 subi r31, 0x01 ; 1 3206c: cf 56 subi r28, 0x6F ; 111 3206e: de 4f sbci r29, 0xFE ; 254 32070: f8 83 st Y, r31 32072: c1 59 subi r28, 0x91 ; 145 32074: 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){ 32076: f1 11 cpse r31, r1 32078: 37 cd rjmp .-1426 ; 0x31ae8 r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 3207a: ef 92 push r14 3207c: ff 92 push r15 3207e: 0f 93 push r16 32080: 1f 93 push r17 32082: c1 57 subi r28, 0x71 ; 113 32084: de 4f sbci r29, 0xFE ; 254 32086: a8 81 ld r26, Y 32088: b9 81 ldd r27, Y+1 ; 0x01 3208a: cf 58 subi r28, 0x8F ; 143 3208c: d1 40 sbci r29, 0x01 ; 1 3208e: 13 96 adiw r26, 0x03 ; 3 32090: 8c 91 ld r24, X 32092: 13 97 sbiw r26, 0x03 ; 3 32094: 8f 93 push r24 32096: 12 96 adiw r26, 0x02 ; 2 32098: 8c 91 ld r24, X 3209a: 12 97 sbiw r26, 0x02 ; 2 3209c: 8f 93 push r24 3209e: 11 96 adiw r26, 0x01 ; 1 320a0: 8c 91 ld r24, X 320a2: 11 97 sbiw r26, 0x01 ; 1 320a4: 8f 93 push r24 320a6: 8c 91 ld r24, X 320a8: 8f 93 push r24 320aa: c3 57 subi r28, 0x73 ; 115 320ac: de 4f sbci r29, 0xFE ; 254 320ae: e8 81 ld r30, Y 320b0: f9 81 ldd r31, Y+1 ; 0x01 320b2: cd 58 subi r28, 0x8D ; 141 320b4: d1 40 sbci r29, 0x01 ; 1 320b6: 83 81 ldd r24, Z+3 ; 0x03 320b8: 8f 93 push r24 320ba: 82 81 ldd r24, Z+2 ; 0x02 320bc: 8f 93 push r24 320be: 81 81 ldd r24, Z+1 ; 0x01 320c0: 8f 93 push r24 320c2: 80 81 ld r24, Z 320c4: 8f 93 push r24 320c6: 83 e3 ldi r24, 0x33 ; 51 320c8: 96 ea ldi r25, 0xA6 ; 166 320ca: 9f 93 push r25 320cc: 8f 93 push r24 320ce: 0f 94 1d dc call 0x3b83a ; 0x3b83a 320d2: 0f b6 in r0, 0x3f ; 63 320d4: f8 94 cli 320d6: de bf out 0x3e, r29 ; 62 320d8: 0f be out 0x3f, r0 ; 63 320da: cd bf out 0x3d, r28 ; 61 } 320dc: c3 54 subi r28, 0x43 ; 67 320de: de 4f sbci r29, 0xFE ; 254 320e0: 0f b6 in r0, 0x3f ; 63 320e2: f8 94 cli 320e4: de bf out 0x3e, r29 ; 62 320e6: 0f be out 0x3f, r0 ; 63 320e8: cd bf out 0x3d, r28 ; 61 320ea: df 91 pop r29 320ec: cf 91 pop r28 320ee: 1f 91 pop r17 320f0: 0f 91 pop r16 320f2: ff 90 pop r15 320f4: ef 90 pop r14 320f6: df 90 pop r13 320f8: cf 90 pop r12 320fa: bf 90 pop r11 320fc: af 90 pop r10 320fe: 9f 90 pop r9 32100: 8f 90 pop r8 32102: 7f 90 pop r7 32104: 6f 90 pop r6 32106: 5f 90 pop r5 32108: 4f 90 pop r4 3210a: 3f 90 pop r3 3210c: 2f 90 pop r2 3210e: 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; 32110: 60 e0 ldi r22, 0x00 ; 0 32112: 70 e0 ldi r23, 0x00 ; 0 32114: cb 01 movw r24, r22 32116: d5 ce rjmp .-598 ; 0x31ec2 00032118 : } /// 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){ 32118: 2f 92 push r2 3211a: 3f 92 push r3 3211c: 4f 92 push r4 3211e: 5f 92 push r5 32120: 6f 92 push r6 32122: 7f 92 push r7 32124: 8f 92 push r8 32126: 9f 92 push r9 32128: af 92 push r10 3212a: bf 92 push r11 3212c: cf 92 push r12 3212e: df 92 push r13 32130: ef 92 push r14 32132: ff 92 push r15 32134: 0f 93 push r16 32136: 1f 93 push r17 32138: cf 93 push r28 3213a: df 93 push r29 3213c: 00 d0 rcall .+0 ; 0x3213e 3213e: 1f 92 push r1 32140: 1f 92 push r1 32142: cd b7 in r28, 0x3d ; 61 32144: de b7 in r29, 0x3e ; 62 32146: 2b 01 movw r4, r22 32148: 1a 01 movw r2, r20 3214a: f1 2c mov r15, r1 3214c: 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; 3214e: 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; 32150: 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; 32152: 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){ 32154: 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); 32156: 66 24 eor r6, r6 32158: 63 94 inc r6 3215a: 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){ 3215c: 70 e0 ldi r23, 0x00 ; 0 3215e: 60 e0 ldi r22, 0x00 ; 0 32160: 97 01 movw r18, r14 32162: 2a 58 subi r18, 0x8A ; 138 32164: 38 4f sbci r19, 0xF8 ; 248 32166: 3a 83 std Y+2, r19 ; 0x02 32168: 29 83 std Y+1, r18 ; 0x01 3216a: 86 2e mov r8, r22 3216c: c9 80 ldd r12, Y+1 ; 0x01 3216e: da 80 ldd r13, Y+2 ; 0x02 32170: c6 0e add r12, r22 32172: d7 1e adc r13, r23 32174: 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; 32176: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 32178: 40 e0 ldi r20, 0x00 ; 0 3217a: 30 e0 ldi r19, 0x00 ; 0 3217c: 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; 3217e: ae ef ldi r26, 0xFE ; 254 32180: a4 0f add r26, r20 32182: 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; 32184: 44 23 and r20, r20 32186: 19 f0 breq .+6 ; 0x3218e 32188: 4b 30 cpi r20, 0x0B ; 11 3218a: 09 f0 breq .+2 ; 0x3218e 3218c: 7d c0 rjmp .+250 ; 0x32288 3218e: ae ef ldi r26, 0xFE ; 254 32190: a2 0f add r26, r18 32192: a8 30 cpi r26, 0x08 ; 8 32194: 08 f4 brcc .+2 ; 0x32198 32196: 7a c0 rjmp .+244 ; 0x3228c 32198: 2f 5f subi r18, 0xFF ; 255 3219a: 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){ 3219c: 2c 30 cpi r18, 0x0C ; 12 3219e: 31 05 cpc r19, r1 321a0: 89 f7 brne .-30 ; 0x32184 /// 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){ 321a2: 4f 5f subi r20, 0xFF ; 255 321a4: 20 e2 ldi r18, 0x20 ; 32 321a6: c2 0e add r12, r18 321a8: d1 1c adc r13, r1 321aa: 32 96 adiw r30, 0x02 ; 2 321ac: 4c 30 cpi r20, 0x0C ; 12 321ae: 29 f7 brne .-54 ; 0x3217a // 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){ 321b0: 3c 81 ldd r19, Y+4 ; 0x04 321b2: 30 17 cp r19, r16 321b4: 18 f4 brcc .+6 ; 0x321bc 321b6: 0c 83 std Y+4, r16 ; 0x04 321b8: 5d 83 std Y+5, r21 ; 0x05 321ba: 18 2d mov r17, r8 321bc: 6f 5f subi r22, 0xFF ; 255 321be: 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){ 321c0: 64 31 cpi r22, 0x14 ; 20 321c2: 71 05 cpc r23, r1 321c4: 91 f6 brne .-92 ; 0x3216a 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){ 321c6: 5f 5f subi r21, 0xFF ; 255 321c8: a0 e2 ldi r26, 0x20 ; 32 321ca: ea 0e add r14, r26 321cc: f1 1c adc r15, r1 321ce: 54 31 cpi r21, 0x14 ; 20 321d0: 29 f6 brne .-118 ; 0x3215c // 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); 321d2: ec 81 ldd r30, Y+4 ; 0x04 321d4: 6e 2f mov r22, r30 321d6: 70 e0 ldi r23, 0x00 ; 0 321d8: 90 e0 ldi r25, 0x00 ; 0 321da: 80 e0 ldi r24, 0x00 ; 0 321dc: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 321e0: 23 ec ldi r18, 0xC3 ; 195 321e2: 35 ef ldi r19, 0xF5 ; 245 321e4: 48 ea ldi r20, 0xA8 ; 168 321e6: 5f e3 ldi r21, 0x3F ; 63 321e8: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 321ec: 9f 93 push r25 321ee: 8f 93 push r24 321f0: 7f 93 push r23 321f2: 6f 93 push r22 321f4: fd 81 ldd r31, Y+5 ; 0x05 321f6: 6f 2f mov r22, r31 321f8: 70 e0 ldi r23, 0x00 ; 0 321fa: 90 e0 ldi r25, 0x00 ; 0 321fc: 80 e0 ldi r24, 0x00 ; 0 321fe: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 32202: 20 e0 ldi r18, 0x00 ; 0 32204: 30 e0 ldi r19, 0x00 ; 0 32206: 40 eb ldi r20, 0xB0 ; 176 32208: 50 e4 ldi r21, 0x40 ; 64 3220a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3220e: 9f 93 push r25 32210: 8f 93 push r24 32212: 7f 93 push r23 32214: 6f 93 push r22 32216: 61 2f mov r22, r17 32218: 70 e0 ldi r23, 0x00 ; 0 3221a: 90 e0 ldi r25, 0x00 ; 0 3221c: 80 e0 ldi r24, 0x00 ; 0 3221e: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 32222: 20 e0 ldi r18, 0x00 ; 0 32224: 30 e0 ldi r19, 0x00 ; 0 32226: 40 eb ldi r20, 0xB0 ; 176 32228: 50 e4 ldi r21, 0x40 ; 64 3222a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3222e: 9f 93 push r25 32230: 8f 93 push r24 32232: 7f 93 push r23 32234: 6f 93 push r22 32236: 8f e0 ldi r24, 0x0F ; 15 32238: 96 ea ldi r25, 0xA6 ; 166 3223a: 9f 93 push r25 3223c: 8f 93 push r24 3223e: 0f 94 1d dc call 0x3b83a ; 0x3b83a *pc = max_c; 32242: f2 01 movw r30, r4 32244: 10 83 st Z, r17 *pr = max_r; 32246: 2d 81 ldd r18, Y+5 ; 0x05 32248: f1 01 movw r30, r2 3224a: 20 83 st Z, r18 3224c: 0f b6 in r0, 0x3f ; 63 3224e: f8 94 cli 32250: de bf out 0x3e, r29 ; 62 32252: 0f be out 0x3f, r0 ; 63 32254: cd bf out 0x3d, r28 ; 61 return max_match; } 32256: 8c 81 ldd r24, Y+4 ; 0x04 32258: 0f 90 pop r0 3225a: 0f 90 pop r0 3225c: 0f 90 pop r0 3225e: 0f 90 pop r0 32260: 0f 90 pop r0 32262: df 91 pop r29 32264: cf 91 pop r28 32266: 1f 91 pop r17 32268: 0f 91 pop r16 3226a: ff 90 pop r15 3226c: ef 90 pop r14 3226e: df 90 pop r13 32270: cf 90 pop r12 32272: bf 90 pop r11 32274: af 90 pop r10 32276: 9f 90 pop r9 32278: 8f 90 pop r8 3227a: 7f 90 pop r7 3227c: 6f 90 pop r6 3227e: 5f 90 pop r5 32280: 4f 90 pop r4 32282: 3f 90 pop r3 32284: 2f 90 pop r2 32286: 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; 32288: 22 23 and r18, r18 3228a: 11 f0 breq .+4 ; 0x32290 3228c: 2b 30 cpi r18, 0x0B ; 11 3228e: 21 f4 brne .+8 ; 0x32298 32290: ab 81 ldd r26, Y+3 ; 0x03 32292: a8 30 cpi r26, 0x08 ; 8 32294: 08 f0 brcs .+2 ; 0x32298 32296: 80 cf rjmp .-256 ; 0x32198 const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 32298: 99 24 eor r9, r9 3229a: 93 94 inc r9 3229c: d6 01 movw r26, r12 3229e: a2 0f add r26, r18 322a0: b3 1f adc r27, r19 322a2: ac 91 ld r26, X 322a4: a1 31 cpi r26, 0x11 ; 17 322a6: 08 f4 brcc .+2 ; 0x322aa 322a8: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 322aa: a0 80 ld r10, Z 322ac: b1 80 ldd r11, Z+1 ; 0x01 322ae: d3 01 movw r26, r6 322b0: 02 2e mov r0, r18 322b2: 02 c0 rjmp .+4 ; 0x322b8 322b4: aa 0f add r26, r26 322b6: bb 1f adc r27, r27 322b8: 0a 94 dec r0 322ba: e2 f7 brpl .-8 ; 0x322b4 322bc: aa 21 and r26, r10 322be: bb 21 and r27, r11 322c0: bb 24 eor r11, r11 322c2: b3 94 inc r11 322c4: ab 2b or r26, r27 322c6: 09 f4 brne .+2 ; 0x322ca 322c8: b1 2c mov r11, r1 if (high_pix == high_pat) 322ca: 9b 10 cpse r9, r11 322cc: 65 cf rjmp .-310 ; 0x32198 match++; 322ce: 0f 5f subi r16, 0xFF ; 255 322d0: 63 cf rjmp .-314 ; 0x32198 000322d2 : 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){ 322d2: 2f 92 push r2 322d4: 3f 92 push r3 322d6: 4f 92 push r4 322d8: 5f 92 push r5 322da: 6f 92 push r6 322dc: 7f 92 push r7 322de: 8f 92 push r8 322e0: 9f 92 push r9 322e2: af 92 push r10 322e4: bf 92 push r11 322e6: cf 92 push r12 322e8: df 92 push r13 322ea: ef 92 push r14 322ec: ff 92 push r15 322ee: 0f 93 push r16 322f0: 1f 93 push r17 322f2: cf 93 push r28 322f4: df 93 push r29 322f6: cd b7 in r28, 0x3d ; 61 322f8: de b7 in r29, 0x3e ; 62 322fa: ca 55 subi r28, 0x5A ; 90 322fc: d1 09 sbc r29, r1 322fe: 0f b6 in r0, 0x3f ; 63 32300: f8 94 cli 32302: de bf out 0x3e, r29 ; 62 32304: 0f be out 0x3f, r0 ; 63 32306: cd bf out 0x3d, r28 ; 61 32308: 63 96 adiw r28, 0x13 ; 19 3230a: 9f af std Y+63, r25 ; 0x3f 3230c: 8e af std Y+62, r24 ; 0x3e 3230e: 63 97 sbiw r28, 0x13 ; 19 32310: 8b 01 movw r16, r22 32312: 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 32314: 7e 01 movw r14, r28 32316: 25 e4 ldi r18, 0x45 ; 69 32318: e2 0e add r14, r18 3231a: f1 1c adc r15, r1 3231c: 80 e1 ldi r24, 0x10 ; 16 3231e: 97 e2 ldi r25, 0x27 ; 39 32320: f7 01 movw r30, r14 32322: 91 83 std Z+1, r25 ; 0x01 32324: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 32326: 8e ef ldi r24, 0xFE ; 254 32328: 95 ea ldi r25, 0xA5 ; 165 3232a: 9f 93 push r25 3232c: 8f 93 push r24 3232e: 0f 94 1d dc call 0x3b83a ; 0x3b83a 32332: 26 e7 ldi r18, 0x76 ; 118 32334: 37 e0 ldi r19, 0x07 ; 7 32336: 61 96 adiw r28, 0x11 ; 17 32338: 3f af std Y+63, r19 ; 0x3f 3233a: 2e af std Y+62, r18 ; 0x3e 3233c: 61 97 sbiw r28, 0x11 ; 17 3233e: c8 01 movw r24, r16 32340: 80 5e subi r24, 0xE0 ; 224 32342: 93 40 sbci r25, 0x03 ; 3 32344: 2b 96 adiw r28, 0x0b ; 11 32346: 9f af std Y+63, r25 ; 0x3f 32348: 8e af std Y+62, r24 ; 0x3e 3234a: 2b 97 sbiw r28, 0x0b ; 11 3234c: 0f 90 pop r0 3234e: 0f 90 pop r0 32350: e0 e4 ldi r30, 0x40 ; 64 32352: f0 e0 ldi r31, 0x00 ; 0 32354: 29 96 adiw r28, 0x09 ; 9 32356: ff af std Y+63, r31 ; 0x3f 32358: ee af std Y+62, r30 ; 0x3e 3235a: 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); 3235c: 63 96 adiw r28, 0x13 ; 19 3235e: 2e ad ldd r18, Y+62 ; 0x3e 32360: 3f ad ldd r19, Y+63 ; 0x3f 32362: 63 97 sbiw r28, 0x13 ; 19 32364: 20 5e subi r18, 0xE0 ; 224 32366: 33 40 sbci r19, 0x03 ; 3 32368: 69 96 adiw r28, 0x19 ; 25 3236a: 3f af std Y+63, r19 ; 0x3f 3236c: 2e af std Y+62, r18 ; 0x3e 3236e: 69 97 sbiw r28, 0x19 ; 25 32370: 29 96 adiw r28, 0x09 ; 9 32372: 4e ac ldd r4, Y+62 ; 0x3e 32374: 5f ac ldd r5, Y+63 ; 0x3f 32376: 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){ 32378: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 3237a: 63 96 adiw r28, 0x13 ; 19 3237c: 8e ad ldd r24, Y+62 ; 0x3e 3237e: 9f ad ldd r25, Y+63 ; 0x3f 32380: 63 97 sbiw r28, 0x13 ; 19 32382: 80 52 subi r24, 0x20 ; 32 32384: 9c 4f sbci r25, 0xFC ; 252 32386: 6b 96 adiw r28, 0x1b ; 27 32388: 9f af std Y+63, r25 ; 0x3f 3238a: 8e af std Y+62, r24 ; 0x3e 3238c: 6b 97 sbiw r28, 0x1b ; 27 3238e: 60 90 6c 07 lds r6, 0x076C ; 0x80076c 32392: 70 90 6d 07 lds r7, 0x076D ; 0x80076d 32396: 80 90 6e 07 lds r8, 0x076E ; 0x80076e 3239a: 90 90 6f 07 lds r9, 0x076F ; 0x80076f 3239e: 6b 96 adiw r28, 0x1b ; 27 323a0: ae ac ldd r10, Y+62 ; 0x3e 323a2: bf ac ldd r11, Y+63 ; 0x3f 323a4: 6b 97 sbiw r28, 0x1b ; 27 323a6: 31 10 cpse r3, r1 323a8: 04 c0 rjmp .+8 ; 0x323b2 323aa: 69 96 adiw r28, 0x19 ; 25 323ac: ae ac ldd r10, Y+62 ; 0x3e 323ae: bf ac ldd r11, Y+63 ; 0x3f 323b0: 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; 323b2: 80 91 64 07 lds r24, 0x0764 ; 0x800764 323b6: 90 91 65 07 lds r25, 0x0765 ; 0x800765 323ba: a0 91 66 07 lds r26, 0x0766 ; 0x800766 323be: b0 91 67 07 lds r27, 0x0767 ; 0x800767 323c2: f5 01 movw r30, r10 323c4: e8 1b sub r30, r24 323c6: f9 0b sbc r31, r25 323c8: 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) 323ca: 71 f0 breq .+28 ; 0x323e8 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)); 323cc: af 01 movw r20, r30 323ce: f7 ff sbrs r31, 7 323d0: 04 c0 rjmp .+8 ; 0x323da 323d2: 44 27 eor r20, r20 323d4: 55 27 eor r21, r21 323d6: 4e 1b sub r20, r30 323d8: 5f 0b sbc r21, r31 323da: 69 2f mov r22, r25 323dc: 66 1f adc r22, r22 323de: 66 27 eor r22, r22 323e0: 66 1f adc r22, r22 323e2: 81 e0 ldi r24, 0x01 ; 1 323e4: 0f 94 e2 73 call 0x2e7c4 ; 0x2e7c4 // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 323e8: 80 91 68 07 lds r24, 0x0768 ; 0x800768 323ec: 90 91 69 07 lds r25, 0x0769 ; 0x800769 323f0: a0 91 6a 07 lds r26, 0x076A ; 0x80076a 323f4: b0 91 6b 07 lds r27, 0x076B ; 0x80076b 323f8: 2b 96 adiw r28, 0x0b ; 11 323fa: 4e ad ldd r20, Y+62 ; 0x3e 323fc: 5f ad ldd r21, Y+63 ; 0x3f 323fe: 2b 97 sbiw r28, 0x0b ; 11 32400: 48 1b sub r20, r24 32402: 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)); 32404: 57 fd sbrc r21, 7 32406: b2 c0 rjmp .+356 ; 0x3256c 32408: 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) 3240a: 41 15 cp r20, r1 3240c: 51 05 cpc r21, r1 3240e: 09 f0 breq .+2 ; 0x32412 32410: ae c0 rjmp .+348 ; 0x3256e // 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; 32412: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 32416: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 3241a: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 3241e: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 32422: 68 1a sub r6, r24 32424: 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)); 32426: 77 fc sbrc r7, 7 32428: ab c0 rjmp .+342 ; 0x32580 3242a: 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) 3242c: 61 14 cp r6, r1 3242e: 71 04 cpc r7, r1 32430: 09 f0 breq .+2 ; 0x32434 32432: a7 c0 rjmp .+334 ; 0x32582 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); 32434: 40 91 6c 07 lds r20, 0x076C ; 0x80076c 32438: 50 91 6d 07 lds r21, 0x076D ; 0x80076d 3243c: 60 91 6e 07 lds r22, 0x076E ; 0x80076e 32440: 70 91 6f 07 lds r23, 0x076F ; 0x80076f 32444: 00 e0 ldi r16, 0x00 ; 0 32446: 28 ec ldi r18, 0xC8 ; 200 32448: 30 e0 ldi r19, 0x00 ; 0 3244a: 2b 96 adiw r28, 0x0b ; 11 3244c: 6e ad ldd r22, Y+62 ; 0x3e 3244e: 7f ad ldd r23, Y+63 ; 0x3f 32450: 2b 97 sbiw r28, 0x0b ; 11 32452: c5 01 movw r24, r10 32454: 0e 94 17 e1 call 0x1c22e ; 0x1c22e sm4_set_dir(X_AXIS, d); 32458: 63 2d mov r22, r3 3245a: 80 e0 ldi r24, 0x00 ; 0 3245c: 0f 94 3c 6a call 0x2d478 ; 0x2d478 //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 32460: 5f 92 push r5 32462: 4f 92 push r4 32464: 8a ef ldi r24, 0xFA ; 250 32466: 95 ea ldi r25, 0xA5 ; 165 32468: 9f 93 push r25 3246a: 8f 93 push r24 3246c: 0f 94 1d dc call 0x3b83a ; 0x3b83a lcd_set_cursor(4,3); 32470: 63 e0 ldi r22, 0x03 ; 3 32472: 84 e0 ldi r24, 0x04 ; 4 32474: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 32478: 5f 92 push r5 3247a: 4f 92 push r4 3247c: 8b ee ldi r24, 0xEB ; 235 3247e: 95 ea ldi r25, 0xA5 ; 165 32480: 9f 93 push r25 32482: 8f 93 push r24 32484: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 32488: 0f b6 in r0, 0x3f ; 63 3248a: f8 94 cli 3248c: de bf out 0x3e, r29 ; 62 3248e: 0f be out 0x3f, r0 ; 63 32490: cd bf out 0x3d, r28 ; 61 32492: 21 e0 ldi r18, 0x01 ; 1 32494: 30 e0 ldi r19, 0x00 ; 0 32496: 31 10 cpse r3, r1 32498: 02 c0 rjmp .+4 ; 0x3249e 3249a: 2f ef ldi r18, 0xFF ; 255 3249c: 3f ef ldi r19, 0xFF ; 255 3249e: 40 ec ldi r20, 0xC0 ; 192 324a0: 42 03 mulsu r20, r18 324a2: c0 01 movw r24, r0 324a4: 43 9f mul r20, r19 324a6: 90 0d add r25, r0 324a8: 11 24 eor r1, r1 324aa: 67 96 adiw r28, 0x17 ; 23 324ac: 9f af std Y+63, r25 ; 0x3f 324ae: 8e af std Y+62, r24 ; 0x3e 324b0: 67 97 sbiw r28, 0x17 ; 23 324b2: 40 ee ldi r20, 0xE0 ; 224 324b4: 53 e0 ldi r21, 0x03 ; 3 324b6: 24 9f mul r18, r20 324b8: 40 01 movw r8, r0 324ba: 25 9f mul r18, r21 324bc: 90 0c add r9, r0 324be: 34 9f mul r19, r20 324c0: 90 0c add r9, r0 324c2: 11 24 eor r1, r1 324c4: 63 96 adiw r28, 0x13 ; 19 324c6: ee ad ldd r30, Y+62 ; 0x3e 324c8: ff ad ldd r31, Y+63 ; 0x3f 324ca: 63 97 sbiw r28, 0x13 ; 19 324cc: 8e 0e add r8, r30 324ce: 9f 1e adc r9, r31 324d0: 9e 01 movw r18, r28 324d2: 2f 5f subi r18, 0xFF ; 255 324d4: 3f 4f sbci r19, 0xFF ; 255 324d6: 2d 96 adiw r28, 0x0d ; 13 324d8: 3f af std Y+63, r19 ; 0x3f 324da: 2e af std Y+62, r18 ; 0x3e 324dc: 2d 97 sbiw r28, 0x0d ; 13 324de: 61 96 adiw r28, 0x11 ; 17 324e0: 8e ad ldd r24, Y+62 ; 0x3e 324e2: 9f ad ldd r25, Y+63 ; 0x3f 324e4: 61 97 sbiw r28, 0x11 ; 17 324e6: 2f 96 adiw r28, 0x0f ; 15 324e8: 9f af std Y+63, r25 ; 0x3f 324ea: 8e af std Y+62, r24 ; 0x3e 324ec: 2f 97 sbiw r28, 0x0f ; 15 324ee: 71 2c mov r7, r1 324f0: 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; 324f2: e0 e1 ldi r30, 0x10 ; 16 324f4: f7 e2 ldi r31, 0x27 ; 39 324f6: 27 96 adiw r28, 0x07 ; 7 324f8: ff af std Y+63, r31 ; 0x3f 324fa: ee af std Y+62, r30 ; 0x3e 324fc: 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); 324fe: 80 91 64 07 lds r24, 0x0764 ; 0x800764 32502: 90 91 65 07 lds r25, 0x0765 ; 0x800765 32506: a0 91 66 07 lds r26, 0x0766 ; 0x800766 3250a: b0 91 67 07 lds r27, 0x0767 ; 0x800767 3250e: 84 01 movw r16, r8 32510: 08 1b sub r16, r24 32512: 19 0b sbc r17, r25 32514: 17 ff sbrs r17, 7 32516: 03 c0 rjmp .+6 ; 0x3251e 32518: 11 95 neg r17 3251a: 01 95 neg r16 3251c: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 3251e: 98 01 movw r18, r16 32520: 35 95 asr r19 32522: 27 95 ror r18 32524: 65 96 adiw r28, 0x15 ; 21 32526: 3f af std Y+63, r19 ; 0x3f 32528: 2e af std Y+62, r18 ; 0x3e 3252a: 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; 3252c: 1c 9b sbis 0x03, 4 ; 3 3252e: 33 c0 rjmp .+102 ; 0x32596 32530: 45 e0 ldi r20, 0x05 ; 5 32532: 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); 32534: 65 96 adiw r28, 0x15 ; 21 32536: ae ac ldd r10, Y+62 ; 0x3e 32538: bf ac ldd r11, Y+63 ; 0x3f 3253a: 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); 3253c: 63 2d mov r22, r3 3253e: 82 2d mov r24, r2 32540: 0e 94 be e0 call 0x1c17c ; 0x1c17c while (steps--){ 32544: 31 e0 ldi r19, 0x01 ; 1 32546: a3 1a sub r10, r19 32548: b1 08 sbc r11, r1 3254a: 40 f1 brcs .+80 ; 0x3259c accelerate_1_step(axes, acc, delay_us, min_delay_us); 3254c: 28 ec ldi r18, 0xC8 ; 200 3254e: 30 e0 ldi r19, 0x00 ; 0 32550: a7 01 movw r20, r14 32552: 68 ee ldi r22, 0xE8 ; 232 32554: 73 e0 ldi r23, 0x03 ; 3 32556: 82 2d mov r24, r2 32558: 0e 94 8f df call 0x1bf1e ; 0x1bf1e update_position_1_step(axes, dir); 3255c: 63 2d mov r22, r3 3255e: 82 2d mov r24, r2 32560: 0e 94 d7 e0 call 0x1c1ae ; 0x1c1ae 32564: ef cf rjmp .-34 ; 0x32544 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){ 32566: 33 24 eor r3, r3 32568: 33 94 inc r3 3256a: 11 cf rjmp .-478 ; 0x3238e 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)); 3256c: 62 e0 ldi r22, 0x02 ; 2 3256e: 57 ff sbrs r21, 7 32570: 03 c0 rjmp .+6 ; 0x32578 32572: 51 95 neg r21 32574: 41 95 neg r20 32576: 51 09 sbc r21, r1 32578: 82 e0 ldi r24, 0x02 ; 2 3257a: 0f 94 e2 73 call 0x2e7c4 ; 0x2e7c4 3257e: 49 cf rjmp .-366 ; 0x32412 // 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)); 32580: 64 e0 ldi r22, 0x04 ; 4 32582: a3 01 movw r20, r6 32584: 77 fe sbrs r7, 7 32586: 03 c0 rjmp .+6 ; 0x3258e 32588: 51 95 neg r21 3258a: 41 95 neg r20 3258c: 51 09 sbc r21, r1 3258e: 84 e0 ldi r24, 0x04 ; 4 32590: 0f 94 e2 73 call 0x2e7c4 ; 0x2e7c4 32594: 4f cf rjmp .-354 ; 0x32434 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; 32596: 22 24 eor r2, r2 32598: 23 94 inc r2 3259a: cc cf rjmp .-104 ; 0x32534 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); 3259c: 65 96 adiw r28, 0x15 ; 21 3259e: ee ad ldd r30, Y+62 ; 0x3e 325a0: ff ad ldd r31, Y+63 ; 0x3f 325a2: 65 97 sbiw r28, 0x15 ; 21 325a4: 0e 1b sub r16, r30 325a6: 1f 0b sbc r17, r31 325a8: 23 96 adiw r28, 0x03 ; 3 325aa: 1f af std Y+63, r17 ; 0x3f 325ac: 0e af std Y+62, r16 ; 0x3e 325ae: 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); 325b0: 63 2d mov r22, r3 325b2: 82 2d mov r24, r2 325b4: 0e 94 be e0 call 0x1c17c ; 0x1c17c while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 325b8: 9e 01 movw r18, r28 325ba: 2f 5b subi r18, 0xBF ; 191 325bc: 3f 4f sbci r19, 0xFF ; 255 325be: a7 01 movw r20, r14 325c0: 68 ee ldi r22, 0xE8 ; 232 325c2: 73 e0 ldi r23, 0x03 ; 3 325c4: 82 2d mov r24, r2 325c6: 0e 94 35 e0 call 0x1c06a ; 0x1c06a 325ca: 88 23 and r24, r24 325cc: 29 f0 breq .+10 ; 0x325d8 update_position_1_step(axes, dir); 325ce: 63 2d mov r22, r3 325d0: 82 2d mov r24, r2 325d2: 0e 94 d7 e0 call 0x1c1ae ; 0x1c1ae 325d6: f0 cf rjmp .-32 ; 0x325b8 z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 325d8: 60 e0 ldi r22, 0x00 ; 0 325da: 82 e0 ldi r24, 0x02 ; 2 325dc: 0f 94 3c 6a call 0x2d478 ; 0x2d478 /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 325e0: 20 e1 ldi r18, 0x10 ; 16 325e2: 37 e2 ldi r19, 0x27 ; 39 325e4: 27 96 adiw r28, 0x07 ; 7 325e6: 3f af std Y+63, r19 ; 0x3f 325e8: 2e af std Y+62, r18 ; 0x3e 325ea: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 325ec: 00 91 6c 07 lds r16, 0x076C ; 0x80076c 325f0: 10 91 6d 07 lds r17, 0x076D ; 0x80076d 325f4: 20 91 6e 07 lds r18, 0x076E ; 0x80076e 325f8: 30 91 6f 07 lds r19, 0x076F ; 0x80076f 325fc: 00 5a subi r16, 0xA0 ; 160 325fe: 16 4f sbci r17, 0xF6 ; 246 32600: 17 ff sbrs r17, 7 32602: 02 c0 rjmp .+4 ; 0x32608 32604: 0f 5f subi r16, 0xFF ; 255 32606: 1f 4f sbci r17, 0xFF ; 255 32608: 15 95 asr r17 3260a: 07 95 ror r16 3260c: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 32610: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 32614: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 32618: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 3261c: 80 17 cp r24, r16 3261e: 91 07 cpc r25, r17 32620: f4 f4 brge .+60 ; 0x3265e if (!_PINDA){ 32622: 1c 9b sbis 0x03, 4 ; 3 32624: 1c c0 rjmp .+56 ; 0x3265e break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 32626: 28 ec ldi r18, 0xC8 ; 200 32628: 30 e0 ldi r19, 0x00 ; 0 3262a: a7 01 movw r20, r14 3262c: 68 ee ldi r22, 0xE8 ; 232 3262e: 73 e0 ldi r23, 0x03 ; 3 32630: 84 e0 ldi r24, 0x04 ; 4 32632: 0e 94 8f df call 0x1bf1e ; 0x1bf1e /// 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_){ 32636: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 3263a: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 3263e: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 32642: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 32646: 01 96 adiw r24, 0x01 ; 1 32648: a1 1d adc r26, r1 3264a: b1 1d adc r27, r1 3264c: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 32650: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 32654: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 32658: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f 3265c: d7 cf rjmp .-82 ; 0x3260c break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 3265e: 1c 9b sbis 0x03, 4 ; 3 32660: 3f c0 rjmp .+126 ; 0x326e0 steps_to_go = MAX(0, max_z - _Z); 32662: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 32666: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 3266a: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 3266e: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 32672: e0 e6 ldi r30, 0x60 ; 96 32674: f9 e0 ldi r31, 0x09 ; 9 32676: e8 1b sub r30, r24 32678: f9 0b sbc r31, r25 3267a: cf 01 movw r24, r30 3267c: f7 ff sbrs r31, 7 3267e: 02 c0 rjmp .+4 ; 0x32684 32680: 90 e0 ldi r25, 0x00 ; 0 32682: 80 e0 ldi r24, 0x00 ; 0 32684: 25 96 adiw r28, 0x05 ; 5 32686: 9f af std Y+63, r25 ; 0x3f 32688: 8e af std Y+62, r24 ; 0x3e 3268a: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 3268c: 1c 9b sbis 0x03, 4 ; 3 3268e: 28 c0 rjmp .+80 ; 0x326e0 32690: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 32694: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 32698: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 3269c: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 326a0: 80 36 cpi r24, 0x60 ; 96 326a2: 99 40 sbci r25, 0x09 ; 9 326a4: ec f4 brge .+58 ; 0x326e0 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 326a6: 9e 01 movw r18, r28 326a8: 2d 5b subi r18, 0xBD ; 189 326aa: 3f 4f sbci r19, 0xFF ; 255 326ac: a7 01 movw r20, r14 326ae: 68 ee ldi r22, 0xE8 ; 232 326b0: 73 e0 ldi r23, 0x03 ; 3 326b2: 84 e0 ldi r24, 0x04 ; 4 326b4: 0e 94 35 e0 call 0x1c06a ; 0x1c06a ++_Z_; 326b8: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 326bc: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 326c0: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 326c4: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 326c8: 01 96 adiw r24, 0x01 ; 1 326ca: a1 1d adc r26, r1 326cc: b1 1d adc r27, r1 326ce: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 326d2: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 326d6: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 326da: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f 326de: d6 cf rjmp .-84 ; 0x3268c /// \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); 326e0: 60 e0 ldi r22, 0x00 ; 0 326e2: 84 e0 ldi r24, 0x04 ; 4 326e4: 0e 94 be e0 call 0x1c17c ; 0x1c17c while (delay_us < MAX_DELAY){ 326e8: f7 01 movw r30, r14 326ea: 20 81 ld r18, Z 326ec: 31 81 ldd r19, Z+1 ; 0x01 326ee: 20 31 cpi r18, 0x10 ; 16 326f0: f7 e2 ldi r31, 0x27 ; 39 326f2: 3f 07 cpc r19, r31 326f4: 58 f4 brcc .+22 ; 0x3270c accelerate_1_step(axes, -dec, delay_us, delay_us); 326f6: a7 01 movw r20, r14 326f8: 68 e1 ldi r22, 0x18 ; 24 326fa: 7c ef ldi r23, 0xFC ; 252 326fc: 84 e0 ldi r24, 0x04 ; 4 326fe: 0e 94 8f df call 0x1bf1e ; 0x1bf1e update_position_1_step(axes, dir); 32702: 60 e0 ldi r22, 0x00 ; 0 32704: 84 e0 ldi r24, 0x04 ; 4 32706: 0e 94 d7 e0 call 0x1c1ae ; 0x1c1ae 3270a: ee cf rjmp .-36 ; 0x326e8 } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 3270c: 61 e0 ldi r22, 0x01 ; 1 3270e: 82 e0 ldi r24, 0x02 ; 2 32710: 0f 94 3c 6a call 0x2d478 ; 0x2d478 /// speed up current_delay_us = MAX_DELAY; 32714: 20 e1 ldi r18, 0x10 ; 16 32716: 37 e2 ldi r19, 0x27 ; 39 32718: f7 01 movw r30, r14 3271a: 31 83 std Z+1, r19 ; 0x01 3271c: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 3271e: 00 91 6c 07 lds r16, 0x076C ; 0x80076c 32722: 10 91 6d 07 lds r17, 0x076D ; 0x80076d 32726: 20 91 6e 07 lds r18, 0x076E ; 0x80076e 3272a: 30 91 6f 07 lds r19, 0x076F ; 0x80076f 3272e: 0c 0d add r16, r12 32730: 1d 1d adc r17, r13 32732: 17 ff sbrs r17, 7 32734: 02 c0 rjmp .+4 ; 0x3273a 32736: 0f 5f subi r16, 0xFF ; 255 32738: 1f 4f sbci r17, 0xFF ; 255 3273a: 15 95 asr r17 3273c: 07 95 ror r16 3273e: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 32742: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 32746: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 3274a: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 3274e: 08 17 cp r16, r24 32750: 19 07 cpc r17, r25 32752: 0c f0 brlt .+2 ; 0x32756 32754: d9 c0 rjmp .+434 ; 0x32908 if (_PINDA){ 32756: 1c 9b sbis 0x03, 4 ; 3 32758: bb c0 rjmp .+374 ; 0x328d0 z_trig = _Z; 3275a: 00 91 6c 07 lds r16, 0x076C ; 0x80076c 3275e: 10 91 6d 07 lds r17, 0x076D ; 0x80076d 32762: 20 91 6e 07 lds r18, 0x076E ; 0x80076e 32766: 30 91 6f 07 lds r19, 0x076F ; 0x80076f break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } /// slow down if (!_PINDA){ 3276a: 1c 99 sbic 0x03, 4 ; 3 3276c: 28 c0 rjmp .+80 ; 0x327be steps_to_go = MAX(0, _Z - min_z); 3276e: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 32772: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 32776: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 3277a: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 3277e: 8c 19 sub r24, r12 32780: 9d 09 sbc r25, r13 32782: 97 ff sbrs r25, 7 32784: 02 c0 rjmp .+4 ; 0x3278a 32786: 90 e0 ldi r25, 0x00 ; 0 32788: 80 e0 ldi r24, 0x00 ; 0 3278a: 25 96 adiw r28, 0x05 ; 5 3278c: 9f af std Y+63, r25 ; 0x3f 3278e: 8e af std Y+62, r24 ; 0x3e 32790: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 32792: 1c 99 sbic 0x03, 4 ; 3 32794: 0c c0 rjmp .+24 ; 0x327ae 32796: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 3279a: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 3279e: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 327a2: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 327a6: c8 16 cp r12, r24 327a8: d9 06 cpc r13, r25 327aa: 0c f4 brge .+2 ; 0x327ae 327ac: af c0 rjmp .+350 ; 0x3290c go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 327ae: 00 91 6c 07 lds r16, 0x076C ; 0x80076c 327b2: 10 91 6d 07 lds r17, 0x076D ; 0x80076d 327b6: 20 91 6e 07 lds r18, 0x076E ; 0x80076e 327ba: 30 91 6f 07 lds r19, 0x076F ; 0x80076f } /// slow down to stop but not lower than min_z while (_Z > min_z && current_delay_us < MAX_DELAY){ 327be: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 327c2: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 327c6: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 327ca: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 327ce: c8 16 cp r12, r24 327d0: d9 06 cpc r13, r25 327d2: 3c f4 brge .+14 ; 0x327e2 327d4: f7 01 movw r30, r14 327d6: 80 81 ld r24, Z 327d8: 91 81 ldd r25, Z+1 ; 0x01 327da: 80 31 cpi r24, 0x10 ; 16 327dc: 97 42 sbci r25, 0x27 ; 39 327de: 08 f4 brcc .+2 ; 0x327e2 327e0: b2 c0 rjmp .+356 ; 0x32946 327e2: 0c 19 sub r16, r12 327e4: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 327e6: 31 10 cpse r3, r1 327e8: ca c0 rjmp .+404 ; 0x3297e line_buffer[c] = (uint16_t)(z_trig - min_z); 327ea: f3 01 movw r30, r6 327ec: ee 0f add r30, r30 327ee: ff 1f adc r31, r31 327f0: 21 e0 ldi r18, 0x01 ; 1 327f2: 30 e0 ldi r19, 0x00 ; 0 327f4: 2c 0f add r18, r28 327f6: 3d 1f adc r19, r29 327f8: e2 0f add r30, r18 327fa: f3 1f adc r31, r19 327fc: 11 83 std Z+1, r17 ; 0x01 327fe: 00 83 st Z, r16 32800: ff ef ldi r31, 0xFF ; 255 32802: 6f 1a sub r6, r31 32804: 7f 0a sbc r7, r31 32806: 67 96 adiw r28, 0x17 ; 23 32808: 2e ad ldd r18, Y+62 ; 0x3e 3280a: 3f ad ldd r19, Y+63 ; 0x3f 3280c: 67 97 sbiw r28, 0x17 ; 23 3280e: 82 0e add r8, r18 32810: 93 1e adc r9, r19 32812: 2d 96 adiw r28, 0x0d ; 13 32814: 8e ad ldd r24, Y+62 ; 0x3e 32816: 9f ad ldd r25, Y+63 ; 0x3f 32818: 2d 97 sbiw r28, 0x0d ; 13 3281a: 02 97 sbiw r24, 0x02 ; 2 3281c: 2d 96 adiw r28, 0x0d ; 13 3281e: 9f af std Y+63, r25 ; 0x3f 32820: 8e af std Y+62, r24 ; 0x3e 32822: 2d 97 sbiw r28, 0x0d ; 13 32824: 2f 96 adiw r28, 0x0f ; 15 32826: ee ad ldd r30, Y+62 ; 0x3e 32828: ff ad ldd r31, Y+63 ; 0x3f 3282a: 2f 97 sbiw r28, 0x0f ; 15 3282c: 31 97 sbiw r30, 0x01 ; 1 3282e: 2f 96 adiw r28, 0x0f ; 15 32830: ff af std Y+63, r31 ; 0x3f 32832: ee af std Y+62, r30 ; 0x3e 32834: 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 32836: f0 e2 ldi r31, 0x20 ; 32 32838: 6f 16 cp r6, r31 3283a: 71 04 cpc r7, r1 3283c: 09 f0 breq .+2 ; 0x32840 3283e: 59 ce rjmp .-846 ; 0x324f2 32840: 21 e0 ldi r18, 0x01 ; 1 32842: 42 1a sub r4, r18 32844: 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){ 32846: 31 e0 ldi r19, 0x01 ; 1 32848: 33 12 cpse r3, r19 3284a: 8d ce rjmp .-742 ; 0x32566 3284c: 61 96 adiw r28, 0x11 ; 17 3284e: 8e ad ldd r24, Y+62 ; 0x3e 32850: 9f ad ldd r25, Y+63 ; 0x3f 32852: 61 97 sbiw r28, 0x11 ; 17 32854: 80 96 adiw r24, 0x20 ; 32 32856: 61 96 adiw r28, 0x11 ; 17 32858: 9f af std Y+63, r25 ; 0x3f 3285a: 8e af std Y+62, r24 ; 0x3e 3285c: 61 97 sbiw r28, 0x11 ; 17 3285e: 2b 96 adiw r28, 0x0b ; 11 32860: ee ad ldd r30, Y+62 ; 0x3e 32862: ff ad ldd r31, Y+63 ; 0x3f 32864: 2b 97 sbiw r28, 0x0b ; 11 32866: e0 5c subi r30, 0xC0 ; 192 32868: ff 4f sbci r31, 0xFF ; 255 3286a: 2b 96 adiw r28, 0x0b ; 11 3286c: ff af std Y+63, r31 ; 0x3f 3286e: ee af std Y+62, r30 ; 0x3e 32870: 2b 97 sbiw r28, 0x0b ; 11 32872: 29 96 adiw r28, 0x09 ; 9 32874: 2e ad ldd r18, Y+62 ; 0x3e 32876: 3f ad ldd r19, Y+63 ; 0x3f 32878: 29 97 sbiw r28, 0x09 ; 9 3287a: 22 50 subi r18, 0x02 ; 2 3287c: 31 09 sbc r19, r1 3287e: 29 96 adiw r28, 0x09 ; 9 32880: 3f af std Y+63, r19 ; 0x3f 32882: 2e af std Y+62, r18 ; 0x3e 32884: 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 32886: 23 2b or r18, r19 32888: 09 f0 breq .+2 ; 0x3288c 3288a: 72 cd rjmp .-1308 ; 0x32370 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); 3288c: 89 ee ldi r24, 0xE9 ; 233 3288e: 95 ea ldi r25, 0xA5 ; 165 32890: 9f 93 push r25 32892: 8f 93 push r24 32894: 0f 94 1d dc call 0x3b83a ; 0x3b83a 32898: 0f 90 pop r0 3289a: 0f 90 pop r0 } 3289c: c6 5a subi r28, 0xA6 ; 166 3289e: df 4f sbci r29, 0xFF ; 255 328a0: 0f b6 in r0, 0x3f ; 63 328a2: f8 94 cli 328a4: de bf out 0x3e, r29 ; 62 328a6: 0f be out 0x3f, r0 ; 63 328a8: cd bf out 0x3d, r28 ; 61 328aa: df 91 pop r29 328ac: cf 91 pop r28 328ae: 1f 91 pop r17 328b0: 0f 91 pop r16 328b2: ff 90 pop r15 328b4: ef 90 pop r14 328b6: df 90 pop r13 328b8: cf 90 pop r12 328ba: bf 90 pop r11 328bc: af 90 pop r10 328be: 9f 90 pop r9 328c0: 8f 90 pop r8 328c2: 7f 90 pop r7 328c4: 6f 90 pop r6 328c6: 5f 90 pop r5 328c8: 4f 90 pop r4 328ca: 3f 90 pop r3 328cc: 2f 90 pop r2 328ce: 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); 328d0: 28 ec ldi r18, 0xC8 ; 200 328d2: 30 e0 ldi r19, 0x00 ; 0 328d4: a7 01 movw r20, r14 328d6: 68 ee ldi r22, 0xE8 ; 232 328d8: 73 e0 ldi r23, 0x03 ; 3 328da: 84 e0 ldi r24, 0x04 ; 4 328dc: 0e 94 8f df call 0x1bf1e ; 0x1bf1e /// 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_){ 328e0: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 328e4: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 328e8: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 328ec: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 328f0: 01 97 sbiw r24, 0x01 ; 1 328f2: a1 09 sbc r26, r1 328f4: b1 09 sbc r27, r1 328f6: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 328fa: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 328fe: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 32902: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f 32906: 1b cf rjmp .-458 ; 0x3273e 32908: 86 01 movw r16, r12 3290a: 2f cf rjmp .-418 ; 0x3276a } /// 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); 3290c: 9e 01 movw r18, r28 3290e: 2d 5b subi r18, 0xBD ; 189 32910: 3f 4f sbci r19, 0xFF ; 255 32912: a7 01 movw r20, r14 32914: 68 ee ldi r22, 0xE8 ; 232 32916: 73 e0 ldi r23, 0x03 ; 3 32918: 84 e0 ldi r24, 0x04 ; 4 3291a: 0e 94 35 e0 call 0x1c06a ; 0x1c06a --_Z_; 3291e: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 32922: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 32926: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 3292a: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 3292e: 01 97 sbiw r24, 0x01 ; 1 32930: a1 09 sbc r26, r1 32932: b1 09 sbc r27, r1 32934: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 32938: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 3293c: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 32940: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f 32944: 26 cf rjmp .-436 ; 0x32792 } 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); 32946: 28 ec ldi r18, 0xC8 ; 200 32948: 30 e0 ldi r19, 0x00 ; 0 3294a: a7 01 movw r20, r14 3294c: 68 e1 ldi r22, 0x18 ; 24 3294e: 7c ef ldi r23, 0xFC ; 252 32950: 84 e0 ldi r24, 0x04 ; 4 32952: 0e 94 8f df call 0x1bf1e ; 0x1bf1e --_Z_; 32956: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 3295a: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 3295e: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 32962: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 32966: 01 97 sbiw r24, 0x01 ; 1 32968: a1 09 sbc r26, r1 3296a: b1 09 sbc r27, r1 3296c: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 32970: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 32974: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 32978: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f 3297c: 20 cf rjmp .-448 ; 0x327be 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); 3297e: 2d 96 adiw r28, 0x0d ; 13 32980: ee ad ldd r30, Y+62 ; 0x3e 32982: ff ad ldd r31, Y+63 ; 0x3f 32984: 2d 97 sbiw r28, 0x0d ; 13 32986: 86 ad ldd r24, Z+62 ; 0x3e 32988: 97 ad ldd r25, Z+63 ; 0x3f 3298a: 01 2e mov r0, r17 3298c: 00 0c add r0, r0 3298e: 22 0b sbc r18, r18 32990: 33 0b sbc r19, r19 32992: 08 0f add r16, r24 32994: 19 1f adc r17, r25 32996: 21 1d adc r18, r1 32998: 31 1d adc r19, r1 3299a: 36 95 lsr r19 3299c: 27 95 ror r18 3299e: 17 95 ror r17 329a0: 07 95 ror r16 329a2: 0f 3f cpi r16, 0xFF ; 255 329a4: 11 05 cpc r17, r1 329a6: 21 05 cpc r18, r1 329a8: 31 05 cpc r19, r1 329aa: 29 f0 breq .+10 ; 0x329b6 329ac: 20 f0 brcs .+8 ; 0x329b6 329ae: 0f ef ldi r16, 0xFF ; 255 329b0: 10 e0 ldi r17, 0x00 ; 0 329b2: 20 e0 ldi r18, 0x00 ; 0 329b4: 30 e0 ldi r19, 0x00 ; 0 329b6: 2f 96 adiw r28, 0x0f ; 15 329b8: ee ad ldd r30, Y+62 ; 0x3e 329ba: ff ad ldd r31, Y+63 ; 0x3f 329bc: 2f 97 sbiw r28, 0x0f ; 15 329be: 07 8f std Z+31, r16 ; 0x1f 329c0: 1f cf rjmp .-450 ; 0x32800 000329c2 : /// 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) 329c2: 2f 92 push r2 329c4: 3f 92 push r3 329c6: 4f 92 push r4 329c8: 5f 92 push r5 329ca: 6f 92 push r6 329cc: 7f 92 push r7 329ce: 8f 92 push r8 329d0: 9f 92 push r9 329d2: af 92 push r10 329d4: bf 92 push r11 329d6: cf 92 push r12 329d8: df 92 push r13 329da: ef 92 push r14 329dc: ff 92 push r15 329de: 0f 93 push r16 329e0: 1f 93 push r17 329e2: cf 93 push r28 329e4: df 93 push r29 329e6: cd b7 in r28, 0x3d ; 61 329e8: de b7 in r29, 0x3e ; 62 329ea: 6c 97 sbiw r28, 0x1c ; 28 329ec: 0f b6 in r0, 0x3f ; 63 329ee: f8 94 cli 329f0: de bf out 0x3e, r29 ; 62 329f2: 0f be out 0x3f, r0 ; 63 329f4: cd bf out 0x3d, r28 ; 61 329f6: 6c 01 movw r12, r24 329f8: 5b 01 movw r10, r22 329fa: 4a 01 movw r8, r20 329fc: 19 01 movw r2, r18 329fe: 18 87 std Y+8, r17 ; 0x08 32a00: 0f 83 std Y+7, r16 ; 0x07 32a02: fa 82 std Y+2, r15 ; 0x02 32a04: 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; 32a06: d7 01 movw r26, r14 32a08: 8d 91 ld r24, X+ 32a0a: 9c 91 ld r25, X 32a0c: 60 ed ldi r22, 0xD0 ; 208 32a0e: 72 e0 ldi r23, 0x02 ; 2 32a10: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 32a14: 9c 8f std Y+28, r25 ; 0x1c 32a16: 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); 32a18: 9f 93 push r25 32a1a: 8f 93 push r24 32a1c: 3f 92 push r3 32a1e: 2f 93 push r18 32a20: 1f 92 push r1 32a22: 84 e6 ldi r24, 0x64 ; 100 32a24: 8f 93 push r24 32a26: 9f 92 push r9 32a28: 8f 92 push r8 32a2a: bf 92 push r11 32a2c: af 92 push r10 32a2e: df 92 push r13 32a30: cf 92 push r12 32a32: 81 eb ldi r24, 0xB1 ; 177 32a34: 95 ea ldi r25, 0xA5 ; 165 32a36: 9f 93 push r25 32a38: 8f 93 push r24 32a3a: 0f 94 1d dc call 0x3b83a ; 0x3b83a 32a3e: 0f b6 in r0, 0x3f ; 63 32a40: f8 94 cli 32a42: de bf out 0x3e, r29 ; 62 32a44: 0f be out 0x3f, r0 ; 63 32a46: 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; 32a48: 22 27 eor r18, r18 32a4a: 33 27 eor r19, r19 32a4c: 22 19 sub r18, r2 32a4e: 33 09 sbc r19, r3 32a50: 3a 8f std Y+26, r19 ; 0x1a 32a52: 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)); 32a54: c4 01 movw r24, r8 32a56: 99 0c add r9, r9 32a58: aa 0b sbc r26, r26 32a5a: bb 0b sbc r27, r27 32a5c: 89 87 std Y+9, r24 ; 0x09 32a5e: 9a 87 std Y+10, r25 ; 0x0a 32a60: ab 87 std Y+11, r26 ; 0x0b 32a62: 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)); 32a64: 95 01 movw r18, r10 32a66: bb 0c add r11, r11 32a68: 44 0b sbc r20, r20 32a6a: 55 0b sbc r21, r21 32a6c: 29 8b std Y+17, r18 ; 0x11 32a6e: 3a 8b std Y+18, r19 ; 0x12 32a70: 4b 8b std Y+19, r20 ; 0x13 32a72: 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)); 32a74: c6 01 movw r24, r12 32a76: dd 0c add r13, r13 32a78: aa 0b sbc r26, r26 32a7a: bb 0b sbc r27, r27 32a7c: 8d 8b std Y+21, r24 ; 0x15 32a7e: 9e 8b std Y+22, r25 ; 0x16 32a80: af 8b std Y+23, r26 ; 0x17 32a82: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 32a84: 12 14 cp r1, r2 32a86: 13 04 cpc r1, r3 32a88: 0c f0 brlt .+2 ; 0x32a8c 32a8a: ba c0 rjmp .+372 ; 0x32c00 { dad = dad_max - (ad / k); 32a8c: 8b 8d ldd r24, Y+27 ; 0x1b 32a8e: 9c 8d ldd r25, Y+28 ; 0x1c 32a90: 6c e3 ldi r22, 0x3C ; 60 32a92: 70 e0 ldi r23, 0x00 ; 0 32a94: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 32a98: 10 e1 ldi r17, 0x10 ; 16 32a9a: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 32a9c: 2b 8d ldd r18, Y+27 ; 0x1b 32a9e: 3c 8d ldd r19, Y+28 ; 0x1c 32aa0: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 32aa2: 0f 94 7b de call 0x3bcf6 ; 0x3bcf6 <__usmulhisi3> 32aa6: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 32aaa: 20 e0 ldi r18, 0x00 ; 0 32aac: 30 e0 ldi r19, 0x00 ; 0 32aae: 44 e3 ldi r20, 0x34 ; 52 32ab0: 54 e4 ldi r21, 0x44 ; 68 32ab2: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 32ab6: 6b 01 movw r12, r22 32ab8: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 32aba: 6f 81 ldd r22, Y+7 ; 0x07 32abc: 78 85 ldd r23, Y+8 ; 0x08 32abe: eb 8d ldd r30, Y+27 ; 0x1b 32ac0: fc 8d ldd r31, Y+28 ; 0x1c 32ac2: 6e 0f add r22, r30 32ac4: 7f 1f adc r23, r31 32ac6: 90 e0 ldi r25, 0x00 ; 0 32ac8: 80 e0 ldi r24, 0x00 ; 0 32aca: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 32ace: 25 e3 ldi r18, 0x35 ; 53 32ad0: 3a ef ldi r19, 0xFA ; 250 32ad2: 4e e8 ldi r20, 0x8E ; 142 32ad4: 5c e3 ldi r21, 0x3C ; 60 32ad6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 32ada: 4b 01 movw r8, r22 32adc: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 32ade: 0f 94 7d df call 0x3befa ; 0x3befa 32ae2: 6b 83 std Y+3, r22 ; 0x03 32ae4: 7c 83 std Y+4, r23 ; 0x04 32ae6: 8d 83 std Y+5, r24 ; 0x05 32ae8: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 32aea: c5 01 movw r24, r10 32aec: b4 01 movw r22, r8 32aee: 0f 94 43 e2 call 0x3c486 ; 0x3c486 32af2: 2b 01 movw r4, r22 32af4: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 32af6: 69 85 ldd r22, Y+9 ; 0x09 32af8: 7a 85 ldd r23, Y+10 ; 0x0a 32afa: 8b 85 ldd r24, Y+11 ; 0x0b 32afc: 9c 85 ldd r25, Y+12 ; 0x0c 32afe: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 32b02: 4b 01 movw r8, r22 32b04: 5c 01 movw r10, r24 32b06: 2b 8d ldd r18, Y+27 ; 0x1b 32b08: 3c 8d ldd r19, Y+28 ; 0x1c 32b0a: a4 e6 ldi r26, 0x64 ; 100 32b0c: b0 e0 ldi r27, 0x00 ; 0 32b0e: 0f 94 fb dd call 0x3bbf6 ; 0x3bbf6 <__umulhisi3> 32b12: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 32b16: 20 e0 ldi r18, 0x00 ; 0 32b18: 30 e0 ldi r19, 0x00 ; 0 32b1a: 44 e3 ldi r20, 0x34 ; 52 32b1c: 54 e4 ldi r21, 0x44 ; 68 32b1e: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 32b22: 9b 01 movw r18, r22 32b24: ac 01 movw r20, r24 32b26: c5 01 movw r24, r10 32b28: b4 01 movw r22, r8 32b2a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 32b2e: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 32b32: 6d 87 std Y+13, r22 ; 0x0d 32b34: 7e 87 std Y+14, r23 ; 0x0e 32b36: 8f 87 std Y+15, r24 ; 0x0f 32b38: 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)); 32b3a: 69 89 ldd r22, Y+17 ; 0x11 32b3c: 7a 89 ldd r23, Y+18 ; 0x12 32b3e: 8b 89 ldd r24, Y+19 ; 0x13 32b40: 9c 89 ldd r25, Y+20 ; 0x14 32b42: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 32b46: 4b 01 movw r8, r22 32b48: 5c 01 movw r10, r24 32b4a: a3 01 movw r20, r6 32b4c: 92 01 movw r18, r4 32b4e: c7 01 movw r24, r14 32b50: b6 01 movw r22, r12 32b52: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 32b56: 9b 01 movw r18, r22 32b58: ac 01 movw r20, r24 32b5a: c5 01 movw r24, r10 32b5c: b4 01 movw r22, r8 32b5e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 32b62: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 32b66: 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)); 32b68: 6d 89 ldd r22, Y+21 ; 0x15 32b6a: 7e 89 ldd r23, Y+22 ; 0x16 32b6c: 8f 89 ldd r24, Y+23 ; 0x17 32b6e: 98 8d ldd r25, Y+24 ; 0x18 32b70: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 32b74: 2b 01 movw r4, r22 32b76: 3c 01 movw r6, r24 32b78: a7 01 movw r20, r14 32b7a: 96 01 movw r18, r12 32b7c: 6b 81 ldd r22, Y+3 ; 0x03 32b7e: 7c 81 ldd r23, Y+4 ; 0x04 32b80: 8d 81 ldd r24, Y+5 ; 0x05 32b82: 9e 81 ldd r25, Y+6 ; 0x06 32b84: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 32b88: 9b 01 movw r18, r22 32b8a: ac 01 movw r20, r24 32b8c: c3 01 movw r24, r6 32b8e: b2 01 movw r22, r4 32b90: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 32b94: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 32b98: 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)) 32b9a: 01 e0 ldi r16, 0x01 ; 1 32b9c: 20 e4 ldi r18, 0x40 ; 64 32b9e: 31 e0 ldi r19, 0x01 ; 1 32ba0: 4d 85 ldd r20, Y+13 ; 0x0d 32ba2: 5e 85 ldd r21, Y+14 ; 0x0e 32ba4: b4 01 movw r22, r8 32ba6: 0e 94 17 e1 call 0x1c22e ; 0x1c22e 32baa: 21 2f mov r18, r17 32bac: 30 e0 ldi r19, 0x00 ; 0 32bae: 88 23 and r24, r24 32bb0: b9 f1 breq .+110 ; 0x32c20 32bb2: 4b 8d ldd r20, Y+27 ; 0x1b 32bb4: 5c 8d ldd r21, Y+28 ; 0x1c 32bb6: 42 0f add r20, r18 32bb8: 53 1f adc r21, r19 { ad += dad + 1; 32bba: 4f 5f subi r20, 0xFF ; 255 32bbc: 5f 4f sbci r21, 0xFF ; 255 32bbe: 5c 8f std Y+28, r21 ; 0x1c 32bc0: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 32bc2: eb 8d ldd r30, Y+27 ; 0x1b 32bc4: fc 8d ldd r31, Y+28 ; 0x1c 32bc6: a9 81 ldd r26, Y+1 ; 0x01 32bc8: ba 81 ldd r27, Y+2 ; 0x02 32bca: ed 93 st X+, r30 32bcc: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 32bce: 6c 96 adiw r28, 0x1c ; 28 32bd0: 0f b6 in r0, 0x3f ; 63 32bd2: f8 94 cli 32bd4: de bf out 0x3e, r29 ; 62 32bd6: 0f be out 0x3f, r0 ; 63 32bd8: cd bf out 0x3d, r28 ; 61 32bda: df 91 pop r29 32bdc: cf 91 pop r28 32bde: 1f 91 pop r17 32be0: 0f 91 pop r16 32be2: ff 90 pop r15 32be4: ef 90 pop r14 32be6: df 90 pop r13 32be8: cf 90 pop r12 32bea: bf 90 pop r11 32bec: af 90 pop r10 32bee: 9f 90 pop r9 32bf0: 8f 90 pop r8 32bf2: 7f 90 pop r7 32bf4: 6f 90 pop r6 32bf6: 5f 90 pop r5 32bf8: 4f 90 pop r4 32bfa: 3f 90 pop r3 32bfc: 2f 90 pop r2 32bfe: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 32c00: 2f ec ldi r18, 0xCF ; 207 32c02: 32 e0 ldi r19, 0x02 ; 2 32c04: ab 8d ldd r26, Y+27 ; 0x1b 32c06: bc 8d ldd r27, Y+28 ; 0x1c 32c08: 2a 1b sub r18, r26 32c0a: 3b 0b sbc r19, r27 32c0c: c9 01 movw r24, r18 32c0e: 6c e3 ldi r22, 0x3C ; 60 32c10: 70 e0 ldi r23, 0x00 ; 0 32c12: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 32c16: 10 e1 ldi r17, 0x10 ; 16 32c18: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 32c1a: a9 8d ldd r26, Y+25 ; 0x19 32c1c: ba 8d ldd r27, Y+26 ; 0x1a 32c1e: 41 cf rjmp .-382 ; 0x32aa2 // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 32c20: 2f 5f subi r18, 0xFF ; 255 32c22: 3f 4f sbci r19, 0xFF ; 255 32c24: ab 8d ldd r26, Y+27 ; 0x1b 32c26: bc 8d ldd r27, Y+28 ; 0x1c 32c28: a2 0f add r26, r18 32c2a: b3 1f adc r27, r19 32c2c: bc 8f std Y+28, r27 ; 0x1c 32c2e: ab 8f std Y+27, r26 ; 0x1b 32c30: a0 3d cpi r26, 0xD0 ; 208 32c32: b2 40 sbci r27, 0x02 ; 2 32c34: 08 f4 brcc .+2 ; 0x32c38 32c36: 26 cf rjmp .-436 ; 0x32a84 32c38: c4 cf rjmp .-120 ; 0x32bc2 00032c3a : float mesh_bed_leveling::get_z(float x, float y) { 32c3a: 2f 92 push r2 32c3c: 3f 92 push r3 32c3e: 4f 92 push r4 32c40: 5f 92 push r5 32c42: 6f 92 push r6 32c44: 7f 92 push r7 32c46: 8f 92 push r8 32c48: 9f 92 push r9 32c4a: af 92 push r10 32c4c: bf 92 push r11 32c4e: cf 92 push r12 32c50: df 92 push r13 32c52: ef 92 push r14 32c54: ff 92 push r15 32c56: 0f 93 push r16 32c58: 1f 93 push r17 32c5a: cf 93 push r28 32c5c: df 93 push r29 32c5e: 00 d0 rcall .+0 ; 0x32c60 32c60: 00 d0 rcall .+0 ; 0x32c62 32c62: 00 d0 rcall .+0 ; 0x32c64 32c64: 1f 92 push r1 32c66: cd b7 in r28, 0x3d ; 61 32c68: de b7 in r29, 0x3e ; 62 32c6a: 2b 01 movw r4, r22 32c6c: 3c 01 movw r6, r24 32c6e: 49 01 movw r8, r18 32c70: 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)); 32c72: 20 e0 ldi r18, 0x00 ; 0 32c74: 30 e0 ldi r19, 0x00 ; 0 32c76: 40 ec ldi r20, 0xC0 ; 192 32c78: 51 e4 ldi r21, 0x41 ; 65 32c7a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 32c7e: 20 e0 ldi r18, 0x00 ; 0 32c80: 30 e0 ldi r19, 0x00 ; 0 32c82: 48 e0 ldi r20, 0x08 ; 8 32c84: 52 e4 ldi r21, 0x42 ; 66 32c86: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 32c8a: 6b 01 movw r12, r22 32c8c: 7c 01 movw r14, r24 32c8e: 0f 94 2a e0 call 0x3c054 ; 0x3c054 32c92: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> if (i < 0) { i = 0; 32c96: 31 2c mov r3, r1 32c98: 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) { 32c9a: 77 fd sbrc r23, 7 32c9c: 1e c0 rjmp .+60 ; 0x32cda 32c9e: 1b 01 movw r2, r22 32ca0: 66 30 cpi r22, 0x06 ; 6 32ca2: 71 05 cpc r23, r1 32ca4: 1c f0 brlt .+6 ; 0x32cac 32ca6: 45 e0 ldi r20, 0x05 ; 5 32ca8: 24 2e mov r2, r20 32caa: 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; } 32cac: 82 2d mov r24, r2 32cae: 0f 94 79 c7 call 0x38ef2 ; 0x38ef2 32cb2: 20 e0 ldi r18, 0x00 ; 0 32cb4: 30 e0 ldi r19, 0x00 ; 0 32cb6: 48 eb ldi r20, 0xB8 ; 184 32cb8: 51 e4 ldi r21, 0x41 ; 65 32cba: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 32cbe: 9b 01 movw r18, r22 32cc0: 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; 32cc2: c3 01 movw r24, r6 32cc4: b2 01 movw r22, r4 32cc6: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 32cca: 20 e0 ldi r18, 0x00 ; 0 32ccc: 30 e0 ldi r19, 0x00 ; 0 32cce: 48 e0 ldi r20, 0x08 ; 8 32cd0: 52 e4 ldi r21, 0x42 ; 66 32cd2: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 32cd6: 6b 01 movw r12, r22 32cd8: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 32cda: 20 e0 ldi r18, 0x00 ; 0 32cdc: 30 e0 ldi r19, 0x00 ; 0 32cde: 40 ec ldi r20, 0xC0 ; 192 32ce0: 50 e4 ldi r21, 0x40 ; 64 32ce2: c5 01 movw r24, r10 32ce4: b4 01 movw r22, r8 32ce6: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 32cea: 20 e0 ldi r18, 0x00 ; 0 32cec: 30 e0 ldi r19, 0x00 ; 0 32cee: 48 e0 ldi r20, 0x08 ; 8 32cf0: 52 e4 ldi r21, 0x42 ; 66 32cf2: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 32cf6: 69 83 std Y+1, r22 ; 0x01 32cf8: 7a 83 std Y+2, r23 ; 0x02 32cfa: 8b 83 std Y+3, r24 ; 0x03 32cfc: 9c 83 std Y+4, r25 ; 0x04 32cfe: 0f 94 2a e0 call 0x3c054 ; 0x3c054 32d02: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> if (j < 0) { 32d06: 77 fd sbrc r23, 7 32d08: da c0 rjmp .+436 ; 0x32ebe 32d0a: 7a 87 std Y+10, r23 ; 0x0a 32d0c: 69 87 std Y+9, r22 ; 0x09 32d0e: 66 30 cpi r22, 0x06 ; 6 32d10: 71 05 cpc r23, r1 32d12: 24 f0 brlt .+8 ; 0x32d1c 32d14: e5 e0 ldi r30, 0x05 ; 5 32d16: f0 e0 ldi r31, 0x00 ; 0 32d18: fa 87 std Y+10, r31 ; 0x0a 32d1a: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 32d1c: 89 85 ldd r24, Y+9 ; 0x09 32d1e: 0f 94 79 c7 call 0x38ef2 ; 0x38ef2 32d22: 20 e0 ldi r18, 0x00 ; 0 32d24: 30 e0 ldi r19, 0x00 ; 0 32d26: 40 ea ldi r20, 0xA0 ; 160 32d28: 50 e4 ldi r21, 0x40 ; 64 32d2a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 32d2e: 9b 01 movw r18, r22 32d30: 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; 32d32: c5 01 movw r24, r10 32d34: b4 01 movw r22, r8 32d36: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 32d3a: 20 e0 ldi r18, 0x00 ; 0 32d3c: 30 e0 ldi r19, 0x00 ; 0 32d3e: 48 e0 ldi r20, 0x08 ; 8 32d40: 52 e4 ldi r21, 0x42 ; 66 32d42: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 32d46: 69 83 std Y+1, r22 ; 0x01 32d48: 7a 83 std Y+2, r23 ; 0x02 32d4a: 8b 83 std Y+3, r24 ; 0x03 32d4c: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 32d4e: a7 01 movw r20, r14 32d50: 96 01 movw r18, r12 32d52: 60 e0 ldi r22, 0x00 ; 0 32d54: 70 e0 ldi r23, 0x00 ; 0 32d56: 80 e8 ldi r24, 0x80 ; 128 32d58: 9f e3 ldi r25, 0x3F ; 63 32d5a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 32d5e: 2b 01 movw r4, r22 32d60: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 32d62: 91 01 movw r18, r2 32d64: 2f 5f subi r18, 0xFF ; 255 32d66: 3f 4f sbci r19, 0xFF ; 255 32d68: 3e 83 std Y+6, r19 ; 0x06 32d6a: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 32d6c: 89 85 ldd r24, Y+9 ; 0x09 32d6e: 9a 85 ldd r25, Y+10 ; 0x0a 32d70: 01 96 adiw r24, 0x01 ; 1 32d72: 98 87 std Y+8, r25 ; 0x08 32d74: 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]; 32d76: 27 e0 ldi r18, 0x07 ; 7 32d78: e9 85 ldd r30, Y+9 ; 0x09 32d7a: fa 85 ldd r31, Y+10 ; 0x0a 32d7c: 2e 9f mul r18, r30 32d7e: 80 01 movw r16, r0 32d80: 2f 9f mul r18, r31 32d82: 10 0d add r17, r0 32d84: 11 24 eor r1, r1 32d86: f8 01 movw r30, r16 32d88: e2 0d add r30, r2 32d8a: f3 1d adc r31, r3 32d8c: ee 0f add r30, r30 32d8e: ff 1f adc r31, r31 32d90: ee 0f add r30, r30 32d92: ff 1f adc r31, r31 32d94: e0 56 subi r30, 0x60 ; 96 32d96: fc 4e sbci r31, 0xEC ; 236 32d98: 21 81 ldd r18, Z+1 ; 0x01 32d9a: 32 81 ldd r19, Z+2 ; 0x02 32d9c: 43 81 ldd r20, Z+3 ; 0x03 32d9e: 54 81 ldd r21, Z+4 ; 0x04 32da0: c3 01 movw r24, r6 32da2: b2 01 movw r22, r4 32da4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 32da8: 4b 01 movw r8, r22 32daa: 5c 01 movw r10, r24 32dac: ed 81 ldd r30, Y+5 ; 0x05 32dae: fe 81 ldd r31, Y+6 ; 0x06 32db0: e0 0f add r30, r16 32db2: f1 1f adc r31, r17 32db4: ee 0f add r30, r30 32db6: ff 1f adc r31, r31 32db8: ee 0f add r30, r30 32dba: ff 1f adc r31, r31 32dbc: e0 56 subi r30, 0x60 ; 96 32dbe: fc 4e sbci r31, 0xEC ; 236 32dc0: 21 81 ldd r18, Z+1 ; 0x01 32dc2: 32 81 ldd r19, Z+2 ; 0x02 32dc4: 43 81 ldd r20, Z+3 ; 0x03 32dc6: 54 81 ldd r21, Z+4 ; 0x04 32dc8: c7 01 movw r24, r14 32dca: b6 01 movw r22, r12 32dcc: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 32dd0: 9b 01 movw r18, r22 32dd2: ac 01 movw r20, r24 32dd4: c5 01 movw r24, r10 32dd6: b4 01 movw r22, r8 32dd8: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 32ddc: 4b 01 movw r8, r22 32dde: 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; 32de0: 29 81 ldd r18, Y+1 ; 0x01 32de2: 3a 81 ldd r19, Y+2 ; 0x02 32de4: 4b 81 ldd r20, Y+3 ; 0x03 32de6: 5c 81 ldd r21, Y+4 ; 0x04 32de8: 60 e0 ldi r22, 0x00 ; 0 32dea: 70 e0 ldi r23, 0x00 ; 0 32dec: 80 e8 ldi r24, 0x80 ; 128 32dee: 9f e3 ldi r25, 0x3F ; 63 32df0: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 32df4: 9b 01 movw r18, r22 32df6: ac 01 movw r20, r24 32df8: c5 01 movw r24, r10 32dfa: b4 01 movw r22, r8 32dfc: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 32e00: 4b 01 movw r8, r22 32e02: 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]; 32e04: 27 e0 ldi r18, 0x07 ; 7 32e06: ef 81 ldd r30, Y+7 ; 0x07 32e08: f8 85 ldd r31, Y+8 ; 0x08 32e0a: 2e 9f mul r18, r30 32e0c: c0 01 movw r24, r0 32e0e: 2f 9f mul r18, r31 32e10: 90 0d add r25, r0 32e12: 11 24 eor r1, r1 32e14: 9a 87 std Y+10, r25 ; 0x0a 32e16: 89 87 std Y+9, r24 ; 0x09 32e18: fc 01 movw r30, r24 32e1a: e2 0d add r30, r2 32e1c: f3 1d adc r31, r3 32e1e: ee 0f add r30, r30 32e20: ff 1f adc r31, r31 32e22: ee 0f add r30, r30 32e24: ff 1f adc r31, r31 32e26: e0 56 subi r30, 0x60 ; 96 32e28: fc 4e sbci r31, 0xEC ; 236 32e2a: 21 81 ldd r18, Z+1 ; 0x01 32e2c: 32 81 ldd r19, Z+2 ; 0x02 32e2e: 43 81 ldd r20, Z+3 ; 0x03 32e30: 54 81 ldd r21, Z+4 ; 0x04 32e32: c3 01 movw r24, r6 32e34: b2 01 movw r22, r4 32e36: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 32e3a: 2b 01 movw r4, r22 32e3c: 3c 01 movw r6, r24 32e3e: 89 85 ldd r24, Y+9 ; 0x09 32e40: 9a 85 ldd r25, Y+10 ; 0x0a 32e42: ed 81 ldd r30, Y+5 ; 0x05 32e44: fe 81 ldd r31, Y+6 ; 0x06 32e46: 8e 0f add r24, r30 32e48: 9f 1f adc r25, r31 32e4a: 88 0f add r24, r24 32e4c: 99 1f adc r25, r25 32e4e: 88 0f add r24, r24 32e50: 99 1f adc r25, r25 32e52: 80 56 subi r24, 0x60 ; 96 32e54: 9c 4e sbci r25, 0xEC ; 236 32e56: fc 01 movw r30, r24 32e58: 21 81 ldd r18, Z+1 ; 0x01 32e5a: 32 81 ldd r19, Z+2 ; 0x02 32e5c: 43 81 ldd r20, Z+3 ; 0x03 32e5e: 54 81 ldd r21, Z+4 ; 0x04 32e60: c7 01 movw r24, r14 32e62: b6 01 movw r22, r12 32e64: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 32e68: 9b 01 movw r18, r22 32e6a: ac 01 movw r20, r24 32e6c: c3 01 movw r24, r6 32e6e: b2 01 movw r22, r4 32e70: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> return (1.f-t) * z0 + t * z1; 32e74: 29 81 ldd r18, Y+1 ; 0x01 32e76: 3a 81 ldd r19, Y+2 ; 0x02 32e78: 4b 81 ldd r20, Y+3 ; 0x03 32e7a: 5c 81 ldd r21, Y+4 ; 0x04 32e7c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 32e80: 9b 01 movw r18, r22 32e82: ac 01 movw r20, r24 32e84: c5 01 movw r24, r10 32e86: b4 01 movw r22, r8 32e88: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> } 32e8c: 2a 96 adiw r28, 0x0a ; 10 32e8e: 0f b6 in r0, 0x3f ; 63 32e90: f8 94 cli 32e92: de bf out 0x3e, r29 ; 62 32e94: 0f be out 0x3f, r0 ; 63 32e96: cd bf out 0x3d, r28 ; 61 32e98: df 91 pop r29 32e9a: cf 91 pop r28 32e9c: 1f 91 pop r17 32e9e: 0f 91 pop r16 32ea0: ff 90 pop r15 32ea2: ef 90 pop r14 32ea4: df 90 pop r13 32ea6: cf 90 pop r12 32ea8: bf 90 pop r11 32eaa: af 90 pop r10 32eac: 9f 90 pop r9 32eae: 8f 90 pop r8 32eb0: 7f 90 pop r7 32eb2: 6f 90 pop r6 32eb4: 5f 90 pop r5 32eb6: 4f 90 pop r4 32eb8: 3f 90 pop r3 32eba: 2f 90 pop r2 32ebc: 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; 32ebe: 1a 86 std Y+10, r1 ; 0x0a 32ec0: 19 86 std Y+9, r1 ; 0x09 32ec2: 45 cf rjmp .-374 ; 0x32d4e 00032ec4 : 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) { 32ec4: 1f 93 push r17 32ec6: cf 93 push r28 32ec8: df 93 push r29 32eca: 00 d0 rcall .+0 ; 0x32ecc 32ecc: 1f 92 push r1 32ece: 1f 92 push r1 32ed0: cd b7 in r28, 0x3d ; 61 32ed2: de b7 in r29, 0x3e ; 62 32ed4: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 32ed6: 48 2f mov r20, r24 32ed8: 62 e5 ldi r22, 0x52 ; 82 32eda: ce 01 movw r24, r28 32edc: 01 96 adiw r24, 0x01 ; 1 32ede: 0f 94 d6 c2 call 0x385ac ; 0x385ac 32ee2: 49 81 ldd r20, Y+1 ; 0x01 32ee4: 5a 81 ldd r21, Y+2 ; 0x02 32ee6: 6b 81 ldd r22, Y+3 ; 0x03 32ee8: 7c 81 ldd r23, Y+4 ; 0x04 32eea: 8d 81 ldd r24, Y+5 ; 0x05 32eec: 0f 94 60 70 call 0x2e0c0 ; 0x2e0c0 scopeState = nextState; 32ef0: 10 93 2c 13 sts 0x132C, r17 ; 0x80132c } 32ef4: 0f 90 pop r0 32ef6: 0f 90 pop r0 32ef8: 0f 90 pop r0 32efa: 0f 90 pop r0 32efc: 0f 90 pop r0 32efe: df 91 pop r29 32f00: cf 91 pop r28 32f02: 1f 91 pop r17 32f04: 08 95 ret 00032f06 : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 32f06: 10 92 77 13 sts 0x1377, r1 ; 0x801377 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 32f0a: e0 e9 ldi r30, 0x90 ; 144 32f0c: fa ea ldi r31, 0xAA ; 170 32f0e: 84 91 lpm r24, Z 32f10: 67 e0 ldi r22, 0x07 ; 7 32f12: 0d 94 62 97 jmp 0x32ec4 ; 0x32ec4 00032f16 : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 32f16: e0 91 77 13 lds r30, 0x1377 ; 0x801377 32f1a: ae 2f mov r26, r30 32f1c: b0 e0 ldi r27, 0x00 ; 0 32f1e: aa 0f add r26, r26 32f20: bb 1f adc r27, r27 32f22: af 58 subi r26, 0x8F ; 143 32f24: bc 4e sbci r27, 0xEC ; 236 32f26: 20 91 44 13 lds r18, 0x1344 ; 0x801344 32f2a: 30 91 45 13 lds r19, 0x1345 ; 0x801345 32f2e: 2d 93 st X+, r18 32f30: 3c 93 st X, r19 ++regIndex; 32f32: ef 5f subi r30, 0xFF ; 255 32f34: e0 93 77 13 sts 0x1377, r30 ; 0x801377 if (regIndex >= regs16Count) { 32f38: e2 30 cpi r30, 0x02 ; 2 32f3a: 40 f4 brcc .+16 ; 0x32f4c return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32f3c: f0 e0 ldi r31, 0x00 ; 0 32f3e: e9 58 subi r30, 0x89 ; 137 32f40: f5 45 sbci r31, 0x55 ; 85 32f42: 84 91 lpm r24, Z 32f44: 68 e0 ldi r22, 0x08 ; 8 32f46: 0f 94 62 97 call 0x32ec4 ; 0x32ec4 } return ScopeState::Reading16bitRegisters; 32f4a: 88 e0 ldi r24, 0x08 ; 8 } 32f4c: 08 95 ret 00032f4e : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 32f4e: e0 91 77 13 lds r30, 0x1377 ; 0x801377 32f52: ae 2f mov r26, r30 32f54: b0 e0 ldi r27, 0x00 ; 0 32f56: a2 59 subi r26, 0x92 ; 146 32f58: bc 4e sbci r27, 0xEC ; 236 32f5a: 80 91 44 13 lds r24, 0x1344 ; 0x801344 32f5e: 8c 93 st X, r24 ++regIndex; 32f60: ef 5f subi r30, 0xFF ; 255 32f62: e0 93 77 13 sts 0x1377, r30 ; 0x801377 if (regIndex >= regs8Count) { 32f66: e3 30 cpi r30, 0x03 ; 3 32f68: 40 f0 brcs .+16 ; 0x32f7a SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 32f6a: 10 92 77 13 sts 0x1377, r1 ; 0x801377 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32f6e: e7 e7 ldi r30, 0x77 ; 119 32f70: fa ea ldi r31, 0xAA ; 170 32f72: 84 91 lpm r24, Z 32f74: 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); 32f76: 0d 94 62 97 jmp 0x32ec4 ; 0x32ec4 32f7a: f0 e0 ldi r31, 0x00 ; 0 32f7c: e0 57 subi r30, 0x70 ; 112 32f7e: f5 45 sbci r31, 0x55 ; 85 32f80: 84 91 lpm r24, Z 32f82: 67 e0 ldi r22, 0x07 ; 7 32f84: f8 cf rjmp .-16 ; 0x32f76 00032f86 : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 32f86: cf 93 push r28 32f88: df 93 push r29 32f8a: 00 d0 rcall .+0 ; 0x32f8c 32f8c: 00 d0 rcall .+0 ; 0x32f8e 32f8e: 00 d0 rcall .+0 ; 0x32f90 32f90: 1f 92 push r1 32f92: cd b7 in r28, 0x3d ; 61 32f94: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 32f96: 80 91 33 13 lds r24, 0x1333 ; 0x801333 32f9a: 82 34 cpi r24, 0x42 ; 66 32f9c: 09 f4 brne .+2 ; 0x32fa0 32f9e: 46 c0 rjmp .+140 ; 0x3302c 32fa0: b8 f5 brcc .+110 ; 0x33010 32fa2: 88 23 and r24, r24 32fa4: 09 f4 brne .+2 ; 0x32fa8 32fa6: 72 c0 rjmp .+228 ; 0x3308c plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 32fa8: 84 e0 ldi r24, 0x04 ; 4 32faa: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b 32fae: 85 e0 ldi r24, 0x05 ; 5 32fb0: e3 e3 ldi r30, 0x33 ; 51 32fb2: f3 e1 ldi r31, 0x13 ; 19 32fb4: de 01 movw r26, r28 32fb6: 16 96 adiw r26, 0x06 ; 6 32fb8: 01 90 ld r0, Z+ 32fba: 0d 92 st X+, r0 32fbc: 8a 95 dec r24 32fbe: e1 f7 brne .-8 ; 0x32fb8 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 32fc0: 85 e0 ldi r24, 0x05 ; 5 32fc2: fe 01 movw r30, r28 32fc4: 36 96 adiw r30, 0x06 ; 6 32fc6: ae e2 ldi r26, 0x2E ; 46 32fc8: b3 e1 ldi r27, 0x13 ; 19 32fca: 01 90 ld r0, Z+ 32fcc: 0d 92 st X+, r0 32fce: 8a 95 dec r24 32fd0: e1 f7 brne .-8 ; 0x32fca SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 32fd2: 40 e0 ldi r20, 0x00 ; 0 32fd4: 60 e0 ldi r22, 0x00 ; 0 32fd6: ce 01 movw r24, r28 32fd8: 01 96 adiw r24, 0x01 ; 1 32fda: 0f 94 d6 c2 call 0x385ac ; 0x385ac 32fde: 85 e0 ldi r24, 0x05 ; 5 32fe0: fe 01 movw r30, r28 32fe2: 31 96 adiw r30, 0x01 ; 1 32fe4: a3 e3 ldi r26, 0x33 ; 51 32fe6: b3 e1 ldi r27, 0x13 ; 19 32fe8: 01 90 ld r0, Z+ 32fea: 0d 92 st X+, r0 32fec: 8a 95 dec r24 32fee: e1 f7 brne .-8 ; 0x32fe8 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 32ff0: 85 e0 ldi r24, 0x05 ; 5 32ff2: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c SendMsg(rq); 32ff6: 40 91 2e 13 lds r20, 0x132E ; 0x80132e 32ffa: 50 91 2f 13 lds r21, 0x132F ; 0x80132f 32ffe: 60 91 30 13 lds r22, 0x1330 ; 0x801330 33002: 70 91 31 13 lds r23, 0x1331 ; 0x801331 33006: 80 91 32 13 lds r24, 0x1332 ; 0x801332 3300a: 0f 94 60 70 call 0x2e0c0 ; 0x2e0c0 3300e: 2e c0 rjmp .+92 ; 0x3306c ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 33010: 82 35 cpi r24, 0x52 ; 82 33012: b1 f1 breq .+108 ; 0x33080 33014: 87 35 cpi r24, 0x57 ; 87 33016: 41 f6 brne .-112 ; 0x32fa8 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); 33018: 60 91 35 13 lds r22, 0x1335 ; 0x801335 3301c: 70 91 36 13 lds r23, 0x1336 ; 0x801336 33020: 4c e0 ldi r20, 0x0C ; 12 33022: 80 91 34 13 lds r24, 0x1334 ; 0x801334 33026: 0f 94 cb 70 call 0x2e196 ; 0x2e196 3302a: 11 c0 rjmp .+34 ; 0x3304e SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 3302c: 40 91 34 13 lds r20, 0x1334 ; 0x801334 33030: 62 e4 ldi r22, 0x42 ; 66 33032: ce 01 movw r24, r28 33034: 01 96 adiw r24, 0x01 ; 1 33036: 0f 94 d6 c2 call 0x385ac ; 0x385ac 3303a: 49 81 ldd r20, Y+1 ; 0x01 3303c: 5a 81 ldd r21, Y+2 ; 0x02 3303e: 6b 81 ldd r22, Y+3 ; 0x03 33040: 7c 81 ldd r23, Y+4 ; 0x04 33042: 8d 81 ldd r24, Y+5 ; 0x05 33044: 0f 94 60 70 call 0x2e0c0 ; 0x2e0c0 scopeState = ScopeState::ButtonSent; 33048: 8a e0 ldi r24, 0x0A ; 10 3304a: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c 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); 3304e: 40 e0 ldi r20, 0x00 ; 0 33050: 60 e0 ldi r22, 0x00 ; 0 33052: ce 01 movw r24, r28 33054: 01 96 adiw r24, 0x01 ; 1 33056: 0f 94 d6 c2 call 0x385ac ; 0x385ac 3305a: 85 e0 ldi r24, 0x05 ; 5 3305c: fe 01 movw r30, r28 3305e: 31 96 adiw r30, 0x01 ; 1 33060: a3 e3 ldi r26, 0x33 ; 51 33062: b3 e1 ldi r27, 0x13 ; 19 33064: 01 90 ld r0, Z+ 33066: 0d 92 st X+, r0 33068: 8a 95 dec r24 3306a: e1 f7 brne .-8 ; 0x33064 default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 3306c: 81 e0 ldi r24, 0x01 ; 1 } } 3306e: 2a 96 adiw r28, 0x0a ; 10 33070: 0f b6 in r0, 0x3f ; 63 33072: f8 94 cli 33074: de bf out 0x3e, r29 ; 62 33076: 0f be out 0x3f, r0 ; 63 33078: cd bf out 0x3d, r28 ; 61 3307a: df 91 pop r29 3307c: cf 91 pop r28 3307e: 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); 33080: 6b e0 ldi r22, 0x0B ; 11 33082: 80 91 34 13 lds r24, 0x1334 ; 0x801334 33086: 0f 94 62 97 call 0x32ec4 ; 0x32ec4 3308a: e1 cf rjmp .-62 ; 0x3304e case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 3308c: 80 e0 ldi r24, 0x00 ; 0 3308e: ef cf rjmp .-34 ; 0x3306e 00033090 : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 33090: cf 93 push r28 33092: df 93 push r29 33094: 00 d0 rcall .+0 ; 0x33096 33096: 1f 92 push r1 33098: 1f 92 push r1 3309a: cd b7 in r28, 0x3d ; 61 3309c: de b7 in r29, 0x3e ; 62 3309e: 49 83 std Y+1, r20 ; 0x01 330a0: 5a 83 std Y+2, r21 ; 0x02 330a2: 6b 83 std Y+3, r22 ; 0x03 330a4: 7c 83 std Y+4, r23 ; 0x04 330a6: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 330a8: 85 e0 ldi r24, 0x05 ; 5 330aa: fe 01 movw r30, r28 330ac: 31 96 adiw r30, 0x01 ; 1 330ae: a3 e3 ldi r26, 0x33 ; 51 330b0: b3 e1 ldi r27, 0x13 ; 19 330b2: 01 90 ld r0, Z+ 330b4: 0d 92 st X+, r0 330b6: 8a 95 dec r24 330b8: e1 f7 brne .-8 ; 0x330b2 if (!ExpectsResponse()) { 330ba: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 330be: 87 ff sbrs r24, 7 330c0: 09 c0 rjmp .+18 ; 0x330d4 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 330c2: 0f 90 pop r0 330c4: 0f 90 pop r0 330c6: 0f 90 pop r0 330c8: 0f 90 pop r0 330ca: 0f 90 pop r0 330cc: df 91 pop r29 330ce: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 330d0: 0d 94 c3 97 jmp 0x32f86 ; 0x32f86 } // otherwise wait for an empty window to activate the request } 330d4: 0f 90 pop r0 330d6: 0f 90 pop r0 330d8: 0f 90 pop r0 330da: 0f 90 pop r0 330dc: 0f 90 pop r0 330de: df 91 pop r29 330e0: cf 91 pop r28 330e2: 08 95 ret 000330e4 : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 330e4: 1f 93 push r17 330e6: cf 93 push r28 330e8: df 93 push r29 330ea: 00 d0 rcall .+0 ; 0x330ec 330ec: 1f 92 push r1 330ee: 1f 92 push r1 330f0: cd b7 in r28, 0x3d ; 61 330f2: de b7 in r29, 0x3e ; 62 330f4: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 330f6: 48 2f mov r20, r24 330f8: 63 e5 ldi r22, 0x53 ; 83 330fa: ce 01 movw r24, r28 330fc: 01 96 adiw r24, 0x01 ; 1 330fe: 0f 94 d6 c2 call 0x385ac ; 0x385ac 33102: 49 81 ldd r20, Y+1 ; 0x01 33104: 5a 81 ldd r21, Y+2 ; 0x02 33106: 6b 81 ldd r22, Y+3 ; 0x03 33108: 7c 81 ldd r23, Y+4 ; 0x04 3310a: 8d 81 ldd r24, Y+5 ; 0x05 3310c: 0f 94 60 70 call 0x2e0c0 ; 0x2e0c0 scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 33110: 10 93 2c 13 sts 0x132C, r17 ; 0x80132c } 33114: 0f 90 pop r0 33116: 0f 90 pop r0 33118: 0f 90 pop r0 3311a: 0f 90 pop r0 3311c: 0f 90 pop r0 3311e: df 91 pop r29 33120: cf 91 pop r28 33122: 1f 91 pop r17 33124: 08 95 ret 00033126 : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 33126: cf 93 push r28 33128: df 93 push r29 3312a: 00 d0 rcall .+0 ; 0x3312c 3312c: 1f 92 push r1 3312e: 1f 92 push r1 33130: cd b7 in r28, 0x3d ; 61 33132: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 33134: 40 e0 ldi r20, 0x00 ; 0 33136: 61 e5 ldi r22, 0x51 ; 81 33138: ce 01 movw r24, r28 3313a: 01 96 adiw r24, 0x01 ; 1 3313c: 0f 94 d6 c2 call 0x385ac ; 0x385ac 33140: 49 81 ldd r20, Y+1 ; 0x01 33142: 5a 81 ldd r21, Y+2 ; 0x02 33144: 6b 81 ldd r22, Y+3 ; 0x03 33146: 7c 81 ldd r23, Y+4 ; 0x04 33148: 8d 81 ldd r24, Y+5 ; 0x05 3314a: 0f 94 60 70 call 0x2e0c0 ; 0x2e0c0 scopeState = ScopeState::QuerySent; 3314e: 84 e0 ldi r24, 0x04 ; 4 33150: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c } 33154: 0f 90 pop r0 33156: 0f 90 pop r0 33158: 0f 90 pop r0 3315a: 0f 90 pop r0 3315c: 0f 90 pop r0 3315e: df 91 pop r29 33160: cf 91 pop r28 33162: 08 95 ret 00033164 : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 33164: cf 93 push r28 33166: df 93 push r29 33168: 00 d0 rcall .+0 ; 0x3316a 3316a: 1f 92 push r1 3316c: 1f 92 push r1 3316e: cd b7 in r28, 0x3d ; 61 33170: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 33172: 0f 94 2e c3 call 0x3865c ; 0x3865c 33176: 80 93 6d 13 sts 0x136D, r24 ; 0x80136d 3317a: 48 2f mov r20, r24 3317c: 66 e6 ldi r22, 0x66 ; 102 3317e: ce 01 movw r24, r28 33180: 01 96 adiw r24, 0x01 ; 1 33182: 0f 94 d6 c2 call 0x385ac ; 0x385ac 33186: 49 81 ldd r20, Y+1 ; 0x01 33188: 5a 81 ldd r21, Y+2 ; 0x02 3318a: 6b 81 ldd r22, Y+3 ; 0x03 3318c: 7c 81 ldd r23, Y+4 ; 0x04 3318e: 8d 81 ldd r24, Y+5 ; 0x05 33190: 0f 94 60 70 call 0x2e0c0 ; 0x2e0c0 scopeState = ScopeState::FilamentSensorStateSent; 33194: 86 e0 ldi r24, 0x06 ; 6 33196: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c } 3319a: 0f 90 pop r0 3319c: 0f 90 pop r0 3319e: 0f 90 pop r0 331a0: 0f 90 pop r0 331a2: 0f 90 pop r0 331a4: df 91 pop r29 331a6: cf 91 pop r28 331a8: 08 95 ret 000331aa : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 331aa: cf 93 push r28 331ac: df 93 push r29 331ae: 00 d0 rcall .+0 ; 0x331b0 331b0: 1f 92 push r1 331b2: 1f 92 push r1 331b4: cd b7 in r28, 0x3d ; 61 331b6: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 331b8: 80 91 43 13 lds r24, 0x1343 ; 0x801343 331bc: 85 34 cpi r24, 0x45 ; 69 331be: f1 f0 breq .+60 ; 0x331fc 331c0: 20 f4 brcc .+8 ; 0x331ca 331c2: 82 34 cpi r24, 0x42 ; 66 331c4: 51 f1 breq .+84 ; 0x3321a } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 331c6: 85 e0 ldi r24, 0x05 ; 5 331c8: 11 c0 rjmp .+34 ; 0x331ec } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 331ca: 86 34 cpi r24, 0x46 ; 70 331cc: 71 f1 breq .+92 ; 0x3322a 331ce: 80 35 cpi r24, 0x50 ; 80 331d0: d1 f7 brne .-12 ; 0x331c6 case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 331d2: 80 91 44 13 lds r24, 0x1344 ; 0x801344 331d6: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b errorCode = ErrorCode::OK; 331da: 81 e0 ldi r24, 0x01 ; 1 331dc: 90 e0 ldi r25, 0x00 ; 0 331de: 90 93 6a 13 sts 0x136A, r25 ; 0x80136a 331e2: 80 93 69 13 sts 0x1369, r24 ; 0x801369 SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 331e6: 0f 94 b2 98 call 0x33164 ; 0x33164 return Processing; 331ea: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 331ec: 0f 90 pop r0 331ee: 0f 90 pop r0 331f0: 0f 90 pop r0 331f2: 0f 90 pop r0 331f4: 0f 90 pop r0 331f6: df 91 pop r29 331f8: cf 91 pop r28 331fa: 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; 331fc: 8c e0 ldi r24, 0x0C ; 12 331fe: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b errorCode = static_cast(rsp.paramValue); 33202: 80 91 44 13 lds r24, 0x1344 ; 0x801344 33206: 90 91 45 13 lds r25, 0x1345 ; 0x801345 3320a: 90 93 6a 13 sts 0x136A, r25 ; 0x80136a 3320e: 80 93 69 13 sts 0x1369, r24 ; 0x801369 // 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(); 33212: 0f 94 b2 98 call 0x33164 ; 0x33164 return CommandError; 33216: 87 e0 ldi r24, 0x07 ; 7 33218: e9 cf rjmp .-46 ; 0x331ec 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); 3321a: 80 91 44 13 lds r24, 0x1344 ; 0x801344 3321e: 80 93 6c 13 sts 0x136C, r24 ; 0x80136c SendAndUpdateFilamentSensor(); 33222: 0f 94 b2 98 call 0x33164 ; 0x33164 return ButtonPushed; 33226: 8b e0 ldi r24, 0x0B ; 11 33228: e1 cf rjmp .-62 ; 0x331ec 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) { 3322a: 90 91 2e 13 lds r25, 0x132E ; 0x80132e 3322e: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 33232: 98 13 cpse r25, r24 33234: 22 c0 rjmp .+68 ; 0x3327a 33236: 90 91 2f 13 lds r25, 0x132F ; 0x80132f 3323a: 80 91 3f 13 lds r24, 0x133F ; 0x80133f 3323e: 98 13 cpse r25, r24 33240: 1c c0 rjmp .+56 ; 0x3327a progressCode = ProgressCode::OK; 33242: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b errorCode = ErrorCode::OK; 33246: 81 e0 ldi r24, 0x01 ; 1 33248: 90 e0 ldi r25, 0x00 ; 0 3324a: 90 93 6a 13 sts 0x136A, r25 ; 0x80136a 3324e: 80 93 69 13 sts 0x1369, r24 ; 0x801369 scopeState = ScopeState::Ready; 33252: 82 e8 ldi r24, 0x82 ; 130 33254: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 33258: 40 e0 ldi r20, 0x00 ; 0 3325a: 60 e0 ldi r22, 0x00 ; 0 3325c: ce 01 movw r24, r28 3325e: 01 96 adiw r24, 0x01 ; 1 33260: 0f 94 d6 c2 call 0x385ac ; 0x385ac 33264: 85 e0 ldi r24, 0x05 ; 5 33266: fe 01 movw r30, r28 33268: 31 96 adiw r30, 0x01 ; 1 3326a: ae e2 ldi r26, 0x2E ; 46 3326c: b3 e1 ldi r27, 0x13 ; 19 3326e: 01 90 ld r0, Z+ 33270: 0d 92 st X+, r0 33272: 8a 95 dec r24 33274: e1 f7 brne .-8 ; 0x3326e 33276: 82 e0 ldi r24, 0x02 ; 2 33278: b9 cf rjmp .-142 ; 0x331ec return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 3327a: 83 e0 ldi r24, 0x03 ; 3 3327c: b7 cf rjmp .-146 ; 0x331ec 0003327e : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 3327e: 1f 93 push r17 33280: cf 93 push r28 33282: df 93 push r29 33284: 00 d0 rcall .+0 ; 0x33286 33286: 1f 92 push r1 33288: 1f 92 push r1 3328a: cd b7 in r28, 0x3d ; 61 3328c: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 3328e: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> 33292: 81 11 cpse r24, r1 33294: 2a c0 rjmp .+84 ; 0x332ea auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 33296: 10 91 93 13 lds r17, 0x1393 ; 0x801393 3329a: 1f 3f cpi r17, 0xFF ; 255 3329c: 91 f5 brne .+100 ; 0x33302 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 3329e: 80 91 92 13 lds r24, 0x1392 ; 0x801392 332a2: 81 11 cpse r24, r1 332a4: 60 c0 rjmp .+192 ; 0x33366 332a6: 1f 3f cpi r17, 0xFF ; 255 332a8: b9 f0 breq .+46 ; 0x332d8 inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 332aa: 81 e0 ldi r24, 0x01 ; 1 332ac: 90 e0 ldi r25, 0x00 ; 0 332ae: 90 93 2a 13 sts 0x132A, r25 ; 0x80132a 332b2: 80 93 29 13 sts 0x1329, r24 ; 0x801329 } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 332b6: 90 93 91 13 sts 0x1391, r25 ; 0x801391 332ba: 80 93 90 13 sts 0x1390, r24 ; 0x801390 lastErrorSource = ErrorSource::ErrorSourceNone; 332be: 8f ef ldi r24, 0xFF ; 255 332c0: 80 93 92 13 sts 0x1392, r24 ; 0x801392 // 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) { 332c4: 13 30 cpi r17, 0x03 ; 3 332c6: 09 f4 brne .+2 ; 0x332ca 332c8: 82 c0 rjmp .+260 ; 0x333ce 332ca: f8 f0 brcs .+62 ; 0x3330a 332cc: 16 30 cpi r17, 0x06 ; 6 332ce: 08 f4 brcc .+2 ; 0x332d2 332d0: 7b c0 rjmp .+246 ; 0x333c8 332d2: 17 30 cpi r17, 0x07 ; 7 332d4: 09 f4 brne .+2 ; 0x332d8 332d6: 7e c0 rjmp .+252 ; 0x333d4 // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 332d8: 0f 90 pop r0 332da: 0f 90 pop r0 332dc: 0f 90 pop r0 332de: 0f 90 pop r0 332e0: 0f 90 pop r0 332e2: df 91 pop r29 332e4: cf 91 pop r28 332e6: 1f 91 pop r17 332e8: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 332ea: 80 91 90 13 lds r24, 0x1390 ; 0x801390 332ee: 90 91 91 13 lds r25, 0x1391 ; 0x801391 332f2: 0f 94 bb c5 call 0x38b76 ; 0x38b76 332f6: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 332f8: 10 92 5f 0e sts 0x0E5F, r1 ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> 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) { 332fc: 8f 3f cpi r24, 0xFF ; 255 332fe: 79 f6 brne .-98 ; 0x3329e 33300: ca cf rjmp .-108 ; 0x33296 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 33302: 8f ef ldi r24, 0xFF ; 255 33304: 80 93 93 13 sts 0x1393, r24 ; 0x801393 33308: ca cf rjmp .-108 ; 0x3329e switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 3330a: 8c e0 ldi r24, 0x0C ; 12 3330c: 99 ea ldi r25, 0xA9 ; 169 3330e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 33312: 81 2f mov r24, r17 33314: 90 e0 ldi r25, 0x00 ; 0 33316: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 3331a: 0f 94 0a 9f call 0x33e14 ; 0x33e14 if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 3331e: 80 91 92 13 lds r24, 0x1392 ; 0x801392 33322: 81 30 cpi r24, 0x01 ; 1 33324: 89 f4 brne .+34 ; 0x33348 ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 33326: 85 e0 ldi r24, 0x05 ; 5 33328: 99 ea ldi r25, 0xA9 ; 169 3332a: 0f 94 1e c3 call 0x3863c ; 0x3863c void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 3332e: 41 2f mov r20, r17 33330: 62 e4 ldi r22, 0x42 ; 66 33332: ce 01 movw r24, r28 33334: 01 96 adiw r24, 0x01 ; 1 33336: 0f 94 d6 c2 call 0x385ac ; 0x385ac 3333a: 49 81 ldd r20, Y+1 ; 0x01 3333c: 5a 81 ldd r21, Y+2 ; 0x02 3333e: 6b 81 ldd r22, Y+3 ; 0x03 33340: 7c 81 ldd r23, Y+4 ; 0x04 33342: 8d 81 ldd r24, Y+5 ; 0x05 33344: 0f 94 48 98 call 0x33090 ; 0x33090 } // 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) { 33348: 80 91 90 13 lds r24, 0x1390 ; 0x801390 3334c: 90 91 91 13 lds r25, 0x1391 ; 0x801391 33350: 84 30 cpi r24, 0x04 ; 4 33352: 20 e8 ldi r18, 0x80 ; 128 33354: 92 07 cpc r25, r18 33356: 21 f0 breq .+8 ; 0x33360 33358: 89 30 cpi r24, 0x09 ; 9 3335a: 90 48 sbci r25, 0x80 ; 128 3335c: 09 f0 breq .+2 ; 0x33360 3335e: bc cf rjmp .-136 ; 0x332d8 case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 33360: 0f 94 f3 72 call 0x2e5e6 ; 0x2e5e6 33364: b9 cf rjmp .-142 ; 0x332d8 // 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) { 33366: 19 30 cpi r17, 0x09 ; 9 33368: 08 f0 brcs .+2 ; 0x3336c 3336a: b6 cf rjmp .-148 ; 0x332d8 3336c: e1 2f mov r30, r17 3336e: f0 e0 ldi r31, 0x00 ; 0 33370: 88 27 eor r24, r24 33372: e2 54 subi r30, 0x42 ; 66 33374: f6 46 sbci r31, 0x66 ; 102 33376: 8e 4f sbci r24, 0xFE ; 254 33378: 0d 94 6b de jmp 0x3bcd6 ; 0x3bcd6 <__tablejump2__> 3337c: d0 3a cpi r29, 0xA0 ; 160 3337e: d0 3a cpi r29, 0xA0 ; 160 33380: d0 3a cpi r29, 0xA0 ; 160 33382: fe 3a cpi r31, 0xAE ; 174 33384: 2e 3b cpi r18, 0xBE ; 190 33386: 2e 3b cpi r18, 0xBE ; 190 33388: c8 3b cpi r28, 0xB8 ; 184 3338a: 9a 3b cpi r25, 0xBA ; 186 3338c: d6 3a cpi r29, 0xA6 ; 166 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 3338e: 80 91 90 13 lds r24, 0x1390 ; 0x801390 33392: 90 91 91 13 lds r25, 0x1391 ; 0x801391 33396: 87 38 cpi r24, 0x87 ; 135 33398: 20 e8 ldi r18, 0x80 ; 128 3339a: 92 07 cpc r25, r18 3339c: 21 f0 breq .+8 ; 0x333a6 3339e: 87 30 cpi r24, 0x07 ; 7 333a0: 91 48 sbci r25, 0x81 ; 129 333a2: 09 f0 breq .+2 ; 0x333a6 333a4: 99 cf rjmp .-206 ; 0x332d8 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 333a6: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 333aa: 84 30 cpi r24, 0x04 ; 4 333ac: 21 f4 brne .+8 ; 0x333b6 ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 333ae: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 333b2: 81 11 cpse r24, r1 333b4: 91 cf rjmp .-222 ; 0x332d8 // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 333b6: 81 e0 ldi r24, 0x01 ; 1 333b8: 80 93 5e 0e sts 0x0E5E, r24 ; 0x800e5e <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.513> menu_submenu(tuneIdlerStallguardThresholdMenu); 333bc: 60 e0 ldi r22, 0x00 ; 0 333be: 88 ef ldi r24, 0xF8 ; 248 333c0: 9a e3 ldi r25, 0x3A ; 58 333c2: 0f 94 47 d0 call 0x3a08e ; 0x3a08e 333c6: 88 cf rjmp .-240 ; 0x332d8 } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 333c8: 10 93 96 13 sts 0x1396, r17 ; 0x801396 333cc: 85 cf rjmp .-246 ; 0x332d8 void MMU2::ResetX42() { logic.ResetMMU(42); } void MMU2::TriggerResetPin() { reset(); 333ce: 0f 94 e3 c2 call 0x385c6 ; 0x385c6 333d2: 82 cf rjmp .-252 ; 0x332d8 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 333d4: 10 92 98 13 sts 0x1398, r1 ; 0x801398 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 333d8: 10 92 46 13 sts 0x1346, r1 ; 0x801346 currentScope = Scope::Stopped; 333dc: 10 92 2b 13 sts 0x132B, r1 ; 0x80132b 333e0: 60 e0 ldi r22, 0x00 ; 0 333e2: 8c ea ldi r24, 0xAC ; 172 333e4: 9c e0 ldi r25, 0x0C ; 12 333e6: 0f 94 7f dd call 0x3bafe ; 0x3bafe } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 333ea: 0f 94 ce 75 call 0x2eb9c ; 0x2eb9c 333ee: 74 cf rjmp .-280 ; 0x332d8 000333f0 : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 333f0: 4f 92 push r4 333f2: 5f 92 push r5 333f4: 6f 92 push r6 333f6: 7f 92 push r7 333f8: 8f 92 push r8 333fa: 9f 92 push r9 333fc: af 92 push r10 333fe: bf 92 push r11 33400: cf 92 push r12 33402: df 92 push r13 33404: ef 92 push r14 33406: ff 92 push r15 33408: 0f 93 push r16 3340a: 1f 93 push r17 3340c: cf 93 push r28 3340e: df 93 push r29 33410: cd b7 in r28, 0x3d ; 61 33412: de b7 in r29, 0x3e ; 62 33414: a0 97 sbiw r28, 0x20 ; 32 33416: 0f b6 in r0, 0x3f ; 63 33418: f8 94 cli 3341a: de bf out 0x3e, r29 ; 62 3341c: 0f be out 0x3f, r0 ; 63 3341e: cd bf out 0x3d, r28 ; 61 33420: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 33422: 0f 94 3f 99 call 0x3327e ; 0x3327e DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 33426: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 3342a: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 3342c: 0f 94 c3 97 call 0x32f86 ; 0x32f86 33430: 90 91 2c 13 lds r25, 0x132C ; 0x80132c } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 33434: 97 ff sbrs r25, 7 33436: 7d c0 rjmp .+250 ; 0x33532 // we are waiting for something switch (currentScope) { 33438: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 3343c: 82 30 cpi r24, 0x02 ; 2 3343e: b1 f0 breq .+44 ; 0x3346c 33440: 08 f4 brcc .+2 ; 0x33444 33442: 75 c0 rjmp .+234 ; 0x3352e 33444: 83 30 cpi r24, 0x03 ; 3 33446: e1 f1 breq .+120 ; 0x334c0 33448: 84 30 cpi r24, 0x04 ; 4 3344a: 09 f4 brne .+2 ; 0x3344e 3344c: 54 c0 rjmp .+168 ; 0x334f6 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 3344e: 0f 94 c3 97 call 0x32f86 ; 0x32f86 33452: 81 11 cpse r24, r1 33454: 6b c3 rjmp .+1750 ; 0x33b2c // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 33456: 82 e0 ldi r24, 0x02 ; 2 33458: 80 93 46 13 sts 0x1346, r24 ; 0x801346 currentScope = Scope::Idle; 3345c: 83 e0 ldi r24, 0x03 ; 3 3345e: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 33462: 82 e8 ldi r24, 0x82 ; 130 33464: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c // 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()) { 33468: 12 e0 ldi r17, 0x02 ; 2 3346a: db c2 rjmp .+1462 ; 0x33a22 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 3346c: 0f 94 86 3e call 0x27d0c ; 0x27d0c 33470: ab 01 movw r20, r22 33472: bc 01 movw r22, r24 33474: 80 91 38 13 lds r24, 0x1338 ; 0x801338 33478: 90 91 39 13 lds r25, 0x1339 ; 0x801339 3347c: a0 91 3a 13 lds r26, 0x133A ; 0x80133a 33480: b0 91 3b 13 lds r27, 0x133B ; 0x80133b 33484: 88 51 subi r24, 0x18 ; 24 33486: 9c 4f sbci r25, 0xFC ; 252 33488: af 4f sbci r26, 0xFF ; 255 3348a: 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 3348c: 48 17 cp r20, r24 3348e: 59 07 cpc r21, r25 33490: 6a 07 cpc r22, r26 33492: 7b 07 cpc r23, r27 33494: 08 f4 brcc .+2 ; 0x33498 33496: 4b c0 rjmp .+150 ; 0x3352e void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 33498: 82 e7 ldi r24, 0x72 ; 114 3349a: 92 e1 ldi r25, 0x12 ; 18 3349c: 0f 94 87 db call 0x3b70e ; 0x3b70e while (uart->read() != -1) 334a0: 01 96 adiw r24, 0x01 ; 1 334a2: d1 f7 brne .-12 ; 0x33498 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 334a4: 81 e0 ldi r24, 0x01 ; 1 334a6: 80 93 46 13 sts 0x1346, r24 ; 0x801346 currentScope = Scope::StartSeq; 334aa: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 334ae: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 334b2: 86 e0 ldi r24, 0x06 ; 6 334b4: 80 93 2d 13 sts 0x132D, r24 ; 0x80132d SendVersion(0); 334b8: 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); 334ba: 0f 94 72 98 call 0x330e4 ; 0x330e4 334be: 37 c0 rjmp .+110 ; 0x3352e } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 334c0: 92 38 cpi r25, 0x82 ; 130 334c2: 29 f6 brne .-118 ; 0x3344e IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 334c4: 0f 94 86 3e call 0x27d0c ; 0x27d0c 334c8: ab 01 movw r20, r22 334ca: bc 01 movw r22, r24 334cc: 80 91 38 13 lds r24, 0x1338 ; 0x801338 334d0: 90 91 39 13 lds r25, 0x1339 ; 0x801339 334d4: a0 91 3a 13 lds r26, 0x133A ; 0x80133a 334d8: b0 91 3b 13 lds r27, 0x133B ; 0x80133b 334dc: 88 51 subi r24, 0x18 ; 24 334de: 9c 4f sbci r25, 0xFC ; 252 334e0: af 4f sbci r26, 0xFF ; 255 334e2: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 334e4: 48 17 cp r20, r24 334e6: 59 07 cpc r21, r25 334e8: 6a 07 cpc r22, r26 334ea: 7b 07 cpc r23, r27 334ec: 08 f4 brcc .+2 ; 0x334f0 334ee: af cf rjmp .-162 ; 0x3344e void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 334f0: 0f 94 93 98 call 0x33126 ; 0x33126 334f4: 1c c0 rjmp .+56 ; 0x3352e } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 334f6: 0f 94 86 3e call 0x27d0c ; 0x27d0c 334fa: ab 01 movw r20, r22 334fc: bc 01 movw r22, r24 334fe: 80 91 38 13 lds r24, 0x1338 ; 0x801338 33502: 90 91 39 13 lds r25, 0x1339 ; 0x801339 33506: a0 91 3a 13 lds r26, 0x133A ; 0x80133a 3350a: b0 91 3b 13 lds r27, 0x133B ; 0x80133b 3350e: 88 51 subi r24, 0x18 ; 24 33510: 9c 4f sbci r25, 0xFC ; 252 33512: af 4f sbci r26, 0xFF ; 255 33514: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 33516: 48 17 cp r20, r24 33518: 59 07 cpc r21, r25 3351a: 6a 07 cpc r22, r26 3351c: 7b 07 cpc r23, r27 3351e: 40 f7 brcc .-48 ; 0x334f0 }; 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(); 33520: 0f 94 2e c3 call 0x3865c ; 0x3865c if (fs != lastFSensor) { 33524: 90 91 6d 13 lds r25, 0x136D ; 0x80136d 33528: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 3352a: 0f 94 b2 98 call 0x33164 ; 0x33164 // 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; 3352e: 10 e0 ldi r17, 0x00 ; 0 33530: 78 c2 rjmp .+1264 ; 0x33a22 StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 33532: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 33534: d1 2c mov r13, r1 33536: 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; 33538: 99 24 eor r9, r9 3353a: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 3353c: 55 e0 ldi r21, 0x05 ; 5 3353e: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 33540: 63 e0 ldi r22, 0x03 ; 3 33542: 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; 33544: 74 e0 ldi r23, 0x04 ; 4 33546: 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; 33548: e2 e0 ldi r30, 0x02 ; 2 3354a: 6e 2e mov r6, r30 3354c: 66 c0 rjmp .+204 ; 0x3361a ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 3354e: 23 30 cpi r18, 0x03 ; 3 33550: 09 f4 brne .+2 ; 0x33554 33552: e0 c0 rjmp .+448 ; 0x33714 33554: 24 30 cpi r18, 0x04 ; 4 33556: 09 f0 breq .+2 ; 0x3355a 33558: 83 c0 rjmp .+262 ; 0x33660 } 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'); 3355a: 20 ed ldi r18, 0xD0 ; 208 3355c: 28 0f add r18, r24 3355e: 2a 30 cpi r18, 0x0A ; 10 33560: 08 f4 brcc .+2 ; 0x33564 33562: f8 c0 rjmp .+496 ; 0x33754 33564: 2f e9 ldi r18, 0x9F ; 159 33566: 28 0f add r18, r24 33568: 26 30 cpi r18, 0x06 ; 6 3356a: 08 f4 brcc .+2 ; 0x3356e 3356c: f3 c0 rjmp .+486 ; 0x33754 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 3356e: 8a 30 cpi r24, 0x0A ; 10 33570: 09 f0 breq .+2 ; 0x33574 33572: fa c0 rjmp .+500 ; 0x33768 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()) { 33574: 40 90 52 13 lds r4, 0x1352 ; 0x801352 33578: 8e e4 ldi r24, 0x4E ; 78 3357a: 93 e1 ldi r25, 0x13 ; 19 3357c: 0f 94 c5 c2 call 0x3858a ; 0x3858a 33580: 48 12 cpse r4, r24 33582: b8 c0 rjmp .+368 ; 0x336f4 // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 33584: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d /// @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; } 33588: 88 e0 ldi r24, 0x08 ; 8 3358a: ee e4 ldi r30, 0x4E ; 78 3358c: f3 e1 ldi r31, 0x13 ; 19 3358e: de 01 movw r26, r28 33590: 51 96 adiw r26, 0x11 ; 17 33592: 01 90 ld r0, Z+ 33594: 0d 92 st X+, r0 33596: 8a 95 dec r24 33598: e1 f7 brne .-8 ; 0x33592 3359a: 88 e0 ldi r24, 0x08 ; 8 3359c: fe 01 movw r30, r28 3359e: 71 96 adiw r30, 0x11 ; 17 335a0: de 01 movw r26, r28 335a2: 59 96 adiw r26, 0x19 ; 25 335a4: 01 90 ld r0, Z+ 335a6: 0d 92 st X+, r0 335a8: 8a 95 dec r24 335aa: e1 f7 brne .-8 ; 0x335a4 while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 335ac: 88 e0 ldi r24, 0x08 ; 8 335ae: fe 01 movw r30, r28 335b0: 79 96 adiw r30, 0x19 ; 25 335b2: ae e3 ldi r26, 0x3E ; 62 335b4: b3 e1 ldi r27, 0x13 ; 19 335b6: 01 90 ld r0, Z+ 335b8: 0d 92 st X+, r0 335ba: 8a 95 dec r24 335bc: e1 f7 brne .-8 ; 0x335b6 } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 335be: 8c e3 ldi r24, 0x3C ; 60 335c0: 89 83 std Y+1, r24 ; 0x01 335c2: fe 01 movw r30, r28 335c4: 32 96 adiw r30, 0x02 ; 2 335c6: a6 e5 ldi r26, 0x56 ; 86 335c8: b3 e1 ldi r27, 0x13 ; 19 for (uint8_t i = 0; i < lrb; ++i) { 335ca: 20 e0 ldi r18, 0x00 ; 0 335cc: cf 01 movw r24, r30 335ce: 52 16 cp r5, r18 335d0: 09 f4 brne .+2 ; 0x335d4 335d2: cd c0 rjmp .+410 ; 0x3376e uint8_t b = lastReceivedBytes[i]; 335d4: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 335d6: 40 ee ldi r20, 0xE0 ; 224 335d8: 43 0f add r20, r19 335da: 40 36 cpi r20, 0x60 ; 96 335dc: 08 f0 brcs .+2 ; 0x335e0 b = '.'; 335de: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 335e0: 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) { 335e2: 2f 5f subi r18, 0xFF ; 255 335e4: f4 cf rjmp .-24 ; 0x335ce } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 335e6: 8e 34 cpi r24, 0x4E ; 78 335e8: 08 f0 brcs .+2 ; 0x335ec 335ea: 56 c0 rjmp .+172 ; 0x33698 335ec: 8b 34 cpi r24, 0x4B ; 75 335ee: 08 f0 brcs .+2 ; 0x335f2 335f0: 46 c0 rjmp .+140 ; 0x3367e 335f2: 82 34 cpi r24, 0x42 ; 66 335f4: 09 f4 brne .+2 ; 0x335f8 335f6: 43 c0 rjmp .+134 ; 0x3367e 335f8: e0 f5 brcc .+120 ; 0x33672 335fa: 8a 30 cpi r24, 0x0A ; 10 335fc: 59 f0 breq .+22 ; 0x33614 335fe: 8d 30 cpi r24, 0x0D ; 13 33600: 49 f0 breq .+18 ; 0x33614 } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 33602: b0 92 4d 13 sts 0x134D, r11 ; 0x80134d 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') { 33606: a1 10 cpse r10, r1 33608: 05 c1 rjmp .+522 ; 0x33814 3360a: 1f 36 cpi r17, 0x6F ; 111 3360c: 09 f0 breq .+2 ; 0x33610 3360e: fc c3 rjmp .+2040 ; 0x33e08 ++ok; 33610: aa 24 eor r10, r10 33612: 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; 33614: 4f ef ldi r20, 0xFF ; 255 33616: c4 1a sub r12, r20 33618: d4 0a sbc r13, r20 3361a: 82 e7 ldi r24, 0x72 ; 114 3361c: 92 e1 ldi r25, 0x12 ; 18 3361e: 0f 94 87 db call 0x3b70e ; 0x3b70e 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) { 33622: 97 fd sbrc r25, 7 33624: 00 c1 rjmp .+512 ; 0x33826 ++bytesConsumed; RecordReceivedByte(c); 33626: 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]; 33628: 20 91 66 13 lds r18, 0x1366 ; 0x801366 3362c: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 3362e: f9 01 movw r30, r18 33630: e7 5d subi r30, 0xD7 ; 215 33632: fc 4e sbci r31, 0xEC ; 236 33634: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 33636: 79 01 movw r14, r18 33638: ef ef ldi r30, 0xFF ; 255 3363a: ee 1a sub r14, r30 3363c: fe 0a sbc r15, r30 3363e: ff e0 ldi r31, 0x0F ; 15 33640: ef 22 and r14, r31 33642: ff 24 eor r15, r15 33644: 5e 2c mov r5, r14 33646: e0 92 66 13 sts 0x1366, r14 ; 0x801366 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 3364a: 20 91 4d 13 lds r18, 0x134D ; 0x80134d 3364e: 22 30 cpi r18, 0x02 ; 2 33650: 09 f4 brne .+2 ; 0x33654 33652: 48 c0 rjmp .+144 ; 0x336e4 33654: 08 f0 brcs .+2 ; 0x33658 33656: 7b cf rjmp .-266 ; 0x3354e 33658: 22 23 and r18, r18 3365a: 29 f2 breq .-118 ; 0x335e6 3365c: 21 30 cpi r18, 0x01 ; 1 3365e: 51 f1 breq .+84 ; 0x336b4 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 33660: 1a 30 cpi r17, 0x0A ; 10 33662: 09 f4 brne .+2 ; 0x33666 33664: 8f cf rjmp .-226 ; 0x33584 33666: 1d 30 cpi r17, 0x0D ; 13 33668: 09 f4 brne .+2 ; 0x3366c 3366a: 8c cf rjmp .-232 ; 0x33584 default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 3366c: 10 92 53 13 sts 0x1353, r1 ; 0x801353 33670: ca cf rjmp .-108 ; 0x33606 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 33672: 85 34 cpi r24, 0x45 ; 69 33674: 30 f2 brcs .-116 ; 0x33602 33676: 87 34 cpi r24, 0x47 ; 71 33678: 10 f0 brcs .+4 ; 0x3367e 3367a: 88 34 cpi r24, 0x48 ; 72 3367c: 11 f6 brne .-124 ; 0x33602 case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 3367e: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e responseMsg.request.value = 0; 33682: 10 92 4f 13 sts 0x134F, r1 ; 0x80134f responseMsg.request.value2 = 0; 33686: 10 92 51 13 sts 0x1351, r1 ; 0x801351 3368a: 10 92 50 13 sts 0x1350, r1 ; 0x801350 responseMsg.request.crc8 = 0; 3368e: 10 92 52 13 sts 0x1352, r1 ; 0x801352 rspState = ResponseStates::RequestValue; 33692: 90 92 4d 13 sts 0x134D, r9 ; 0x80134d 33696: be cf rjmp .-132 ; 0x33614 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 33698: 89 35 cpi r24, 0x59 ; 89 3369a: 40 f4 brcc .+16 ; 0x336ac 3369c: 87 35 cpi r24, 0x57 ; 87 3369e: 78 f7 brcc .-34 ; 0x3367e 336a0: 20 eb ldi r18, 0xB0 ; 176 336a2: 28 0f add r18, r24 336a4: 26 30 cpi r18, 0x06 ; 6 336a6: 08 f0 brcs .+2 ; 0x336aa 336a8: ac cf rjmp .-168 ; 0x33602 336aa: e9 cf rjmp .-46 ; 0x3367e 336ac: 86 36 cpi r24, 0x66 ; 102 336ae: 09 f0 breq .+2 ; 0x336b2 336b0: a8 cf rjmp .-176 ; 0x33602 336b2: e5 cf rjmp .-54 ; 0x3367e } 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'); 336b4: 20 ed ldi r18, 0xD0 ; 208 336b6: 28 0f add r18, r24 336b8: 2a 30 cpi r18, 0x0A ; 10 336ba: 50 f0 brcs .+20 ; 0x336d0 336bc: 2f e9 ldi r18, 0x9F ; 159 336be: 28 0f add r18, r24 336c0: 26 30 cpi r18, 0x06 ; 6 336c2: 30 f0 brcs .+12 ; 0x336d0 case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 336c4: 80 32 cpi r24, 0x20 ; 32 336c6: 09 f0 breq .+2 ; 0x336ca 336c8: 9c cf rjmp .-200 ; 0x33602 rspState = ResponseStates::ParamCode; 336ca: 60 92 4d 13 sts 0x134D, r6 ; 0x80134d 336ce: a2 cf rjmp .-188 ; 0x33614 return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 336d0: 0f 94 a4 c2 call 0x38548 ; 0x38548 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 336d4: 90 91 4f 13 lds r25, 0x134F ; 0x80134f 336d8: 92 95 swap r25 336da: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 336dc: 89 0f add r24, r25 336de: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f 336e2: 98 cf rjmp .-208 ; 0x33614 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 336e4: 87 34 cpi r24, 0x47 ; 71 336e6: 48 f4 brcc .+18 ; 0x336fa 336e8: 85 34 cpi r24, 0x45 ; 69 336ea: 58 f4 brcc .+22 ; 0x33702 336ec: 2f eb ldi r18, 0xBF ; 191 336ee: 28 0f add r18, r24 336f0: 22 30 cpi r18, 0x02 ; 2 336f2: 38 f0 brcs .+14 ; 0x33702 return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 336f4: 10 92 53 13 sts 0x1353, r1 ; 0x801353 336f8: 84 cf rjmp .-248 ; 0x33602 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 336fa: 80 35 cpi r24, 0x50 ; 80 336fc: 11 f0 breq .+4 ; 0x33702 336fe: 82 35 cpi r24, 0x52 ; 82 33700: c9 f7 brne .-14 ; 0x336f4 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 33702: 80 92 4d 13 sts 0x134D, r8 ; 0x80134d responseMsg.paramCode = (ResponseMsgParamCodes)c; 33706: 80 93 53 13 sts 0x1353, r24 ; 0x801353 responseMsg.paramValue = 0; 3370a: 10 92 55 13 sts 0x1355, r1 ; 0x801355 3370e: 10 92 54 13 sts 0x1354, r1 ; 0x801354 33712: 80 cf rjmp .-256 ; 0x33614 33714: 20 ed ldi r18, 0xD0 ; 208 33716: 28 0f add r18, r24 33718: 2a 30 cpi r18, 0x0A ; 10 3371a: 48 f0 brcs .+18 ; 0x3372e 3371c: 2f e9 ldi r18, 0x9F ; 159 3371e: 28 0f add r18, r24 33720: 26 30 cpi r18, 0x06 ; 6 33722: 28 f0 brcs .+10 ; 0x3372e case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 33724: 8a 32 cpi r24, 0x2A ; 42 33726: 31 f7 brne .-52 ; 0x336f4 rspState = ResponseStates::CRC; 33728: 70 92 4d 13 sts 0x134D, r7 ; 0x80134d 3372c: 73 cf rjmp .-282 ; 0x33614 return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 3372e: 0f 94 a4 c2 call 0x38548 ; 0x38548 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 33732: 20 91 54 13 lds r18, 0x1354 ; 0x801354 33736: 30 91 55 13 lds r19, 0x1355 ; 0x801355 3373a: 44 e0 ldi r20, 0x04 ; 4 3373c: 22 0f add r18, r18 3373e: 33 1f adc r19, r19 33740: 4a 95 dec r20 33742: e1 f7 brne .-8 ; 0x3373c responseMsg.paramValue += Char2Nibble(c); 33744: 82 0f add r24, r18 33746: 93 2f mov r25, r19 33748: 91 1d adc r25, r1 3374a: 90 93 55 13 sts 0x1355, r25 ; 0x801355 3374e: 80 93 54 13 sts 0x1354, r24 ; 0x801354 33752: 60 cf rjmp .-320 ; 0x33614 return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 33754: 0f 94 a4 c2 call 0x38548 ; 0x38548 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 33758: 90 91 52 13 lds r25, 0x1352 ; 0x801352 3375c: 92 95 swap r25 3375e: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 33760: 89 0f add r24, r25 33762: 80 93 52 13 sts 0x1352, r24 ; 0x801352 33766: 56 cf rjmp .-340 ; 0x33614 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 33768: 8d 30 cpi r24, 0x0D ; 13 3376a: 21 f6 brne .-120 ; 0x336f4 3376c: 03 cf rjmp .-506 ; 0x33574 if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 3376e: e8 0e add r14, r24 33770: f9 1e adc r15, r25 33772: f7 01 movw r30, r14 33774: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 33776: 10 92 66 13 sts 0x1366, r1 ; 0x801366 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 3377a: 82 ef ldi r24, 0xF2 ; 242 3377c: 9a ea ldi r25, 0xAA ; 170 3377e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 33782: 8c ee ldi r24, 0xEC ; 236 33784: 9a ea ldi r25, 0xAA ; 170 33786: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 3378a: ce 01 movw r24, r28 3378c: 01 96 adiw r24, 0x01 ; 1 3378e: 0f 94 60 d6 call 0x3acc0 ; 0x3acc0 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 33792: 0f 94 5a 6f call 0x2deb4 ; 0x2deb4 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 33796: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 3379a: 81 30 cpi r24, 0x01 ; 1 3379c: 09 f4 brne .+2 ; 0x337a0 3379e: 74 c0 rjmp .+232 ; 0x33888 337a0: 08 f4 brcc .+2 ; 0x337a4 337a2: c5 ce rjmp .-630 ; 0x3352e 337a4: 83 30 cpi r24, 0x03 ; 3 337a6: 09 f4 brne .+2 ; 0x337aa 337a8: d1 c0 rjmp .+418 ; 0x3394c 337aa: 84 30 cpi r24, 0x04 ; 4 337ac: 09 f0 breq .+2 ; 0x337b0 337ae: 4f ce rjmp .-866 ; 0x3344e return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 337b0: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 337b4: 86 30 cpi r24, 0x06 ; 6 337b6: 09 f4 brne .+2 ; 0x337ba 337b8: 6c c1 rjmp .+728 ; 0x33a92 337ba: 08 f0 brcs .+2 ; 0x337be 337bc: 93 c1 rjmp .+806 ; 0x33ae4 337be: 84 30 cpi r24, 0x04 ; 4 337c0: 09 f4 brne .+2 ; 0x337c4 337c2: 09 c1 rjmp .+530 ; 0x339d6 337c4: 85 30 cpi r24, 0x05 ; 5 337c6: 09 f0 breq .+2 ; 0x337ca 337c8: cc c0 rjmp .+408 ; 0x33962 case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 337ca: 80 91 43 13 lds r24, 0x1343 ; 0x801343 337ce: 81 34 cpi r24, 0x41 ; 65 337d0: 09 f4 brne .+2 ; 0x337d4 337d2: 96 c1 rjmp .+812 ; 0x33b00 337d4: 82 35 cpi r24, 0x52 ; 82 337d6: 09 f0 breq .+2 ; 0x337da 337d8: c4 c0 rjmp .+392 ; 0x33962 errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 337da: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b errorCode = ErrorCode::PROTOCOL_ERROR; 337de: 8d e2 ldi r24, 0x2D ; 45 337e0: 90 e8 ldi r25, 0x80 ; 128 337e2: 90 93 6a 13 sts 0x136A, r25 ; 0x80136a 337e6: 80 93 69 13 sts 0x1369, r24 ; 0x801369 } 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")); 337ea: 85 e7 ldi r24, 0x75 ; 117 337ec: 98 ea ldi r25, 0xA8 ; 168 337ee: 0f 94 77 6f call 0x2deee ; 0x2deee void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 337f2: 85 e0 ldi r24, 0x05 ; 5 337f4: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c SendMsg(rq); 337f8: 40 91 2e 13 lds r20, 0x132E ; 0x80132e 337fc: 50 91 2f 13 lds r21, 0x132F ; 0x80132f 33800: 60 91 30 13 lds r22, 0x1330 ; 0x801330 33804: 70 91 31 13 lds r23, 0x1331 ; 0x801331 33808: 80 91 32 13 lds r24, 0x1332 ; 0x801332 3380c: 0f 94 60 70 call 0x2e0c0 ; 0x2e0c0 33810: 16 e0 ldi r17, 0x06 ; 6 33812: 07 c1 rjmp .+526 ; 0x33a22 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') { 33814: 1b 36 cpi r17, 0x6B ; 107 33816: 09 f0 breq .+2 ; 0x3381a 33818: f7 c2 rjmp .+1518 ; 0x33e08 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")); 3381a: 86 e5 ldi r24, 0x56 ; 86 3381c: 98 ea ldi r25, 0xA8 ; 168 3381e: 0f 94 77 6f call 0x2deee ; 0x2deee 33822: 18 e0 ldi r17, 0x08 ; 8 33824: fe c0 rjmp .+508 ; 0x33a22 default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 33826: cd 28 or r12, r13 33828: 19 f0 breq .+6 ; 0x33830 RecordUARTActivity(); // something has happened on the UART, update the timeout record 3382a: 0f 94 5a 6f call 0x2deb4 ; 0x2deb4 3382e: 7f ce rjmp .-770 ; 0x3352e IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 33830: 0f 94 86 3e call 0x27d0c ; 0x27d0c 33834: ab 01 movw r20, r22 33836: bc 01 movw r22, r24 33838: 80 91 38 13 lds r24, 0x1338 ; 0x801338 3383c: 90 91 39 13 lds r25, 0x1339 ; 0x801339 33840: a0 91 3a 13 lds r26, 0x133A ; 0x80133a 33844: b0 91 3b 13 lds r27, 0x133B ; 0x80133b 33848: 80 53 subi r24, 0x30 ; 48 3384a: 98 4f sbci r25, 0xF8 ; 248 3384c: af 4f sbci r26, 0xFF ; 255 3384e: 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) { 33850: 48 17 cp r20, r24 33852: 59 07 cpc r21, r25 33854: 6a 07 cpc r22, r26 33856: 7b 07 cpc r23, r27 33858: 08 f4 brcc .+2 ; 0x3385c 3385a: 69 ce rjmp .-814 ; 0x3352e 3385c: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33860: 88 23 and r24, r24 33862: 09 f4 brne .+2 ; 0x33866 33864: 64 ce rjmp .-824 ; 0x3352e rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 33866: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 3386a: 81 e0 ldi r24, 0x01 ; 1 3386c: 80 93 46 13 sts 0x1346, r24 ; 0x801346 currentScope = Scope::StartSeq; 33870: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 33874: 86 e0 ldi r24, 0x06 ; 6 33876: 80 93 2d 13 sts 0x132D, r24 ; 0x80132d SendVersion(0); 3387a: 80 e0 ldi r24, 0x00 ; 0 3387c: 0f 94 72 98 call 0x330e4 ; 0x330e4 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 33880: 64 e0 ldi r22, 0x04 ; 4 33882: 8e e2 ldi r24, 0x2E ; 46 33884: 98 ea ldi r25, 0xA8 ; 168 33886: 79 c0 rjmp .+242 ; 0x3397a return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 33888: 10 91 2c 13 lds r17, 0x132C ; 0x80132c 3388c: 13 30 cpi r17, 0x03 ; 3 3388e: b1 f1 breq .+108 ; 0x338fc 33890: 60 f0 brcs .+24 ; 0x338aa 33892: 16 30 cpi r17, 0x06 ; 6 33894: 09 f4 brne .+2 ; 0x33898 33896: 50 c0 rjmp .+160 ; 0x33938 33898: 19 30 cpi r17, 0x09 ; 9 3389a: 09 f0 breq .+2 ; 0x3389e 3389c: be cf rjmp .-132 ; 0x3381a // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 3389e: 0f 94 8a 71 call 0x2e314 ; 0x2e314 338a2: 88 23 and r24, r24 338a4: 09 f4 brne .+2 ; 0x338a8 338a6: 43 ce rjmp .-890 ; 0x3352e 338a8: 40 ce rjmp .-896 ; 0x3352a void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 338aa: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 338ae: 83 35 cpi r24, 0x53 ; 83 338b0: 21 f4 brne .+8 ; 0x338ba 338b2: 80 91 3f 13 lds r24, 0x133F ; 0x80133f 338b6: 18 17 cp r17, r24 338b8: 11 f0 breq .+4 ; 0x338be mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 338ba: 81 2f mov r24, r17 338bc: fe cd rjmp .-1028 ; 0x334ba 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; 338be: 80 91 44 13 lds r24, 0x1344 ; 0x801344 338c2: e1 2f mov r30, r17 338c4: f0 e0 ldi r31, 0x00 ; 0 338c6: df 01 movw r26, r30 338c8: a8 58 subi r26, 0x88 ; 136 338ca: bc 4e sbci r27, 0xEC ; 236 338cc: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 338ce: ed 5a subi r30, 0xAD ; 173 338d0: f7 45 sbci r31, 0x57 ; 87 338d2: e4 91 lpm r30, Z 338d4: 8e 17 cp r24, r30 338d6: 41 f0 breq .+16 ; 0x338e8 if (--retries == 0) { 338d8: 80 91 2d 13 lds r24, 0x132D ; 0x80132d 338dc: 81 50 subi r24, 0x01 ; 1 338de: 80 93 2d 13 sts 0x132D, r24 ; 0x80132d 338e2: 81 11 cpse r24, r1 338e4: ea cf rjmp .-44 ; 0x338ba 338e6: 99 cf rjmp .-206 ; 0x3381a SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 338e8: 85 e9 ldi r24, 0x95 ; 149 338ea: 9a ea ldi r25, 0xAA ; 170 338ec: 0e 94 86 7b call 0xf70c ; 0xf70c /// @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; } 338f0: 8a e0 ldi r24, 0x0A ; 10 338f2: 80 93 3d 13 sts 0x133D, r24 ; 0x80133d } else { SendVersion(stage); } } else { ResetCommunicationTimeoutAttempts(); // got a meaningful response from the MMU, stop data layer timeout tracking SendVersion(stage + 1); 338f6: 81 e0 ldi r24, 0x01 ; 1 338f8: 81 0f add r24, r17 338fa: df cd rjmp .-1090 ; 0x334ba 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) { 338fc: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 33900: 83 35 cpi r24, 0x53 ; 83 33902: 21 f4 brne .+8 ; 0x3390c 33904: 80 91 3f 13 lds r24, 0x133F ; 0x80133f 33908: 83 30 cpi r24, 0x03 ; 3 3390a: 11 f0 breq .+4 ; 0x33910 // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 3390c: 83 e0 ldi r24, 0x03 ; 3 3390e: d5 cd rjmp .-1110 ; 0x334ba } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 33910: 80 91 44 13 lds r24, 0x1344 ; 0x801344 33914: 90 91 45 13 lds r25, 0x1345 ; 0x801345 33918: 90 93 7c 13 sts 0x137C, r25 ; 0x80137c 3391c: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 33920: 10 92 77 13 sts 0x1377, r1 ; 0x801377 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 33924: e3 e9 ldi r30, 0x93 ; 147 33926: fa ea ldi r31, 0xAA ; 170 33928: 84 91 lpm r24, Z 3392a: 60 91 75 13 lds r22, 0x1375 ; 0x801375 3392e: 70 e0 ldi r23, 0x00 ; 0 33930: 49 e0 ldi r20, 0x09 ; 9 33932: 0f 94 cb 70 call 0x2e196 ; 0x2e196 33936: fb cd rjmp .-1034 ; 0x3352e currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 33938: 82 e0 ldi r24, 0x02 ; 2 3393a: 80 93 46 13 sts 0x1346, r24 ; 0x801346 currentScope = Scope::Idle; 3393e: 83 e0 ldi r24, 0x03 ; 3 33940: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 33944: 82 e8 ldi r24, 0x82 ; 130 33946: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c 3394a: d2 cd rjmp .-1116 ; 0x334f0 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 3394c: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 33950: 88 30 cpi r24, 0x08 ; 8 33952: 09 f4 brne .+2 ; 0x33956 33954: b7 c0 rjmp .+366 ; 0x33ac4 33956: a8 f4 brcc .+42 ; 0x33982 33958: 84 30 cpi r24, 0x04 ; 4 3395a: d9 f0 breq .+54 ; 0x33992 3395c: 87 30 cpi r24, 0x07 ; 7 3395e: 09 f4 brne .+2 ; 0x33962 33960: ae c0 rjmp .+348 ; 0x33abe return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 33962: 81 e0 ldi r24, 0x01 ; 1 33964: 80 93 46 13 sts 0x1346, r24 ; 0x801346 currentScope = Scope::DelayedRestart; 33968: 82 e0 ldi r24, 0x02 ; 2 3396a: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 3396e: 83 e8 ldi r24, 0x83 ; 131 33970: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; currentScope = Scope::DelayedRestart; DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); 33974: 65 e0 ldi r22, 0x05 ; 5 33976: 84 e4 ldi r24, 0x44 ; 68 33978: 98 ea ldi r25, 0xA8 ; 168 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 3397a: 0f 94 e8 6f call 0x2dfd0 ; 0x2dfd0 3397e: 18 2f mov r17, r24 33980: 50 c0 rjmp .+160 ; 0x33a22 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 33982: 8a 30 cpi r24, 0x0A ; 10 33984: 09 f4 brne .+2 ; 0x33988 33986: a7 c0 rjmp .+334 ; 0x33ad6 33988: 60 f3 brcs .-40 ; 0x33962 3398a: 8d 30 cpi r24, 0x0D ; 13 3398c: 08 f4 brcc .+2 ; 0x33990 3398e: 5f cd rjmp .-1346 ; 0x3344e 33990: e8 cf rjmp .-48 ; 0x33962 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) { 33992: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 33996: 8e 34 cpi r24, 0x4E ; 78 33998: 60 f5 brcc .+88 ; 0x339f2 3399a: 8b 34 cpi r24, 0x4B ; 75 3399c: 10 f4 brcc .+4 ; 0x339a2 3399e: 85 34 cpi r24, 0x45 ; 69 339a0: 01 f7 brne .-64 ; 0x33962 case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 339a2: 80 91 43 13 lds r24, 0x1343 ; 0x801343 339a6: 86 34 cpi r24, 0x46 ; 70 339a8: 09 f4 brne .+2 ; 0x339ac 339aa: 73 c0 rjmp .+230 ; 0x33a92 return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 339ac: 84 e0 ldi r24, 0x04 ; 4 339ae: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b 339b2: 85 e0 ldi r24, 0x05 ; 5 339b4: ee e3 ldi r30, 0x3E ; 62 339b6: f3 e1 ldi r31, 0x13 ; 19 339b8: de 01 movw r26, r28 339ba: 11 96 adiw r26, 0x01 ; 1 339bc: 01 90 ld r0, Z+ 339be: 0d 92 st X+, r0 339c0: 8a 95 dec r24 339c2: e1 f7 brne .-8 ; 0x339bc StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 339c4: 85 e0 ldi r24, 0x05 ; 5 339c6: fe 01 movw r30, r28 339c8: 31 96 adiw r30, 0x01 ; 1 339ca: ae e2 ldi r26, 0x2E ; 46 339cc: b3 e1 ldi r27, 0x13 ; 19 339ce: 01 90 ld r0, Z+ 339d0: 0d 92 st X+, r0 339d2: 8a 95 dec r24 339d4: e1 f7 brne .-8 ; 0x339ce default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 339d6: 0f 94 d5 98 call 0x331aa ; 0x331aa 339da: 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) { 339dc: 85 30 cpi r24, 0x05 ; 5 339de: 09 f2 breq .-126 ; 0x33962 339e0: 08 f0 brcs .+2 ; 0x339e4 339e2: 9c c0 rjmp .+312 ; 0x33b1c 339e4: 82 30 cpi r24, 0x02 ; 2 339e6: 09 f4 brne .+2 ; 0x339ea 339e8: 32 cd rjmp .-1436 ; 0x3344e 339ea: 84 30 cpi r24, 0x04 ; 4 339ec: 09 f4 brne .+2 ; 0x339f0 339ee: 3b cf rjmp .-394 ; 0x33866 339f0: 18 c0 rjmp .+48 ; 0x33a22 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) { 339f2: 84 35 cpi r24, 0x54 ; 84 339f4: 08 f4 brcc .+2 ; 0x339f8 339f6: b5 cf rjmp .-150 ; 0x33962 339f8: 86 35 cpi r24, 0x56 ; 86 339fa: 98 f2 brcs .-90 ; 0x339a2 339fc: 88 35 cpi r24, 0x58 ; 88 339fe: 09 f0 breq .+2 ; 0x33a02 33a00: b0 cf rjmp .-160 ; 0x33962 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) { 33a02: 80 91 43 13 lds r24, 0x1343 ; 0x801343 33a06: 86 34 cpi r24, 0x46 ; 70 33a08: 89 f1 breq .+98 ; 0x33a6c 33a0a: 80 35 cpi r24, 0x50 ; 80 33a0c: c1 f1 breq .+112 ; 0x33a7e 33a0e: 82 34 cpi r24, 0x42 ; 66 33a10: 09 f0 breq .+2 ; 0x33a14 33a12: 42 c0 rjmp .+132 ; 0x33a98 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); 33a14: 80 91 44 13 lds r24, 0x1344 ; 0x801344 33a18: 80 93 6c 13 sts 0x136C, r24 ; 0x80136c StartReading8bitRegisters(); 33a1c: 0f 94 83 97 call 0x32f06 ; 0x32f06 return ButtonPushed; 33a20: 1b e0 ldi r17, 0x0B ; 11 33a22: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33a26: 90 91 2a 13 lds r25, 0x132A ; 0x80132a break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 33a2a: 81 30 cpi r24, 0x01 ; 1 33a2c: 91 05 cpc r25, r1 33a2e: 09 f0 breq .+2 ; 0x33a32 33a30: ee c1 rjmp .+988 ; 0x33e0e const StepStatus ss = logic.Step(); switch (ss) { 33a32: 12 30 cpi r17, 0x02 ; 2 33a34: 09 f4 brne .+2 ; 0x33a38 33a36: 90 c0 rjmp .+288 ; 0x33b58 33a38: 08 f0 brcs .+2 ; 0x33a3c 33a3a: 7d c0 rjmp .+250 ; 0x33b36 33a3c: 11 23 and r17, r17 33a3e: 09 f4 brne .+2 ; 0x33a42 33a40: 18 c1 rjmp .+560 ; 0x33c72 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 33a42: 00 23 and r16, r16 33a44: 09 f4 brne .+2 ; 0x33a48 33a46: e4 c0 rjmp .+456 ; 0x33c10 switch (ss) { 33a48: 17 30 cpi r17, 0x07 ; 7 33a4a: 09 f4 brne .+2 ; 0x33a4e 33a4c: c4 c1 rjmp .+904 ; 0x33dd6 33a4e: 08 f0 brcs .+2 ; 0x33a52 33a50: b8 c1 rjmp .+880 ; 0x33dc2 33a52: 14 30 cpi r17, 0x04 ; 4 33a54: 09 f4 brne .+2 ; 0x33a58 33a56: c7 c1 rjmp .+910 ; 0x33de6 33a58: 15 30 cpi r17, 0x05 ; 5 33a5a: 09 f0 breq .+2 ; 0x33a5e 33a5c: d9 c0 rjmp .+434 ; 0x33c10 state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 33a5e: 82 e0 ldi r24, 0x02 ; 2 33a60: 80 93 98 13 sts 0x1398, r24 ; 0x801398 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 33a64: 60 e0 ldi r22, 0x00 ; 0 33a66: 8d e2 ldi r24, 0x2D ; 45 33a68: 90 e8 ldi r25, 0x80 ; 128 33a6a: ba c1 rjmp .+884 ; 0x33de0 // 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) { 33a6c: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 33a70: 88 23 and r24, r24 33a72: 29 f0 breq .+10 ; 0x33a7e scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 33a74: 82 e8 ldi r24, 0x82 ; 130 33a76: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c 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; 33a7a: 13 e0 ldi r17, 0x03 ; 3 33a7c: d2 cf rjmp .-92 ; 0x33a22 } [[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); 33a7e: 80 91 44 13 lds r24, 0x1344 ; 0x801344 33a82: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b errorCode = ErrorCode::OK; 33a86: 81 e0 ldi r24, 0x01 ; 1 33a88: 90 e0 ldi r25, 0x00 ; 0 33a8a: 90 93 6a 13 sts 0x136A, r25 ; 0x80136a 33a8e: 80 93 69 13 sts 0x1369, r24 ; 0x801369 } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 33a92: 0f 94 83 97 call 0x32f06 ; 0x32f06 33a96: 4b cd rjmp .-1386 ; 0x3352e // 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; 33a98: 8c e0 ldi r24, 0x0C ; 12 33a9a: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b errorCode = static_cast(rsp.paramValue); 33a9e: 80 91 44 13 lds r24, 0x1344 ; 0x801344 33aa2: 90 91 45 13 lds r25, 0x1345 ; 0x801345 33aa6: 90 93 6a 13 sts 0x136A, r25 ; 0x80136a 33aaa: 80 93 69 13 sts 0x1369, r24 ; 0x801369 StartReading8bitRegisters(); // continue Idle state without restarting the communication 33aae: 0f 94 83 97 call 0x32f06 ; 0x32f06 // @@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")); 33ab2: 87 e6 ldi r24, 0x67 ; 103 33ab4: 98 ea ldi r25, 0xA8 ; 168 33ab6: 0f 94 77 6f call 0x2deee ; 0x2deee 33aba: 17 e0 ldi r17, 0x07 ; 7 33abc: b2 cf rjmp .-156 ; 0x33a22 return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 33abe: 0f 94 a7 97 call 0x32f4e ; 0x32f4e 33ac2: 35 cd rjmp .-1430 ; 0x3352e return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 33ac4: 82 e8 ldi r24, 0x82 ; 130 33ac6: 0f 94 8b 97 call 0x32f16 ; 0x32f16 33aca: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c return scopeState == ScopeState::Ready ? Finished : Processing; 33ace: 82 38 cpi r24, 0x82 ; 130 33ad0: 09 f0 breq .+2 ; 0x33ad4 33ad2: 2d cd rjmp .-1446 ; 0x3352e 33ad4: bc cc rjmp .-1672 ; 0x3344e case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 33ad6: 80 91 43 13 lds r24, 0x1343 ; 0x801343 33ada: 81 34 cpi r24, 0x41 ; 65 33adc: d1 f6 brne .-76 ; 0x33a92 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 33ade: 0f 94 65 6f call 0x2deca ; 0x2deca 33ae2: d7 cf rjmp .-82 ; 0x33a92 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 33ae4: 88 30 cpi r24, 0x08 ; 8 33ae6: b1 f0 breq .+44 ; 0x33b14 33ae8: 50 f3 brcs .-44 ; 0x33abe 33aea: 8a 30 cpi r24, 0x0A ; 10 33aec: 09 f0 breq .+2 ; 0x33af0 33aee: 39 cf rjmp .-398 ; 0x33962 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 33af0: 80 91 43 13 lds r24, 0x1343 ; 0x801343 33af4: 81 34 cpi r24, 0x41 ; 65 33af6: 09 f0 breq .+2 ; 0x33afa 33af8: 18 cd rjmp .-1488 ; 0x3352a // Button was accepted, decrement the retry. DecrementRetryAttempts(); 33afa: 0f 94 65 6f call 0x2deca ; 0x2deca 33afe: 15 cd rjmp .-1494 ; 0x3352a 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; 33b00: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b errorCode = ErrorCode::RUNNING; 33b04: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a 33b08: 10 92 69 13 sts 0x1369, r1 ; 0x801369 scopeState = ScopeState::Wait; 33b0c: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 33b0e: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c 33b12: 0d cd rjmp .-1510 ; 0x3352e 33b14: 81 e8 ldi r24, 0x81 ; 129 33b16: 0f 94 8b 97 call 0x32f16 ; 0x32f16 33b1a: f9 cf rjmp .-14 ; 0x33b0e StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 33b1c: 87 30 cpi r24, 0x07 ; 7 33b1e: 49 f2 breq .-110 ; 0x33ab2 33b20: 08 f4 brcc .+2 ; 0x33b24 33b22: 63 ce rjmp .-826 ; 0x337ea 33b24: 88 30 cpi r24, 0x08 ; 8 33b26: 09 f4 brne .+2 ; 0x33b2a 33b28: 78 ce rjmp .-784 ; 0x3381a 33b2a: 7b cf rjmp .-266 ; 0x33a22 // 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()) { 33b2c: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 33b30: 87 fd sbrc r24, 7 33b32: 9a cc rjmp .-1740 ; 0x33468 33b34: fc cc rjmp .-1544 ; 0x3352e StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 33b36: 13 30 cpi r17, 0x03 ; 3 33b38: 09 f4 brne .+2 ; 0x33b3c 33b3a: 6a c0 rjmp .+212 ; 0x33c10 33b3c: 1b 30 cpi r17, 0x0B ; 11 33b3e: 09 f0 breq .+2 ; 0x33b42 33b40: 80 cf rjmp .-256 ; 0x33a42 case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 33b42: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 33b46: 80 93 93 13 sts 0x1393, r24 ; 0x801393 LogEchoEvent_P(PSTR("MMU Button pushed")); 33b4a: 86 e8 ldi r24, 0x86 ; 134 33b4c: 98 ea ldi r25, 0xA8 ; 168 33b4e: 0f 94 1e c3 call 0x3863c ; 0x3863c CheckUserInput(); // Process the button immediately 33b52: 0f 94 3f 99 call 0x3327e ; 0x3327e 33b56: 5c c0 rjmp .+184 ; 0x33c10 CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 33b58: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 33b5c: 81 11 cpse r24, r1 33b5e: 58 c0 rjmp .+176 ; 0x33c10 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() 33b60: 0e 94 c5 68 call 0xd18a ; 0xd18a && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 33b64: 88 23 and r24, r24 33b66: 09 f4 brne .+2 ; 0x33b6a 33b68: 53 c0 rjmp .+166 ; 0x33c10 } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 33b6a: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b <_ZL17mcode_in_progress.lto_priv.549> 33b6e: 90 91 5c 0e lds r25, 0x0E5C ; 0x800e5c <_ZL17mcode_in_progress.lto_priv.549+0x1> 33b72: 88 35 cpi r24, 0x58 ; 88 33b74: 92 40 sbci r25, 0x02 ; 2 33b76: 09 f4 brne .+2 ; 0x33b7a 33b78: 4b c0 rjmp .+150 ; 0x33c10 && !saved_printing 33b7a: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 33b7e: 81 11 cpse r24, r1 33b80: 47 c0 rjmp .+142 ; 0x33c10 && !mesh_bed_leveling_flag 33b82: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 33b86: 81 11 cpse r24, r1 33b88: 43 c0 rjmp .+134 ; 0x33c10 && !homing_flag 33b8a: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 33b8e: 81 11 cpse r24, r1 33b90: 3f c0 rjmp .+126 ; 0x33c10 bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 33b92: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 33b96: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 33b9a: 98 17 cp r25, r24 33b9c: c9 f1 breq .+114 ; 0x33c10 { uint8_t block_index = block_buffer_tail; 33b9e: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 } #endif bool e_active() { unsigned char e_active = 0; 33ba2: 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++; 33ba4: 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) 33ba6: 30 91 56 0e lds r19, 0x0E56 ; 0x800e56 33baa: 38 17 cp r19, r24 33bac: 89 f0 breq .+34 ; 0x33bd0 { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 33bae: 28 9f mul r18, r24 33bb0: f0 01 movw r30, r0 33bb2: 11 24 eor r1, r1 33bb4: ea 58 subi r30, 0x8A ; 138 33bb6: f8 4f sbci r31, 0xF8 ; 248 33bb8: 44 85 ldd r20, Z+12 ; 0x0c 33bba: 55 85 ldd r21, Z+13 ; 0x0d 33bbc: 66 85 ldd r22, Z+14 ; 0x0e 33bbe: 77 85 ldd r23, Z+15 ; 0x0f 33bc0: 45 2b or r20, r21 33bc2: 46 2b or r20, r22 33bc4: 47 2b or r20, r23 33bc6: 09 f0 breq .+2 ; 0x33bca 33bc8: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 33bca: 8f 5f subi r24, 0xFF ; 255 33bcc: 8f 70 andi r24, 0x0F ; 15 33bce: eb cf rjmp .-42 ; 0x33ba6 && e_active(); 33bd0: 99 23 and r25, r25 33bd2: f1 f0 breq .+60 ; 0x33c10 SERIAL_ECHOLNPGM("FINDA filament runout!"); 33bd4: 87 e1 ldi r24, 0x17 ; 23 33bd6: 98 ea ldi r25, 0xA8 ; 168 33bd8: 0e 94 86 7b call 0xf70c ; 0xf70c 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); 33bdc: 20 e0 ldi r18, 0x00 ; 0 33bde: 30 e0 ldi r19, 0x00 ; 0 33be0: a9 01 movw r20, r18 33be2: ca 01 movw r24, r20 33be4: b9 01 movw r22, r18 33be6: 0e 94 e2 8a call 0x115c4 ; 0x115c4 marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 33bea: 60 e0 ldi r22, 0x00 ; 0 33bec: 70 e0 ldi r23, 0x00 ; 0 33bee: cb 01 movw r24, r22 33bf0: 0e 94 79 69 call 0xd2f2 ; 0xd2f2 33bf4: 86 ed ldi r24, 0xD6 ; 214 33bf6: 9e e0 ldi r25, 0x0E ; 14 33bf8: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 33bfc: 81 30 cpi r24, 0x01 ; 1 33bfe: 21 f4 brne .+8 ; 0x33c08 if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 33c00: 0f 94 a4 75 call 0x2eb48 ; 0x2eb48 33c04: 8f 3f cpi r24, 0xFF ; 255 33c06: 91 f5 brne .+100 ; 0x33c6c enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 33c08: 83 e2 ldi r24, 0x23 ; 35 33c0a: 91 e7 ldi r25, 0x71 ; 113 if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors SERIAL_ECHOLNPGM("FINDA filament runout!"); marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command 33c0c: 0f 94 e8 75 call 0x2ebd0 ; 0x2ebd0 break; } } } if (logic.Running()) { 33c10: 80 91 46 13 lds r24, 0x1346 ; 0x801346 33c14: 82 30 cpi r24, 0x02 ; 2 33c16: 19 f4 brne .+6 ; 0x33c1e state = xState::Active; 33c18: 81 e0 ldi r24, 0x01 ; 1 33c1a: 80 93 98 13 sts 0x1398, r24 ; 0x801398 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 33c1e: 10 93 97 13 sts 0x1397, r17 ; 0x801397 // 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) { 33c22: 80 91 74 07 lds r24, 0x0774 ; 0x800774 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.507> 33c26: 88 23 and r24, r24 33c28: 51 f0 breq .+20 ; 0x33c3e bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 33c2a: 80 91 5e 0e lds r24, 0x0E5E ; 0x800e5e <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.513> 33c2e: 81 11 cpse r24, r1 33c30: 06 c0 rjmp .+12 ; 0x33c3e 33c32: 80 91 90 13 lds r24, 0x1390 ; 0x801390 33c36: 90 91 91 13 lds r25, 0x1391 ; 0x801391 33c3a: 0f 94 81 c4 call 0x38902 ; 0x38902 CheckErrorScreenUserInput(); } 33c3e: a0 96 adiw r28, 0x20 ; 32 33c40: 0f b6 in r0, 0x3f ; 63 33c42: f8 94 cli 33c44: de bf out 0x3e, r29 ; 62 33c46: 0f be out 0x3f, r0 ; 63 33c48: cd bf out 0x3d, r28 ; 61 33c4a: df 91 pop r29 33c4c: cf 91 pop r28 33c4e: 1f 91 pop r17 33c50: 0f 91 pop r16 33c52: ff 90 pop r15 33c54: ef 90 pop r14 33c56: df 90 pop r13 33c58: cf 90 pop r12 33c5a: bf 90 pop r11 33c5c: af 90 pop r10 33c5e: 9f 90 pop r9 33c60: 8f 90 pop r8 33c62: 7f 90 pop r7 33c64: 6f 90 pop r6 33c66: 5f 90 pop r5 33c68: 4f 90 pop r4 33c6a: 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 33c6c: 8d e0 ldi r24, 0x0D ; 13 33c6e: 98 ea ldi r25, 0xA8 ; 168 33c70: cd cf rjmp .-102 ; 0x33c0c 33c72: 00 91 6b 13 lds r16, 0x136B ; 0x80136b ReportProgressHook((CommandInProgress)logic.CommandInProgress(), pc); LogEchoEvent_P(_O(ProgressCodeToText(pc))); } void MMU2::OnMMUProgressMsg(ProgressCode pc) { if (pc != lastProgressCode) { 33c76: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 33c7a: 08 17 cp r16, r24 33c7c: 09 f4 brne .+2 ; 0x33c80 33c7e: 49 c0 rjmp .+146 ; 0x33d12 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 33c80: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33c84: 84 30 cpi r24, 0x04 ; 4 33c86: b9 f4 brne .+46 ; 0x33cb6 break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 33c88: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 33c8c: 88 23 and r24, r24 33c8e: 99 f0 breq .+38 ; 0x33cb6 custom_message_type = CustomMsg::MMUProgress; 33c90: 89 e0 ldi r24, 0x09 ; 9 33c92: 80 93 75 07 sts 0x0775, r24 ; 0x800775 : static_cast(pgm_read_ptr(&progressTexts[0])); 33c96: e3 ed ldi r30, 0xD3 ; 211 33c98: f7 ea ldi r31, 0xA7 ; 167 }; 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])) 33c9a: 0e 31 cpi r16, 0x1E ; 30 33c9c: 30 f4 brcc .+12 ; 0x33caa 33c9e: e0 2f mov r30, r16 33ca0: f0 e0 ldi r31, 0x00 ; 0 33ca2: ee 0f add r30, r30 33ca4: ff 1f adc r31, r31 33ca6: ed 52 subi r30, 0x2D ; 45 33ca8: f8 45 sbci r31, 0x58 ; 88 : static_cast(pgm_read_ptr(&progressTexts[0])); 33caa: 85 91 lpm r24, Z+ 33cac: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 33cae: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 33cb2: 0f 94 0c 0b call 0x21618 ; 0x21618 33cb6: e3 ed ldi r30, 0xD3 ; 211 33cb8: f7 ea ldi r31, 0xA7 ; 167 }; 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])) 33cba: 0e 31 cpi r16, 0x1E ; 30 33cbc: 30 f4 brcc .+12 ; 0x33cca 33cbe: e0 2f mov r30, r16 33cc0: f0 e0 ldi r31, 0x00 ; 0 33cc2: ee 0f add r30, r30 33cc4: ff 1f adc r31, r31 33cc6: ed 52 subi r30, 0x2D ; 45 33cc8: f8 45 sbci r31, 0x58 ; 88 : static_cast(pgm_read_ptr(&progressTexts[0])); 33cca: 85 91 lpm r24, Z+ 33ccc: 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))); 33cce: 02 96 adiw r24, 0x02 ; 2 33cd0: 0f 94 1e c3 call 0x3863c ; 0x3863c } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 33cd4: 00 93 8f 13 sts 0x138F, r16 ; 0x80138f switch (pc) { 33cd8: 03 30 cpi r16, 0x03 ; 3 33cda: 49 f0 breq .+18 ; 0x33cee 33cdc: 0c 31 cpi r16, 0x1C ; 28 33cde: 09 f0 breq .+2 ; 0x33ce2 33ce0: 97 cf rjmp .-210 ; 0x33c10 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 33ce2: 0f 94 27 58 call 0x2b04e ; 0x2b04e } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 33ce6: 81 e0 ldi r24, 0x01 ; 1 33ce8: 80 93 9a 13 sts 0x139A, r24 ; 0x80139a 33cec: 91 cf rjmp .-222 ; 0x33c10 33cee: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33cf2: 84 30 cpi r24, 0x04 ; 4 33cf4: 31 f4 brne .+12 ; 0x33d02 ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 33cf6: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 33cfa: 84 55 subi r24, 0x54 ; 84 33cfc: 82 30 cpi r24, 0x02 ; 2 33cfe: 08 f4 brcc .+2 ; 0x33d02 33d00: 87 cf rjmp .-242 ; 0x33c10 33d02: 0f 94 27 58 call 0x2b04e ; 0x2b04e // 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; 33d06: 81 e0 ldi r24, 0x01 ; 1 33d08: 80 93 9b 13 sts 0x139B, r24 ; 0x80139b 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(); 33d0c: 0f 94 f3 72 call 0x2e5e6 ; 0x2e5e6 33d10: 7f cf rjmp .-258 ; 0x33c10 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) { 33d12: 03 30 cpi r16, 0x03 ; 3 33d14: 71 f1 breq .+92 ; 0x33d72 33d16: 0c 31 cpi r16, 0x1C ; 28 33d18: 09 f0 breq .+2 ; 0x33d1c 33d1a: 7a cf rjmp .-268 ; 0x33c10 unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 33d1c: 80 91 9a 13 lds r24, 0x139A ; 0x80139a 33d20: 88 23 and r24, r24 33d22: 09 f4 brne .+2 ; 0x33d26 33d24: 75 cf rjmp .-278 ; 0x33c10 switch (WhereIsFilament()) { 33d26: 0f 94 2e c3 call 0x3865c ; 0x3865c 33d2a: 88 23 and r24, r24 33d2c: b1 f1 breq .+108 ; 0x33d9a 33d2e: 81 30 cpi r24, 0x01 ; 1 33d30: 09 f0 breq .+2 ; 0x33d34 33d32: 6e cf rjmp .-292 ; 0x33c10 case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 33d34: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 33d38: 0f 94 d7 bb call 0x377ae ; 0x377ae // 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; 33d3c: 10 92 5d 0e sts 0x0E5D, r1 ; 0x800e5d planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 33d40: 60 91 76 13 lds r22, 0x1376 ; 0x801376 33d44: 70 e0 ldi r23, 0x00 ; 0 33d46: 90 e0 ldi r25, 0x00 ; 0 33d48: 80 e0 ldi r24, 0x00 ; 0 33d4a: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 33d4e: 6b 01 movw r12, r22 33d50: 7c 01 movw r14, r24 33d52: 60 91 75 13 lds r22, 0x1375 ; 0x801375 33d56: 70 e0 ldi r23, 0x00 ; 0 33d58: 6e 5f subi r22, 0xFE ; 254 33d5a: 7f 4f sbci r23, 0xFF ; 255 33d5c: 07 2e mov r0, r23 33d5e: 00 0c add r0, r0 33d60: 88 0b sbc r24, r24 33d62: 99 0b sbc r25, r25 33d64: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 33d68: a7 01 movw r20, r14 33d6a: 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()); 33d6c: 0f 94 fa c2 call 0x385f4 ; 0x385f4 33d70: 4f cf rjmp .-354 ; 0x33c10 } 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 33d72: 80 91 9b 13 lds r24, 0x139B ; 0x80139b 33d76: 88 23 and r24, r24 33d78: 09 f4 brne .+2 ; 0x33d7c 33d7a: 4a cf rjmp .-364 ; 0x33c10 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); 33d7c: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 33d80: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 33d84: 98 13 cpse r25, r24 33d86: 44 cf rjmp .-376 ; 0x33c10 switch (WhereIsFilament()) { 33d88: 0f 94 2e c3 call 0x3865c ; 0x3865c 33d8c: 81 50 subi r24, 0x01 ; 1 33d8e: 83 30 cpi r24, 0x03 ; 3 33d90: 08 f4 brcc .+2 ; 0x33d94 33d92: bc cf rjmp .-136 ; 0x33d0c 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; 33d94: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b 33d98: 3b cf rjmp .-394 ; 0x33c10 33d9a: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 33d9e: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 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 33da2: 98 13 cpse r25, r24 33da4: 35 cf rjmp .-406 ; 0x33c10 // 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()); 33da6: 60 91 76 13 lds r22, 0x1376 ; 0x801376 33daa: 70 e0 ldi r23, 0x00 ; 0 33dac: 90 e0 ldi r25, 0x00 ; 0 33dae: 80 e0 ldi r24, 0x00 ; 0 33db0: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 33db4: 9b 01 movw r18, r22 33db6: ac 01 movw r20, r24 33db8: 60 e0 ldi r22, 0x00 ; 0 33dba: 70 e0 ldi r23, 0x00 ; 0 33dbc: 8f ea ldi r24, 0xAF ; 175 33dbe: 93 e4 ldi r25, 0x43 ; 67 33dc0: d5 cf rjmp .-86 ; 0x33d6c // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 33dc2: 18 30 cpi r17, 0x08 ; 8 33dc4: b9 f0 breq .+46 ; 0x33df4 33dc6: 19 30 cpi r17, 0x09 ; 9 33dc8: 09 f0 breq .+2 ; 0x33dcc 33dca: 22 cf rjmp .-444 ; 0x33c10 StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 33dcc: 60 e0 ldi r22, 0x00 ; 0 33dce: 0f 94 6b 82 call 0x304d6 ; 0x304d6 33dd2: 19 e0 ldi r17, 0x09 ; 9 33dd4: 1d cf rjmp .-454 ; 0x33c10 default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 33dd6: 61 e0 ldi r22, 0x01 ; 1 33dd8: 80 91 69 13 lds r24, 0x1369 ; 0x801369 33ddc: 90 91 6a 13 lds r25, 0x136A ; 0x80136a ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 33de0: 0f 94 6b 82 call 0x304d6 ; 0x304d6 33de4: 15 cf rjmp .-470 ; 0x33c10 case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 33de6: 82 e0 ldi r24, 0x02 ; 2 33de8: 80 93 98 13 sts 0x1398, r24 ; 0x801398 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 33dec: 60 e0 ldi r22, 0x00 ; 0 33dee: 8e e2 ldi r24, 0x2E ; 46 33df0: 90 e8 ldi r25, 0x80 ; 128 33df2: f6 cf rjmp .-20 ; 0x33de0 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 33df4: 10 92 98 13 sts 0x1398, r1 ; 0x801398 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 33df8: 10 92 46 13 sts 0x1346, r1 ; 0x801346 currentScope = Scope::Stopped; 33dfc: 10 92 2b 13 sts 0x132B, r1 ; 0x80132b ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 33e00: 60 e0 ldi r22, 0x00 ; 0 33e02: 8c e2 ldi r24, 0x2C ; 44 33e04: 90 e8 ldi r25, 0x80 ; 128 33e06: ec cf rjmp .-40 ; 0x33de0 break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 33e08: 0f 94 5a 6f call 0x2deb4 ; 0x2deb4 33e0c: aa cd rjmp .-1196 ; 0x33962 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 33e0e: 00 23 and r16, r16 33e10: 01 f3 breq .-64 ; 0x33dd2 33e12: dc cf rjmp .-72 ; 0x33dcc 00033e14 : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 33e14: 80 91 99 13 lds r24, 0x1399 ; 0x801399 33e18: 82 ff sbrs r24, 2 33e1a: 07 c0 rjmp .+14 ; 0x33e2a // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 33e1c: 8b 7f andi r24, 0xFB ; 251 33e1e: 80 93 99 13 sts 0x1399, r24 ; 0x801399 LogEchoEvent_P(PSTR("Cooldown flag cleared")); 33e22: 81 e6 ldi r24, 0x61 ; 97 33e24: 99 ea ldi r25, 0xA9 ; 169 33e26: 0f 94 1e c3 call 0x3863c ; 0x3863c } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 33e2a: 80 91 99 13 lds r24, 0x1399 ; 0x801399 33e2e: 81 ff sbrs r24, 1 33e30: 52 c0 rjmp .+164 ; 0x33ed6 33e32: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 33e36: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 33e3a: 89 2b or r24, r25 33e3c: 09 f4 brne .+2 ; 0x33e40 33e3e: 4b c0 rjmp .+150 ; 0x33ed6 LogEchoEvent_P(PSTR("Resuming Temp")); 33e40: 83 e5 ldi r24, 0x53 ; 83 33e42: 99 ea ldi r25, 0xA9 ; 169 33e44: 0f 94 1e c3 call 0x3863c ; 0x3863c // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 33e48: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 33e4c: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 33e50: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 mmu_print_saved &= ~(SavedState::Cooldown); 33e54: 80 91 99 13 lds r24, 0x1399 ; 0x801399 33e58: 8d 7f andi r24, 0xFD ; 253 33e5a: 80 93 99 13 sts 0x1399, r24 ; 0x801399 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 33e5e: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 33e62: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 33e66: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e 33e6a: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); } void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); 33e6e: 8b e4 ldi r24, 0x4B ; 75 33e70: 9d e5 ldi r25, 0x5D ; 93 33e72: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 33e76: 0f 94 80 34 call 0x26900 ; 0x26900 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)); 33e7a: 43 e2 ldi r20, 0x23 ; 35 33e7c: 59 ea ldi r21, 0xA9 ; 169 33e7e: 62 e0 ldi r22, 0x02 ; 2 33e80: 80 e0 ldi r24, 0x00 ; 0 33e82: 0e 94 29 70 call 0xe052 ; 0xe052 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 33e86: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 33e8a: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 33e8e: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 33e92: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 33e96: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 33e9a: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d 33e9e: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e 33ea2: c9 01 movw r24, r18 33ea4: 86 1b sub r24, r22 33ea6: 97 0b sbc r25, r23 33ea8: 06 97 sbiw r24, 0x06 ; 6 33eaa: 6c f0 brlt .+26 ; 0x33ec6 void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 33eac: 81 e0 ldi r24, 0x01 ; 1 33eae: 0e 94 5a 8c call 0x118b4 ; 0x118b4 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); 33eb2: 80 e0 ldi r24, 0x00 ; 0 33eb4: 0f 94 f8 99 call 0x333f0 ; 0x333f0 ReportErrorHookDynamicRender(); 33eb8: 0f 94 42 c2 call 0x38484 ; 0x38484 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 33ebc: 84 e6 ldi r24, 0x64 ; 100 33ebe: 90 e0 ldi r25, 0x00 ; 0 33ec0: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 33ec4: e0 cf rjmp .-64 ; 0x33e86 }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 33ec6: 0f 94 18 c2 call 0x38430 ; 0x38430 LogEchoEvent_P(PSTR("Hotend temperature reached")); 33eca: 88 e3 ldi r24, 0x38 ; 56 33ecc: 99 ea ldi r25, 0xA9 ; 169 33ece: 0f 94 1e c3 call 0x3863c ; 0x3863c void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 33ed2: 0c 94 48 70 jmp 0xe090 ; 0xe090 ScreenClear(); } } 33ed6: 08 95 ret 00033ed8 : /// 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) { 33ed8: 0f 93 push r16 33eda: 1f 93 push r17 33edc: cf 93 push r28 33ede: df 93 push r29 33ee0: 00 d0 rcall .+0 ; 0x33ee2 33ee2: 1f 92 push r1 33ee4: 1f 92 push r1 33ee6: cd b7 in r28, 0x3d ; 61 33ee8: de b7 in r29, 0x3e ; 62 33eea: 18 2f mov r17, r24 33eec: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 33eee: 10 92 99 13 sts 0x1399, r1 ; 0x801399 MARLIN_KEEPALIVE_STATE_IN_PROCESS; 33ef2: 83 e0 ldi r24, 0x03 ; 3 33ef4: 80 93 96 02 sts 0x0296, r24 ; 0x800296 LongTimer nozzleTimeout; 33ef8: 19 82 std Y+1, r1 ; 0x01 33efa: 1a 82 std Y+2, r1 ; 0x02 33efc: 1b 82 std Y+3, r1 ; 0x03 33efe: 1c 82 std Y+4, r1 ; 0x04 33f00: 1d 82 std Y+5, r1 ; 0x05 33f02: 90 e0 ldi r25, 0x00 ; 0 33f04: 80 e0 ldi r24, 0x00 ; 0 33f06: 0e 94 ff 8e call 0x11dfe ; 0x11dfe // - 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) { 33f0a: 90 91 99 13 lds r25, 0x1399 ; 0x801399 33f0e: 89 81 ldd r24, Y+1 ; 0x01 33f10: 92 ff sbrs r25, 2 33f12: 37 c0 rjmp .+110 ; 0x33f82 if (!nozzleTimeout.running()) { 33f14: 81 11 cpse r24, r1 33f16: 1e c0 rjmp .+60 ; 0x33f54 nozzleTimeout.start(); 33f18: ce 01 movw r24, r28 33f1a: 01 96 adiw r24, 0x01 ; 1 33f1c: 0f 94 29 41 call 0x28252 ; 0x28252 ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 33f20: 88 e3 ldi r24, 0x38 ; 56 33f22: 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")); 33f24: 0f 94 1e c3 call 0x3863c ; 0x3863c } switch (logicStepLastStatus) { 33f28: e0 91 97 13 lds r30, 0x1397 ; 0x801397 33f2c: e2 50 subi r30, 0x02 ; 2 33f2e: ea 30 cpi r30, 0x0A ; 10 33f30: 40 f7 brcc .-48 ; 0x33f02 33f32: f0 e0 ldi r31, 0x00 ; 0 33f34: 88 27 eor r24, r24 33f36: e0 56 subi r30, 0x60 ; 96 33f38: f0 46 sbci r31, 0x60 ; 96 33f3a: 8e 4f sbci r24, 0xFE ; 254 33f3c: 0d 94 6b de jmp 0x3bcd6 ; 0x3bcd6 <__tablejump2__> 33f40: 9c 3a cpi r25, 0xAC ; 172 33f42: d2 39 cpi r29, 0x92 ; 146 33f44: 0e 3b cpi r16, 0xBE ; 190 33f46: 0e 3b cpi r16, 0xBE ; 190 33f48: ba 39 cpi r27, 0x9A ; 154 33f4a: 0e 3b cpi r16, 0xBE ; 190 33f4c: 7a 3a cpi r23, 0xAA ; 170 33f4e: ca 39 cpi r28, 0x9A ; 154 33f50: 62 3a cpi r22, 0xA2 ; 162 33f52: 0e 3b cpi r16, 0xBE ; 190 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. 33f54: 40 e4 ldi r20, 0x40 ; 64 33f56: 57 e7 ldi r21, 0x77 ; 119 33f58: 6b e1 ldi r22, 0x1B ; 27 33f5a: 70 e0 ldi r23, 0x00 ; 0 33f5c: ce 01 movw r24, r28 33f5e: 01 96 adiw r24, 0x01 ; 1 33f60: 0f 94 6a 3f call 0x27ed4 ; 0x27ed4 ::expired(unsigned long)> 33f64: 88 23 and r24, r24 33f66: 01 f3 breq .-64 ; 0x33f28 mmu_print_saved &= ~(SavedState::CooldownPending); 33f68: 80 91 99 13 lds r24, 0x1399 ; 0x801399 33f6c: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 33f6e: 82 60 ori r24, 0x02 ; 2 33f70: 80 93 99 13 sts 0x1399, r24 ; 0x801399 33f74: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 33f78: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 33f7c: 88 e2 ldi r24, 0x28 ; 40 33f7e: 97 ea ldi r25, 0xA7 ; 167 33f80: d1 cf rjmp .-94 ; 0x33f24 } } else if (nozzleTimeout.running()) { 33f82: 88 23 and r24, r24 33f84: 89 f2 breq .-94 ; 0x33f28 33f86: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 33f88: 82 e1 ldi r24, 0x12 ; 18 33f8a: 97 ea ldi r25, 0xA7 ; 167 33f8c: cb cf rjmp .-106 ; 0x33f24 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(); 33f8e: 0f 94 0a 9f call 0x33e14 ; 0x33e14 ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 33f92: 0f 94 19 73 call 0x2e632 ; 0x2e632 if (!TuneMenuEntered()) { 33f96: 80 91 5e 0e lds r24, 0x0E5E ; 0x800e5e <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.513> 33f9a: 81 11 cpse r24, r1 33f9c: 07 c0 rjmp .+14 ; 0x33fac retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 33f9e: 8f ef ldi r24, 0xFF ; 255 33fa0: 96 ea ldi r25, 0xA6 ; 166 33fa2: 0e 94 86 7b call 0xf70c ; 0xf70c retryAttempts = MAX_RETRIES; 33fa6: 83 e0 ldi r24, 0x03 ; 3 33fa8: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 33fac: 0f 94 27 58 call 0x2b04e ; 0x2b04e 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; 33fb0: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 33fb2: 0f 90 pop r0 33fb4: 0f 90 pop r0 33fb6: 0f 90 pop r0 33fb8: 0f 90 pop r0 33fba: 0f 90 pop r0 33fbc: df 91 pop r29 33fbe: cf 91 pop r28 33fc0: 1f 91 pop r17 33fc2: 0f 91 pop r16 33fc4: 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(); 33fc6: 0f 94 3f 99 call 0x3327e ; 0x3327e 33fca: f2 cf rjmp .-28 ; 0x33fb0 break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 33fcc: 80 91 7e 13 lds r24, 0x137E ; 0x80137e 33fd0: 81 11 cpse r24, r1 33fd2: 97 cf rjmp .-210 ; 0x33f02 // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 33fd4: 81 2f mov r24, r17 33fd6: 0f 94 65 73 call 0x2e6ca ; 0x2e6ca SaveHotendTemp(turn_off_nozzle); 33fda: 80 2f mov r24, r16 33fdc: 0f 94 fd 72 call 0x2e5fa ; 0x2e5fa CheckUserInput(); 33fe0: 0f 94 3f 99 call 0x3327e ; 0x3327e 33fe4: 8e cf rjmp .-228 ; 0x33f02 } 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(); 33fe6: 0f 94 0a 9f call 0x33e14 ; 0x33e14 ResumeUnpark(); 33fea: 0f 94 19 73 call 0x2e632 ; 0x2e632 33fee: 89 cf rjmp .-238 ; 0x33f02 } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 33ff0: 80 e0 ldi r24, 0x00 ; 0 33ff2: df cf rjmp .-66 ; 0x33fb2 00033ff4 : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 33ff4: cf 93 push r28 33ff6: df 93 push r29 33ff8: 00 d0 rcall .+0 ; 0x33ffa 33ffa: 1f 92 push r1 33ffc: 1f 92 push r1 33ffe: cd b7 in r28, 0x3d ; 61 34000: de b7 in r29, 0x3e ; 62 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 34002: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 34006: 10 92 89 17 sts 0x1789, r1 ; 0x801789 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 3400a: 62 e1 ldi r22, 0x12 ; 18 3400c: 8f e6 ldi r24, 0x6F ; 111 3400e: 96 ea ldi r25, 0xA6 ; 166 34010: 0f 94 f7 87 call 0x30fee ; 0x30fee 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(); 34014: 0f 94 f8 c2 call 0x385f0 ; 0x385f0 void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 34018: 40 e0 ldi r20, 0x00 ; 0 3401a: 65 e5 ldi r22, 0x55 ; 85 3401c: ce 01 movw r24, r28 3401e: 01 96 adiw r24, 0x01 ; 1 34020: 0f 94 d6 c2 call 0x385ac ; 0x385ac 34024: 49 81 ldd r20, Y+1 ; 0x01 34026: 5a 81 ldd r21, Y+2 ; 0x02 34028: 6b 81 ldd r22, Y+3 ; 0x03 3402a: 7c 81 ldd r23, Y+4 ; 0x04 3402c: 8d 81 ldd r24, Y+5 ; 0x05 3402e: 0f 94 48 98 call 0x33090 ; 0x33090 logic.UnloadFilament(); if (manage_response(false, true)) { 34032: 61 e0 ldi r22, 0x01 ; 1 34034: 80 e0 ldi r24, 0x00 ; 0 34036: 0f 94 6c 9f call 0x33ed8 ; 0x33ed8 3403a: 81 11 cpse r24, r1 3403c: 03 c0 rjmp .+6 ; 0x34044 break; } IncrementMMUFails(); 3403e: 0f 94 3a c2 call 0x38474 ; 0x38474 34042: e8 cf rjmp .-48 ; 0x34014 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); 34044: 83 e0 ldi r24, 0x03 ; 3 34046: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 3404a: 83 e6 ldi r24, 0x63 ; 99 3404c: 0f 94 9f 87 call 0x30f3e ; 0x30f3e tool_change_extruder = MMU2_NO_TOOL; 34050: 83 e6 ldi r24, 0x63 ; 99 34052: 80 93 80 13 sts 0x1380, r24 ; 0x801380 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 34056: 88 e8 ldi r24, 0x88 ; 136 34058: 97 e1 ldi r25, 0x17 ; 23 3405a: 0e 94 04 76 call 0xec08 ; 0xec08 } 3405e: 0f 90 pop r0 34060: 0f 90 pop r0 34062: 0f 90 pop r0 34064: 0f 90 pop r0 34066: 0f 90 pop r0 34068: df 91 pop r29 3406a: cf 91 pop r28 3406c: 08 95 ret 0003406e : bool MMU2::unload() { 3406e: cf 93 push r28 if (!WaitForMMUReady()) { 34070: 0f 94 20 88 call 0x31040 ; 0x31040 34074: c8 2f mov r28, r24 34076: 88 23 and r24, r24 34078: 79 f0 breq .+30 ; 0x34098 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 3407a: 88 ec ldi r24, 0xC8 ; 200 3407c: 90 e0 ldi r25, 0x00 ; 0 3407e: 0f 94 77 c6 call 0x38cee ; 0x38cee (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> 34082: 82 e0 ldi r24, 0x02 ; 2 34084: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 34088: 0f 94 94 87 call 0x30f28 ; 0x30f28 WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 3408c: 0f 94 fa 9f call 0x33ff4 ; 0x33ff4 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 34090: 0f 94 15 88 call 0x3102a ; 0x3102a { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 34094: 0f 94 18 c2 call 0x38430 ; 0x38430 return true; } 34098: 8c 2f mov r24, r28 3409a: cf 91 pop r28 3409c: 08 95 ret 0003409e : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 3409e: 0f 93 push r16 340a0: 1f 93 push r17 340a2: cf 93 push r28 340a4: df 93 push r29 340a6: 00 d0 rcall .+0 ; 0x340a8 340a8: 1f 92 push r1 340aa: 1f 92 push r1 340ac: cd b7 in r28, 0x3d ; 61 340ae: de b7 in r29, 0x3e ; 62 340b0: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 340b2: 0f 94 20 88 call 0x31040 ; 0x31040 340b6: 18 2f mov r17, r24 340b8: 88 23 and r24, r24 340ba: 49 f1 breq .+82 ; 0x3410e void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 340bc: 88 e3 ldi r24, 0x38 ; 56 340be: 9d e5 ldi r25, 0x5D ; 93 340c0: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 340c4: 60 2f mov r22, r16 340c6: 0f 94 1b c2 call 0x38436 ; 0x38436 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 340ca: 0f 94 94 87 call 0x30f28 ; 0x30f28 FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 340ce: 0f 94 f8 c2 call 0x385f0 ; 0x385f0 } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 340d2: 40 2f mov r20, r16 340d4: 6c e4 ldi r22, 0x4C ; 76 340d6: ce 01 movw r24, r28 340d8: 01 96 adiw r24, 0x01 ; 1 340da: 0f 94 d6 c2 call 0x385ac ; 0x385ac 340de: 49 81 ldd r20, Y+1 ; 0x01 340e0: 5a 81 ldd r21, Y+2 ; 0x02 340e2: 6b 81 ldd r22, Y+3 ; 0x03 340e4: 7c 81 ldd r23, Y+4 ; 0x04 340e6: 8d 81 ldd r24, Y+5 ; 0x05 340e8: 0f 94 48 98 call 0x33090 ; 0x33090 logic.LoadFilament(slot); if (manage_response(false, false)) { 340ec: 60 e0 ldi r22, 0x00 ; 0 340ee: 80 e0 ldi r24, 0x00 ; 0 340f0: 0f 94 6c 9f call 0x33ed8 ; 0x33ed8 340f4: 18 2f mov r17, r24 340f6: 81 11 cpse r24, r1 340f8: 03 c0 rjmp .+6 ; 0x34100 break; } IncrementMMUFails(); 340fa: 0f 94 3a c2 call 0x38474 ; 0x38474 340fe: e7 cf rjmp .-50 ; 0x340ce 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); 34100: 83 e0 ldi r24, 0x03 ; 3 34102: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 34106: 0f 94 15 88 call 0x3102a ; 0x3102a } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 3410a: 0f 94 18 c2 call 0x38430 ; 0x38430 return true; } 3410e: 81 2f mov r24, r17 34110: 0f 90 pop r0 34112: 0f 90 pop r0 34114: 0f 90 pop r0 34116: 0f 90 pop r0 34118: 0f 90 pop r0 3411a: df 91 pop r29 3411c: cf 91 pop r28 3411e: 1f 91 pop r17 34120: 0f 91 pop r16 34122: 08 95 ret 00034124 : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 34124: ff 92 push r15 34126: 0f 93 push r16 34128: 1f 93 push r17 3412a: cf 93 push r28 3412c: df 93 push r29 3412e: 00 d0 rcall .+0 ; 0x34130 34130: 1f 92 push r1 34132: 1f 92 push r1 34134: cd b7 in r28, 0x3d ; 61 34136: de b7 in r29, 0x3e ; 62 34138: 08 2f mov r16, r24 3413a: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 3413c: 0f 94 20 88 call 0x31040 ; 0x31040 34140: 18 2f mov r17, r24 34142: 88 23 and r24, r24 34144: b1 f1 breq .+108 ; 0x341b2 return false; } if (enableFullScreenMsg) { 34146: ff 20 and r15, r15 34148: 39 f0 breq .+14 ; 0x34158 void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 3414a: 87 e2 ldi r24, 0x27 ; 39 3414c: 9d e5 ldi r25, 0x5D ; 93 3414e: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 34152: 60 2f mov r22, r16 34154: 0f 94 1b c2 call 0x38436 ; 0x38436 FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 34158: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 3415c: 81 11 cpse r24, r1 unload(); 3415e: 0f 94 37 a0 call 0x3406e ; 0x3406e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 34162: 0f 94 94 87 call 0x30f28 ; 0x30f28 unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 34166: 0f 94 f8 c2 call 0x385f0 ; 0x385f0 } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 3416a: 40 2f mov r20, r16 3416c: 65 e4 ldi r22, 0x45 ; 69 3416e: ce 01 movw r24, r28 34170: 01 96 adiw r24, 0x01 ; 1 34172: 0f 94 d6 c2 call 0x385ac ; 0x385ac 34176: 49 81 ldd r20, Y+1 ; 0x01 34178: 5a 81 ldd r21, Y+2 ; 0x02 3417a: 6b 81 ldd r22, Y+3 ; 0x03 3417c: 7c 81 ldd r23, Y+4 ; 0x04 3417e: 8d 81 ldd r24, Y+5 ; 0x05 34180: 0f 94 48 98 call 0x33090 ; 0x33090 logic.EjectFilament(slot); if (manage_response(false, true)) { 34184: 61 e0 ldi r22, 0x01 ; 1 34186: 80 e0 ldi r24, 0x00 ; 0 34188: 0f 94 6c 9f call 0x33ed8 ; 0x33ed8 3418c: 18 2f mov r17, r24 3418e: 81 11 cpse r24, r1 34190: 03 c0 rjmp .+6 ; 0x34198 break; } IncrementMMUFails(); 34192: 0f 94 3a c2 call 0x38474 ; 0x38474 34196: e7 cf rjmp .-50 ; 0x34166 } SetCurrentTool(MMU2_NO_TOOL); 34198: 83 e6 ldi r24, 0x63 ; 99 3419a: 0f 94 9f 87 call 0x30f3e ; 0x30f3e tool_change_extruder = MMU2_NO_TOOL; 3419e: 83 e6 ldi r24, 0x63 ; 99 341a0: 80 93 80 13 sts 0x1380, r24 ; 0x801380 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); 341a4: 83 e0 ldi r24, 0x03 ; 3 341a6: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 341aa: 0f 94 15 88 call 0x3102a ; 0x3102a } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 341ae: 0f 94 18 c2 call 0x38430 ; 0x38430 return true; } 341b2: 81 2f mov r24, r17 341b4: 0f 90 pop r0 341b6: 0f 90 pop r0 341b8: 0f 90 pop r0 341ba: 0f 90 pop r0 341bc: 0f 90 pop r0 341be: df 91 pop r29 341c0: cf 91 pop r28 341c2: 1f 91 pop r17 341c4: 0f 91 pop r16 341c6: ff 90 pop r15 341c8: 08 95 ret 000341ca : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 341ca: 1f 93 push r17 341cc: cf 93 push r28 341ce: df 93 push r29 341d0: 00 d0 rcall .+0 ; 0x341d2 341d2: 1f 92 push r1 341d4: 1f 92 push r1 341d6: cd b7 in r28, 0x3d ; 61 341d8: de b7 in r29, 0x3e ; 62 341da: 18 2f mov r17, r24 for (;;) { Disable_E0(); 341dc: 0f 94 f8 c2 call 0x385f0 ; 0x385f0 } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 341e0: 41 2f mov r20, r17 341e2: 6b e4 ldi r22, 0x4B ; 75 341e4: ce 01 movw r24, r28 341e6: 01 96 adiw r24, 0x01 ; 1 341e8: 0f 94 d6 c2 call 0x385ac ; 0x385ac 341ec: 49 81 ldd r20, Y+1 ; 0x01 341ee: 5a 81 ldd r21, Y+2 ; 0x02 341f0: 6b 81 ldd r22, Y+3 ; 0x03 341f2: 7c 81 ldd r23, Y+4 ; 0x04 341f4: 8d 81 ldd r24, Y+5 ; 0x05 341f6: 0f 94 48 98 call 0x33090 ; 0x33090 logic.CutFilament(slot); if (manage_response(false, true)) { 341fa: 61 e0 ldi r22, 0x01 ; 1 341fc: 80 e0 ldi r24, 0x00 ; 0 341fe: 0f 94 6c 9f call 0x33ed8 ; 0x33ed8 34202: 81 11 cpse r24, r1 34204: 03 c0 rjmp .+6 ; 0x3420c break; } IncrementMMUFails(); 34206: 0f 94 3a c2 call 0x38474 ; 0x38474 3420a: e8 cf rjmp .-48 ; 0x341dc } } 3420c: 0f 90 pop r0 3420e: 0f 90 pop r0 34210: 0f 90 pop r0 34212: 0f 90 pop r0 34214: 0f 90 pop r0 34216: df 91 pop r29 34218: cf 91 pop r28 3421a: 1f 91 pop r17 3421c: 08 95 ret 0003421e : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 3421e: cf 93 push r28 34220: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 34222: 88 e1 ldi r24, 0x18 ; 24 34224: 9d e5 ldi r25, 0x5D ; 93 34226: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 3422a: 6c 2f mov r22, r28 3422c: 0f 94 1b c2 call 0x38436 ; 0x38436 if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 34230: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 34234: 81 11 cpse r24, r1 unload(); 34236: 0f 94 37 a0 call 0x3406e ; 0x3406e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 3423a: 0f 94 94 87 call 0x30f28 ; 0x30f28 if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 3423e: 8c 2f mov r24, r28 34240: 0f 94 e5 a0 call 0x341ca ; 0x341ca SetCurrentTool(MMU2_NO_TOOL); 34244: 83 e6 ldi r24, 0x63 ; 99 34246: 0f 94 9f 87 call 0x30f3e ; 0x30f3e tool_change_extruder = MMU2_NO_TOOL; 3424a: 83 e6 ldi r24, 0x63 ; 99 3424c: 80 93 80 13 sts 0x1380, r24 ; 0x801380 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); 34250: 83 e0 ldi r24, 0x03 ; 3 34252: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 34256: 0f 94 15 88 call 0x3102a ; 0x3102a CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 3425a: 0f 94 18 c2 call 0x38430 ; 0x38430 return true; } 3425e: 81 e0 ldi r24, 0x01 ; 1 34260: cf 91 pop r28 34262: 08 95 ret 00034264 : ch = UDR0; return ch; } static void putch(char ch) { while (!(UCSR0A & _BV(UDRE0))); 34264: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 34268: 95 ff sbrs r25, 5 3426a: fc cf rjmp .-8 ; 0x34264 UDR0 = ch; 3426c: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> } 34270: 08 95 ret 00034272 : #define RECV_READY ((UCSR0A & _BV(RXC0)) != 0) static uint8_t getch(void) { uint8_t ch; while(! RECV_READY) ; 34272: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 34276: 87 ff sbrs r24, 7 34278: fc cf rjmp .-8 ; 0x34272 if (!(UCSR0A & _BV(FE0))) { 3427a: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 3427e: 84 fd sbrc r24, 4 34280: 01 c0 rjmp .+2 ; 0x34284 * 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(); 34282: a8 95 wdr } ch = UDR0; 34284: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> return ch; } 34288: 08 95 ret 0003428a : /// 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; 3428a: 86 27 eor r24, r22 3428c: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 3428e: 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) { 34290: 38 2f mov r19, r24 34292: 88 0f add r24, r24 34294: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 34296: 82 27 eor r24, r18 34298: 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++) { 3429a: d1 f7 brne .-12 ; 0x34290 } else { data <<= 1U; } } return data; } 3429c: 08 95 ret 0003429e : // 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) { 3429e: 2f 92 push r2 342a0: 3f 92 push r3 342a2: 4f 92 push r4 342a4: 5f 92 push r5 342a6: 6f 92 push r6 342a8: 7f 92 push r7 342aa: 8f 92 push r8 342ac: 9f 92 push r9 342ae: af 92 push r10 342b0: bf 92 push r11 342b2: cf 92 push r12 342b4: df 92 push r13 342b6: ef 92 push r14 342b8: ff 92 push r15 342ba: 0f 93 push r16 342bc: 1f 93 push r17 342be: cf 93 push r28 342c0: df 93 push r29 342c2: cd b7 in r28, 0x3d ; 61 342c4: de b7 in r29, 0x3e ; 62 342c6: a1 97 sbiw r28, 0x21 ; 33 342c8: 0f b6 in r0, 0x3f ; 63 342ca: f8 94 cli 342cc: de bf out 0x3e, r29 ; 62 342ce: 0f be out 0x3f, r0 ; 63 342d0: cd bf out 0x3d, r28 ; 61 342d2: 1c 01 movw r2, r24 342d4: 48 01 movw r8, r16 342d6: 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) 342d8: fc 01 movw r30, r24 342da: e8 5b subi r30, 0xB8 ; 184 342dc: ff 4f sbci r31, 0xFF ; 255 342de: c0 80 ld r12, Z 342e0: d1 80 ldd r13, Z+1 ; 0x01 342e2: e2 80 ldd r14, Z+2 ; 0x02 342e4: f3 80 ldd r15, Z+3 ; 0x03 342e6: 9a 01 movw r18, r20 342e8: ab 01 movw r20, r22 342ea: c7 01 movw r24, r14 342ec: b6 01 movw r22, r12 342ee: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 342f2: 0f 94 61 df call 0x3bec2 ; 0x3bec2 342f6: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 342fa: 8b 01 movw r16, r22 342fc: 8d 83 std Y+5, r24 ; 0x05 342fe: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 34300: a5 01 movw r20, r10 34302: 94 01 movw r18, r8 34304: c7 01 movw r24, r14 34306: b6 01 movw r22, r12 34308: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3430c: 0f 94 61 df call 0x3bec2 ; 0x3bec2 34310: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 34314: 36 2f mov r19, r22 34316: 27 2f mov r18, r23 34318: a8 01 movw r20, r16 3431a: 6d 81 ldd r22, Y+5 ; 0x05 3431c: 79 81 ldd r23, Y+1 ; 0x01 3431e: 48 37 cpi r20, 0x78 ; 120 34320: 51 05 cpc r21, r1 34322: 61 05 cpc r22, r1 34324: 71 05 cpc r23, r1 34326: 20 f4 brcc .+8 ; 0x34330 34328: 48 e7 ldi r20, 0x78 ; 120 3432a: 50 e0 ldi r21, 0x00 ; 0 3432c: 60 e0 ldi r22, 0x00 ; 0 3432e: 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) 34330: d1 01 movw r26, r2 34332: d6 96 adiw r26, 0x36 ; 54 34334: 8d 90 ld r8, X+ 34336: 9d 90 ld r9, X+ 34338: ad 90 ld r10, X+ 3433a: bc 90 ld r11, X 3433c: d9 97 sbiw r26, 0x39 ; 57 3433e: 8f 8a std Y+23, r8 ; 0x17 34340: 98 8e std Y+24, r9 ; 0x18 34342: a9 8e std Y+25, r10 ; 0x19 34344: ba 8e std Y+26, r11 ; 0x1a 34346: 48 15 cp r20, r8 34348: 59 05 cpc r21, r9 3434a: 6a 05 cpc r22, r10 3434c: 7b 05 cpc r23, r11 3434e: 20 f4 brcc .+8 ; 0x34358 34350: 4f 8b std Y+23, r20 ; 0x17 34352: 58 8f std Y+24, r21 ; 0x18 34354: 69 8f std Y+25, r22 ; 0x19 34356: 7a 8f std Y+26, r23 ; 0x1a 34358: 43 2f mov r20, r19 3435a: 52 2f mov r21, r18 3435c: bc 01 movw r22, r24 3435e: 48 37 cpi r20, 0x78 ; 120 34360: 51 05 cpc r21, r1 34362: 61 05 cpc r22, r1 34364: 71 05 cpc r23, r1 34366: 20 f4 brcc .+8 ; 0x34370 34368: 48 e7 ldi r20, 0x78 ; 120 3436a: 50 e0 ldi r21, 0x00 ; 0 3436c: 60 e0 ldi r22, 0x00 ; 0 3436e: 70 e0 ldi r23, 0x00 ; 0 34370: 18 2d mov r17, r8 34372: 09 2d mov r16, r9 34374: a9 a2 std Y+33, r10 ; 0x21 34376: b8 a2 std Y+32, r11 ; 0x20 34378: 48 15 cp r20, r8 3437a: 59 05 cpc r21, r9 3437c: 6a 05 cpc r22, r10 3437e: 7b 05 cpc r23, r11 34380: 20 f4 brcc .+8 ; 0x3438a 34382: 14 2f mov r17, r20 34384: 05 2f mov r16, r21 34386: 69 a3 std Y+33, r22 ; 0x21 34388: 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; 3438a: f1 01 movw r30, r2 3438c: ee 5b subi r30, 0xBE ; 190 3438e: ff 4f sbci r31, 0xFF ; 255 34390: c0 80 ld r12, Z 34392: d1 80 ldd r13, Z+1 ; 0x01 34394: e2 80 ldd r14, Z+2 ; 0x02 34396: f3 80 ldd r15, Z+3 ; 0x03 34398: cd 82 std Y+5, r12 ; 0x05 3439a: de 82 std Y+6, r13 ; 0x06 3439c: ef 82 std Y+7, r14 ; 0x07 3439e: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 343a0: cd 28 or r12, r13 343a2: ce 28 or r12, r14 343a4: cf 28 or r12, r15 343a6: 41 f4 brne .+16 ; 0x343b8 // Don't allow zero acceleration. acceleration = 1; 343a8: c1 2c mov r12, r1 343aa: d1 2c mov r13, r1 343ac: 76 01 movw r14, r12 343ae: c3 94 inc r12 343b0: cd 82 std Y+5, r12 ; 0x05 343b2: de 82 std Y+6, r13 ; 0x06 343b4: ef 82 std Y+7, r14 ; 0x07 343b6: 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; 343b8: 2f 89 ldd r18, Y+23 ; 0x17 343ba: 38 8d ldd r19, Y+24 ; 0x18 343bc: 49 8d ldd r20, Y+25 ; 0x19 343be: 5a 8d ldd r21, Y+26 ; 0x1a 343c0: b9 01 movw r22, r18 343c2: ca 01 movw r24, r20 343c4: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__mulsi3> 343c8: 6d 87 std Y+13, r22 ; 0x0d 343ca: 7e 87 std Y+14, r23 ; 0x0e 343cc: 8f 87 std Y+15, r24 ; 0x0f 343ce: 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; 343d0: a5 01 movw r20, r10 343d2: 94 01 movw r18, r8 343d4: c5 01 movw r24, r10 343d6: b4 01 movw r22, r8 343d8: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__mulsi3> 343dc: 2b 01 movw r4, r22 343de: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 343e0: 21 2f mov r18, r17 343e2: 30 2f mov r19, r16 343e4: 49 a1 ldd r20, Y+33 ; 0x21 343e6: 58 a1 ldd r21, Y+32 ; 0x20 343e8: 61 2f mov r22, r17 343ea: 70 2f mov r23, r16 343ec: ca 01 movw r24, r20 343ee: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__mulsi3> 343f2: 69 8b std Y+17, r22 ; 0x11 343f4: 7a 8b std Y+18, r23 ; 0x12 343f6: 8b 8b std Y+19, r24 ; 0x13 343f8: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 343fa: cd 80 ldd r12, Y+5 ; 0x05 343fc: de 80 ldd r13, Y+6 ; 0x06 343fe: ef 80 ldd r14, Y+7 ; 0x07 34400: f8 84 ldd r15, Y+8 ; 0x08 34402: cc 0c add r12, r12 34404: dd 1c adc r13, r13 34406: ee 1c adc r14, r14 34408: ff 1c adc r15, r15 3440a: c9 86 std Y+9, r12 ; 0x09 3440c: da 86 std Y+10, r13 ; 0x0a 3440e: eb 86 std Y+11, r14 ; 0x0b 34410: 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; 34412: c3 01 movw r24, r6 34414: b2 01 movw r22, r4 34416: 61 50 subi r22, 0x01 ; 1 34418: 71 09 sbc r23, r1 3441a: 81 09 sbc r24, r1 3441c: 91 09 sbc r25, r1 3441e: cd 84 ldd r12, Y+13 ; 0x0d 34420: de 84 ldd r13, Y+14 ; 0x0e 34422: ef 84 ldd r14, Y+15 ; 0x0f 34424: f8 88 ldd r15, Y+16 ; 0x10 34426: 6c 19 sub r22, r12 34428: 7d 09 sbc r23, r13 3442a: 8e 09 sbc r24, r14 3442c: 9f 09 sbc r25, r15 3442e: c9 84 ldd r12, Y+9 ; 0x09 34430: da 84 ldd r13, Y+10 ; 0x0a 34432: eb 84 ldd r14, Y+11 ; 0x0b 34434: fc 84 ldd r15, Y+12 ; 0x0c 34436: 6c 0d add r22, r12 34438: 7d 1d adc r23, r13 3443a: 8e 1d adc r24, r14 3443c: 9f 1d adc r25, r15 3443e: a7 01 movw r20, r14 34440: 96 01 movw r18, r12 34442: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 34446: 69 01 movw r12, r18 34448: 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; 3444a: c3 01 movw r24, r6 3444c: b2 01 movw r22, r4 3444e: 29 89 ldd r18, Y+17 ; 0x11 34450: 3a 89 ldd r19, Y+18 ; 0x12 34452: 4b 89 ldd r20, Y+19 ; 0x13 34454: 5c 89 ldd r21, Y+20 ; 0x14 34456: 62 1b sub r22, r18 34458: 73 0b sbc r23, r19 3445a: 84 0b sbc r24, r20 3445c: 95 0b sbc r25, r21 3445e: 29 85 ldd r18, Y+9 ; 0x09 34460: 3a 85 ldd r19, Y+10 ; 0x0a 34462: 4b 85 ldd r20, Y+11 ; 0x0b 34464: 5c 85 ldd r21, Y+12 ; 0x0c 34466: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 3446a: 29 01 movw r4, r18 3446c: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 3446e: d7 01 movw r26, r14 34470: c6 01 movw r24, r12 34472: 84 0d add r24, r4 34474: 95 1d adc r25, r5 34476: a6 1d adc r26, r6 34478: b7 1d adc r27, r7 3447a: 8c 8f std Y+28, r24 ; 0x1c 3447c: 9d 8f std Y+29, r25 ; 0x1d 3447e: ae 8f std Y+30, r26 ; 0x1e 34480: 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) { 34482: f1 01 movw r30, r2 34484: e4 5b subi r30, 0xB4 ; 180 34486: ff 4f sbci r31, 0xFF ; 255 34488: 90 81 ld r25, Z 3448a: 9b 8f std Y+27, r25 ; 0x1b 3448c: 99 23 and r25, r25 3448e: 09 f4 brne .+2 ; 0x34492 34490: 8d c0 rjmp .+282 ; 0x345ac final_adv_steps = final_rate * block->adv_comp; 34492: 61 2f mov r22, r17 34494: 70 2f mov r23, r16 34496: 89 a1 ldd r24, Y+33 ; 0x21 34498: 98 a1 ldd r25, Y+32 ; 0x20 3449a: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 3449e: f1 01 movw r30, r2 344a0: ec 5a subi r30, 0xAC ; 172 344a2: ff 4f sbci r31, 0xFF ; 255 344a4: 20 81 ld r18, Z 344a6: 31 81 ldd r19, Z+1 ; 0x01 344a8: 42 81 ldd r20, Z+2 ; 0x02 344aa: 53 81 ldd r21, Z+3 ; 0x03 344ac: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 344b0: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 344b4: 6d 8b std Y+21, r22 ; 0x15 344b6: 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) { 344b8: d1 01 movw r26, r2 344ba: 50 96 adiw r26, 0x10 ; 16 344bc: 2d 91 ld r18, X+ 344be: 3d 91 ld r19, X+ 344c0: 4d 91 ld r20, X+ 344c2: 5c 91 ld r21, X 344c4: 53 97 sbiw r26, 0x13 ; 19 344c6: 29 83 std Y+1, r18 ; 0x01 344c8: 3a 83 std Y+2, r19 ; 0x02 344ca: 4b 83 std Y+3, r20 ; 0x03 344cc: 5c 83 std Y+4, r21 ; 0x04 344ce: 8c 8d ldd r24, Y+28 ; 0x1c 344d0: 9d 8d ldd r25, Y+29 ; 0x1d 344d2: ae 8d ldd r26, Y+30 ; 0x1e 344d4: bf 8d ldd r27, Y+31 ; 0x1f 344d6: 82 17 cp r24, r18 344d8: 93 07 cpc r25, r19 344da: a4 07 cpc r26, r20 344dc: b5 07 cpc r27, r21 344de: 08 f0 brcs .+2 ; 0x344e2 344e0: 68 c0 rjmp .+208 ; 0x345b2 plateau_steps = block->step_event_count.wide - accel_decel_steps; 344e2: 29 01 movw r4, r18 344e4: 3a 01 movw r6, r20 344e6: 48 1a sub r4, r24 344e8: 59 0a sbc r5, r25 344ea: 6a 0a sbc r6, r26 344ec: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 344ee: 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; 344f0: 40 e0 ldi r20, 0x00 ; 0 344f2: 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) 344f4: 99 23 and r25, r25 344f6: 89 f0 breq .+34 ; 0x3451a max_adv_steps = block->nominal_rate * block->adv_comp; 344f8: c5 01 movw r24, r10 344fa: b4 01 movw r22, r8 344fc: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 34500: f1 01 movw r30, r2 34502: ec 5a subi r30, 0xAC ; 172 34504: ff 4f sbci r31, 0xFF ; 255 34506: 20 81 ld r18, Z 34508: 31 81 ldd r19, Z+1 ; 0x01 3450a: 42 81 ldd r20, Z+2 ; 0x02 3450c: 53 81 ldd r21, Z+3 ; 0x03 3450e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 34512: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 34516: 46 2f mov r20, r22 34518: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 3451a: 3f b7 in r19, 0x3f ; 63 3451c: 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. 3451e: f1 01 movw r30, r2 34520: e9 5b subi r30, 0xB9 ; 185 34522: ff 4f sbci r31, 0xFF ; 255 34524: 20 81 ld r18, Z 34526: 21 11 cpse r18, r1 34528: 27 c0 rjmp .+78 ; 0x34578 block->accelerate_until = accelerate_steps; 3452a: d1 01 movw r26, r2 3452c: 59 96 adiw r26, 0x19 ; 25 3452e: cd 92 st X+, r12 34530: dd 92 st X+, r13 34532: ed 92 st X+, r14 34534: fc 92 st X, r15 34536: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 34538: c4 0c add r12, r4 3453a: d5 1c adc r13, r5 3453c: e6 1c adc r14, r6 3453e: f7 1c adc r15, r7 34540: f1 01 movw r30, r2 34542: c5 8e std Z+29, r12 ; 0x1d 34544: d6 8e std Z+30, r13 ; 0x1e 34546: e7 8e std Z+31, r14 ; 0x1f 34548: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 3454a: cf 88 ldd r12, Y+23 ; 0x17 3454c: c2 ae std Z+58, r12 ; 0x3a 3454e: d8 8c ldd r13, Y+24 ; 0x18 34550: d3 ae std Z+59, r13 ; 0x3b 34552: e9 8c ldd r14, Y+25 ; 0x19 34554: e4 ae std Z+60, r14 ; 0x3c 34556: fa 8c ldd r15, Y+26 ; 0x1a 34558: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 3455a: fe 96 adiw r30, 0x3e ; 62 3455c: 10 83 st Z, r17 3455e: 01 83 std Z+1, r16 ; 0x01 34560: c9 a0 ldd r12, Y+33 ; 0x21 34562: c2 82 std Z+2, r12 ; 0x02 34564: d8 a0 ldd r13, Y+32 ; 0x20 34566: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 34568: 73 96 adiw r30, 0x13 ; 19 3456a: ed 88 ldd r14, Y+21 ; 0x15 3456c: e0 82 st Z, r14 3456e: fe 88 ldd r15, Y+22 ; 0x16 34570: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 34572: 32 97 sbiw r30, 0x02 ; 2 34574: 40 83 st Z, r20 34576: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 34578: 3f bf out 0x3f, r19 ; 63 } 3457a: a1 96 adiw r28, 0x21 ; 33 3457c: 0f b6 in r0, 0x3f ; 63 3457e: f8 94 cli 34580: de bf out 0x3e, r29 ; 62 34582: 0f be out 0x3f, r0 ; 63 34584: cd bf out 0x3d, r28 ; 61 34586: df 91 pop r29 34588: cf 91 pop r28 3458a: 1f 91 pop r17 3458c: 0f 91 pop r16 3458e: ff 90 pop r15 34590: ef 90 pop r14 34592: df 90 pop r13 34594: cf 90 pop r12 34596: bf 90 pop r11 34598: af 90 pop r10 3459a: 9f 90 pop r9 3459c: 8f 90 pop r8 3459e: 7f 90 pop r7 345a0: 6f 90 pop r6 345a2: 5f 90 pop r5 345a4: 4f 90 pop r4 345a6: 3f 90 pop r3 345a8: 2f 90 pop r2 345aa: 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; 345ac: 1d 8a std Y+21, r1 ; 0x15 345ae: 1e 8a std Y+22, r1 ; 0x16 345b0: 83 cf rjmp .-250 ; 0x344b8 #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; 345b2: 2d 81 ldd r18, Y+5 ; 0x05 345b4: 3e 81 ldd r19, Y+6 ; 0x06 345b6: 4f 81 ldd r20, Y+7 ; 0x07 345b8: 58 85 ldd r21, Y+8 ; 0x08 345ba: 82 e0 ldi r24, 0x02 ; 2 345bc: 22 0f add r18, r18 345be: 33 1f adc r19, r19 345c0: 44 1f adc r20, r20 345c2: 55 1f adc r21, r21 345c4: 8a 95 dec r24 345c6: d1 f7 brne .-12 ; 0x345bc 345c8: 89 81 ldd r24, Y+1 ; 0x01 345ca: 9a 81 ldd r25, Y+2 ; 0x02 345cc: ab 81 ldd r26, Y+3 ; 0x03 345ce: bc 81 ldd r27, Y+4 ; 0x04 345d0: 81 70 andi r24, 0x01 ; 1 345d2: 99 27 eor r25, r25 345d4: aa 27 eor r26, r26 345d6: bb 27 eor r27, r27 345d8: 8d 83 std Y+5, r24 ; 0x05 345da: 9e 83 std Y+6, r25 ; 0x06 345dc: af 83 std Y+7, r26 ; 0x07 345de: b8 87 std Y+8, r27 ; 0x08 345e0: 89 80 ldd r8, Y+1 ; 0x01 345e2: 9a 80 ldd r9, Y+2 ; 0x02 345e4: ab 80 ldd r10, Y+3 ; 0x03 345e6: bc 80 ldd r11, Y+4 ; 0x04 345e8: b6 94 lsr r11 345ea: a7 94 ror r10 345ec: 97 94 ror r9 345ee: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 345f0: cd 84 ldd r12, Y+13 ; 0x0d 345f2: de 84 ldd r13, Y+14 ; 0x0e 345f4: ef 84 ldd r14, Y+15 ; 0x0f 345f6: f8 88 ldd r15, Y+16 ; 0x10 345f8: 89 89 ldd r24, Y+17 ; 0x11 345fa: 9a 89 ldd r25, Y+18 ; 0x12 345fc: ab 89 ldd r26, Y+19 ; 0x13 345fe: bc 89 ldd r27, Y+20 ; 0x14 34600: 8c 15 cp r24, r12 34602: 9d 05 cpc r25, r13 34604: ae 05 cpc r26, r14 34606: bf 05 cpc r27, r15 34608: 08 f4 brcc .+2 ; 0x3460c 3460a: 6f c0 rjmp .+222 ; 0x346ea // 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; 3460c: 6c 01 movw r12, r24 3460e: 7d 01 movw r14, r26 34610: 91 e0 ldi r25, 0x01 ; 1 34612: c9 1a sub r12, r25 34614: d1 08 sbc r13, r1 34616: e1 08 sbc r14, r1 34618: f1 08 sbc r15, r1 3461a: 8d 85 ldd r24, Y+13 ; 0x0d 3461c: 9e 85 ldd r25, Y+14 ; 0x0e 3461e: af 85 ldd r26, Y+15 ; 0x0f 34620: b8 89 ldd r27, Y+16 ; 0x10 34622: c8 1a sub r12, r24 34624: d9 0a sbc r13, r25 34626: ea 0a sbc r14, r26 34628: fb 0a sbc r15, r27 3462a: c7 01 movw r24, r14 3462c: b6 01 movw r22, r12 3462e: 62 0f add r22, r18 34630: 73 1f adc r23, r19 34632: 84 1f adc r24, r20 34634: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 34636: cd 80 ldd r12, Y+5 ; 0x05 34638: de 80 ldd r13, Y+6 ; 0x06 3463a: ef 80 ldd r14, Y+7 ; 0x07 3463c: f8 84 ldd r15, Y+8 ; 0x08 3463e: cd 28 or r12, r13 34640: ce 28 or r12, r14 34642: cf 28 or r12, r15 34644: 41 f0 breq .+16 ; 0x34656 accelerate_steps += acceleration_x2; 34646: c9 84 ldd r12, Y+9 ; 0x09 34648: da 84 ldd r13, Y+10 ; 0x0a 3464a: eb 84 ldd r14, Y+11 ; 0x0b 3464c: fc 84 ldd r15, Y+12 ; 0x0c 3464e: 6c 0d add r22, r12 34650: 7d 1d adc r23, r13 34652: 8e 1d adc r24, r14 34654: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 34656: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 3465a: 75 01 movw r14, r10 3465c: 64 01 movw r12, r8 3465e: c2 0e add r12, r18 34660: d3 1e adc r13, r19 34662: e4 1e adc r14, r20 34664: f5 1e adc r15, r21 34666: 29 81 ldd r18, Y+1 ; 0x01 34668: 3a 81 ldd r19, Y+2 ; 0x02 3466a: 4b 81 ldd r20, Y+3 ; 0x03 3466c: 5c 81 ldd r21, Y+4 ; 0x04 3466e: 2c 15 cp r18, r12 34670: 3d 05 cpc r19, r13 34672: 4e 05 cpc r20, r14 34674: 5f 05 cpc r21, r15 34676: 10 f4 brcc .+4 ; 0x3467c 34678: 69 01 movw r12, r18 3467a: 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) { 3467c: 2b 8d ldd r18, Y+27 ; 0x1b 3467e: 22 23 and r18, r18 34680: 09 f4 brne .+2 ; 0x34684 34682: 69 c0 rjmp .+210 ; 0x34756 if(!accelerate_steps || !decelerate_steps) { 34684: c1 14 cp r12, r1 34686: d1 04 cpc r13, r1 34688: e1 04 cpc r14, r1 3468a: f1 04 cpc r15, r1 3468c: 09 f4 brne .+2 ; 0x34690 3468e: 66 c0 rjmp .+204 ; 0x3475c // 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; 34690: 4d 89 ldd r20, Y+21 ; 0x15 34692: 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) { 34694: 41 14 cp r4, r1 34696: 51 04 cpc r5, r1 34698: 61 04 cpc r6, r1 3469a: 71 04 cpc r7, r1 3469c: 09 f4 brne .+2 ; 0x346a0 3469e: 3d cf rjmp .-390 ; 0x3451a // 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); 346a0: a7 01 movw r20, r14 346a2: 96 01 movw r18, r12 346a4: 69 85 ldd r22, Y+9 ; 0x09 346a6: 7a 85 ldd r23, Y+10 ; 0x0a 346a8: 8b 85 ldd r24, Y+11 ; 0x0b 346aa: 9c 85 ldd r25, Y+12 ; 0x0c 346ac: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__mulsi3> 346b0: 2d 85 ldd r18, Y+13 ; 0x0d 346b2: 3e 85 ldd r19, Y+14 ; 0x0e 346b4: 4f 85 ldd r20, Y+15 ; 0x0f 346b6: 58 89 ldd r21, Y+16 ; 0x10 346b8: 62 0f add r22, r18 346ba: 73 1f adc r23, r19 346bc: 84 1f adc r24, r20 346be: 95 1f adc r25, r21 346c0: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 346c4: 0f 94 51 e2 call 0x3c4a2 ; 0x3c4a2 max_adv_steps = max_rate * block->adv_comp; 346c8: f1 01 movw r30, r2 346ca: ec 5a subi r30, 0xAC ; 172 346cc: ff 4f sbci r31, 0xFF ; 255 346ce: 20 81 ld r18, Z 346d0: 31 81 ldd r19, Z+1 ; 0x01 346d2: 42 81 ldd r20, Z+2 ; 0x02 346d4: 53 81 ldd r21, Z+3 ; 0x03 346d6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 346da: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 346de: 46 2f mov r20, r22 346e0: 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; 346e2: 41 2c mov r4, r1 346e4: 51 2c mov r5, r1 346e6: 32 01 movw r6, r4 346e8: 18 cf rjmp .-464 ; 0x3451a 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; 346ea: 6d 85 ldd r22, Y+13 ; 0x0d 346ec: 7e 85 ldd r23, Y+14 ; 0x0e 346ee: 8f 85 ldd r24, Y+15 ; 0x0f 346f0: 98 89 ldd r25, Y+16 ; 0x10 346f2: c9 88 ldd r12, Y+17 ; 0x11 346f4: da 88 ldd r13, Y+18 ; 0x12 346f6: eb 88 ldd r14, Y+19 ; 0x13 346f8: fc 88 ldd r15, Y+20 ; 0x14 346fa: 6c 19 sub r22, r12 346fc: 7d 09 sbc r23, r13 346fe: 8e 09 sbc r24, r14 34700: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 34702: cd 80 ldd r12, Y+5 ; 0x05 34704: de 80 ldd r13, Y+6 ; 0x06 34706: ef 80 ldd r14, Y+7 ; 0x07 34708: f8 84 ldd r15, Y+8 ; 0x08 3470a: cd 28 or r12, r13 3470c: ce 28 or r12, r14 3470e: cf 28 or r12, r15 34710: 41 f0 breq .+16 ; 0x34722 decelerate_steps += acceleration_x2; 34712: c9 84 ldd r12, Y+9 ; 0x09 34714: da 84 ldd r13, Y+10 ; 0x0a 34716: eb 84 ldd r14, Y+11 ; 0x0b 34718: fc 84 ldd r15, Y+12 ; 0x0c 3471a: 6c 0d add r22, r12 3471c: 7d 1d adc r23, r13 3471e: 8e 1d adc r24, r14 34720: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 34722: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 34726: 82 0e add r8, r18 34728: 93 1e adc r9, r19 3472a: a4 1e adc r10, r20 3472c: b5 1e adc r11, r21 3472e: 49 80 ldd r4, Y+1 ; 0x01 34730: 5a 80 ldd r5, Y+2 ; 0x02 34732: 6b 80 ldd r6, Y+3 ; 0x03 34734: 7c 80 ldd r7, Y+4 ; 0x04 34736: 84 14 cp r8, r4 34738: 95 04 cpc r9, r5 3473a: a6 04 cpc r10, r6 3473c: b7 04 cpc r11, r7 3473e: 10 f4 brcc .+4 ; 0x34744 34740: 24 01 movw r4, r8 34742: 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; 34744: c9 80 ldd r12, Y+1 ; 0x01 34746: da 80 ldd r13, Y+2 ; 0x02 34748: eb 80 ldd r14, Y+3 ; 0x03 3474a: fc 80 ldd r15, Y+4 ; 0x04 3474c: c4 18 sub r12, r4 3474e: d5 08 sbc r13, r5 34750: e6 08 sbc r14, r6 34752: f7 08 sbc r15, r7 34754: 93 cf rjmp .-218 ; 0x3467c // 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; 34756: 40 e0 ldi r20, 0x00 ; 0 34758: 80 e0 ldi r24, 0x00 ; 0 3475a: c3 cf rjmp .-122 ; 0x346e2 #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; 3475c: 4d 89 ldd r20, Y+21 ; 0x15 3475e: 8e 89 ldd r24, Y+22 ; 0x16 34760: c0 cf rjmp .-128 ; 0x346e2 00034762 : while (!(UCSR0A & _BV(UDRE0))); UDR0 = ch; } static void verifySpace() { if (getch() != CRC_EOP) { 34762: 0f 94 39 a1 call 0x34272 ; 0x34272 34766: 80 32 cpi r24, 0x20 ; 32 34768: 29 f0 breq .+10 ; 0x34774 putch(STK_FAILED); 3476a: 81 e1 ldi r24, 0x11 ; 17 3476c: 0f 94 32 a1 call 0x34264 ; 0x34264 softReset(); 34770: 0e 94 81 68 call 0xd102 ; 0xd102 } putch(STK_INSYNC); 34774: 84 e1 ldi r24, 0x14 ; 20 34776: 0d 94 32 a1 jmp 0x34264 ; 0x34264 0003477a : } static void getNch(uint8_t count) { 3477a: cf 93 push r28 3477c: c8 2f mov r28, r24 do getch(); while (--count); 3477e: 0f 94 39 a1 call 0x34272 ; 0x34272 34782: c1 50 subi r28, 0x01 ; 1 34784: e1 f7 brne .-8 ; 0x3477e verifySpace(); } 34786: cf 91 pop r28 putch(STK_INSYNC); } static void getNch(uint8_t count) { do getch(); while (--count); verifySpace(); 34788: 0d 94 b1 a3 jmp 0x34762 ; 0x34762 0003478c : /// @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) { 3478c: 0f 93 push r16 3478e: 1f 93 push r17 34790: cf 93 push r28 34792: df 93 push r29 34794: eb 01 movw r28, r22 34796: 14 2f mov r17, r20 34798: 05 2f mov r16, r21 lcd_putc(chr); 3479a: 0e 94 04 70 call 0xe008 ; 0xe008 lcd_puts_P(str); 3479e: ce 01 movw r24, r28 347a0: 0e 94 00 70 call 0xe000 ; 0xe000 lcd_putc(':'); 347a4: 8a e3 ldi r24, 0x3A ; 58 347a6: 0e 94 04 70 call 0xe008 ; 0xe008 347aa: ce 01 movw r24, r28 347ac: 0f 94 19 db call 0x3b632 ; 0x3b632 <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 347b0: 9e e0 ldi r25, 0x0E ; 14 347b2: 98 1b sub r25, r24 347b4: 89 2f mov r24, r25 347b6: 0e 94 0b 70 call 0xe016 ; 0xe016 // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 347ba: 0f 93 push r16 347bc: 1f 93 push r17 347be: 8f e0 ldi r24, 0x0F ; 15 347c0: 9b ea ldi r25, 0xAB ; 171 347c2: 9f 93 push r25 347c4: 8f 93 push r24 347c6: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 347ca: 0f 90 pop r0 347cc: 0f 90 pop r0 347ce: 0f 90 pop r0 347d0: 0f 90 pop r0 } 347d2: df 91 pop r29 347d4: cf 91 pop r28 347d6: 1f 91 pop r17 347d8: 0f 91 pop r16 347da: 08 95 ret 000347dc : * \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) { 347dc: 0f 93 push r16 347de: 1f 93 push r17 347e0: cf 93 push r28 347e2: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 347e4: fc 01 movw r30, r24 347e6: 23 81 ldd r18, Z+3 ; 0x03 347e8: 22 23 and r18, r18 347ea: 31 f0 breq .+12 ; 0x347f8 dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 347ec: 80 e0 ldi r24, 0x00 ; 0 } 347ee: df 91 pop r29 347f0: cf 91 pop r28 347f2: 1f 91 pop r17 347f4: 0f 91 pop r16 347f6: 08 95 ret 347f8: 8b 01 movw r16, r22 347fa: ec 01 movw r28, r24 347fc: fb 01 movw r30, r22 347fe: 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)) { 34800: 80 31 cpi r24, 0x10 ; 16 34802: 39 f5 brne .+78 ; 0x34852 type_ = FAT_FILE_TYPE_ROOT_FIXED; 34804: 82 e0 ldi r24, 0x02 ; 2 34806: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 34808: 1d 8a std Y+21, r1 ; 0x15 3480a: 1e 8a std Y+22, r1 ; 0x16 3480c: 1f 8a std Y+23, r1 ; 0x17 3480e: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 34810: 80 8d ldd r24, Z+24 ; 0x18 34812: 91 8d ldd r25, Z+25 ; 0x19 34814: b0 e0 ldi r27, 0x00 ; 0 34816: a0 e0 ldi r26, 0x00 ; 0 34818: 25 e0 ldi r18, 0x05 ; 5 3481a: 88 0f add r24, r24 3481c: 99 1f adc r25, r25 3481e: aa 1f adc r26, r26 34820: bb 1f adc r27, r27 34822: 2a 95 dec r18 34824: d1 f7 brne .-12 ; 0x3481a 34826: 89 8b std Y+17, r24 ; 0x11 34828: 9a 8b std Y+18, r25 ; 0x12 3482a: ab 8b std Y+19, r26 ; 0x13 3482c: 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; 3482e: 1a 8f std Y+26, r17 ; 0x1a 34830: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 34832: 81 e0 ldi r24, 0x01 ; 1 34834: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 34836: 1c 82 std Y+4, r1 ; 0x04 34838: 1d 82 std Y+5, r1 ; 0x05 3483a: 1e 82 std Y+6, r1 ; 0x06 3483c: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 3483e: 18 86 std Y+8, r1 ; 0x08 34840: 19 86 std Y+9, r1 ; 0x09 34842: 1a 86 std Y+10, r1 ; 0x0a 34844: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 34846: 1c 86 std Y+12, r1 ; 0x0c 34848: 1d 86 std Y+13, r1 ; 0x0d 3484a: 1e 86 std Y+14, r1 ; 0x0e 3484c: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 3484e: 18 8a std Y+16, r1 ; 0x10 34850: ce cf rjmp .-100 ; 0x347ee 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) { 34852: 80 32 cpi r24, 0x20 ; 32 34854: 59 f6 brne .-106 ; 0x347ec type_ = FAT_FILE_TYPE_ROOT32; 34856: 83 e0 ldi r24, 0x03 ; 3 34858: 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_;} 3485a: 42 8d ldd r20, Z+26 ; 0x1a 3485c: 53 8d ldd r21, Z+27 ; 0x1b 3485e: 64 8d ldd r22, Z+28 ; 0x1c 34860: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 34862: 4d 8b std Y+21, r20 ; 0x15 34864: 5e 8b std Y+22, r21 ; 0x16 34866: 6f 8b std Y+23, r22 ; 0x17 34868: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 3486a: 9e 01 movw r18, r28 3486c: 2f 5e subi r18, 0xEF ; 239 3486e: 3f 4f sbci r19, 0xFF ; 255 34870: c8 01 movw r24, r16 34872: 0f 94 f6 6b call 0x2d7ec ; 0x2d7ec 34876: 81 11 cpse r24, r1 34878: da cf rjmp .-76 ; 0x3482e 3487a: b8 cf rjmp .-144 ; 0x347ec 0003487c : * * \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() { 3487c: cf 93 push r28 3487e: df 93 push r29 34880: ec 01 movw r28, r24 bool rtn = sync(); 34882: 0f 94 41 6d call 0x2da82 ; 0x2da82 type_ = FAT_FILE_TYPE_CLOSED; 34886: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 34888: df 91 pop r29 3488a: cf 91 pop r28 3488c: 08 95 ret 0003488e : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 3488e: cf 93 push r28 34890: df 93 push r29 34892: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 34894: 46 2f mov r20, r22 34896: 41 70 andi r20, 0x01 ; 1 34898: 6c 85 ldd r22, Y+12 ; 0x0c 3489a: 7d 85 ldd r23, Y+13 ; 0x0d 3489c: 8e 85 ldd r24, Y+14 ; 0x0e 3489e: 9f 85 ldd r25, Y+15 ; 0x0f 348a0: 0f 94 a4 6a call 0x2d548 ; 0x2d548 348a4: 88 23 and r24, r24 348a6: 51 f0 breq .+20 ; 0x348bc return vol_->cache()->dir + dirIndex_; 348a8: 88 89 ldd r24, Y+16 ; 0x10 348aa: 20 e2 ldi r18, 0x20 ; 32 348ac: 82 9f mul r24, r18 348ae: c0 01 movw r24, r0 348b0: 11 24 eor r1, r1 348b2: 85 58 subi r24, 0x85 ; 133 348b4: 91 4f sbci r25, 0xF1 ; 241 fail: return 0; } 348b6: df 91 pop r29 348b8: cf 91 pop r28 348ba: 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; 348bc: 90 e0 ldi r25, 0x00 ; 0 348be: 80 e0 ldi r24, 0x00 ; 0 348c0: fa cf rjmp .-12 ; 0x348b6 000348c2 : * \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) { 348c2: cf 93 push r28 348c4: df 93 push r29 348c6: eb 01 movw r28, r22 348c8: fc 01 movw r30, r24 348ca: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 348cc: 21 11 cpse r18, r1 348ce: 04 c0 rjmp .+8 ; 0x348d8 348d0: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 348d2: df 91 pop r29 348d4: cf 91 pop r28 348d6: 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; 348d8: 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()) { 348da: 22 30 cpi r18, 0x02 ; 2 348dc: 28 f4 brcc .+10 ; 0x348e8 name[0] = '/'; 348de: 8f e2 ldi r24, 0x2F ; 47 348e0: 88 83 st Y, r24 name[1] = '\0'; 348e2: 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; 348e4: 81 e0 ldi r24, 0x01 ; 1 348e6: f5 cf rjmp .-22 ; 0x348d2 name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 348e8: 60 e0 ldi r22, 0x00 ; 0 348ea: 0f 94 47 a4 call 0x3488e ; 0x3488e if (!p) return false; 348ee: 00 97 sbiw r24, 0x00 ; 0 348f0: 79 f3 breq .-34 ; 0x348d0 348f2: 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; 348f4: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 348f6: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 348f8: 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; 348fa: 2d 91 ld r18, X+ 348fc: 20 32 cpi r18, 0x20 ; 32 348fe: 99 f0 breq .+38 ; 0x34926 if (i == 8) name[j++] = '.'; 34900: 88 30 cpi r24, 0x08 ; 8 34902: 31 f4 brne .+12 ; 0x34910 34904: 9e 01 movw r18, r28 34906: 26 0f add r18, r22 34908: 31 1d adc r19, r1 3490a: f9 01 movw r30, r18 3490c: 90 83 st Z, r25 3490e: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 34910: 9e 01 movw r18, r28 34912: 26 0f add r18, r22 34914: 31 1d adc r19, r1 34916: ad 01 movw r20, r26 34918: 41 50 subi r20, 0x01 ; 1 3491a: 51 09 sbc r21, r1 3491c: fa 01 movw r30, r20 3491e: 40 81 ld r20, Z 34920: f9 01 movw r30, r18 34922: 40 83 st Z, r20 34924: 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++) { 34926: 8f 5f subi r24, 0xFF ; 255 34928: 8b 30 cpi r24, 0x0B ; 11 3492a: 39 f7 brne .-50 ; 0x348fa if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 3492c: fe 01 movw r30, r28 3492e: e6 0f add r30, r22 34930: f1 1d adc r31, r1 34932: 10 82 st Z, r1 34934: d7 cf rjmp .-82 ; 0x348e4 00034936 : 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() { 34936: 3f 92 push r3 34938: 4f 92 push r4 3493a: 5f 92 push r5 3493c: 6f 92 push r6 3493e: 7f 92 push r7 34940: 8f 92 push r8 34942: 9f 92 push r9 34944: af 92 push r10 34946: bf 92 push r11 34948: cf 92 push r12 3494a: df 92 push r13 3494c: ef 92 push r14 3494e: ff 92 push r15 34950: 0f 93 push r16 34952: 1f 93 push r17 34954: cf 93 push r28 34956: df 93 push r29 34958: cd b7 in r28, 0x3d ; 61 3495a: de b7 in r29, 0x3e ; 62 3495c: 2c 97 sbiw r28, 0x0c ; 12 3495e: 0f b6 in r0, 0x3f ; 63 34960: f8 94 cli 34962: de bf out 0x3e, r29 ; 62 34964: 0f be out 0x3f, r0 ; 63 34966: cd bf out 0x3d, r28 ; 61 34968: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 3496a: dc 01 movw r26, r24 3496c: 59 96 adiw r26, 0x19 ; 25 3496e: 8d 90 ld r8, X+ 34970: 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; 34972: f4 01 movw r30, r8 34974: 81 85 ldd r24, Z+9 ; 0x09 34976: 92 85 ldd r25, Z+10 ; 0x0a 34978: a3 85 ldd r26, Z+11 ; 0x0b 3497a: b4 85 ldd r27, Z+12 ; 0x0c 3497c: 9c 01 movw r18, r24 3497e: ad 01 movw r20, r26 34980: 2f 5f subi r18, 0xFF ; 255 34982: 3f 4f sbci r19, 0xFF ; 255 34984: 4f 4f sbci r20, 0xFF ; 255 34986: 5f 4f sbci r21, 0xFF ; 255 34988: 29 87 std Y+9, r18 ; 0x09 3498a: 3a 87 std Y+10, r19 ; 0x0a 3498c: 4b 87 std Y+11, r20 ; 0x0b 3498e: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 34990: d5 01 movw r26, r10 34992: 14 96 adiw r26, 0x04 ; 4 34994: 4d 90 ld r4, X+ 34996: 5d 90 ld r5, X+ 34998: 6d 90 ld r6, X+ 3499a: 7c 90 ld r7, X 3499c: 17 97 sbiw r26, 0x07 ; 7 3499e: 41 14 cp r4, r1 349a0: 51 04 cpc r5, r1 349a2: 61 04 cpc r6, r1 349a4: 71 04 cpc r7, r1 349a6: 09 f4 brne .+2 ; 0x349aa 349a8: 59 c0 rjmp .+178 ; 0x34a5c // try to make file contiguous bgnCluster = *curCluster + 1; 349aa: bf ef ldi r27, 0xFF ; 255 349ac: 4b 1a sub r4, r27 349ae: 5b 0a sbc r5, r27 349b0: 6b 0a sbc r6, r27 349b2: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 349b4: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 349b6: 73 01 movw r14, r6 349b8: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 349ba: 1d 82 std Y+5, r1 ; 0x05 349bc: 1e 82 std Y+6, r1 ; 0x06 349be: 1f 82 std Y+7, r1 ; 0x07 349c0: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 349c2: f4 01 movw r30, r8 349c4: 81 85 ldd r24, Z+9 ; 0x09 349c6: 92 85 ldd r25, Z+10 ; 0x0a 349c8: a3 85 ldd r26, Z+11 ; 0x0b 349ca: b4 85 ldd r27, Z+12 ; 0x0c 349cc: 2d 81 ldd r18, Y+5 ; 0x05 349ce: 3e 81 ldd r19, Y+6 ; 0x06 349d0: 4f 81 ldd r20, Y+7 ; 0x07 349d2: 58 85 ldd r21, Y+8 ; 0x08 349d4: 28 17 cp r18, r24 349d6: 39 07 cpc r19, r25 349d8: 4a 07 cpc r20, r26 349da: 5b 07 cpc r21, r27 349dc: 08 f0 brcs .+2 ; 0x349e0 349de: 56 c0 rjmp .+172 ; 0x34a8c // past end - start from beginning of FAT if (endCluster > fatEnd) { 349e0: 89 85 ldd r24, Y+9 ; 0x09 349e2: 9a 85 ldd r25, Y+10 ; 0x0a 349e4: ab 85 ldd r26, Y+11 ; 0x0b 349e6: bc 85 ldd r27, Y+12 ; 0x0c 349e8: 8c 15 cp r24, r12 349ea: 9d 05 cpc r25, r13 349ec: ae 05 cpc r26, r14 349ee: bf 05 cpc r27, r15 349f0: 50 f4 brcc .+20 ; 0x34a06 bgnCluster = endCluster = 2; 349f2: 82 e0 ldi r24, 0x02 ; 2 349f4: c8 2e mov r12, r24 349f6: d1 2c mov r13, r1 349f8: e1 2c mov r14, r1 349fa: f1 2c mov r15, r1 349fc: 92 e0 ldi r25, 0x02 ; 2 349fe: 49 2e mov r4, r25 34a00: 51 2c mov r5, r1 34a02: 61 2c mov r6, r1 34a04: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 34a06: 9e 01 movw r18, r28 34a08: 2f 5f subi r18, 0xFF ; 255 34a0a: 3f 4f sbci r19, 0xFF ; 255 34a0c: b7 01 movw r22, r14 34a0e: a6 01 movw r20, r12 34a10: c4 01 movw r24, r8 34a12: 0f 94 73 6b call 0x2d6e6 ; 0x2d6e6 34a16: 88 23 and r24, r24 34a18: c9 f1 breq .+114 ; 0x34a8c if (f != 0) { 34a1a: 89 81 ldd r24, Y+1 ; 0x01 34a1c: 9a 81 ldd r25, Y+2 ; 0x02 34a1e: ab 81 ldd r26, Y+3 ; 0x03 34a20: bc 81 ldd r27, Y+4 ; 0x04 34a22: 89 2b or r24, r25 34a24: 8a 2b or r24, r26 34a26: 8b 2b or r24, r27 34a28: 01 f1 breq .+64 ; 0x34a6a // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 34a2a: 26 01 movw r4, r12 34a2c: 37 01 movw r6, r14 34a2e: 9f ef ldi r25, 0xFF ; 255 34a30: 49 1a sub r4, r25 34a32: 59 0a sbc r5, r25 34a34: 69 0a sbc r6, r25 34a36: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 34a38: 2d 81 ldd r18, Y+5 ; 0x05 34a3a: 3e 81 ldd r19, Y+6 ; 0x06 34a3c: 4f 81 ldd r20, Y+7 ; 0x07 34a3e: 58 85 ldd r21, Y+8 ; 0x08 34a40: 2f 5f subi r18, 0xFF ; 255 34a42: 3f 4f sbci r19, 0xFF ; 255 34a44: 4f 4f sbci r20, 0xFF ; 255 34a46: 5f 4f sbci r21, 0xFF ; 255 34a48: 2d 83 std Y+5, r18 ; 0x05 34a4a: 3e 83 std Y+6, r19 ; 0x06 34a4c: 4f 83 std Y+7, r20 ; 0x07 34a4e: 58 87 std Y+8, r21 ; 0x08 34a50: 3f ef ldi r19, 0xFF ; 255 34a52: c3 1a sub r12, r19 34a54: d3 0a sbc r13, r19 34a56: e3 0a sbc r14, r19 34a58: f3 0a sbc r15, r19 34a5a: b3 cf rjmp .-154 ; 0x349c2 // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 34a5c: 40 80 ld r4, Z 34a5e: 51 80 ldd r5, Z+1 ; 0x01 34a60: 62 80 ldd r6, Z+2 ; 0x02 34a62: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 34a64: 33 24 eor r3, r3 34a66: 33 94 inc r3 34a68: a6 cf rjmp .-180 ; 0x349b6 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) { 34a6a: c4 14 cp r12, r4 34a6c: d5 04 cpc r13, r5 34a6e: e6 04 cpc r14, r6 34a70: f7 04 cpc r15, r7 34a72: 11 f7 brne .-60 ; 0x34a38 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); 34a74: 0f ef ldi r16, 0xFF ; 255 34a76: 1f ef ldi r17, 0xFF ; 255 34a78: 2f ef ldi r18, 0xFF ; 255 34a7a: 3f e0 ldi r19, 0x0F ; 15 34a7c: b7 01 movw r22, r14 34a7e: a6 01 movw r20, r12 34a80: c4 01 movw r24, r8 34a82: 0f 94 e1 6a call 0x2d5c2 ; 0x2d5c2 34a86: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 34a88: 81 11 cpse r24, r1 34a8a: 1a c0 rjmp .+52 ; 0x34ac0 flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 34a8c: 71 2c mov r7, r1 } 34a8e: 87 2d mov r24, r7 34a90: 2c 96 adiw r28, 0x0c ; 12 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: 1f 91 pop r17 34aa2: 0f 91 pop r16 34aa4: ff 90 pop r15 34aa6: ef 90 pop r14 34aa8: df 90 pop r13 34aaa: cf 90 pop r12 34aac: bf 90 pop r11 34aae: af 90 pop r10 34ab0: 9f 90 pop r9 34ab2: 8f 90 pop r8 34ab4: 7f 90 pop r7 34ab6: 6f 90 pop r6 34ab8: 5f 90 pop r5 34aba: 4f 90 pop r4 34abc: 3f 90 pop r3 34abe: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 34ac0: f5 01 movw r30, r10 34ac2: 44 81 ldd r20, Z+4 ; 0x04 34ac4: 55 81 ldd r21, Z+5 ; 0x05 34ac6: 66 81 ldd r22, Z+6 ; 0x06 34ac8: 77 81 ldd r23, Z+7 ; 0x07 34aca: 41 15 cp r20, r1 34acc: 51 05 cpc r21, r1 34ace: 61 05 cpc r22, r1 34ad0: 71 05 cpc r23, r1 34ad2: 39 f0 breq .+14 ; 0x34ae2 // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 34ad4: 97 01 movw r18, r14 34ad6: 86 01 movw r16, r12 34ad8: c4 01 movw r24, r8 34ada: 0f 94 e1 6a call 0x2d5c2 ; 0x2d5c2 34ade: 88 23 and r24, r24 34ae0: a9 f2 breq .-86 ; 0x34a8c } // return first cluster number to caller *curCluster = bgnCluster; 34ae2: d5 01 movw r26, r10 34ae4: 14 96 adiw r26, 0x04 ; 4 34ae6: cd 92 st X+, r12 34ae8: dd 92 st X+, r13 34aea: ed 92 st X+, r14 34aec: fc 92 st X, r15 34aee: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 34af0: 33 20 and r3, r3 34af2: 51 f0 breq .+20 ; 0x34b08 34af4: d7 01 movw r26, r14 34af6: c6 01 movw r24, r12 34af8: 01 96 adiw r24, 0x01 ; 1 34afa: a1 1d adc r26, r1 34afc: b1 1d adc r27, r1 34afe: f4 01 movw r30, r8 34b00: 80 83 st Z, r24 34b02: 91 83 std Z+1, r25 ; 0x01 34b04: a2 83 std Z+2, r26 ; 0x02 34b06: 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) { 34b08: f5 01 movw r30, r10 34b0a: 85 89 ldd r24, Z+21 ; 0x15 34b0c: 96 89 ldd r25, Z+22 ; 0x16 34b0e: a7 89 ldd r26, Z+23 ; 0x17 34b10: b0 8d ldd r27, Z+24 ; 0x18 34b12: 89 2b or r24, r25 34b14: 8a 2b or r24, r26 34b16: 8b 2b or r24, r27 34b18: 09 f0 breq .+2 ; 0x34b1c 34b1a: b9 cf rjmp .-142 ; 0x34a8e firstCluster_ = curCluster_; 34b1c: c5 8a std Z+21, r12 ; 0x15 34b1e: d6 8a std Z+22, r13 ; 0x16 34b20: e7 8a std Z+23, r14 ; 0x17 34b22: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 34b24: 81 81 ldd r24, Z+1 ; 0x01 34b26: 80 68 ori r24, 0x80 ; 128 34b28: 81 83 std Z+1, r24 ; 0x01 34b2a: b1 cf rjmp .-158 ; 0x34a8e 00034b2c : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 34b2c: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34b2e: 0d b4 in r0, 0x2d ; 45 34b30: 07 fe sbrs r0, 7 34b32: fd cf rjmp .-6 ; 0x34b2e } 34b34: 08 95 ret 00034b36 : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 34b36: 8f ef ldi r24, 0xFF ; 255 34b38: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34b3a: 0d b4 in r0, 0x2d ; 45 34b3c: 07 fe sbrs r0, 7 34b3e: fd cf rjmp .-6 ; 0x34b3a return SPDR; 34b40: 8e b5 in r24, 0x2e ; 46 } 34b42: 08 95 ret 00034b44 : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 34b44: 8f 92 push r8 34b46: 9f 92 push r9 34b48: af 92 push r10 34b4a: bf 92 push r11 34b4c: ef 92 push r14 34b4e: ff 92 push r15 34b50: 0f 93 push r16 34b52: 1f 93 push r17 34b54: cf 93 push r28 34b56: 7c 01 movw r14, r24 34b58: c6 2f mov r28, r22 34b5a: 49 01 movw r8, r18 34b5c: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 34b5e: fc 01 movw r30, r24 34b60: 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); 34b62: 89 2f mov r24, r25 34b64: 80 6a ori r24, 0xA0 ; 160 34b66: 86 95 lsr r24 34b68: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 34b6a: 90 fd sbrc r25, 0 34b6c: 03 c0 rjmp .+6 ; 0x34b74 34b6e: 81 e0 ldi r24, 0x01 ; 1 34b70: 96 30 cpi r25, 0x06 ; 6 34b72: 09 f4 brne .+2 ; 0x34b76 34b74: 80 e0 ldi r24, 0x00 ; 0 34b76: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 34b78: 9f b7 in r25, 0x3f ; 63 34b7a: f8 94 cli 34b7c: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 34b80: 8f 7b andi r24, 0xBF ; 191 34b82: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 34b86: 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); 34b88: 8c e2 ldi r24, 0x2C ; 44 34b8a: 91 e0 ldi r25, 0x01 ; 1 34b8c: 0f 94 b3 75 call 0x2eb66 ; 0x2eb66 // send command spiSend(cmd | 0x40); 34b90: 8c 2f mov r24, r28 34b92: 80 64 ori r24, 0x40 ; 64 34b94: 0f 94 96 a5 call 0x34b2c ; 0x34b2c 34b98: 08 e1 ldi r16, 0x18 ; 24 34b9a: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 34b9c: d5 01 movw r26, r10 34b9e: c4 01 movw r24, r8 34ba0: 00 2e mov r0, r16 34ba2: 04 c0 rjmp .+8 ; 0x34bac 34ba4: b6 95 lsr r27 34ba6: a7 95 ror r26 34ba8: 97 95 ror r25 34baa: 87 95 ror r24 34bac: 0a 94 dec r0 34bae: d2 f7 brpl .-12 ; 0x34ba4 34bb0: 0f 94 96 a5 call 0x34b2c ; 0x34b2c 34bb4: 08 50 subi r16, 0x08 ; 8 34bb6: 11 09 sbc r17, r1 34bb8: 08 3f cpi r16, 0xF8 ; 248 34bba: ff ef ldi r31, 0xFF ; 255 34bbc: 1f 07 cpc r17, r31 34bbe: 71 f7 brne .-36 ; 0x34b9c // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 34bc0: 85 e9 ldi r24, 0x95 ; 149 34bc2: cc 23 and r28, r28 34bc4: 21 f0 breq .+8 ; 0x34bce if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 34bc6: 87 e8 ldi r24, 0x87 ; 135 34bc8: c8 30 cpi r28, 0x08 ; 8 34bca: 09 f0 breq .+2 ; 0x34bce // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 34bcc: 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); 34bce: 0f 94 96 a5 call 0x34b2c ; 0x34b2c // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 34bd2: cc 30 cpi r28, 0x0C ; 12 34bd4: 11 f4 brne .+4 ; 0x34bda 34bd6: 0f 94 9b a5 call 0x34b36 ; 0x34b36 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 34bda: 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 */ } 34bdc: 0f 94 9b a5 call 0x34b36 ; 0x34b36 34be0: f7 01 movw r30, r14 34be2: 82 83 std Z+2, r24 ; 0x02 34be4: 87 ff sbrs r24, 7 34be6: 04 c0 rjmp .+8 ; 0x34bf0 34be8: cf 3f cpi r28, 0xFF ; 255 34bea: 11 f0 breq .+4 ; 0x34bf0 34bec: cf 5f subi r28, 0xFF ; 255 34bee: f6 cf rjmp .-20 ; 0x34bdc return status_; } 34bf0: cf 91 pop r28 34bf2: 1f 91 pop r17 34bf4: 0f 91 pop r16 34bf6: ff 90 pop r15 34bf8: ef 90 pop r14 34bfa: bf 90 pop r11 34bfc: af 90 pop r10 34bfe: 9f 90 pop r9 34c00: 8f 90 pop r8 34c02: 08 95 ret 00034c04 : * \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) { 34c04: 0f 93 push r16 34c06: 1f 93 push r17 34c08: cf 93 push r28 34c0a: df 93 push r29 34c0c: ec 01 movw r28, r24 34c0e: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 34c10: 8b 81 ldd r24, Y+3 ; 0x03 34c12: 83 30 cpi r24, 0x03 ; 3 34c14: 39 f0 breq .+14 ; 0x34c24 34c16: 89 e0 ldi r24, 0x09 ; 9 34c18: 44 0f add r20, r20 34c1a: 55 1f adc r21, r21 34c1c: 66 1f adc r22, r22 34c1e: 77 1f adc r23, r23 34c20: 8a 95 dec r24 34c22: d1 f7 brne .-12 ; 0x34c18 if (cardCommand(CMD24, blockNumber)) { 34c24: 9a 01 movw r18, r20 34c26: ab 01 movw r20, r22 34c28: 68 e1 ldi r22, 0x18 ; 24 34c2a: ce 01 movw r24, r28 34c2c: 0f 94 a2 a5 call 0x34b44 ; 0x34b44 34c30: 88 23 and r24, r24 34c32: 19 f0 breq .+6 ; 0x34c3a 34c34: 86 e0 ldi r24, 0x06 ; 6 34c36: 88 83 st Y, r24 34c38: 39 c0 rjmp .+114 ; 0x34cac } //------------------------------------------------------------------------------ /** 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; 34c3a: 8e ef ldi r24, 0xFE ; 254 34c3c: 8e bd out 0x2e, r24 ; 46 34c3e: f8 01 movw r30, r16 34c40: c8 01 movw r24, r16 34c42: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34c44: 0d b4 in r0, 0x2d ; 45 34c46: 07 fe sbrs r0, 7 34c48: fd cf rjmp .-6 ; 0x34c44 SPDR = buf[i]; 34c4a: 20 81 ld r18, Z 34c4c: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34c4e: 0d b4 in r0, 0x2d ; 45 34c50: 07 fe sbrs r0, 7 34c52: fd cf rjmp .-6 ; 0x34c4e SPDR = buf[i + 1]; 34c54: 21 81 ldd r18, Z+1 ; 0x01 34c56: 2e bd out 0x2e, r18 ; 46 34c58: 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) { 34c5a: e8 17 cp r30, r24 34c5c: f9 07 cpc r31, r25 34c5e: 91 f7 brne .-28 ; 0x34c44 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 */ } 34c60: 0d b4 in r0, 0x2d ; 45 34c62: 07 fe sbrs r0, 7 34c64: fd cf rjmp .-6 ; 0x34c60 //------------------------------------------------------------------------------ // 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 34c66: 8f ef ldi r24, 0xFF ; 255 34c68: 0f 94 96 a5 call 0x34b2c ; 0x34b2c spiSend(0xff); // dummy crc 34c6c: 8f ef ldi r24, 0xFF ; 255 34c6e: 0f 94 96 a5 call 0x34b2c ; 0x34b2c status_ = spiRec(); 34c72: 0f 94 9b a5 call 0x34b36 ; 0x34b36 34c76: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 34c78: 8f 71 andi r24, 0x1F ; 31 34c7a: 85 30 cpi r24, 0x05 ; 5 34c7c: 99 f4 brne .+38 ; 0x34ca4 goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 34c7e: 88 e5 ldi r24, 0x58 ; 88 34c80: 92 e0 ldi r25, 0x02 ; 2 34c82: 0f 94 b3 75 call 0x2eb66 ; 0x2eb66 34c86: 18 2f mov r17, r24 34c88: 87 e1 ldi r24, 0x17 ; 23 34c8a: 11 23 and r17, r17 34c8c: a1 f2 breq .-88 ; 0x34c36 error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 34c8e: 20 e0 ldi r18, 0x00 ; 0 34c90: 30 e0 ldi r19, 0x00 ; 0 34c92: a9 01 movw r20, r18 34c94: 6d e0 ldi r22, 0x0D ; 13 34c96: ce 01 movw r24, r28 34c98: 0f 94 a2 a5 call 0x34b44 ; 0x34b44 34c9c: 88 23 and r24, r24 34c9e: 51 f0 breq .+20 ; 0x34cb4 34ca0: 86 e1 ldi r24, 0x16 ; 22 34ca2: c9 cf rjmp .-110 ; 0x34c36 34ca4: 83 e1 ldi r24, 0x13 ; 19 34ca6: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 34ca8: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 } chipSelectHigh(); return true; fail: chipSelectHigh(); 34cac: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 return false; 34cb0: 10 e0 ldi r17, 0x00 ; 0 34cb2: 06 c0 rjmp .+12 ; 0x34cc0 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()) { 34cb4: 0f 94 9b a5 call 0x34b36 ; 0x34b36 34cb8: 81 11 cpse r24, r1 34cba: f2 cf rjmp .-28 ; 0x34ca0 error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 34cbc: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 return true; fail: chipSelectHigh(); return false; } 34cc0: 81 2f mov r24, r17 34cc2: df 91 pop r29 34cc4: cf 91 pop r28 34cc6: 1f 91 pop r17 34cc8: 0f 91 pop r16 34cca: 08 95 ret 00034ccc : * \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) { 34ccc: 2f 92 push r2 34cce: 3f 92 push r3 34cd0: 4f 92 push r4 34cd2: 5f 92 push r5 34cd4: 6f 92 push r6 34cd6: 7f 92 push r7 34cd8: 8f 92 push r8 34cda: 9f 92 push r9 34cdc: af 92 push r10 34cde: bf 92 push r11 34ce0: cf 92 push r12 34ce2: df 92 push r13 34ce4: ef 92 push r14 34ce6: ff 92 push r15 34ce8: 0f 93 push r16 34cea: 1f 93 push r17 34cec: cf 93 push r28 34cee: df 93 push r29 34cf0: ec 01 movw r28, r24 34cf2: 2a 01 movw r4, r20 34cf4: 3b 01 movw r6, r22 34cf6: 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; 34cf8: 8b 81 ldd r24, Y+3 ; 0x03 34cfa: 83 30 cpi r24, 0x03 ; 3 34cfc: 39 f0 breq .+14 ; 0x34d0c 34cfe: 69 e0 ldi r22, 0x09 ; 9 34d00: 44 0c add r4, r4 34d02: 55 1c adc r5, r5 34d04: 66 1c adc r6, r6 34d06: 77 1c adc r7, r7 34d08: 6a 95 dec r22 34d0a: d1 f7 brne .-12 ; 0x34d00 retry2: 34d0c: 43 e0 ldi r20, 0x03 ; 3 34d0e: 94 2e mov r9, r20 34d10: 56 01 movw r10, r12 34d12: 81 e0 ldi r24, 0x01 ; 1 34d14: a8 1a sub r10, r24 34d16: 8e ef ldi r24, 0xFE ; 254 34d18: b8 0a sbc r11, r24 34d1a: 16 01 movw r2, r12 34d1c: ee ef ldi r30, 0xFE ; 254 34d1e: 3e 1a sub r3, r30 34d20: 54 e0 ldi r21, 0x04 ; 4 34d22: 85 2e mov r8, r21 retryCnt --; 34d24: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 34d26: a3 01 movw r20, r6 34d28: 92 01 movw r18, r4 34d2a: 61 e1 ldi r22, 0x11 ; 17 34d2c: ce 01 movw r24, r28 34d2e: 0f 94 a2 a5 call 0x34b44 ; 0x34b44 34d32: 88 23 and r24, r24 34d34: 79 f0 breq .+30 ; 0x34d54 34d36: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 34d38: 99 20 and r9, r9 34d3a: 09 f4 brne .+2 ; 0x34d3e 34d3c: 7a c0 rjmp .+244 ; 0x34e32 if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 34d3e: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 34d42: 20 e0 ldi r18, 0x00 ; 0 34d44: 30 e0 ldi r19, 0x00 ; 0 34d46: a9 01 movw r20, r18 34d48: 6c e0 ldi r22, 0x0C ; 12 34d4a: ce 01 movw r24, r28 34d4c: 0f 94 a2 a5 call 0x34b44 ; 0x34b44 errorCode_ = 0; 34d50: 18 82 st Y, r1 34d52: e8 cf rjmp .-48 ; 0x34d24 #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 34d54: 0f 94 86 3e call 0x27d0c ; 0x27d0c 34d58: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 34d5a: 0f 94 9b a5 call 0x34b36 ; 0x34b36 34d5e: 8a 83 std Y+2, r24 ; 0x02 34d60: 8f 3f cpi r24, 0xFF ; 255 34d62: 91 f4 brne .+36 ; 0x34d88 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 34d64: 0f 94 86 3e call 0x27d0c ; 0x27d0c 34d68: 60 1b sub r22, r16 34d6a: 71 0b sbc r23, r17 34d6c: 6d 32 cpi r22, 0x2D ; 45 34d6e: 71 40 sbci r23, 0x01 ; 1 34d70: a0 f3 brcs .-24 ; 0x34d5a 34d72: 81 e1 ldi r24, 0x11 ; 17 34d74: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 34d76: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 34d7a: 8c 81 ldd r24, Y+4 ; 0x04 34d7c: 88 23 and r24, r24 34d7e: e1 f2 breq .-72 ; 0x34d38 spiSend(0XFF); 34d80: 8f ef ldi r24, 0xFF ; 255 34d82: 0f 94 96 a5 call 0x34b2c ; 0x34b2c 34d86: d8 cf rjmp .-80 ; 0x34d38 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 34d88: 8e 3f cpi r24, 0xFE ; 254 34d8a: 11 f0 breq .+4 ; 0x34d90 34d8c: 8f e0 ldi r24, 0x0F ; 15 34d8e: f2 cf rjmp .-28 ; 0x34d74 //------------------------------------------------------------------------------ /** 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; 34d90: 8f ef ldi r24, 0xFF ; 255 34d92: 8e bd out 0x2e, r24 ; 46 34d94: d6 01 movw r26, r12 34d96: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34d98: 0d b4 in r0, 0x2d ; 45 34d9a: 07 fe sbrs r0, 7 34d9c: fd cf rjmp .-6 ; 0x34d98 buf[i] = SPDR; 34d9e: 9e b5 in r25, 0x2e ; 46 34da0: 91 93 st Z+, r25 SPDR = 0XFF; 34da2: 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++) { 34da4: ea 15 cp r30, r10 34da6: fb 05 cpc r31, r11 34da8: b9 f7 brne .-18 ; 0x34d98 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34daa: 0d b4 in r0, 0x2d ; 45 34dac: 07 fe sbrs r0, 7 34dae: fd cf rjmp .-6 ; 0x34daa buf[nbyte] = SPDR; 34db0: 8e b5 in r24, 0x2e ; 46 34db2: f5 01 movw r30, r10 34db4: 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; 34db6: f1 2c mov r15, r1 34db8: 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); 34dba: 8d 91 ld r24, X+ 34dbc: ef 2d mov r30, r15 34dbe: ff 27 eor r31, r31 34dc0: e8 27 eor r30, r24 34dc2: ee 0f add r30, r30 34dc4: ff 1f adc r31, r31 34dc6: e5 55 subi r30, 0x55 ; 85 34dc8: f2 45 sbci r31, 0x52 ; 82 34dca: 85 91 lpm r24, Z+ 34dcc: 94 91 lpm r25, Z 34dce: fe 2c mov r15, r14 34dd0: ee 24 eor r14, r14 34dd2: e8 26 eor r14, r24 34dd4: 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++) { 34dd6: 2a 16 cp r2, r26 34dd8: 3b 06 cpc r3, r27 34dda: 79 f7 brne .-34 ; 0x34dba spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 34ddc: 0f 94 9b a5 call 0x34b36 ; 0x34b36 34de0: 08 2f mov r16, r24 34de2: 10 e0 ldi r17, 0x00 ; 0 34de4: 10 2f mov r17, r16 34de6: 00 27 eor r16, r16 recvCrc |= spiRec(); 34de8: 0f 94 9b a5 call 0x34b36 ; 0x34b36 34dec: 08 2b or r16, r24 if (calcCrc != recvCrc) 34dee: 0e 15 cp r16, r14 34df0: 1f 05 cpc r17, r15 34df2: 19 f0 breq .+6 ; 0x34dfa 34df4: f0 e2 ldi r31, 0x20 ; 32 34df6: f8 83 st Y, r31 34df8: be cf rjmp .-132 ; 0x34d76 #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 34dfa: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 34dfe: cc 81 ldd r28, Y+4 ; 0x04 34e00: cc 23 and r28, r28 34e02: d9 f0 breq .+54 ; 0x34e3a spiSend(0XFF); 34e04: 8f ef ldi r24, 0xFF ; 255 34e06: 0f 94 96 a5 call 0x34b2c ; 0x34b2c #endif fail: chipSelectHigh(); return false; } 34e0a: 8c 2f mov r24, r28 34e0c: df 91 pop r29 34e0e: cf 91 pop r28 34e10: 1f 91 pop r17 34e12: 0f 91 pop r16 34e14: ff 90 pop r15 34e16: ef 90 pop r14 34e18: df 90 pop r13 34e1a: cf 90 pop r12 34e1c: bf 90 pop r11 34e1e: af 90 pop r10 34e20: 9f 90 pop r9 34e22: 8f 90 pop r8 34e24: 7f 90 pop r7 34e26: 6f 90 pop r6 34e28: 5f 90 pop r5 34e2a: 4f 90 pop r4 34e2c: 3f 90 pop r3 34e2e: 2f 90 pop r2 34e30: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 34e32: 0f 94 aa 75 call 0x2eb54 ; 0x2eb54 return false; 34e36: c0 e0 ldi r28, 0x00 ; 0 34e38: e8 cf rjmp .-48 ; 0x34e0a if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 34e3a: c1 e0 ldi r28, 0x01 ; 1 34e3c: e6 cf rjmp .-52 ; 0x34e0a 00034e3e : * 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) { 34e3e: 2f 92 push r2 34e40: 3f 92 push r3 34e42: 4f 92 push r4 34e44: 5f 92 push r5 34e46: 6f 92 push r6 34e48: 7f 92 push r7 34e4a: 8f 92 push r8 34e4c: 9f 92 push r9 34e4e: af 92 push r10 34e50: bf 92 push r11 34e52: cf 92 push r12 34e54: df 92 push r13 34e56: ef 92 push r14 34e58: ff 92 push r15 34e5a: 0f 93 push r16 34e5c: 1f 93 push r17 34e5e: cf 93 push r28 34e60: df 93 push r29 34e62: 00 d0 rcall .+0 ; 0x34e64 34e64: 1f 92 push r1 34e66: cd b7 in r28, 0x3d ; 61 34e68: de b7 in r29, 0x3e ; 62 34e6a: 9c 83 std Y+4, r25 ; 0x04 34e6c: 8b 83 std Y+3, r24 ; 0x03 34e6e: 4b 01 movw r8, r22 34e70: 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; 34e72: dc 01 movw r26, r24 34e74: 13 96 adiw r26, 0x03 ; 3 34e76: 8c 91 ld r24, X 34e78: 81 11 cpse r24, r1 34e7a: 19 c0 rjmp .+50 ; 0x34eae toRead -= n; } return nbyte; fail: return -1; 34e7c: 8f ef ldi r24, 0xFF ; 255 34e7e: 9f ef ldi r25, 0xFF ; 255 } 34e80: 0f 90 pop r0 34e82: 0f 90 pop r0 34e84: 0f 90 pop r0 34e86: 0f 90 pop r0 34e88: df 91 pop r29 34e8a: cf 91 pop r28 34e8c: 1f 91 pop r17 34e8e: 0f 91 pop r16 34e90: ff 90 pop r15 34e92: ef 90 pop r14 34e94: df 90 pop r13 34e96: cf 90 pop r12 34e98: bf 90 pop r11 34e9a: af 90 pop r10 34e9c: 9f 90 pop r9 34e9e: 8f 90 pop r8 34ea0: 7f 90 pop r7 34ea2: 6f 90 pop r6 34ea4: 5f 90 pop r5 34ea6: 4f 90 pop r4 34ea8: 3f 90 pop r3 34eaa: 2f 90 pop r2 34eac: 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; 34eae: eb 81 ldd r30, Y+3 ; 0x03 34eb0: fc 81 ldd r31, Y+4 ; 0x04 34eb2: 81 81 ldd r24, Z+1 ; 0x01 34eb4: 80 ff sbrs r24, 0 34eb6: e2 cf rjmp .-60 ; 0x34e7c // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 34eb8: 01 89 ldd r16, Z+17 ; 0x11 34eba: 12 89 ldd r17, Z+18 ; 0x12 34ebc: 23 89 ldd r18, Z+19 ; 0x13 34ebe: 34 89 ldd r19, Z+20 ; 0x14 34ec0: 40 85 ldd r20, Z+8 ; 0x08 34ec2: 51 85 ldd r21, Z+9 ; 0x09 34ec4: 62 85 ldd r22, Z+10 ; 0x0a 34ec6: 73 85 ldd r23, Z+11 ; 0x0b 34ec8: c7 01 movw r24, r14 34eca: b0 e0 ldi r27, 0x00 ; 0 34ecc: a0 e0 ldi r26, 0x00 ; 0 34ece: 28 01 movw r4, r16 34ed0: 39 01 movw r6, r18 34ed2: 44 1a sub r4, r20 34ed4: 55 0a sbc r5, r21 34ed6: 66 0a sbc r6, r22 34ed8: 77 0a sbc r7, r23 34eda: 84 15 cp r24, r4 34edc: 95 05 cpc r25, r5 34ede: a6 05 cpc r26, r6 34ee0: b7 05 cpc r27, r7 34ee2: 18 f0 brcs .+6 ; 0x34eea nbyte = fileSize_ - curPosition_; 34ee4: 78 01 movw r14, r16 34ee6: e4 1a sub r14, r20 34ee8: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 34eea: 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; 34eec: 8b 81 ldd r24, Y+3 ; 0x03 34eee: 9c 81 ldd r25, Y+4 ; 0x04 34ef0: 04 96 adiw r24, 0x04 ; 4 34ef2: 9a 83 std Y+2, r25 ; 0x02 34ef4: 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; 34ef6: 61 2c mov r6, r1 34ef8: 32 e0 ldi r19, 0x02 ; 2 34efa: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 34efc: c1 14 cp r12, r1 34efe: d1 04 cpc r13, r1 34f00: 09 f4 brne .+2 ; 0x34f04 34f02: b7 c0 rjmp .+366 ; 0x35072 offset = curPosition_ & 0X1FF; // offset in block 34f04: ab 81 ldd r26, Y+3 ; 0x03 34f06: bc 81 ldd r27, Y+4 ; 0x04 34f08: 18 96 adiw r26, 0x08 ; 8 34f0a: 4d 91 ld r20, X+ 34f0c: 5d 91 ld r21, X+ 34f0e: 6d 91 ld r22, X+ 34f10: 7c 91 ld r23, X 34f12: 1b 97 sbiw r26, 0x0b ; 11 34f14: 5a 01 movw r10, r20 34f16: b1 e0 ldi r27, 0x01 ; 1 34f18: bb 22 and r11, r27 34f1a: eb 81 ldd r30, Y+3 ; 0x03 34f1c: fc 81 ldd r31, Y+4 ; 0x04 34f1e: 81 8d ldd r24, Z+25 ; 0x19 34f20: 92 8d ldd r25, Z+26 ; 0x1a 34f22: 1a 01 movw r2, r20 34f24: 2b 01 movw r4, r22 34f26: 29 e0 ldi r18, 0x09 ; 9 34f28: 56 94 lsr r5 34f2a: 47 94 ror r4 34f2c: 37 94 ror r3 34f2e: 27 94 ror r2 34f30: 2a 95 dec r18 34f32: d1 f7 brne .-12 ; 0x34f28 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 34f34: 23 81 ldd r18, Z+3 ; 0x03 34f36: 22 30 cpi r18, 0x02 ; 2 34f38: 91 f5 brne .+100 ; 0x34f9e block = vol_->rootDirStart() + (curPosition_ >> 9); 34f3a: dc 01 movw r26, r24 34f3c: 5a 96 adiw r26, 0x1a ; 26 34f3e: 6d 91 ld r22, X+ 34f40: 7d 91 ld r23, X+ 34f42: 8d 91 ld r24, X+ 34f44: 9c 91 ld r25, X 34f46: 5d 97 sbiw r26, 0x1d ; 29 34f48: 62 0d add r22, r2 34f4a: 73 1d adc r23, r3 34f4c: 84 1d adc r24, r4 34f4e: 95 1d adc r25, r5 34f50: 83 01 movw r16, r6 34f52: 0a 19 sub r16, r10 34f54: 1b 09 sbc r17, r11 34f56: c0 16 cp r12, r16 34f58: d1 06 cpc r13, r17 34f5a: 08 f4 brcc .+2 ; 0x34f5e 34f5c: 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()) { 34f5e: 01 15 cp r16, r1 34f60: b2 e0 ldi r27, 0x02 ; 2 34f62: 1b 07 cpc r17, r27 34f64: 71 f4 brne .+28 ; 0x34f82 34f66: 20 91 6f 0e lds r18, 0x0E6F ; 0x800e6f 34f6a: 30 91 70 0e lds r19, 0x0E70 ; 0x800e70 34f6e: 40 91 71 0e lds r20, 0x0E71 ; 0x800e71 34f72: 50 91 72 0e lds r21, 0x0E72 ; 0x800e72 34f76: 62 17 cp r22, r18 34f78: 73 07 cpc r23, r19 34f7a: 84 07 cpc r24, r20 34f7c: 95 07 cpc r25, r21 34f7e: 09 f0 breq .+2 ; 0x34f82 34f80: 59 c0 rjmp .+178 ; 0x35034 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; 34f82: 40 e0 ldi r20, 0x00 ; 0 34f84: 0f 94 a4 6a call 0x2d548 ; 0x2d548 34f88: 88 23 and r24, r24 34f8a: 09 f4 brne .+2 ; 0x34f8e 34f8c: 77 cf rjmp .-274 ; 0x34e7c uint8_t* src = vol_->cache()->data + offset; 34f8e: b5 01 movw r22, r10 34f90: 65 58 subi r22, 0x85 ; 133 34f92: 71 4f sbci r23, 0xF1 ; 241 memcpy(dst, src, n); 34f94: a8 01 movw r20, r16 34f96: c4 01 movw r24, r8 34f98: 0f 94 84 e3 call 0x3c708 ; 0x3c708 34f9c: 57 c0 rjmp .+174 ; 0x3504c 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);} 34f9e: fc 01 movw r30, r24 34fa0: 14 81 ldd r17, Z+4 ; 0x04 34fa2: 11 50 subi r17, 0x01 ; 1 34fa4: 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) { 34fa6: a1 14 cp r10, r1 34fa8: b1 04 cpc r11, r1 34faa: 81 f4 brne .+32 ; 0x34fcc 34fac: 11 11 cpse r17, r1 34fae: 0e c0 rjmp .+28 ; 0x34fcc // start of new cluster if (curPosition_ == 0) { 34fb0: 45 2b or r20, r21 34fb2: 46 2b or r20, r22 34fb4: 47 2b or r20, r23 34fb6: 79 f5 brne .+94 ; 0x35016 // use first cluster in file curCluster_ = firstCluster_; 34fb8: eb 81 ldd r30, Y+3 ; 0x03 34fba: fc 81 ldd r31, Y+4 ; 0x04 34fbc: 85 89 ldd r24, Z+21 ; 0x15 34fbe: 96 89 ldd r25, Z+22 ; 0x16 34fc0: a7 89 ldd r26, Z+23 ; 0x17 34fc2: b0 8d ldd r27, Z+24 ; 0x18 34fc4: 84 83 std Z+4, r24 ; 0x04 34fc6: 95 83 std Z+5, r25 ; 0x05 34fc8: a6 83 std Z+6, r26 ; 0x06 34fca: 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; 34fcc: ab 81 ldd r26, Y+3 ; 0x03 34fce: bc 81 ldd r27, Y+4 ; 0x04 34fd0: 59 96 adiw r26, 0x19 ; 25 34fd2: ed 91 ld r30, X+ 34fd4: fc 91 ld r31, X 34fd6: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 34fd8: 14 96 adiw r26, 0x04 ; 4 34fda: 6d 91 ld r22, X+ 34fdc: 7d 91 ld r23, X+ 34fde: 8d 91 ld r24, X+ 34fe0: 9c 91 ld r25, X 34fe2: 17 97 sbiw r26, 0x07 ; 7 34fe4: 62 50 subi r22, 0x02 ; 2 34fe6: 71 09 sbc r23, r1 34fe8: 81 09 sbc r24, r1 34fea: 91 09 sbc r25, r1 34fec: 25 85 ldd r18, Z+13 ; 0x0d 34fee: 04 c0 rjmp .+8 ; 0x34ff8 34ff0: 66 0f add r22, r22 34ff2: 77 1f adc r23, r23 34ff4: 88 1f adc r24, r24 34ff6: 99 1f adc r25, r25 34ff8: 2a 95 dec r18 34ffa: d2 f7 brpl .-12 ; 0x34ff0 34ffc: 26 85 ldd r18, Z+14 ; 0x0e 34ffe: 37 85 ldd r19, Z+15 ; 0x0f 35000: 40 89 ldd r20, Z+16 ; 0x10 35002: 51 89 ldd r21, Z+17 ; 0x11 35004: 62 0f add r22, r18 35006: 73 1f adc r23, r19 35008: 84 1f adc r24, r20 3500a: 95 1f adc r25, r21 3500c: 61 0f add r22, r17 3500e: 71 1d adc r23, r1 35010: 81 1d adc r24, r1 35012: 91 1d adc r25, r1 35014: 9d cf rjmp .-198 ; 0x34f50 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 35016: ab 81 ldd r26, Y+3 ; 0x03 35018: bc 81 ldd r27, Y+4 ; 0x04 3501a: 14 96 adiw r26, 0x04 ; 4 3501c: 4d 91 ld r20, X+ 3501e: 5d 91 ld r21, X+ 35020: 6d 91 ld r22, X+ 35022: 7c 91 ld r23, X 35024: 17 97 sbiw r26, 0x07 ; 7 35026: 29 81 ldd r18, Y+1 ; 0x01 35028: 3a 81 ldd r19, Y+2 ; 0x02 3502a: 0f 94 73 6b call 0x2d6e6 ; 0x2d6e6 3502e: 81 11 cpse r24, r1 35030: cd cf rjmp .-102 ; 0x34fcc 35032: 24 cf rjmp .-440 ; 0x34e7c 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);} 35034: 94 01 movw r18, r8 35036: ab 01 movw r20, r22 35038: bc 01 movw r22, r24 3503a: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 3503e: 90 91 79 0e lds r25, 0x0E79 ; 0x800e79 35042: 0f 94 66 a6 call 0x34ccc ; 0x34ccc // 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; 35046: 88 23 and r24, r24 35048: 09 f4 brne .+2 ; 0x3504c 3504a: 18 cf rjmp .-464 ; 0x34e7c // 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; 3504c: 80 0e add r8, r16 3504e: 91 1e adc r9, r17 curPosition_ += n; 35050: eb 81 ldd r30, Y+3 ; 0x03 35052: fc 81 ldd r31, Y+4 ; 0x04 35054: 80 85 ldd r24, Z+8 ; 0x08 35056: 91 85 ldd r25, Z+9 ; 0x09 35058: a2 85 ldd r26, Z+10 ; 0x0a 3505a: b3 85 ldd r27, Z+11 ; 0x0b 3505c: 80 0f add r24, r16 3505e: 91 1f adc r25, r17 35060: a1 1d adc r26, r1 35062: b1 1d adc r27, r1 35064: 80 87 std Z+8, r24 ; 0x08 35066: 91 87 std Z+9, r25 ; 0x09 35068: a2 87 std Z+10, r26 ; 0x0a 3506a: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 3506c: c0 1a sub r12, r16 3506e: d1 0a sbc r13, r17 35070: 45 cf rjmp .-374 ; 0x34efc } return nbyte; 35072: c7 01 movw r24, r14 35074: 05 cf rjmp .-502 ; 0x34e80 00035076 : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 35076: 4f 92 push r4 35078: 5f 92 push r5 3507a: 6f 92 push r6 3507c: 7f 92 push r7 3507e: af 92 push r10 35080: bf 92 push r11 35082: cf 92 push r12 35084: df 92 push r13 35086: ef 92 push r14 35088: ff 92 push r15 3508a: 0f 93 push r16 3508c: 1f 93 push r17 3508e: cf 93 push r28 35090: df 93 push r29 35092: 1f 92 push r1 35094: cd b7 in r28, 0x3d ; 61 35096: de b7 in r29, 0x3e ; 62 35098: 8c 01 movw r16, r24 3509a: 7b 01 movw r14, r22 3509c: 5a 01 movw r10, r20 3509e: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 350a0: db 01 movw r26, r22 350a2: 59 96 adiw r26, 0x19 ; 25 350a4: 8d 91 ld r24, X+ 350a6: 9c 91 ld r25, X 350a8: f8 01 movw r30, r16 350aa: 92 8f std Z+26, r25 ; 0x1a 350ac: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 350ae: cb 01 movw r24, r22 350b0: 0e 94 37 79 call 0xf26e ; 0xf26e } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 350b4: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 350b6: f7 01 movw r30, r14 350b8: 80 85 ldd r24, Z+8 ; 0x08 350ba: 91 85 ldd r25, Z+9 ; 0x09 350bc: a2 85 ldd r26, Z+10 ; 0x0a 350be: b3 85 ldd r27, Z+11 ; 0x0b 350c0: 41 89 ldd r20, Z+17 ; 0x11 350c2: 52 89 ldd r21, Z+18 ; 0x12 350c4: 63 89 ldd r22, Z+19 ; 0x13 350c6: 74 89 ldd r23, Z+20 ; 0x14 350c8: 84 17 cp r24, r20 350ca: 95 07 cpc r25, r21 350cc: a6 07 cpc r26, r22 350ce: b7 07 cpc r27, r23 350d0: 08 f0 brcs .+2 ; 0x350d4 350d2: 52 c0 rjmp .+164 ; 0x35178 index = 0XF & (dirFile->curPosition_ >> 5); 350d4: 55 e0 ldi r21, 0x05 ; 5 350d6: b6 95 lsr r27 350d8: a7 95 ror r26 350da: 97 95 ror r25 350dc: 87 95 ror r24 350de: 5a 95 dec r21 350e0: d1 f7 brne .-12 ; 0x350d6 350e2: f8 2f mov r31, r24 350e4: ff 70 andi r31, 0x0F ; 15 350e6: 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; 350e8: d7 01 movw r26, r14 350ea: 13 96 adiw r26, 0x03 ; 3 350ec: 8c 91 ld r24, X 350ee: 82 30 cpi r24, 0x02 ; 2 350f0: 10 f4 brcc .+4 ; 0x350f6 if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 350f2: 80 e0 ldi r24, 0x00 ; 0 350f4: db c0 rjmp .+438 ; 0x352ac * \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; 350f6: 41 e0 ldi r20, 0x01 ; 1 350f8: 50 e0 ldi r21, 0x00 ; 0 350fa: be 01 movw r22, r28 350fc: 6f 5f subi r22, 0xFF ; 255 350fe: 7f 4f sbci r23, 0xFF ; 255 35100: c7 01 movw r24, r14 35102: 0f 94 1f a7 call 0x34e3e ; 0x34e3e 35106: 01 97 sbiw r24, 0x01 ; 1 35108: a1 f7 brne .-24 ; 0x350f2 // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 3510a: f7 01 movw r30, r14 3510c: 80 85 ldd r24, Z+8 ; 0x08 3510e: 91 85 ldd r25, Z+9 ; 0x09 35110: a2 85 ldd r26, Z+10 ; 0x0a 35112: b3 85 ldd r27, Z+11 ; 0x0b 35114: 4f 96 adiw r24, 0x1f ; 31 35116: a1 1d adc r26, r1 35118: b1 1d adc r27, r1 3511a: 80 87 std Z+8, r24 ; 0x08 3511c: 91 87 std Z+9, r25 ; 0x09 3511e: a2 87 std Z+10, r26 ; 0x0a 35120: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 35122: f0 e2 ldi r31, 0x20 ; 32 35124: df 9e mul r13, r31 35126: b0 01 movw r22, r0 35128: 11 24 eor r1, r1 3512a: 65 58 subi r22, 0x85 ; 133 3512c: 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; 3512e: 61 15 cp r22, r1 35130: 71 05 cpc r23, r1 35132: f9 f2 breq .-66 ; 0x350f2 if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 35134: db 01 movw r26, r22 35136: 8c 91 ld r24, X 35138: 88 23 and r24, r24 3513a: 41 f0 breq .+16 ; 0x3514c 3513c: 85 3e cpi r24, 0xE5 ; 229 3513e: 09 f0 breq .+2 ; 0x35142 35140: 4c c0 rjmp .+152 ; 0x351da // remember first empty slot if (!emptyFound) { 35142: 77 20 and r7, r7 35144: 29 f0 breq .+10 ; 0x35150 return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 35146: 77 24 eor r7, r7 35148: 73 94 inc r7 3514a: b5 cf rjmp .-150 ; 0x350b6 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) { 3514c: 71 10 cpse r7, r1 3514e: 0e c0 rjmp .+28 ; 0x3516c dirBlock_ = dirFile->vol_->cacheBlockNumber(); 35150: 80 91 6f 0e lds r24, 0x0E6F ; 0x800e6f 35154: 90 91 70 0e lds r25, 0x0E70 ; 0x800e70 35158: a0 91 71 0e lds r26, 0x0E71 ; 0x800e71 3515c: b0 91 72 0e lds r27, 0x0E72 ; 0x800e72 35160: f8 01 movw r30, r16 35162: 84 87 std Z+12, r24 ; 0x0c 35164: 95 87 std Z+13, r25 ; 0x0d 35166: a6 87 std Z+14, r26 ; 0x0e 35168: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 3516a: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 3516c: db 01 movw r26, r22 3516e: 8c 91 ld r24, X 35170: 81 11 cpse r24, r1 35172: e9 cf rjmp .-46 ; 0x35146 35174: 77 24 eor r7, r7 35176: 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; 35178: 8c 2d mov r24, r12 3517a: 82 74 andi r24, 0x42 ; 66 3517c: 82 34 cpi r24, 0x42 ; 66 3517e: 09 f0 breq .+2 ; 0x35182 35180: b8 cf rjmp .-144 ; 0x350f2 if (emptyFound) { 35182: 77 20 and r7, r7 35184: 09 f4 brne .+2 ; 0x35188 35186: a2 c0 rjmp .+324 ; 0x352cc index = dirIndex_; 35188: f8 01 movw r30, r16 3518a: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 3518c: 61 e0 ldi r22, 0x01 ; 1 3518e: c8 01 movw r24, r16 35190: 0f 94 47 a4 call 0x3488e ; 0x3488e if (!p) goto fail; 35194: 00 97 sbiw r24, 0x00 ; 0 35196: 09 f4 brne .+2 ; 0x3519a 35198: ac cf rjmp .-168 ; 0x350f2 // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 3519a: 20 e2 ldi r18, 0x20 ; 32 3519c: dc 01 movw r26, r24 3519e: 1d 92 st X+, r1 351a0: 2a 95 dec r18 351a2: e9 f7 brne .-6 ; 0x3519e memcpy(p->name, dname, 11); 351a4: 2b e0 ldi r18, 0x0B ; 11 351a6: f5 01 movw r30, r10 351a8: dc 01 movw r26, r24 351aa: 01 90 ld r0, Z+ 351ac: 0d 92 st X+, r0 351ae: 2a 95 dec r18 351b0: e1 f7 brne .-8 ; 0x351aa if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 351b2: 21 e2 ldi r18, 0x21 ; 33 351b4: 38 e2 ldi r19, 0x28 ; 40 351b6: fc 01 movw r30, r24 351b8: 31 8b std Z+17, r19 ; 0x11 351ba: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 351bc: 40 e0 ldi r20, 0x00 ; 0 351be: 58 e0 ldi r21, 0x08 ; 8 351c0: 57 87 std Z+15, r21 ; 0x0f 351c2: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 351c4: 33 8b std Z+19, r19 ; 0x13 351c6: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 351c8: 31 8f std Z+25, r19 ; 0x19 351ca: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 351cc: 57 8b std Z+23, r21 ; 0x17 351ce: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 351d0: 0f 94 65 6a call 0x2d4ca ; 0x2d4ca 351d4: 81 11 cpse r24, r1 351d6: 09 c0 rjmp .+18 ; 0x351ea 351d8: 8c cf rjmp .-232 ; 0x350f2 dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 351da: 4b e0 ldi r20, 0x0B ; 11 351dc: 50 e0 ldi r21, 0x00 ; 0 351de: c5 01 movw r24, r10 351e0: 0f 94 77 e3 call 0x3c6ee ; 0x3c6ee 351e4: 89 2b or r24, r25 351e6: 09 f0 breq .+2 ; 0x351ea 351e8: 66 cf rjmp .-308 ; 0x350b6 } //------------------------------------------------------------------------------ // 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]; 351ea: f0 e2 ldi r31, 0x20 ; 32 351ec: df 9e mul r13, r31 351ee: d0 01 movw r26, r0 351f0: 11 24 eor r1, r1 351f2: 9d 01 movw r18, r26 351f4: 25 58 subi r18, 0x85 ; 133 351f6: 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)) { 351f8: f9 01 movw r30, r18 351fa: 83 85 ldd r24, Z+11 ; 0x0b 351fc: 81 71 andi r24, 0x11 ; 17 351fe: 21 f0 breq .+8 ; 0x35208 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 35200: 8c 2d mov r24, r12 35202: 82 71 andi r24, 0x12 ; 18 35204: 09 f0 breq .+2 ; 0x35208 35206: fc c0 rjmp .+504 ; 0x35400 } //------------------------------------------------------------------------------ // 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]; 35208: f8 01 movw r30, r16 3520a: 81 8d ldd r24, Z+25 ; 0x19 3520c: 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(); 3520e: 40 91 6f 0e lds r20, 0x0E6F ; 0x800e6f 35212: 50 91 70 0e lds r21, 0x0E70 ; 0x800e70 35216: 60 91 71 0e lds r22, 0x0E71 ; 0x800e71 3521a: 70 91 72 0e lds r23, 0x0E72 ; 0x800e72 3521e: 44 87 std Z+12, r20 ; 0x0c 35220: 55 87 std Z+13, r21 ; 0x0d 35222: 66 87 std Z+14, r22 ; 0x0e 35224: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 35226: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 35228: fd 01 movw r30, r26 3522a: e5 58 subi r30, 0x85 ; 133 3522c: f1 4f sbci r31, 0xF1 ; 241 3522e: 44 88 ldd r4, Z+20 ; 0x14 35230: 55 88 ldd r5, Z+21 ; 0x15 35232: 71 2c mov r7, r1 35234: 61 2c mov r6, r1 35236: 32 01 movw r6, r4 35238: 55 24 eor r5, r5 3523a: 44 24 eor r4, r4 3523c: d8 01 movw r26, r16 3523e: 55 96 adiw r26, 0x15 ; 21 35240: 4d 92 st X+, r4 35242: 5d 92 st X+, r5 35244: 6d 92 st X+, r6 35246: 7c 92 st X, r7 35248: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 3524a: 42 8d ldd r20, Z+26 ; 0x1a 3524c: 53 8d ldd r21, Z+27 ; 0x1b 3524e: 70 e0 ldi r23, 0x00 ; 0 35250: 60 e0 ldi r22, 0x00 ; 0 35252: 44 29 or r20, r4 35254: 55 29 or r21, r5 35256: 66 29 or r22, r6 35258: 77 29 or r23, r7 3525a: 55 96 adiw r26, 0x15 ; 21 3525c: 4d 93 st X+, r20 3525e: 5d 93 st X+, r21 35260: 6d 93 st X+, r22 35262: 7c 93 st X, r23 35264: 58 97 sbiw r26, 0x18 ; 24 35266: d9 01 movw r26, r18 35268: 1b 96 adiw r26, 0x0b ; 11 3526a: 2c 91 ld r18, X 3526c: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 3526e: 09 f0 breq .+2 ; 0x35272 35270: b9 c0 rjmp .+370 ; 0x353e4 fileSize_ = p->fileSize; 35272: 84 8d ldd r24, Z+28 ; 0x1c 35274: 95 8d ldd r25, Z+29 ; 0x1d 35276: a6 8d ldd r26, Z+30 ; 0x1e 35278: b7 8d ldd r27, Z+31 ; 0x1f 3527a: f8 01 movw r30, r16 3527c: 81 8b std Z+17, r24 ; 0x11 3527e: 92 8b std Z+18, r25 ; 0x12 35280: a3 8b std Z+19, r26 ; 0x13 35282: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 35284: 81 e0 ldi r24, 0x01 ; 1 35286: 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; 35288: 8c 2d mov r24, r12 3528a: 8f 70 andi r24, 0x0F ; 15 3528c: f8 01 movw r30, r16 3528e: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 35290: 14 82 std Z+4, r1 ; 0x04 35292: 15 82 std Z+5, r1 ; 0x05 35294: 16 82 std Z+6, r1 ; 0x06 35296: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 35298: 10 86 std Z+8, r1 ; 0x08 3529a: 11 86 std Z+9, r1 ; 0x09 3529c: 12 86 std Z+10, r1 ; 0x0a 3529e: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 352a0: 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; 352a2: c4 fe sbrs r12, 4 352a4: 03 c0 rjmp .+6 ; 0x352ac 352a6: c8 01 movw r24, r16 352a8: 0f 94 68 77 call 0x2eed0 ; 0x2eed0 // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 352ac: 0f 90 pop r0 352ae: df 91 pop r29 352b0: cf 91 pop r28 352b2: 1f 91 pop r17 352b4: 0f 91 pop r16 352b6: ff 90 pop r15 352b8: ef 90 pop r14 352ba: df 90 pop r13 352bc: cf 90 pop r12 352be: bf 90 pop r11 352c0: af 90 pop r10 352c2: 7f 90 pop r7 352c4: 6f 90 pop r6 352c6: 5f 90 pop r5 352c8: 4f 90 pop r4 352ca: 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; 352cc: d7 01 movw r26, r14 352ce: 13 96 adiw r26, 0x03 ; 3 352d0: 8c 91 ld r24, X 352d2: 13 97 sbiw r26, 0x03 ; 3 352d4: 82 30 cpi r24, 0x02 ; 2 352d6: 09 f4 brne .+2 ; 0x352da 352d8: 0c cf rjmp .-488 ; 0x350f2 // 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; 352da: 51 96 adiw r26, 0x11 ; 17 352dc: 8d 91 ld r24, X+ 352de: 9d 91 ld r25, X+ 352e0: 0d 90 ld r0, X+ 352e2: bc 91 ld r27, X 352e4: a0 2d mov r26, r0 352e6: 80 3e cpi r24, 0xE0 ; 224 352e8: 9f 4f sbci r25, 0xFF ; 255 352ea: af 41 sbci r26, 0x1F ; 31 352ec: b1 05 cpc r27, r1 352ee: 08 f0 brcs .+2 ; 0x352f2 352f0: 00 cf rjmp .-512 ; 0x350f2 if (!addCluster()) goto fail; 352f2: c7 01 movw r24, r14 352f4: 0f 94 9b a4 call 0x34936 ; 0x34936 352f8: 88 23 and r24, r24 352fa: 09 f4 brne .+2 ; 0x352fe 352fc: fa ce rjmp .-524 ; 0x350f2 if (!vol_->cacheFlush()) goto fail; 352fe: 0f 94 65 6a call 0x2d4ca ; 0x2d4ca 35302: 88 23 and r24, r24 35304: 09 f4 brne .+2 ; 0x35308 35306: f5 ce rjmp .-534 ; 0x350f2 block = vol_->clusterStartBlock(curCluster_); 35308: d7 01 movw r26, r14 3530a: 59 96 adiw r26, 0x19 ; 25 3530c: ed 91 ld r30, X+ 3530e: fc 91 ld r31, X 35310: 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_);} 35312: 14 96 adiw r26, 0x04 ; 4 35314: 4d 90 ld r4, X+ 35316: 5d 90 ld r5, X+ 35318: 6d 90 ld r6, X+ 3531a: 7c 90 ld r7, X 3531c: 17 97 sbiw r26, 0x07 ; 7 3531e: b2 e0 ldi r27, 0x02 ; 2 35320: 4b 1a sub r4, r27 35322: 51 08 sbc r5, r1 35324: 61 08 sbc r6, r1 35326: 71 08 sbc r7, r1 35328: 85 85 ldd r24, Z+13 ; 0x0d 3532a: 04 c0 rjmp .+8 ; 0x35334 3532c: 44 0c add r4, r4 3532e: 55 1c adc r5, r5 35330: 66 1c adc r6, r6 35332: 77 1c adc r7, r7 35334: 8a 95 dec r24 35336: d2 f7 brpl .-12 ; 0x3532c 35338: 86 85 ldd r24, Z+14 ; 0x0e 3533a: 97 85 ldd r25, Z+15 ; 0x0f 3533c: a0 89 ldd r26, Z+16 ; 0x10 3533e: b1 89 ldd r27, Z+17 ; 0x11 35340: 48 0e add r4, r24 35342: 59 1e adc r5, r25 35344: 6a 1e adc r6, r26 35346: 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; 35348: 81 e0 ldi r24, 0x01 ; 1 3534a: 80 93 77 0e sts 0x0E77, r24 ; 0x800e77 cacheBlockNumber_ = blockNumber; 3534e: 40 92 6f 0e sts 0x0E6F, r4 ; 0x800e6f 35352: 50 92 70 0e sts 0x0E70, r5 ; 0x800e70 35356: 60 92 71 0e sts 0x0E71, r6 ; 0x800e71 3535a: 70 92 72 0e sts 0x0E72, r7 ; 0x800e72 // set cache to first block of cluster vol_->cacheSetBlockNumber(block, true); // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); 3535e: eb e7 ldi r30, 0x7B ; 123 35360: fe e0 ldi r31, 0x0E ; 14 35362: 80 e0 ldi r24, 0x00 ; 0 35364: 92 e0 ldi r25, 0x02 ; 2 35366: df 01 movw r26, r30 35368: 9c 01 movw r18, r24 3536a: 1d 92 st X+, r1 3536c: 21 50 subi r18, 0x01 ; 1 3536e: 30 40 sbci r19, 0x00 ; 0 35370: e1 f7 brne .-8 ; 0x3536a // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 35372: dd 24 eor r13, r13 35374: d3 94 inc r13 35376: d7 01 movw r26, r14 35378: 59 96 adiw r26, 0x19 ; 25 3537a: ed 91 ld r30, X+ 3537c: fc 91 ld r31, X 3537e: 84 81 ldd r24, Z+4 ; 0x04 35380: d8 16 cp r13, r24 35382: 98 f4 brcc .+38 ; 0x353aa 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); 35384: 2b e7 ldi r18, 0x7B ; 123 35386: 3e e0 ldi r19, 0x0E ; 14 35388: b3 01 movw r22, r6 3538a: a2 01 movw r20, r4 3538c: 4d 0d add r20, r13 3538e: 51 1d adc r21, r1 35390: 61 1d adc r22, r1 35392: 71 1d adc r23, r1 35394: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 35398: 90 91 79 0e lds r25, 0x0E79 ; 0x800e79 3539c: 0f 94 02 a6 call 0x34c04 ; 0x34c04 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 353a0: 88 23 and r24, r24 353a2: 09 f4 brne .+2 ; 0x353a6 353a4: a6 ce rjmp .-692 ; 0x350f2 // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 353a6: d3 94 inc r13 353a8: e6 cf rjmp .-52 ; 0x35376 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 353aa: 25 85 ldd r18, Z+13 ; 0x0d 353ac: 80 e0 ldi r24, 0x00 ; 0 353ae: 92 e0 ldi r25, 0x02 ; 2 353b0: a0 e0 ldi r26, 0x00 ; 0 353b2: b0 e0 ldi r27, 0x00 ; 0 353b4: 04 c0 rjmp .+8 ; 0x353be 353b6: 88 0f add r24, r24 353b8: 99 1f adc r25, r25 353ba: aa 1f adc r26, r26 353bc: bb 1f adc r27, r27 353be: 2a 95 dec r18 353c0: d2 f7 brpl .-12 ; 0x353b6 353c2: f7 01 movw r30, r14 353c4: 41 89 ldd r20, Z+17 ; 0x11 353c6: 52 89 ldd r21, Z+18 ; 0x12 353c8: 63 89 ldd r22, Z+19 ; 0x13 353ca: 74 89 ldd r23, Z+20 ; 0x14 353cc: 84 0f add r24, r20 353ce: 95 1f adc r25, r21 353d0: a6 1f adc r26, r22 353d2: b7 1f adc r27, r23 353d4: 81 8b std Z+17, r24 ; 0x11 353d6: 92 8b std Z+18, r25 ; 0x12 353d8: a3 8b std Z+19, r26 ; 0x13 353da: 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; 353dc: 8b e7 ldi r24, 0x7B ; 123 353de: 9e e0 ldi r25, 0x0E ; 14 index = 0; 353e0: d1 2c mov r13, r1 353e2: db ce rjmp .-586 ; 0x3519a // 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)) { 353e4: 20 31 cpi r18, 0x10 ; 16 353e6: 61 f4 brne .+24 ; 0x35400 if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 353e8: 98 01 movw r18, r16 353ea: 2f 5e subi r18, 0xEF ; 239 353ec: 3f 4f sbci r19, 0xFF ; 255 353ee: 0f 94 f6 6b call 0x2d7ec ; 0x2d7ec 353f2: 88 23 and r24, r24 353f4: 29 f0 breq .+10 ; 0x35400 type_ = FAT_FILE_TYPE_SUBDIR; 353f6: 84 e0 ldi r24, 0x04 ; 4 353f8: d8 01 movw r26, r16 353fa: 13 96 adiw r26, 0x03 ; 3 353fc: 8c 93 st X, r24 353fe: 44 cf rjmp .-376 ; 0x35288 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 35400: d8 01 movw r26, r16 35402: 13 96 adiw r26, 0x03 ; 3 35404: 1c 92 st X, r1 35406: 75 ce rjmp .-790 ; 0x350f2 00035408 : 35408: 88 e1 ldi r24, 0x18 ; 24 3540a: 9e e0 ldi r25, 0x0E ; 14 3540c: 0f b6 in r0, 0x3f ; 63 3540e: f8 94 cli 35410: a8 95 wdr 35412: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 35416: 0f be out 0x3f, r0 ; 63 35418: 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); 3541c: 9f b7 in r25, 0x3f ; 63 3541e: f8 94 cli 35420: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 35424: 84 60 ori r24, 0x04 ; 4 35426: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 3542a: 9f bf out 0x3f, r25 ; 63 lcd_clear(); 3542c: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 1, MSG_POWERPANIC_DETECTED); 35430: 43 ee ldi r20, 0xE3 ; 227 35432: 51 e7 ldi r21, 0x71 ; 113 35434: 61 e0 ldi r22, 0x01 ; 1 35436: 80 e0 ldi r24, 0x00 ; 0 35438: 0e 94 29 70 call 0xe052 ; 0xe052 3543c: ff cf rjmp .-2 ; 0x3543c 0003543e : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 3543e: 60 91 56 0e lds r22, 0x0E56 ; 0x800e56 uint8_t _block_buffer_tail = block_buffer_tail; 35442: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 uint16_t sdlen = 0; 35446: 30 e0 ldi r19, 0x00 ; 0 35448: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 3544a: 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) 3544c: 96 17 cp r25, r22 3544e: 61 f0 breq .+24 ; 0x35468 { sdlen += block_buffer[_block_buffer_tail].sdlen; 35450: 89 9f mul r24, r25 35452: f0 01 movw r30, r0 35454: 11 24 eor r1, r1 35456: ee 51 subi r30, 0x1E ; 30 35458: f8 4f sbci r31, 0xF8 ; 248 3545a: 40 81 ld r20, Z 3545c: 51 81 ldd r21, Z+1 ; 0x01 3545e: 24 0f add r18, r20 35460: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 35462: 9f 5f subi r25, 0xFF ; 255 35464: 9f 70 andi r25, 0x0F ; 15 35466: f2 cf rjmp .-28 ; 0x3544c } return sdlen; } 35468: c9 01 movw r24, r18 3546a: 08 95 ret 0003546c : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 3546c: 30 91 56 0e lds r19, 0x0E56 ; 0x800e56 35470: 20 91 57 0e lds r18, 0x0E57 ; 0x800e57 35474: 32 17 cp r19, r18 35476: 91 f0 breq .+36 ; 0x3549c // 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; 35478: e0 91 56 0e lds r30, 0x0E56 ; 0x800e56 } // 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) 3547c: e1 11 cpse r30, r1 3547e: 01 c0 rjmp .+2 ; 0x35482 block_index = BLOCK_BUFFER_SIZE; 35480: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 35482: 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; 35484: 2e e6 ldi r18, 0x6E ; 110 35486: e2 9f mul r30, r18 35488: f0 01 movw r30, r0 3548a: 11 24 eor r1, r1 3548c: ee 51 subi r30, 0x1E ; 30 3548e: f8 4f sbci r31, 0xF8 ; 248 35490: 20 81 ld r18, Z 35492: 31 81 ldd r19, Z+1 ; 0x01 35494: 82 0f add r24, r18 35496: 93 1f adc r25, r19 35498: 91 83 std Z+1, r25 ; 0x01 3549a: 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. } } 3549c: 08 95 ret 0003549e : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 3549e: 8f 92 push r8 354a0: 9f 92 push r9 354a2: af 92 push r10 354a4: bf 92 push r11 354a6: cf 92 push r12 354a8: df 92 push r13 354aa: ef 92 push r14 354ac: ff 92 push r15 354ae: 0f 93 push r16 354b0: 1f 93 push r17 354b2: cf 93 push r28 354b4: df 93 push r29 354b6: c0 91 97 02 lds r28, 0x0297 ; 0x800297 354ba: d0 91 98 02 lds r29, 0x0298 ; 0x800298 354be: 82 e7 ldi r24, 0x72 ; 114 354c0: e8 2e mov r14, r24 354c2: 86 e0 ldi r24, 0x06 ; 6 354c4: f8 2e mov r15, r24 354c6: 00 ef ldi r16, 0xF0 ; 240 354c8: 17 e1 ldi r17, 0x17 ; 23 354ca: 6e 01 movw r12, r28 354cc: 80 e1 ldi r24, 0x10 ; 16 354ce: c8 0e add r12, r24 354d0: 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]; 354d2: 69 91 ld r22, Y+ 354d4: 79 91 ld r23, Y+ 354d6: 89 91 ld r24, Y+ 354d8: 99 91 ld r25, Y+ 354da: f7 01 movw r30, r14 354dc: 81 90 ld r8, Z+ 354de: 91 90 ld r9, Z+ 354e0: a1 90 ld r10, Z+ 354e2: b1 90 ld r11, Z+ 354e4: 7f 01 movw r14, r30 354e6: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 354ea: a5 01 movw r20, r10 354ec: 94 01 movw r18, r8 354ee: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 354f2: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 354f6: f8 01 movw r30, r16 354f8: 61 93 st Z+, r22 354fa: 71 93 st Z+, r23 354fc: 81 93 st Z+, r24 354fe: 91 93 st Z+, r25 35500: 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++) 35502: cc 15 cp r28, r12 35504: dd 05 cpc r29, r13 35506: 29 f7 brne .-54 ; 0x354d2 max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 35508: df 91 pop r29 3550a: cf 91 pop r28 3550c: 1f 91 pop r17 3550e: 0f 91 pop r16 35510: ff 90 pop r15 35512: ef 90 pop r14 35514: df 90 pop r13 35516: cf 90 pop r12 35518: bf 90 pop r11 3551a: af 90 pop r10 3551c: 9f 90 pop r9 3551e: 8f 90 pop r8 35520: 08 95 ret 00035522 : #ifdef TMC2130 void update_mode_profile() { if (tmc2130_mode == TMC2130_MODE_NORMAL) 35522: 80 91 6c 06 lds r24, 0x066C ; 0x80066c 35526: 81 11 cpse r24, r1 35528: 0e c0 rjmp .+28 ; 0x35546 { max_feedrate = cs.max_feedrate_normal; 3552a: 82 e8 ldi r24, 0x82 ; 130 3552c: 96 e0 ldi r25, 0x06 ; 6 3552e: 90 93 9a 02 sts 0x029A, r25 ; 0x80029a 35532: 80 93 99 02 sts 0x0299, r24 ; 0x800299 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_normal; 35536: 82 e9 ldi r24, 0x92 ; 146 35538: 96 e0 ldi r25, 0x06 ; 6 } 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; 3553a: 90 93 98 02 sts 0x0298, r25 ; 0x800298 3553e: 80 93 97 02 sts 0x0297, r24 ; 0x800297 } reset_acceleration_rates(); 35542: 0d 94 4f aa jmp 0x3549e ; 0x3549e 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) 35546: 81 30 cpi r24, 0x01 ; 1 35548: e1 f7 brne .-8 ; 0x35542 { max_feedrate = cs.max_feedrate_silent; 3554a: 8a e0 ldi r24, 0x0A ; 10 3554c: 97 e0 ldi r25, 0x07 ; 7 3554e: 90 93 9a 02 sts 0x029A, r25 ; 0x80029a 35552: 80 93 99 02 sts 0x0299, r24 ; 0x800299 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_silent; 35556: 8a e1 ldi r24, 0x1A ; 26 35558: 97 e0 ldi r25, 0x07 ; 7 3555a: ef cf rjmp .-34 ; 0x3553a 0003555c : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 3555c: fc 01 movw r30, r24 3555e: 40 81 ld r20, Z 35560: 51 81 ldd r21, Z+1 ; 0x01 35562: 62 81 ldd r22, Z+2 ; 0x02 35564: 73 81 ldd r23, Z+3 ; 0x03 35566: 40 93 dc 04 sts 0x04DC, r20 ; 0x8004dc 3556a: 50 93 dd 04 sts 0x04DD, r21 ; 0x8004dd 3556e: 60 93 de 04 sts 0x04DE, r22 ; 0x8004de 35572: 70 93 df 04 sts 0x04DF, r23 ; 0x8004df #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 35576: 20 91 7e 06 lds r18, 0x067E ; 0x80067e 3557a: 30 91 7f 06 lds r19, 0x067F ; 0x80067f 3557e: 40 91 80 06 lds r20, 0x0680 ; 0x800680 35582: 50 91 81 06 lds r21, 0x0681 ; 0x800681 35586: 60 81 ld r22, Z 35588: 71 81 ldd r23, Z+1 ; 0x01 3558a: 82 81 ldd r24, Z+2 ; 0x02 3558c: 93 81 ldd r25, Z+3 ; 0x03 3558e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 35592: 0f 94 c0 e1 call 0x3c380 ; 0x3c380 35596: e4 e5 ldi r30, 0x54 ; 84 35598: f7 e0 ldi r31, 0x07 ; 7 3559a: 64 87 std Z+12, r22 ; 0x0c 3559c: 75 87 std Z+13, r23 ; 0x0d 3559e: 86 87 std Z+14, r24 ; 0x0e 355a0: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 355a2: 8f b7 in r24, 0x3f ; 63 355a4: f8 94 cli count_position[E_AXIS] = e; 355a6: 44 85 ldd r20, Z+12 ; 0x0c 355a8: 55 85 ldd r21, Z+13 ; 0x0d 355aa: 66 85 ldd r22, Z+14 ; 0x0e 355ac: 77 85 ldd r23, Z+15 ; 0x0f 355ae: 40 93 70 07 sts 0x0770, r20 ; 0x800770 355b2: 50 93 71 07 sts 0x0771, r21 ; 0x800771 355b6: 60 93 72 07 sts 0x0772, r22 ; 0x800772 355ba: 70 93 73 07 sts 0x0773, r23 ; 0x800773 CRITICAL_SECTION_END; 355be: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 355c0: 08 95 ret 000355c2 : // 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; 355c2: fc 01 movw r30, r24 355c4: 40 81 ld r20, Z 355c6: 51 81 ldd r21, Z+1 ; 0x01 355c8: 62 81 ldd r22, Z+2 ; 0x02 355ca: 73 81 ldd r23, Z+3 ; 0x03 355cc: 40 93 d8 04 sts 0x04D8, r20 ; 0x8004d8 355d0: 50 93 d9 04 sts 0x04D9, r21 ; 0x8004d9 355d4: 60 93 da 04 sts 0x04DA, r22 ; 0x8004da 355d8: 70 93 db 04 sts 0x04DB, r23 ; 0x8004db #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 355dc: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 355e0: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 355e4: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 355e8: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 355ec: 60 81 ld r22, Z 355ee: 71 81 ldd r23, Z+1 ; 0x01 355f0: 82 81 ldd r24, Z+2 ; 0x02 355f2: 93 81 ldd r25, Z+3 ; 0x03 355f4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 355f8: 0f 94 c0 e1 call 0x3c380 ; 0x3c380 355fc: 60 93 5c 07 sts 0x075C, r22 ; 0x80075c 35600: 70 93 5d 07 sts 0x075D, r23 ; 0x80075d 35604: 80 93 5e 07 sts 0x075E, r24 ; 0x80075e 35608: 90 93 5f 07 sts 0x075F, r25 ; 0x80075f st_set_position(position); 3560c: 0d 94 87 87 jmp 0x30f0e ; 0x30f0e 00035610 : // 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) { 35610: 2f 92 push r2 35612: 3f 92 push r3 35614: 4f 92 push r4 35616: 5f 92 push r5 35618: 6f 92 push r6 3561a: 7f 92 push r7 3561c: 8f 92 push r8 3561e: 9f 92 push r9 35620: af 92 push r10 35622: bf 92 push r11 35624: cf 92 push r12 35626: df 92 push r13 35628: ef 92 push r14 3562a: ff 92 push r15 3562c: 0f 93 push r16 3562e: 1f 93 push r17 35630: cf 93 push r28 35632: df 93 push r29 35634: cd b7 in r28, 0x3d ; 61 35636: de b7 in r29, 0x3e ; 62 35638: c5 58 subi r28, 0x85 ; 133 3563a: d1 09 sbc r29, r1 3563c: 0f b6 in r0, 0x3f ; 63 3563e: f8 94 cli 35640: de bf out 0x3e, r29 ; 62 35642: 0f be out 0x3f, r0 ; 63 35644: cd bf out 0x3d, r28 ; 61 35646: 69 a3 std Y+33, r22 ; 0x21 35648: 7a a3 std Y+34, r23 ; 0x22 3564a: 8b a3 std Y+35, r24 ; 0x23 3564c: 9c a3 std Y+36, r25 ; 0x24 3564e: 2d a3 std Y+37, r18 ; 0x25 35650: 3e a3 std Y+38, r19 ; 0x26 35652: 4f a3 std Y+39, r20 ; 0x27 35654: 58 a7 std Y+40, r21 ; 0x28 35656: a8 96 adiw r28, 0x28 ; 40 35658: ec ae std Y+60, r14 ; 0x3c 3565a: fd ae std Y+61, r15 ; 0x3d 3565c: 0e af std Y+62, r16 ; 0x3e 3565e: 1f af std Y+63, r17 ; 0x3f 35660: a8 97 sbiw r28, 0x28 ; 40 35662: aa 96 adiw r28, 0x2a ; 42 35664: df ae std Y+63, r13 ; 0x3f 35666: ce ae std Y+62, r12 ; 0x3e 35668: aa 97 sbiw r28, 0x2a ; 42 3566a: 89 aa std Y+49, r8 ; 0x31 3566c: 99 ae std Y+57, r9 ; 0x39 3566e: ad ae std Y+61, r10 ; 0x3d 35670: bd aa std Y+53, r11 ; 0x35 35672: c5 56 subi r28, 0x65 ; 101 35674: df 4f sbci r29, 0xFF ; 255 35676: 08 81 ld r16, Y 35678: 19 81 ldd r17, Y+1 ; 0x01 3567a: cb 59 subi r28, 0x9B ; 155 3567c: 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); 3567e: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 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) 35682: 8f 5f subi r24, 0xFF ; 255 35684: a1 96 adiw r28, 0x21 ; 33 35686: 8f af std Y+63, r24 ; 0x3f 35688: a1 97 sbiw r28, 0x21 ; 33 3568a: 80 31 cpi r24, 0x10 ; 16 3568c: 19 f4 brne .+6 ; 0x35694 block_index = 0; 3568e: a1 96 adiw r28, 0x21 ; 33 35690: 1f ae std Y+63, r1 ; 0x3f 35692: 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) { 35694: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 35698: a1 96 adiw r28, 0x21 ; 33 3569a: 2f ad ldd r18, Y+63 ; 0x3f 3569c: a1 97 sbiw r28, 0x21 ; 33 3569e: 82 13 cpse r24, r18 356a0: 0f c0 rjmp .+30 ; 0x356c0 do { manage_heater(); 356a2: 0f 94 9b 4d call 0x29b36 ; 0x29b36 // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 356a6: 80 e0 ldi r24, 0x00 ; 0 356a8: 0e 94 5a 8c call 0x118b4 ; 0x118b4 lcd_update(0); 356ac: 80 e0 ldi r24, 0x00 ; 0 356ae: 0e 94 dc 6f call 0xdfb8 ; 0xdfb8 } while (block_buffer_tail == next_buffer_head); 356b2: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 356b6: a1 96 adiw r28, 0x21 ; 33 356b8: 3f ad ldd r19, Y+63 ; 0x3f 356ba: a1 97 sbiw r28, 0x21 ; 33 356bc: 83 17 cp r24, r19 356be: 89 f3 breq .-30 ; 0x356a2 } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 356c0: 40 91 5d 0e lds r20, 0x0E5D ; 0x800e5d 356c4: a2 96 adiw r28, 0x22 ; 34 356c6: 4f af std Y+63, r20 ; 0x3f 356c8: a2 97 sbiw r28, 0x22 ; 34 356ca: 44 23 and r20, r20 356cc: 11 f1 breq .+68 ; 0x35712 // avoid planning the block early if aborted SERIAL_ECHO_START; 356ce: 82 ef ldi r24, 0xF2 ; 242 356d0: 9a ea ldi r25, 0xAA ; 170 356d2: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNRPGM(_n("Move aborted")); 356d6: 86 ed ldi r24, 0xD6 ; 214 356d8: 91 e7 ldi r25, 0x71 ; 113 356da: 0e 94 86 7b call 0xf70c ; 0xf70c // 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(); } 356de: cb 57 subi r28, 0x7B ; 123 356e0: df 4f sbci r29, 0xFF ; 255 356e2: 0f b6 in r0, 0x3f ; 63 356e4: f8 94 cli 356e6: de bf out 0x3e, r29 ; 62 356e8: 0f be out 0x3f, r0 ; 63 356ea: cd bf out 0x3d, r28 ; 61 356ec: df 91 pop r29 356ee: cf 91 pop r28 356f0: 1f 91 pop r17 356f2: 0f 91 pop r16 356f4: ff 90 pop r15 356f6: ef 90 pop r14 356f8: df 90 pop r13 356fa: cf 90 pop r12 356fc: bf 90 pop r11 356fe: af 90 pop r10 35700: 9f 90 pop r9 35702: 8f 90 pop r8 35704: 7f 90 pop r7 35706: 6f 90 pop r6 35708: 5f 90 pop r5 3570a: 4f 90 pop r4 3570c: 3f 90 pop r3 3570e: 2f 90 pop r2 35710: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 35712: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 35716: 29 2e mov r2, r25 35718: 31 2c mov r3, r1 3571a: 8e e6 ldi r24, 0x6E ; 110 3571c: 98 9f mul r25, r24 3571e: d0 01 movw r26, r0 35720: 11 24 eor r1, r1 35722: a4 96 adiw r28, 0x24 ; 36 35724: bf af std Y+63, r27 ; 0x3f 35726: ae af std Y+62, r26 ; 0x3e 35728: 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; 3572a: cd 01 movw r24, r26 3572c: 8a 58 subi r24, 0x8A ; 138 3572e: 98 4f sbci r25, 0xF8 ; 248 35730: fc 01 movw r30, r24 35732: e9 5b subi r30, 0xB9 ; 185 35734: ff 4f sbci r31, 0xFF ; 255 35736: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 35738: 84 59 subi r24, 0x94 ; 148 3573a: 9f 4f sbci r25, 0xFF ; 255 3573c: fc 01 movw r30, r24 3573e: 11 82 std Z+1, r1 ; 0x01 35740: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 35742: 01 15 cp r16, r1 35744: 11 05 cpc r17, r1 35746: 11 f4 brne .+4 ; 0x3574c 35748: 0d 94 fc b5 jmp 0x36bf8 ; 0x36bf8 memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 3574c: 80 e1 ldi r24, 0x10 ; 16 3574e: f8 01 movw r30, r16 35750: a2 53 subi r26, 0x32 ; 50 35752: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 35754: 01 90 ld r0, Z+ 35756: 0d 92 st X+, r0 35758: 8a 95 dec r24 3575a: e1 f7 brne .-8 ; 0x35754 // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 3575c: 8e e6 ldi r24, 0x6E ; 110 3575e: 82 9d mul r24, r2 35760: 80 01 movw r16, r0 35762: 83 9d mul r24, r3 35764: 10 0d add r17, r0 35766: 11 24 eor r1, r1 35768: 0a 58 subi r16, 0x8A ; 138 3576a: 18 4f sbci r17, 0xF8 ; 248 3576c: f8 01 movw r30, r16 3576e: e8 59 subi r30, 0x98 ; 152 35770: ff 4f sbci r31, 0xFF ; 255 35772: c3 56 subi r28, 0x63 ; 99 35774: df 4f sbci r29, 0xFF ; 255 35776: 88 81 ld r24, Y 35778: 99 81 ldd r25, Y+1 ; 0x01 3577a: cd 59 subi r28, 0x9D ; 157 3577c: d0 40 sbci r29, 0x00 ; 0 3577e: 91 83 std Z+1, r25 ; 0x01 35780: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 35782: 06 59 subi r16, 0x96 ; 150 35784: 1f 4f sbci r17, 0xFF ; 255 35786: 60 91 90 02 lds r22, 0x0290 ; 0x800290 3578a: 70 91 91 02 lds r23, 0x0291 ; 0x800291 3578e: 80 91 92 02 lds r24, 0x0292 ; 0x800292 35792: 90 91 93 02 lds r25, 0x0293 ; 0x800293 35796: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 3579a: d8 01 movw r26, r16 3579c: 6d 93 st X+, r22 3579e: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 357a0: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb <_ZL23plan_reset_next_e_queue.lto_priv.503> 357a4: 88 23 and r24, r24 357a6: a9 f0 breq .+42 ; 0x357d2 { position[E_AXIS] = 0; 357a8: 10 92 60 07 sts 0x0760, r1 ; 0x800760 357ac: 10 92 61 07 sts 0x0761, r1 ; 0x800761 357b0: 10 92 62 07 sts 0x0762, r1 ; 0x800762 357b4: 10 92 63 07 sts 0x0763, r1 ; 0x800763 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 357b8: 10 92 dc 04 sts 0x04DC, r1 ; 0x8004dc 357bc: 10 92 dd 04 sts 0x04DD, r1 ; 0x8004dd 357c0: 10 92 de 04 sts 0x04DE, r1 ; 0x8004de 357c4: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df #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; 357c8: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL23plan_reset_next_e_queue.lto_priv.503> plan_reset_next_e_sched = true; 357cc: 81 e0 ldi r24, 0x01 ; 1 357ce: 80 93 ba 04 sts 0x04BA, r24 ; 0x8004ba <_ZL23plan_reset_next_e_sched.lto_priv.504> } // Apply the machine correction matrix. world2machine(x, y); 357d2: be 01 movw r22, r28 357d4: 6b 5d subi r22, 0xDB ; 219 357d6: 7f 4f sbci r23, 0xFF ; 255 357d8: ce 01 movw r24, r28 357da: 81 96 adiw r24, 0x21 ; 33 357dc: 0e 94 37 6b call 0xd66e ; 0xd66e // 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]); 357e0: c9 a0 ldd r12, Y+33 ; 0x21 357e2: da a0 ldd r13, Y+34 ; 0x22 357e4: eb a0 ldd r14, Y+35 ; 0x23 357e6: fc a0 ldd r15, Y+36 ; 0x24 357e8: 20 91 72 06 lds r18, 0x0672 ; 0x800672 357ec: 30 91 73 06 lds r19, 0x0673 ; 0x800673 357f0: 40 91 74 06 lds r20, 0x0674 ; 0x800674 357f4: 50 91 75 06 lds r21, 0x0675 ; 0x800675 357f8: c7 01 movw r24, r14 357fa: b6 01 movw r22, r12 357fc: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 35800: 0f 94 c0 e1 call 0x3c380 ; 0x3c380 35804: c2 58 subi r28, 0x82 ; 130 35806: df 4f sbci r29, 0xFF ; 255 35808: 68 83 st Y, r22 3580a: 79 83 std Y+1, r23 ; 0x01 3580c: 8a 83 std Y+2, r24 ; 0x02 3580e: 9b 83 std Y+3, r25 ; 0x03 35810: ce 57 subi r28, 0x7E ; 126 35812: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 35814: 8d a0 ldd r8, Y+37 ; 0x25 35816: 9e a0 ldd r9, Y+38 ; 0x26 35818: af a0 ldd r10, Y+39 ; 0x27 3581a: b8 a4 ldd r11, Y+40 ; 0x28 3581c: 20 91 76 06 lds r18, 0x0676 ; 0x800676 35820: 30 91 77 06 lds r19, 0x0677 ; 0x800677 35824: 40 91 78 06 lds r20, 0x0678 ; 0x800678 35828: 50 91 79 06 lds r21, 0x0679 ; 0x800679 3582c: c5 01 movw r24, r10 3582e: b4 01 movw r22, r8 35830: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 35834: 0f 94 c0 e1 call 0x3c380 ; 0x3c380 35838: ce 57 subi r28, 0x7E ; 126 3583a: df 4f sbci r29, 0xFF ; 255 3583c: 68 83 st Y, r22 3583e: 79 83 std Y+1, r23 ; 0x01 35840: 8a 83 std Y+2, r24 ; 0x02 35842: 9b 83 std Y+3, r25 ; 0x03 35844: c2 58 subi r28, 0x82 ; 130 35846: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 35848: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 3584c: 88 23 and r24, r24 3584e: 11 f4 brne .+4 ; 0x35854 35850: 0d 94 03 b6 jmp 0x36c06 ; 0x36c06 target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 35854: a5 01 movw r20, r10 35856: 94 01 movw r18, r8 35858: c7 01 movw r24, r14 3585a: b6 01 movw r22, r12 3585c: 0f 94 1d 96 call 0x32c3a ; 0x32c3a 35860: a8 96 adiw r28, 0x28 ; 40 35862: 2c ad ldd r18, Y+60 ; 0x3c 35864: 3d ad ldd r19, Y+61 ; 0x3d 35866: 4e ad ldd r20, Y+62 ; 0x3e 35868: 5f ad ldd r21, Y+63 ; 0x3f 3586a: a8 97 sbiw r28, 0x28 ; 40 3586c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 35870: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 35874: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 35878: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 3587c: 50 91 7d 06 lds r21, 0x067D ; 0x80067d }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 35880: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 35884: 0f 94 c0 e1 call 0x3c380 ; 0x3c380 35888: e6 96 adiw r28, 0x36 ; 54 3588a: 6c af std Y+60, r22 ; 0x3c 3588c: 7d af std Y+61, r23 ; 0x3d 3588e: 8e af std Y+62, r24 ; 0x3e 35890: 9f af std Y+63, r25 ; 0x3f 35892: 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]); 35894: aa 96 adiw r28, 0x2a ; 42 35896: ee ad ldd r30, Y+62 ; 0x3e 35898: ff ad ldd r31, Y+63 ; 0x3f 3589a: aa 97 sbiw r28, 0x2a ; 42 3589c: 80 80 ld r8, Z 3589e: 91 80 ldd r9, Z+1 ; 0x01 358a0: a2 80 ldd r10, Z+2 ; 0x02 358a2: b3 80 ldd r11, Z+3 ; 0x03 358a4: 20 91 7e 06 lds r18, 0x067E ; 0x80067e 358a8: 30 91 7f 06 lds r19, 0x067F ; 0x80067f 358ac: 40 91 80 06 lds r20, 0x0680 ; 0x800680 358b0: 50 91 81 06 lds r21, 0x0681 ; 0x800681 358b4: c5 01 movw r24, r10 358b6: b4 01 movw r22, r8 358b8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 358bc: 0f 94 c0 e1 call 0x3c380 ; 0x3c380 358c0: ae 96 adiw r28, 0x2e ; 46 358c2: 6c af std Y+60, r22 ; 0x3c 358c4: 7d af std Y+61, r23 ; 0x3d 358c6: 8e af std Y+62, r24 ; 0x3e 358c8: 9f af std Y+63, r25 ; 0x3f 358ca: 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]; 358cc: 80 91 60 07 lds r24, 0x0760 ; 0x800760 358d0: 90 91 61 07 lds r25, 0x0761 ; 0x800761 358d4: a0 91 62 07 lds r26, 0x0762 ; 0x800762 358d8: b0 91 63 07 lds r27, 0x0763 ; 0x800763 358dc: ae 96 adiw r28, 0x2e ; 46 358de: 4c ac ldd r4, Y+60 ; 0x3c 358e0: 5d ac ldd r5, Y+61 ; 0x3d 358e2: 6e ac ldd r6, Y+62 ; 0x3e 358e4: 7f ac ldd r7, Y+63 ; 0x3f 358e6: ae 97 sbiw r28, 0x2e ; 46 358e8: 48 1a sub r4, r24 358ea: 59 0a sbc r5, r25 358ec: 6a 0a sbc r6, r26 358ee: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 358f0: 80 91 54 07 lds r24, 0x0754 ; 0x800754 358f4: 90 91 55 07 lds r25, 0x0755 ; 0x800755 358f8: a0 91 56 07 lds r26, 0x0756 ; 0x800756 358fc: b0 91 57 07 lds r27, 0x0757 ; 0x800757 35900: c2 58 subi r28, 0x82 ; 130 35902: df 4f sbci r29, 0xFF ; 255 35904: c8 80 ld r12, Y 35906: d9 80 ldd r13, Y+1 ; 0x01 35908: ea 80 ldd r14, Y+2 ; 0x02 3590a: fb 80 ldd r15, Y+3 ; 0x03 3590c: ce 57 subi r28, 0x7E ; 126 3590e: d0 40 sbci r29, 0x00 ; 0 35910: c8 1a sub r12, r24 35912: d9 0a sbc r13, r25 35914: ea 0a sbc r14, r26 35916: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 35918: 80 91 58 07 lds r24, 0x0758 ; 0x800758 3591c: 90 91 59 07 lds r25, 0x0759 ; 0x800759 35920: a0 91 5a 07 lds r26, 0x075A ; 0x80075a 35924: b0 91 5b 07 lds r27, 0x075B ; 0x80075b 35928: ce 57 subi r28, 0x7E ; 126 3592a: df 4f sbci r29, 0xFF ; 255 3592c: 28 81 ld r18, Y 3592e: 39 81 ldd r19, Y+1 ; 0x01 35930: 4a 81 ldd r20, Y+2 ; 0x02 35932: 5b 81 ldd r21, Y+3 ; 0x03 35934: c2 58 subi r28, 0x82 ; 130 35936: d0 40 sbci r29, 0x00 ; 0 35938: 28 1b sub r18, r24 3593a: 39 0b sbc r19, r25 3593c: 4a 0b sbc r20, r26 3593e: 5b 0b sbc r21, r27 35940: 29 a7 std Y+41, r18 ; 0x29 35942: 3a a7 std Y+42, r19 ; 0x2a 35944: 4b a7 std Y+43, r20 ; 0x2b 35946: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 35948: 80 91 5c 07 lds r24, 0x075C ; 0x80075c 3594c: 90 91 5d 07 lds r25, 0x075D ; 0x80075d 35950: a0 91 5e 07 lds r26, 0x075E ; 0x80075e 35954: b0 91 5f 07 lds r27, 0x075F ; 0x80075f 35958: e6 96 adiw r28, 0x36 ; 54 3595a: 2c ad ldd r18, Y+60 ; 0x3c 3595c: 3d ad ldd r19, Y+61 ; 0x3d 3595e: 4e ad ldd r20, Y+62 ; 0x3e 35960: 5f ad ldd r21, Y+63 ; 0x3f 35962: e6 97 sbiw r28, 0x36 ; 54 35964: 28 1b sub r18, r24 35966: 39 0b sbc r19, r25 35968: 4a 0b sbc r20, r26 3596a: 5b 0b sbc r21, r27 3596c: 2d a7 std Y+45, r18 ; 0x2d 3596e: 3e a7 std Y+46, r19 ; 0x2e 35970: 4f a7 std Y+47, r20 ; 0x2f 35972: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 35974: 41 14 cp r4, r1 35976: 51 04 cpc r5, r1 35978: 61 04 cpc r6, r1 3597a: 71 04 cpc r7, r1 3597c: 09 f4 brne .+2 ; 0x35980 3597e: 80 c0 rjmp .+256 ; 0x35a80 { if((int)degHotend(active_extruder) 35984: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 35988: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 3598c: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 35990: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 35994: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 35998: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 3599c: 62 17 cp r22, r18 3599e: 73 07 cpc r23, r19 359a0: 0c f5 brge .+66 ; 0x359e4 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 359a2: ae 96 adiw r28, 0x2e ; 46 359a4: 8c ad ldd r24, Y+60 ; 0x3c 359a6: 9d ad ldd r25, Y+61 ; 0x3d 359a8: ae ad ldd r26, Y+62 ; 0x3e 359aa: bf ad ldd r27, Y+63 ; 0x3f 359ac: ae 97 sbiw r28, 0x2e ; 46 359ae: 80 93 60 07 sts 0x0760, r24 ; 0x800760 359b2: 90 93 61 07 sts 0x0761, r25 ; 0x800761 359b6: a0 93 62 07 sts 0x0762, r26 ; 0x800762 359ba: b0 93 63 07 sts 0x0763, r27 ; 0x800763 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 359be: 80 92 dc 04 sts 0x04DC, r8 ; 0x8004dc 359c2: 90 92 dd 04 sts 0x04DD, r9 ; 0x8004dd 359c6: a0 92 de 04 sts 0x04DE, r10 ; 0x8004de 359ca: b0 92 df 04 sts 0x04DF, r11 ; 0x8004df #endif de = 0; // no difference SERIAL_ECHO_START; 359ce: 82 ef ldi r24, 0xF2 ; 242 359d0: 9a ea ldi r25, 0xAA ; 170 359d2: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 359d6: 8c eb ldi r24, 0xBC ; 188 359d8: 91 e7 ldi r25, 0x71 ; 113 359da: 0e 94 86 7b call 0xf70c ; 0xf70c { 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 359de: 41 2c mov r4, r1 359e0: 51 2c mov r5, r1 359e2: 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) 359e4: c3 01 movw r24, r6 359e6: b2 01 movw r22, r4 359e8: 77 fe sbrs r7, 7 359ea: 07 c0 rjmp .+14 ; 0x359fa 359ec: 66 27 eor r22, r22 359ee: 77 27 eor r23, r23 359f0: cb 01 movw r24, r22 359f2: 64 19 sub r22, r4 359f4: 75 09 sbc r23, r5 359f6: 86 09 sbc r24, r6 359f8: 97 09 sbc r25, r7 359fa: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 359fe: 4b 01 movw r8, r22 35a00: 5c 01 movw r10, r24 35a02: 20 e0 ldi r18, 0x00 ; 0 35a04: 30 ec ldi r19, 0xC0 ; 192 35a06: 4b ee ldi r20, 0xEB ; 235 35a08: 53 e4 ldi r21, 0x43 ; 67 35a0a: 60 91 7e 06 lds r22, 0x067E ; 0x80067e 35a0e: 70 91 7f 06 lds r23, 0x067F ; 0x80067f 35a12: 80 91 80 06 lds r24, 0x0680 ; 0x800680 35a16: 90 91 81 06 lds r25, 0x0681 ; 0x800681 35a1a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 35a1e: 9b 01 movw r18, r22 35a20: ac 01 movw r20, r24 35a22: c5 01 movw r24, r10 35a24: b4 01 movw r22, r8 35a26: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 35a2a: 18 16 cp r1, r24 35a2c: 4c f5 brge .+82 ; 0x35a80 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 35a2e: ae 96 adiw r28, 0x2e ; 46 35a30: 2c ad ldd r18, Y+60 ; 0x3c 35a32: 3d ad ldd r19, Y+61 ; 0x3d 35a34: 4e ad ldd r20, Y+62 ; 0x3e 35a36: 5f ad ldd r21, Y+63 ; 0x3f 35a38: ae 97 sbiw r28, 0x2e ; 46 35a3a: 20 93 60 07 sts 0x0760, r18 ; 0x800760 35a3e: 30 93 61 07 sts 0x0761, r19 ; 0x800761 35a42: 40 93 62 07 sts 0x0762, r20 ; 0x800762 35a46: 50 93 63 07 sts 0x0763, r21 ; 0x800763 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 35a4a: aa 96 adiw r28, 0x2a ; 42 35a4c: ee ad ldd r30, Y+62 ; 0x3e 35a4e: ff ad ldd r31, Y+63 ; 0x3f 35a50: aa 97 sbiw r28, 0x2a ; 42 35a52: 80 81 ld r24, Z 35a54: 91 81 ldd r25, Z+1 ; 0x01 35a56: a2 81 ldd r26, Z+2 ; 0x02 35a58: b3 81 ldd r27, Z+3 ; 0x03 35a5a: 80 93 dc 04 sts 0x04DC, r24 ; 0x8004dc 35a5e: 90 93 dd 04 sts 0x04DD, r25 ; 0x8004dd 35a62: a0 93 de 04 sts 0x04DE, r26 ; 0x8004de 35a66: b0 93 df 04 sts 0x04DF, r27 ; 0x8004df #endif de = 0; // no difference SERIAL_ECHO_START; 35a6a: 82 ef ldi r24, 0xF2 ; 242 35a6c: 9a ea ldi r25, 0xAA ; 170 35a6e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 35a72: 8e e9 ldi r24, 0x9E ; 158 35a74: 91 e7 ldi r25, 0x71 ; 113 35a76: 0e 94 86 7b call 0xf70c ; 0xf70c { 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 35a7a: 41 2c mov r4, r1 35a7c: 51 2c mov r5, r1 35a7e: 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); 35a80: 8e e6 ldi r24, 0x6E ; 110 35a82: 82 9d mul r24, r2 35a84: f0 01 movw r30, r0 35a86: 83 9d mul r24, r3 35a88: f0 0d add r31, r0 35a8a: 11 24 eor r1, r1 35a8c: ea 58 subi r30, 0x8A ; 138 35a8e: f8 4f sbci r31, 0xF8 ; 248 35a90: d7 01 movw r26, r14 35a92: c6 01 movw r24, r12 35a94: f7 fe sbrs r15, 7 35a96: 07 c0 rjmp .+14 ; 0x35aa6 35a98: 88 27 eor r24, r24 35a9a: 99 27 eor r25, r25 35a9c: dc 01 movw r26, r24 35a9e: 8c 19 sub r24, r12 35aa0: 9d 09 sbc r25, r13 35aa2: ae 09 sbc r26, r14 35aa4: bf 09 sbc r27, r15 35aa6: 80 83 st Z, r24 35aa8: 91 83 std Z+1, r25 ; 0x01 35aaa: a2 83 std Z+2, r26 ; 0x02 35aac: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 35aae: 8e e6 ldi r24, 0x6E ; 110 35ab0: 82 9d mul r24, r2 35ab2: f0 01 movw r30, r0 35ab4: 83 9d mul r24, r3 35ab6: f0 0d add r31, r0 35ab8: 11 24 eor r1, r1 35aba: ea 58 subi r30, 0x8A ; 138 35abc: f8 4f sbci r31, 0xF8 ; 248 35abe: 89 a5 ldd r24, Y+41 ; 0x29 35ac0: 9a a5 ldd r25, Y+42 ; 0x2a 35ac2: ab a5 ldd r26, Y+43 ; 0x2b 35ac4: bc a5 ldd r27, Y+44 ; 0x2c 35ac6: b7 ff sbrs r27, 7 35ac8: 07 c0 rjmp .+14 ; 0x35ad8 35aca: b0 95 com r27 35acc: a0 95 com r26 35ace: 90 95 com r25 35ad0: 81 95 neg r24 35ad2: 9f 4f sbci r25, 0xFF ; 255 35ad4: af 4f sbci r26, 0xFF ; 255 35ad6: bf 4f sbci r27, 0xFF ; 255 35ad8: 84 83 std Z+4, r24 ; 0x04 35ada: 95 83 std Z+5, r25 ; 0x05 35adc: a6 83 std Z+6, r26 ; 0x06 35ade: 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); 35ae0: 8e e6 ldi r24, 0x6E ; 110 35ae2: 82 9d mul r24, r2 35ae4: f0 01 movw r30, r0 35ae6: 83 9d mul r24, r3 35ae8: f0 0d add r31, r0 35aea: 11 24 eor r1, r1 35aec: ea 58 subi r30, 0x8A ; 138 35aee: f8 4f sbci r31, 0xF8 ; 248 35af0: 8d a5 ldd r24, Y+45 ; 0x2d 35af2: 9e a5 ldd r25, Y+46 ; 0x2e 35af4: af a5 ldd r26, Y+47 ; 0x2f 35af6: b8 a9 ldd r27, Y+48 ; 0x30 35af8: b7 ff sbrs r27, 7 35afa: 07 c0 rjmp .+14 ; 0x35b0a 35afc: b0 95 com r27 35afe: a0 95 com r26 35b00: 90 95 com r25 35b02: 81 95 neg r24 35b04: 9f 4f sbci r25, 0xFF ; 255 35b06: af 4f sbci r26, 0xFF ; 255 35b08: bf 4f sbci r27, 0xFF ; 255 35b0a: 80 87 std Z+8, r24 ; 0x08 35b0c: 91 87 std Z+9, r25 ; 0x09 35b0e: a2 87 std Z+10, r26 ; 0x0a 35b10: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 35b12: b3 01 movw r22, r6 35b14: a2 01 movw r20, r4 35b16: 77 fe sbrs r7, 7 35b18: 07 c0 rjmp .+14 ; 0x35b28 35b1a: 44 27 eor r20, r20 35b1c: 55 27 eor r21, r21 35b1e: ba 01 movw r22, r20 35b20: 44 19 sub r20, r4 35b22: 55 09 sbc r21, r5 35b24: 66 09 sbc r22, r6 35b26: 77 09 sbc r23, r7 35b28: 8e e6 ldi r24, 0x6E ; 110 35b2a: 82 9d mul r24, r2 35b2c: f0 01 movw r30, r0 35b2e: 83 9d mul r24, r3 35b30: f0 0d add r31, r0 35b32: 11 24 eor r1, r1 35b34: ea 58 subi r30, 0x8A ; 138 35b36: f8 4f sbci r31, 0xF8 ; 248 35b38: 44 87 std Z+12, r20 ; 0x0c 35b3a: 55 87 std Z+13, r21 ; 0x0d 35b3c: 66 87 std Z+14, r22 ; 0x0e 35b3e: 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))); 35b40: 00 81 ld r16, Z 35b42: 11 81 ldd r17, Z+1 ; 0x01 35b44: 22 81 ldd r18, Z+2 ; 0x02 35b46: 33 81 ldd r19, Z+3 ; 0x03 35b48: 84 81 ldd r24, Z+4 ; 0x04 35b4a: 95 81 ldd r25, Z+5 ; 0x05 35b4c: a6 81 ldd r26, Z+6 ; 0x06 35b4e: b7 81 ldd r27, Z+7 ; 0x07 35b50: 80 17 cp r24, r16 35b52: 91 07 cpc r25, r17 35b54: a2 07 cpc r26, r18 35b56: b3 07 cpc r27, r19 35b58: 14 f4 brge .+4 ; 0x35b5e 35b5a: d9 01 movw r26, r18 35b5c: c8 01 movw r24, r16 35b5e: ee e6 ldi r30, 0x6E ; 110 35b60: be 2e mov r11, r30 35b62: b2 9c mul r11, r2 35b64: f0 01 movw r30, r0 35b66: b3 9c mul r11, r3 35b68: f0 0d add r31, r0 35b6a: 11 24 eor r1, r1 35b6c: ea 58 subi r30, 0x8A ; 138 35b6e: f8 4f sbci r31, 0xF8 ; 248 35b70: 80 84 ldd r8, Z+8 ; 0x08 35b72: 91 84 ldd r9, Z+9 ; 0x09 35b74: a2 84 ldd r10, Z+10 ; 0x0a 35b76: b3 84 ldd r11, Z+11 ; 0x0b 35b78: 88 15 cp r24, r8 35b7a: 99 05 cpc r25, r9 35b7c: aa 05 cpc r26, r10 35b7e: bb 05 cpc r27, r11 35b80: 14 f4 brge .+4 ; 0x35b86 35b82: d5 01 movw r26, r10 35b84: c4 01 movw r24, r8 35b86: 84 17 cp r24, r20 35b88: 95 07 cpc r25, r21 35b8a: a6 07 cpc r26, r22 35b8c: b7 07 cpc r27, r23 35b8e: 14 f4 brge .+4 ; 0x35b94 35b90: db 01 movw r26, r22 35b92: ca 01 movw r24, r20 35b94: 4e e6 ldi r20, 0x6E ; 110 35b96: 42 9d mul r20, r2 35b98: f0 01 movw r30, r0 35b9a: 43 9d mul r20, r3 35b9c: f0 0d add r31, r0 35b9e: 11 24 eor r1, r1 35ba0: ea 58 subi r30, 0x8A ; 138 35ba2: f8 4f sbci r31, 0xF8 ; 248 35ba4: 80 8b std Z+16, r24 ; 0x10 35ba6: 91 8b std Z+17, r25 ; 0x11 35ba8: a2 8b std Z+18, r26 ; 0x12 35baa: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 35bac: 06 97 sbiw r24, 0x06 ; 6 35bae: a1 05 cpc r26, r1 35bb0: b1 05 cpc r27, r1 35bb2: 0c f4 brge .+2 ; 0x35bb6 35bb4: 94 cd rjmp .-1240 ; 0x356de planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 35bb6: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 35bba: df 01 movw r26, r30 35bbc: aa 5b subi r26, 0xBA ; 186 35bbe: bf 4f sbci r27, 0xFF ; 255 35bc0: 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); 35bc2: f7 fe sbrs r15, 7 35bc4: 02 c0 rjmp .+4 ; 0x35bca 35bc6: 0d 94 13 b6 jmp 0x36c26 ; 0x36c26 } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 35bca: 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); 35bcc: 89 a5 ldd r24, Y+41 ; 0x29 35bce: 9a a5 ldd r25, Y+42 ; 0x2a 35bd0: ab a5 ldd r26, Y+43 ; 0x2b 35bd2: bc a5 ldd r27, Y+44 ; 0x2c 35bd4: b7 ff sbrs r27, 7 35bd6: 0b c0 rjmp .+22 ; 0x35bee 35bd8: 8e e6 ldi r24, 0x6E ; 110 35bda: 82 9d mul r24, r2 35bdc: f0 01 movw r30, r0 35bde: 83 9d mul r24, r3 35be0: f0 0d add r31, r0 35be2: 11 24 eor r1, r1 35be4: ea 58 subi r30, 0x8A ; 138 35be6: f8 4f sbci r31, 0xF8 ; 248 35be8: 80 8d ldd r24, Z+24 ; 0x18 35bea: 82 60 ori r24, 0x02 ; 2 35bec: 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); 35bee: 8d a5 ldd r24, Y+45 ; 0x2d 35bf0: 9e a5 ldd r25, Y+46 ; 0x2e 35bf2: af a5 ldd r26, Y+47 ; 0x2f 35bf4: b8 a9 ldd r27, Y+48 ; 0x30 35bf6: b7 ff sbrs r27, 7 35bf8: 0b c0 rjmp .+22 ; 0x35c10 35bfa: 8e e6 ldi r24, 0x6E ; 110 35bfc: 82 9d mul r24, r2 35bfe: f0 01 movw r30, r0 35c00: 83 9d mul r24, r3 35c02: f0 0d add r31, r0 35c04: 11 24 eor r1, r1 35c06: ea 58 subi r30, 0x8A ; 138 35c08: f8 4f sbci r31, 0xF8 ; 248 35c0a: 80 8d ldd r24, Z+24 ; 0x18 35c0c: 84 60 ori r24, 0x04 ; 4 35c0e: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 35c10: 77 fe sbrs r7, 7 35c12: 0b c0 rjmp .+22 ; 0x35c2a 35c14: 8e e6 ldi r24, 0x6E ; 110 35c16: 82 9d mul r24, r2 35c18: f0 01 movw r30, r0 35c1a: 83 9d mul r24, r3 35c1c: f0 0d add r31, r0 35c1e: 11 24 eor r1, r1 35c20: ea 58 subi r30, 0x8A ; 138 35c22: f8 4f sbci r31, 0xF8 ; 248 35c24: 80 8d ldd r24, Z+24 ; 0x18 35c26: 88 60 ori r24, 0x08 ; 8 35c28: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 35c2a: 01 2b or r16, r17 35c2c: 02 2b or r16, r18 35c2e: 03 2b or r16, r19 35c30: 09 f0 breq .+2 ; 0x35c34 35c32: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 35c34: 8e e6 ldi r24, 0x6E ; 110 35c36: 82 9d mul r24, r2 35c38: f0 01 movw r30, r0 35c3a: 83 9d mul r24, r3 35c3c: f0 0d add r31, r0 35c3e: 11 24 eor r1, r1 35c40: ea 58 subi r30, 0x8A ; 138 35c42: f8 4f sbci r31, 0xF8 ; 248 35c44: 84 81 ldd r24, Z+4 ; 0x04 35c46: 95 81 ldd r25, Z+5 ; 0x05 35c48: a6 81 ldd r26, Z+6 ; 0x06 35c4a: b7 81 ldd r27, Z+7 ; 0x07 35c4c: 89 2b or r24, r25 35c4e: 8a 2b or r24, r26 35c50: 8b 2b or r24, r27 35c52: 09 f0 breq .+2 ; 0x35c56 35c54: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 35c56: 8e e6 ldi r24, 0x6E ; 110 35c58: 82 9d mul r24, r2 35c5a: f0 01 movw r30, r0 35c5c: 83 9d mul r24, r3 35c5e: f0 0d add r31, r0 35c60: 11 24 eor r1, r1 35c62: ea 58 subi r30, 0x8A ; 138 35c64: f8 4f sbci r31, 0xF8 ; 248 35c66: 80 85 ldd r24, Z+8 ; 0x08 35c68: 91 85 ldd r25, Z+9 ; 0x09 35c6a: a2 85 ldd r26, Z+10 ; 0x0a 35c6c: b3 85 ldd r27, Z+11 ; 0x0b 35c6e: 89 2b or r24, r25 35c70: 8a 2b or r24, r26 35c72: 8b 2b or r24, r27 35c74: 09 f0 breq .+2 ; 0x35c78 35c76: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 35c78: 8e e6 ldi r24, 0x6E ; 110 35c7a: 82 9d mul r24, r2 35c7c: f0 01 movw r30, r0 35c7e: 83 9d mul r24, r3 35c80: f0 0d add r31, r0 35c82: 11 24 eor r1, r1 35c84: ea 58 subi r30, 0x8A ; 138 35c86: f8 4f sbci r31, 0xF8 ; 248 35c88: 84 85 ldd r24, Z+12 ; 0x0c 35c8a: 95 85 ldd r25, Z+13 ; 0x0d 35c8c: a6 85 ldd r26, Z+14 ; 0x0e 35c8e: b7 85 ldd r27, Z+15 ; 0x0f 35c90: 89 2b or r24, r25 35c92: 8a 2b or r24, r26 35c94: 8b 2b or r24, r27 35c96: 09 f0 breq .+2 ; 0x35c9a 35c98: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 35c9a: 8e e6 ldi r24, 0x6E ; 110 35c9c: 82 9d mul r24, r2 35c9e: f0 01 movw r30, r0 35ca0: 83 9d mul r24, r3 35ca2: f0 0d add r31, r0 35ca4: 11 24 eor r1, r1 35ca6: ea 58 subi r30, 0x8A ; 138 35ca8: f8 4f sbci r31, 0xF8 ; 248 35caa: 24 85 ldd r18, Z+12 ; 0x0c 35cac: 35 85 ldd r19, Z+13 ; 0x0d 35cae: 46 85 ldd r20, Z+14 ; 0x0e 35cb0: 57 85 ldd r21, Z+15 ; 0x0f 35cb2: 2a 96 adiw r28, 0x0a ; 10 35cb4: 2c af std Y+60, r18 ; 0x3c 35cb6: 3d af std Y+61, r19 ; 0x3d 35cb8: 4e af std Y+62, r20 ; 0x3e 35cba: 5f af std Y+63, r21 ; 0x3f 35cbc: 2a 97 sbiw r28, 0x0a ; 10 35cbe: 23 2b or r18, r19 35cc0: 24 2b or r18, r20 35cc2: 25 2b or r18, r21 35cc4: 09 f0 breq .+2 ; 0x35cc8 35cc6: b3 c7 rjmp .+3942 ; 0x36c2e { if(feed_rate 35ccc: b0 90 af 06 lds r11, 0x06AF ; 0x8006af 35cd0: 00 91 b0 06 lds r16, 0x06B0 ; 0x8006b0 35cd4: 10 91 b1 06 lds r17, 0x06B1 ; 0x8006b1 } else { if(feed_rate 35ce8: 18 16 cp r1, r24 35cea: 24 f4 brge .+8 ; 0x35cf4 35cec: a9 aa std Y+49, r10 ; 0x31 35cee: b9 ae std Y+57, r11 ; 0x39 35cf0: 0d af std Y+61, r16 ; 0x3d 35cf2: 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]; 35cf4: c7 01 movw r24, r14 35cf6: b6 01 movw r22, r12 35cf8: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 35cfc: 20 91 72 06 lds r18, 0x0672 ; 0x800672 35d00: 30 91 73 06 lds r19, 0x0673 ; 0x800673 35d04: 40 91 74 06 lds r20, 0x0674 ; 0x800674 35d08: 50 91 75 06 lds r21, 0x0675 ; 0x800675 35d0c: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 35d10: 4b 01 movw r8, r22 35d12: 5c 01 movw r10, r24 35d14: 89 82 std Y+1, r8 ; 0x01 35d16: 9a 82 std Y+2, r9 ; 0x02 35d18: ab 82 std Y+3, r10 ; 0x03 35d1a: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 35d1c: 69 a5 ldd r22, Y+41 ; 0x29 35d1e: 7a a5 ldd r23, Y+42 ; 0x2a 35d20: 8b a5 ldd r24, Y+43 ; 0x2b 35d22: 9c a5 ldd r25, Y+44 ; 0x2c 35d24: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 35d28: 20 91 76 06 lds r18, 0x0676 ; 0x800676 35d2c: 30 91 77 06 lds r19, 0x0677 ; 0x800677 35d30: 40 91 78 06 lds r20, 0x0678 ; 0x800678 35d34: 50 91 79 06 lds r21, 0x0679 ; 0x800679 35d38: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 35d3c: 6b 01 movw r12, r22 35d3e: 7c 01 movw r14, r24 35d40: cd 82 std Y+5, r12 ; 0x05 35d42: de 82 std Y+6, r13 ; 0x06 35d44: ef 82 std Y+7, r14 ; 0x07 35d46: 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]; 35d48: 6d a5 ldd r22, Y+45 ; 0x2d 35d4a: 7e a5 ldd r23, Y+46 ; 0x2e 35d4c: 8f a5 ldd r24, Y+47 ; 0x2f 35d4e: 98 a9 ldd r25, Y+48 ; 0x30 35d50: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 35d54: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 35d58: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 35d5c: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 35d60: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 35d64: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 35d68: 22 96 adiw r28, 0x02 ; 2 35d6a: 6c af std Y+60, r22 ; 0x3c 35d6c: 7d af std Y+61, r23 ; 0x3d 35d6e: 8e af std Y+62, r24 ; 0x3e 35d70: 9f af std Y+63, r25 ; 0x3f 35d72: 22 97 sbiw r28, 0x02 ; 2 35d74: 69 87 std Y+9, r22 ; 0x09 35d76: 7a 87 std Y+10, r23 ; 0x0a 35d78: 8b 87 std Y+11, r24 ; 0x0b 35d7a: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 35d7c: c3 01 movw r24, r6 35d7e: b2 01 movw r22, r4 35d80: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 35d84: 20 91 7e 06 lds r18, 0x067E ; 0x80067e 35d88: 30 91 7f 06 lds r19, 0x067F ; 0x80067f 35d8c: 40 91 80 06 lds r20, 0x0680 ; 0x800680 35d90: 50 91 81 06 lds r21, 0x0681 ; 0x800681 35d94: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 35d98: 26 96 adiw r28, 0x06 ; 6 35d9a: 6c af std Y+60, r22 ; 0x3c 35d9c: 7d af std Y+61, r23 ; 0x3d 35d9e: 8e af std Y+62, r24 ; 0x3e 35da0: 9f af std Y+63, r25 ; 0x3f 35da2: 26 97 sbiw r28, 0x06 ; 6 35da4: 6d 87 std Y+13, r22 ; 0x0d 35da6: 7e 87 std Y+14, r23 ; 0x0e 35da8: 8f 87 std Y+15, r24 ; 0x0f 35daa: 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 ) 35dac: 8e e6 ldi r24, 0x6E ; 110 35dae: 82 9d mul r24, r2 35db0: f0 01 movw r30, r0 35db2: 83 9d mul r24, r3 35db4: f0 0d add r31, r0 35db6: 11 24 eor r1, r1 35db8: ea 58 subi r30, 0x8A ; 138 35dba: f8 4f sbci r31, 0xF8 ; 248 35dbc: 80 81 ld r24, Z 35dbe: 91 81 ldd r25, Z+1 ; 0x01 35dc0: a2 81 ldd r26, Z+2 ; 0x02 35dc2: b3 81 ldd r27, Z+3 ; 0x03 35dc4: 2e 96 adiw r28, 0x0e ; 14 35dc6: 8c af std Y+60, r24 ; 0x3c 35dc8: 9d af std Y+61, r25 ; 0x3d 35dca: ae af std Y+62, r26 ; 0x3e 35dcc: bf af std Y+63, r27 ; 0x3f 35dce: 2e 97 sbiw r28, 0x0e ; 14 35dd0: 06 97 sbiw r24, 0x06 ; 6 35dd2: a1 05 cpc r26, r1 35dd4: b1 05 cpc r27, r1 35dd6: 0c f0 brlt .+2 ; 0x35dda 35dd8: 33 c7 rjmp .+3686 ; 0x36c40 35dda: 84 81 ldd r24, Z+4 ; 0x04 35ddc: 95 81 ldd r25, Z+5 ; 0x05 35dde: a6 81 ldd r26, Z+6 ; 0x06 35de0: b7 81 ldd r27, Z+7 ; 0x07 35de2: 06 97 sbiw r24, 0x06 ; 6 35de4: a1 05 cpc r26, r1 35de6: b1 05 cpc r27, r1 35de8: 0c f0 brlt .+2 ; 0x35dec 35dea: 2a c7 rjmp .+3668 ; 0x36c40 35dec: 80 85 ldd r24, Z+8 ; 0x08 35dee: 91 85 ldd r25, Z+9 ; 0x09 35df0: a2 85 ldd r26, Z+10 ; 0x0a 35df2: b3 85 ldd r27, Z+11 ; 0x0b 35df4: 06 97 sbiw r24, 0x06 ; 6 35df6: a1 05 cpc r26, r1 35df8: b1 05 cpc r27, r1 35dfa: 0c f0 brlt .+2 ; 0x35dfe 35dfc: 21 c7 rjmp .+3650 ; 0x36c40 { block->millimeters = fabs(delta_mm[E_AXIS]); 35dfe: 26 96 adiw r28, 0x06 ; 6 35e00: 8c ad ldd r24, Y+60 ; 0x3c 35e02: 9d ad ldd r25, Y+61 ; 0x3d 35e04: ae ad ldd r26, Y+62 ; 0x3e 35e06: bf ad ldd r27, Y+63 ; 0x3f 35e08: 26 97 sbiw r28, 0x06 ; 6 35e0a: bf 77 andi r27, 0x7F ; 127 35e0c: 85 a7 std Z+45, r24 ; 0x2d 35e0e: 96 a7 std Z+46, r25 ; 0x2e 35e10: a7 a7 std Z+47, r26 ; 0x2f 35e12: 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 35e14: 8e e6 ldi r24, 0x6E ; 110 35e16: 82 9d mul r24, r2 35e18: f0 01 movw r30, r0 35e1a: 83 9d mul r24, r3 35e1c: f0 0d add r31, r0 35e1e: 11 24 eor r1, r1 35e20: ea 58 subi r30, 0x8A ; 138 35e22: f8 4f sbci r31, 0xF8 ; 248 35e24: 45 a4 ldd r4, Z+45 ; 0x2d 35e26: 56 a4 ldd r5, Z+46 ; 0x2e 35e28: 67 a4 ldd r6, Z+47 ; 0x2f 35e2a: 70 a8 ldd r7, Z+48 ; 0x30 35e2c: a3 01 movw r20, r6 35e2e: 92 01 movw r18, r4 35e30: 60 e0 ldi r22, 0x00 ; 0 35e32: 70 e0 ldi r23, 0x00 ; 0 35e34: 80 e8 ldi r24, 0x80 ; 128 35e36: 9f e3 ldi r25, 0x3F ; 63 35e38: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 35e3c: 29 a9 ldd r18, Y+49 ; 0x31 35e3e: 39 ad ldd r19, Y+57 ; 0x39 35e40: 4d ad ldd r20, Y+61 ; 0x3d 35e42: 5d a9 ldd r21, Y+53 ; 0x35 35e44: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 35e48: 6b 01 movw r12, r22 35e4a: 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); 35e4c: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 35e50: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 35e54: 89 1b sub r24, r25 35e56: 8f 70 andi r24, 0x0F ; 15 35e58: 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)) { 35e5a: 82 50 subi r24, 0x02 ; 2 35e5c: 86 30 cpi r24, 0x06 ; 6 35e5e: 08 f0 brcs .+2 ; 0x35e62 35e60: 40 c0 rjmp .+128 ; 0x35ee2 // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 35e62: a7 01 movw r20, r14 35e64: 96 01 movw r18, r12 35e66: 60 e0 ldi r22, 0x00 ; 0 35e68: 74 e2 ldi r23, 0x24 ; 36 35e6a: 84 e7 ldi r24, 0x74 ; 116 35e6c: 99 e4 ldi r25, 0x49 ; 73 35e6e: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 35e72: 0f 94 c0 e1 call 0x3c380 ; 0x3c380 35e76: 4b 01 movw r8, r22 35e78: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 35e7a: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 35e7e: 90 91 b3 06 lds r25, 0x06B3 ; 0x8006b3 35e82: a0 91 b4 06 lds r26, 0x06B4 ; 0x8006b4 35e86: b0 91 b5 06 lds r27, 0x06B5 ; 0x8006b5 35e8a: 88 16 cp r8, r24 35e8c: 99 06 cpc r9, r25 35e8e: aa 06 cpc r10, r26 35e90: bb 06 cpc r11, r27 35e92: 38 f5 brcc .+78 ; 0x35ee2 // 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)); 35e94: bc 01 movw r22, r24 35e96: cd 01 movw r24, r26 35e98: 68 19 sub r22, r8 35e9a: 79 09 sbc r23, r9 35e9c: 8a 09 sbc r24, r10 35e9e: 9b 09 sbc r25, r11 35ea0: 66 0f add r22, r22 35ea2: 77 1f adc r23, r23 35ea4: 88 1f adc r24, r24 35ea6: 99 1f adc r25, r25 35ea8: ad ad ldd r26, Y+61 ; 0x3d 35eaa: 2a 2f mov r18, r26 35eac: 30 e0 ldi r19, 0x00 ; 0 35eae: 50 e0 ldi r21, 0x00 ; 0 35eb0: 40 e0 ldi r20, 0x00 ; 0 35eb2: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 35eb6: ca 01 movw r24, r20 35eb8: b9 01 movw r22, r18 35eba: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 35ebe: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 35ec2: 68 0d add r22, r8 35ec4: 79 1d adc r23, r9 35ec6: 8a 1d adc r24, r10 35ec8: 9b 1d adc r25, r11 35eca: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 35ece: 9b 01 movw r18, r22 35ed0: ac 01 movw r20, r24 35ed2: 60 e0 ldi r22, 0x00 ; 0 35ed4: 74 e2 ldi r23, 0x24 ; 36 35ed6: 84 e7 ldi r24, 0x74 ; 116 35ed8: 99 e4 ldi r25, 0x49 ; 73 35eda: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 35ede: 6b 01 movw r12, r22 35ee0: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 35ee2: a3 01 movw r20, r6 35ee4: 92 01 movw r18, r4 35ee6: c7 01 movw r24, r14 35ee8: b6 01 movw r22, r12 35eea: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 35eee: 6d ab std Y+53, r22 ; 0x35 35ef0: 7e ab std Y+54, r23 ; 0x36 35ef2: 8f ab std Y+55, r24 ; 0x37 35ef4: 98 af std Y+56, r25 ; 0x38 35ef6: 8e e6 ldi r24, 0x6E ; 110 35ef8: 82 9d mul r24, r2 35efa: 80 01 movw r16, r0 35efc: 83 9d mul r24, r3 35efe: 10 0d add r17, r0 35f00: 11 24 eor r1, r1 35f02: 0a 58 subi r16, 0x8A ; 138 35f04: 18 4f sbci r17, 0xF8 ; 248 35f06: 2d a9 ldd r18, Y+53 ; 0x35 35f08: 3e a9 ldd r19, Y+54 ; 0x36 35f0a: 4f a9 ldd r20, Y+55 ; 0x37 35f0c: 58 ad ldd r21, Y+56 ; 0x38 35f0e: d8 01 movw r26, r16 35f10: 91 96 adiw r26, 0x21 ; 33 35f12: 2d 93 st X+, r18 35f14: 3d 93 st X+, r19 35f16: 4d 93 st X+, r20 35f18: 5c 93 st X, r21 35f1a: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 35f1c: 50 96 adiw r26, 0x10 ; 16 35f1e: 6d 91 ld r22, X+ 35f20: 7d 91 ld r23, X+ 35f22: 8d 91 ld r24, X+ 35f24: 9c 91 ld r25, X 35f26: 53 97 sbiw r26, 0x13 ; 19 35f28: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 35f2c: 69 af std Y+57, r22 ; 0x39 35f2e: 7a af std Y+58, r23 ; 0x3a 35f30: 8b af std Y+59, r24 ; 0x3b 35f32: 9c af std Y+60, r25 ; 0x3c 35f34: 9b 01 movw r18, r22 35f36: ac 01 movw r20, r24 35f38: c7 01 movw r24, r14 35f3a: b6 01 movw r22, r12 35f3c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 35f40: 0f 94 61 df call 0x3bec2 ; 0x3bec2 35f44: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 35f48: 62 96 adiw r28, 0x12 ; 18 35f4a: 6c af std Y+60, r22 ; 0x3c 35f4c: 7d af std Y+61, r23 ; 0x3d 35f4e: 8e af std Y+62, r24 ; 0x3e 35f50: 9f af std Y+63, r25 ; 0x3f 35f52: 62 97 sbiw r28, 0x12 ; 18 35f54: f8 01 movw r30, r16 35f56: 66 ab std Z+54, r22 ; 0x36 35f58: 77 ab std Z+55, r23 ; 0x37 35f5a: 80 af std Z+56, r24 ; 0x38 35f5c: 91 af std Z+57, r25 ; 0x39 35f5e: 9e 01 movw r18, r28 35f60: 2f 5f subi r18, 0xFF ; 255 35f62: 3f 4f sbci r19, 0xFF ; 255 35f64: 6c 96 adiw r28, 0x1c ; 28 35f66: 3f af std Y+63, r19 ; 0x3f 35f68: 2e af std Y+62, r18 ; 0x3e 35f6a: 6c 97 sbiw r28, 0x1c ; 28 35f6c: ae 01 movw r20, r28 35f6e: 4f 5e subi r20, 0xEF ; 239 35f70: 5f 4f sbci r21, 0xFF ; 255 35f72: a0 96 adiw r28, 0x20 ; 32 35f74: 5f af std Y+63, r21 ; 0x3f 35f76: 4e af std Y+62, r20 ; 0x3e 35f78: a0 97 sbiw r28, 0x20 ; 32 35f7a: 80 91 99 02 lds r24, 0x0299 ; 0x800299 35f7e: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 35f82: 9a ab std Y+50, r25 ; 0x32 35f84: 89 ab std Y+49, r24 ; 0x31 35f86: 40 96 adiw r24, 0x10 ; 16 35f88: 6e 96 adiw r28, 0x1e ; 30 35f8a: 9f af std Y+63, r25 ; 0x3f 35f8c: 8e af std Y+62, r24 ; 0x3e 35f8e: 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]) 35f90: 68 96 adiw r28, 0x18 ; 24 35f92: 5f af std Y+63, r21 ; 0x3f 35f94: 4e af std Y+62, r20 ; 0x3e 35f96: 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 35f98: 19 a6 std Y+41, r1 ; 0x29 35f9a: 1d a6 std Y+45, r1 ; 0x2d 35f9c: 00 e8 ldi r16, 0x80 ; 128 35f9e: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 35fa0: 6c 96 adiw r28, 0x1c ; 28 35fa2: ae ad ldd r26, Y+62 ; 0x3e 35fa4: bf ad ldd r27, Y+63 ; 0x3f 35fa6: 6c 97 sbiw r28, 0x1c ; 28 35fa8: 2d 91 ld r18, X+ 35faa: 3d 91 ld r19, X+ 35fac: 4d 91 ld r20, X+ 35fae: 5d 91 ld r21, X+ 35fb0: 6c 96 adiw r28, 0x1c ; 28 35fb2: bf af std Y+63, r27 ; 0x3f 35fb4: ae af std Y+62, r26 ; 0x3e 35fb6: 6c 97 sbiw r28, 0x1c ; 28 35fb8: c7 01 movw r24, r14 35fba: b6 01 movw r22, r12 35fbc: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 35fc0: 68 96 adiw r28, 0x18 ; 24 35fc2: ee ad ldd r30, Y+62 ; 0x3e 35fc4: ff ad ldd r31, Y+63 ; 0x3f 35fc6: 68 97 sbiw r28, 0x18 ; 24 35fc8: 61 93 st Z+, r22 35fca: 71 93 st Z+, r23 35fcc: 81 93 st Z+, r24 35fce: 91 93 st Z+, r25 35fd0: 68 96 adiw r28, 0x18 ; 24 35fd2: ff af std Y+63, r31 ; 0x3f 35fd4: ee af std Y+62, r30 ; 0x3e 35fd6: 68 97 sbiw r28, 0x18 ; 24 if(fabs(current_speed[i]) > max_feedrate[i]) 35fd8: 4b 01 movw r8, r22 35fda: 5c 01 movw r10, r24 35fdc: e8 94 clt 35fde: b7 f8 bld r11, 7 35fe0: a9 a9 ldd r26, Y+49 ; 0x31 35fe2: ba a9 ldd r27, Y+50 ; 0x32 35fe4: 2d 91 ld r18, X+ 35fe6: 3d 91 ld r19, X+ 35fe8: 4d 91 ld r20, X+ 35fea: 5d 91 ld r21, X+ 35fec: ba ab std Y+50, r27 ; 0x32 35fee: a9 ab std Y+49, r26 ; 0x31 35ff0: 66 96 adiw r28, 0x16 ; 22 35ff2: 2c af std Y+60, r18 ; 0x3c 35ff4: 3d af std Y+61, r19 ; 0x3d 35ff6: 4e af std Y+62, r20 ; 0x3e 35ff8: 5f af std Y+63, r21 ; 0x3f 35ffa: 66 97 sbiw r28, 0x16 ; 22 35ffc: c5 01 movw r24, r10 35ffe: b4 01 movw r22, r8 36000: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 36004: 18 16 cp r1, r24 36006: b4 f4 brge .+44 ; 0x36034 { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 36008: a5 01 movw r20, r10 3600a: 94 01 movw r18, r8 3600c: 66 96 adiw r28, 0x16 ; 22 3600e: 6c ad ldd r22, Y+60 ; 0x3c 36010: 7d ad ldd r23, Y+61 ; 0x3d 36012: 8e ad ldd r24, Y+62 ; 0x3e 36014: 9f ad ldd r25, Y+63 ; 0x3f 36016: 66 97 sbiw r28, 0x16 ; 22 36018: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 3601c: 4b 01 movw r8, r22 3601e: 5c 01 movw r10, r24 36020: 29 a5 ldd r18, Y+41 ; 0x29 36022: 3d a5 ldd r19, Y+45 ; 0x2d 36024: a8 01 movw r20, r16 36026: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 3602a: 18 16 cp r1, r24 3602c: 1c f0 brlt .+6 ; 0x36034 3602e: 89 a6 std Y+41, r8 ; 0x29 36030: 9d a6 std Y+45, r9 ; 0x2d 36032: 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++) 36034: 6e 96 adiw r28, 0x1e ; 30 36036: ee ad ldd r30, Y+62 ; 0x3e 36038: ff ad ldd r31, Y+63 ; 0x3f 3603a: 6e 97 sbiw r28, 0x1e ; 30 3603c: 29 a9 ldd r18, Y+49 ; 0x31 3603e: 3a a9 ldd r19, Y+50 ; 0x32 36040: e2 17 cp r30, r18 36042: f3 07 cpc r31, r19 36044: 09 f0 breq .+2 ; 0x36048 36046: ac cf rjmp .-168 ; 0x35fa0 speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 36048: 20 e0 ldi r18, 0x00 ; 0 3604a: 30 e0 ldi r19, 0x00 ; 0 3604c: 40 e8 ldi r20, 0x80 ; 128 3604e: 5f e3 ldi r21, 0x3F ; 63 36050: 69 a5 ldd r22, Y+41 ; 0x29 36052: 7d a5 ldd r23, Y+45 ; 0x2d 36054: c8 01 movw r24, r16 36056: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 3605a: 87 ff sbrs r24, 7 3605c: 50 c0 rjmp .+160 ; 0x360fe 3605e: a0 96 adiw r28, 0x20 ; 32 36060: ae ac ldd r10, Y+62 ; 0x3e 36062: bf ac ldd r11, Y+63 ; 0x3f 36064: a0 97 sbiw r28, 0x20 ; 32 36066: 30 e1 ldi r19, 0x10 ; 16 36068: a3 0e add r10, r19 3606a: b1 1c adc r11, r1 3606c: a0 96 adiw r28, 0x20 ; 32 3606e: ce ac ldd r12, Y+62 ; 0x3e 36070: df ac ldd r13, Y+63 ; 0x3f 36072: a0 97 sbiw r28, 0x20 ; 32 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 36074: d6 01 movw r26, r12 36076: 6d 91 ld r22, X+ 36078: 7d 91 ld r23, X+ 3607a: 8d 91 ld r24, X+ 3607c: 9d 91 ld r25, X+ 3607e: 6d 01 movw r12, r26 36080: 7d 01 movw r14, r26 36082: b4 e0 ldi r27, 0x04 ; 4 36084: eb 1a sub r14, r27 36086: f1 08 sbc r15, r1 36088: 29 a5 ldd r18, Y+41 ; 0x29 3608a: 3d a5 ldd r19, Y+45 ; 0x2d 3608c: a8 01 movw r20, r16 3608e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36092: f7 01 movw r30, r14 36094: 60 83 st Z, r22 36096: 71 83 std Z+1, r23 ; 0x01 36098: 82 83 std Z+2, r24 ; 0x02 3609a: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 3609c: ac 14 cp r10, r12 3609e: bd 04 cpc r11, r13 360a0: 49 f7 brne .-46 ; 0x36074 { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 360a2: 2e e6 ldi r18, 0x6E ; 110 360a4: 22 9d mul r18, r2 360a6: c0 01 movw r24, r0 360a8: 23 9d mul r18, r3 360aa: 90 0d add r25, r0 360ac: 11 24 eor r1, r1 360ae: 9c 01 movw r18, r24 360b0: 2a 58 subi r18, 0x8A ; 138 360b2: 38 4f sbci r19, 0xF8 ; 248 360b4: 79 01 movw r14, r18 360b6: 29 a5 ldd r18, Y+41 ; 0x29 360b8: 3d a5 ldd r19, Y+45 ; 0x2d 360ba: a8 01 movw r20, r16 360bc: 6d a9 ldd r22, Y+53 ; 0x35 360be: 7e a9 ldd r23, Y+54 ; 0x36 360c0: 8f a9 ldd r24, Y+55 ; 0x37 360c2: 98 ad ldd r25, Y+56 ; 0x38 360c4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 360c8: d7 01 movw r26, r14 360ca: 91 96 adiw r26, 0x21 ; 33 360cc: 6d 93 st X+, r22 360ce: 7d 93 st X+, r23 360d0: 8d 93 st X+, r24 360d2: 9c 93 st X, r25 360d4: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 360d6: 62 96 adiw r28, 0x12 ; 18 360d8: 6c ad ldd r22, Y+60 ; 0x3c 360da: 7d ad ldd r23, Y+61 ; 0x3d 360dc: 8e ad ldd r24, Y+62 ; 0x3e 360de: 9f ad ldd r25, Y+63 ; 0x3f 360e0: 62 97 sbiw r28, 0x12 ; 18 360e2: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 360e6: 29 a5 ldd r18, Y+41 ; 0x29 360e8: 3d a5 ldd r19, Y+45 ; 0x2d 360ea: a8 01 movw r20, r16 360ec: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 360f0: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 360f4: f7 01 movw r30, r14 360f6: 66 ab std Z+54, r22 ; 0x36 360f8: 77 ab std Z+55, r23 ; 0x37 360fa: 80 af std Z+56, r24 ; 0x38 360fc: 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; 360fe: a3 01 movw r20, r6 36100: 92 01 movw r18, r4 36102: 69 ad ldd r22, Y+57 ; 0x39 36104: 7a ad ldd r23, Y+58 ; 0x3a 36106: 8b ad ldd r24, Y+59 ; 0x3b 36108: 9c ad ldd r25, Y+60 ; 0x3c 3610a: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 3610e: 69 a7 std Y+41, r22 ; 0x29 36110: 7a a7 std Y+42, r23 ; 0x2a 36112: 8b a7 std Y+43, r24 ; 0x2b 36114: 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) 36116: 2e 96 adiw r28, 0x0e ; 14 36118: 2c ad ldd r18, Y+60 ; 0x3c 3611a: 3d ad ldd r19, Y+61 ; 0x3d 3611c: 4e ad ldd r20, Y+62 ; 0x3e 3611e: 5f ad ldd r21, Y+63 ; 0x3f 36120: 2e 97 sbiw r28, 0x0e ; 14 36122: 23 2b or r18, r19 36124: 24 2b or r18, r20 36126: 25 2b or r18, r21 36128: 09 f0 breq .+2 ; 0x3612c 3612a: b9 c5 rjmp .+2930 ; 0x36c9e 3612c: 8e e6 ldi r24, 0x6E ; 110 3612e: 82 9d mul r24, r2 36130: 80 01 movw r16, r0 36132: 83 9d mul r24, r3 36134: 10 0d add r17, r0 36136: 11 24 eor r1, r1 36138: 0a 58 subi r16, 0x8A ; 138 3613a: 18 4f sbci r17, 0xF8 ; 248 3613c: f8 01 movw r30, r16 3613e: 84 81 ldd r24, Z+4 ; 0x04 36140: 95 81 ldd r25, Z+5 ; 0x05 36142: a6 81 ldd r26, Z+6 ; 0x06 36144: b7 81 ldd r27, Z+7 ; 0x07 36146: 89 2b or r24, r25 36148: 8a 2b or r24, r26 3614a: 8b 2b or r24, r27 3614c: 09 f0 breq .+2 ; 0x36150 3614e: a7 c5 rjmp .+2894 ; 0x36c9e 36150: 80 85 ldd r24, Z+8 ; 0x08 36152: 91 85 ldd r25, Z+9 ; 0x09 36154: a2 85 ldd r26, Z+10 ; 0x0a 36156: b3 85 ldd r27, Z+11 ; 0x0b 36158: 89 2b or r24, r25 3615a: 8a 2b or r24, r26 3615c: 8b 2b or r24, r27 3615e: 09 f0 breq .+2 ; 0x36162 36160: 9e c5 rjmp .+2876 ; 0x36c9e { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 36162: 20 91 a6 06 lds r18, 0x06A6 ; 0x8006a6 36166: 30 91 a7 06 lds r19, 0x06A7 ; 0x8006a7 3616a: 40 91 a8 06 lds r20, 0x06A8 ; 0x8006a8 3616e: 50 91 a9 06 lds r21, 0x06A9 ; 0x8006a9 36172: 69 a5 ldd r22, Y+41 ; 0x29 36174: 7a a5 ldd r23, Y+42 ; 0x2a 36176: 8b a5 ldd r24, Y+43 ; 0x2b 36178: 9c a5 ldd r25, Y+44 ; 0x2c 3617a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3617e: 0f 94 61 df call 0x3bec2 ; 0x3bec2 36182: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 36186: 2b 01 movw r4, r22 36188: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 3618a: f8 01 movw r30, r16 3618c: e4 5b subi r30, 0xB4 ; 180 3618e: ff 4f sbci r31, 0xFF ; 255 36190: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 36192: 6a 96 adiw r28, 0x1a ; 26 36194: 1c ae std Y+60, r1 ; 0x3c 36196: 1d ae std Y+61, r1 ; 0x3d 36198: 1e ae std Y+62, r1 ; 0x3e 3619a: 1f ae std Y+63, r1 ; 0x3f 3619c: 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; 3619e: 8e e6 ldi r24, 0x6E ; 110 361a0: 82 9d mul r24, r2 361a2: 80 01 movw r16, r0 361a4: 83 9d mul r24, r3 361a6: 10 0d add r17, r0 361a8: 11 24 eor r1, r1 361aa: 0a 58 subi r16, 0x8A ; 138 361ac: 18 4f sbci r17, 0xF8 ; 248 361ae: f8 01 movw r30, r16 361b0: ee 5b subi r30, 0xBE ; 190 361b2: ff 4f sbci r31, 0xFF ; 255 361b4: 40 82 st Z, r4 361b6: 51 82 std Z+1, r5 ; 0x01 361b8: 62 82 std Z+2, r6 ; 0x02 361ba: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 361bc: c3 01 movw r24, r6 361be: b2 01 movw r22, r4 361c0: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 361c4: 6b 01 movw r12, r22 361c6: 7c 01 movw r14, r24 361c8: 29 a5 ldd r18, Y+41 ; 0x29 361ca: 3a a5 ldd r19, Y+42 ; 0x2a 361cc: 4b a5 ldd r20, Y+43 ; 0x2b 361ce: 5c a5 ldd r21, Y+44 ; 0x2c 361d0: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 361d4: e2 96 adiw r28, 0x32 ; 50 361d6: 6c af std Y+60, r22 ; 0x3c 361d8: 7d af std Y+61, r23 ; 0x3d 361da: 8e af std Y+62, r24 ; 0x3e 361dc: 9f af std Y+63, r25 ; 0x3f 361de: e2 97 sbiw r28, 0x32 ; 50 361e0: f8 01 movw r30, r16 361e2: 61 ab std Z+49, r22 ; 0x31 361e4: 72 ab std Z+50, r23 ; 0x32 361e6: 83 ab std Z+51, r24 ; 0x33 361e8: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 361ea: 2d eb ldi r18, 0xBD ; 189 361ec: 37 e3 ldi r19, 0x37 ; 55 361ee: 46 e0 ldi r20, 0x06 ; 6 361f0: 51 e4 ldi r21, 0x41 ; 65 361f2: c7 01 movw r24, r14 361f4: b6 01 movw r22, r12 361f6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 361fa: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 361fe: d8 01 movw r26, r16 36200: 54 96 adiw r26, 0x14 ; 20 36202: 6d 93 st X+, r22 36204: 7d 93 st X+, r23 36206: 8d 93 st X+, r24 36208: 9c 93 st X, r25 3620a: 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; 3620c: 91 96 adiw r26, 0x21 ; 33 3620e: bc 91 ld r27, X 36210: 27 96 adiw r28, 0x07 ; 7 36212: bf af std Y+63, r27 ; 0x3f 36214: 27 97 sbiw r28, 0x07 ; 7 36216: f8 01 movw r30, r16 36218: f2 a1 ldd r31, Z+34 ; 0x22 3621a: 2b 96 adiw r28, 0x0b ; 11 3621c: ff af std Y+63, r31 ; 0x3f 3621e: 2b 97 sbiw r28, 0x0b ; 11 36220: d8 01 movw r26, r16 36222: 93 96 adiw r26, 0x23 ; 35 36224: bc 91 ld r27, X 36226: 2f 96 adiw r28, 0x0f ; 15 36228: bf af std Y+63, r27 ; 0x3f 3622a: 2f 97 sbiw r28, 0x0f ; 15 3622c: f8 01 movw r30, r16 3622e: f4 a1 ldd r31, Z+36 ; 0x24 36230: 63 96 adiw r28, 0x13 ; 19 36232: ff af std Y+63, r31 ; 0x3f 36234: 63 97 sbiw r28, 0x13 ; 19 36236: 26 eb ldi r18, 0xB6 ; 182 36238: 36 e0 ldi r19, 0x06 ; 6 3623a: ee 96 adiw r28, 0x3e ; 62 3623c: 3f af std Y+63, r19 ; 0x3f 3623e: 2e af std Y+62, r18 ; 0x3e 36240: ee 97 sbiw r28, 0x3e ; 62 36242: a0 96 adiw r28, 0x20 ; 32 36244: 4e ac ldd r4, Y+62 ; 0x3e 36246: 5f ac ldd r5, Y+63 ; 0x3f 36248: a0 97 sbiw r28, 0x20 ; 32 3624a: 30 e1 ldi r19, 0x10 ; 16 3624c: 43 0e add r4, r19 3624e: 51 1c adc r5, r1 36250: 06 eb ldi r16, 0xB6 ; 182 36252: 16 e0 ldi r17, 0x06 ; 6 36254: a0 96 adiw r28, 0x20 ; 32 36256: 6e ac ldd r6, Y+62 ; 0x3e 36258: 7f ac ldd r7, Y+63 ; 0x3f 3625a: a0 97 sbiw r28, 0x20 ; 32 3625c: 27 96 adiw r28, 0x07 ; 7 3625e: 4f ad ldd r20, Y+63 ; 0x3f 36260: 27 97 sbiw r28, 0x07 ; 7 36262: 49 a7 std Y+41, r20 ; 0x29 36264: 2b 96 adiw r28, 0x0b ; 11 36266: 5f ad ldd r21, Y+63 ; 0x3f 36268: 2b 97 sbiw r28, 0x0b ; 11 3626a: 5d a7 std Y+45, r21 ; 0x2d 3626c: b9 ab std Y+49, r27 ; 0x31 3626e: f9 af std Y+57, r31 ; 0x39 bool limited = false; 36270: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 36272: d3 01 movw r26, r6 36274: 8d 90 ld r8, X+ 36276: 9d 90 ld r9, X+ 36278: ad 90 ld r10, X+ 3627a: bd 90 ld r11, X+ 3627c: 3d 01 movw r6, r26 3627e: e8 94 clt 36280: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 36282: f8 01 movw r30, r16 36284: c1 90 ld r12, Z+ 36286: d1 90 ld r13, Z+ 36288: e1 90 ld r14, Z+ 3628a: f1 90 ld r15, Z+ 3628c: 8f 01 movw r16, r30 3628e: a5 01 movw r20, r10 36290: 94 01 movw r18, r8 36292: c7 01 movw r24, r14 36294: b6 01 movw r22, r12 36296: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 3629a: 87 ff sbrs r24, 7 3629c: 3a c0 rjmp .+116 ; 0x36312 // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 3629e: fd a9 ldd r31, Y+53 ; 0x35 362a0: ff 23 and r31, r31 362a2: 09 f4 brne .+2 ; 0x362a6 362a4: 7e c6 rjmp .+3324 ; 0x36fa2 // 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; 362a6: 29 a5 ldd r18, Y+41 ; 0x29 362a8: 3d a5 ldd r19, Y+45 ; 0x2d 362aa: 49 a9 ldd r20, Y+49 ; 0x31 362ac: 59 ad ldd r21, Y+57 ; 0x39 362ae: c5 01 movw r24, r10 362b0: b4 01 movw r22, r8 362b2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 362b6: 4b 01 movw r8, r22 362b8: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 362ba: a7 01 movw r20, r14 362bc: 96 01 movw r18, r12 362be: 27 96 adiw r28, 0x07 ; 7 362c0: 6f ad ldd r22, Y+63 ; 0x3f 362c2: 27 97 sbiw r28, 0x07 ; 7 362c4: 2b 96 adiw r28, 0x0b ; 11 362c6: 7f ad ldd r23, Y+63 ; 0x3f 362c8: 2b 97 sbiw r28, 0x0b ; 11 362ca: 2f 96 adiw r28, 0x0f ; 15 362cc: 8f ad ldd r24, Y+63 ; 0x3f 362ce: 2f 97 sbiw r28, 0x0f ; 15 362d0: 63 96 adiw r28, 0x13 ; 19 362d2: 9f ad ldd r25, Y+63 ; 0x3f 362d4: 63 97 sbiw r28, 0x13 ; 19 362d6: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 362da: 6b 01 movw r12, r22 362dc: 7c 01 movw r14, r24 if (jerk > mjerk) { 362de: ac 01 movw r20, r24 362e0: 9b 01 movw r18, r22 362e2: c5 01 movw r24, r10 362e4: b4 01 movw r22, r8 362e6: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 362ea: 18 16 cp r1, r24 362ec: 94 f4 brge .+36 ; 0x36312 safe_speed *= mjerk / jerk; 362ee: a5 01 movw r20, r10 362f0: 94 01 movw r18, r8 362f2: c7 01 movw r24, r14 362f4: b6 01 movw r22, r12 362f6: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 362fa: 9b 01 movw r18, r22 362fc: ac 01 movw r20, r24 362fe: 69 a5 ldd r22, Y+41 ; 0x29 36300: 7d a5 ldd r23, Y+45 ; 0x2d 36302: 89 a9 ldd r24, Y+49 ; 0x31 36304: 99 ad ldd r25, Y+57 ; 0x39 36306: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3630a: 69 a7 std Y+41, r22 ; 0x29 3630c: 7d a7 std Y+45, r23 ; 0x2d 3630e: 89 ab std Y+49, r24 ; 0x31 36310: 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) { 36312: 46 14 cp r4, r6 36314: 57 04 cpc r5, r7 36316: 09 f0 breq .+2 ; 0x3631a 36318: ac cf rjmp .-168 ; 0x36272 } } } // Reset the block flag. block->flag = 0; 3631a: 8e e6 ldi r24, 0x6E ; 110 3631c: 82 9d mul r24, r2 3631e: f0 01 movw r30, r0 36320: 83 9d mul r24, r3 36322: f0 0d add r31, r0 36324: 11 24 eor r1, r1 36326: ea 58 subi r30, 0x8A ; 138 36328: f8 4f sbci r31, 0xF8 ; 248 3632a: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 3632c: 80 91 ba 04 lds r24, 0x04BA ; 0x8004ba <_ZL23plan_reset_next_e_sched.lto_priv.504> 36330: 88 23 and r24, r24 36332: 21 f0 breq .+8 ; 0x3633c { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 36334: 80 e1 ldi r24, 0x10 ; 16 36336: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 36338: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL23plan_reset_next_e_sched.lto_priv.504> 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) { 3633c: 3d ad ldd r19, Y+61 ; 0x3d 3633e: 32 30 cpi r19, 0x02 ; 2 36340: 08 f4 brcc .+2 ; 0x36344 36342: 8f c6 rjmp .+3358 ; 0x37062 36344: 40 91 bc 04 lds r20, 0x04BC ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.505> 36348: 6b 96 adiw r28, 0x1b ; 27 3634a: 4f af std Y+63, r20 ; 0x3f 3634c: 6b 97 sbiw r28, 0x1b ; 27 3634e: 50 91 bd 04 lds r21, 0x04BD ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.505+0x1> 36352: 6d 96 adiw r28, 0x1d ; 29 36354: 5f af std Y+63, r21 ; 0x3f 36356: 6d 97 sbiw r28, 0x1d ; 29 36358: 00 91 be 04 lds r16, 0x04BE ; 0x8004be <_ZL22previous_nominal_speed.lto_priv.505+0x2> 3635c: 10 91 bf 04 lds r17, 0x04BF ; 0x8004bf <_ZL22previous_nominal_speed.lto_priv.505+0x3> 36360: 27 e1 ldi r18, 0x17 ; 23 36362: 37 eb ldi r19, 0xB7 ; 183 36364: 41 ed ldi r20, 0xD1 ; 209 36366: 58 e3 ldi r21, 0x38 ; 56 36368: 6b 96 adiw r28, 0x1b ; 27 3636a: 6f ad ldd r22, Y+63 ; 0x3f 3636c: 6b 97 sbiw r28, 0x1b ; 27 3636e: 6d 96 adiw r28, 0x1d ; 29 36370: 7f ad ldd r23, Y+63 ; 0x3f 36372: 6d 97 sbiw r28, 0x1d ; 29 36374: c8 01 movw r24, r16 36376: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 3637a: 18 16 cp r1, r24 3637c: 0c f0 brlt .+2 ; 0x36380 3637e: 71 c6 rjmp .+3298 ; 0x37062 // 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); 36380: 6b 96 adiw r28, 0x1b ; 27 36382: 2f ad ldd r18, Y+63 ; 0x3f 36384: 6b 97 sbiw r28, 0x1b ; 27 36386: 6d 96 adiw r28, 0x1d ; 29 36388: 3f ad ldd r19, Y+63 ; 0x3f 3638a: 6d 97 sbiw r28, 0x1d ; 29 3638c: a8 01 movw r20, r16 3638e: 27 96 adiw r28, 0x07 ; 7 36390: 6f ad ldd r22, Y+63 ; 0x3f 36392: 27 97 sbiw r28, 0x07 ; 7 36394: 2b 96 adiw r28, 0x0b ; 11 36396: 7f ad ldd r23, Y+63 ; 0x3f 36398: 2b 97 sbiw r28, 0x0b ; 11 3639a: 2f 96 adiw r28, 0x0f ; 15 3639c: 8f ad ldd r24, Y+63 ; 0x3f 3639e: 2f 97 sbiw r28, 0x0f ; 15 363a0: 63 96 adiw r28, 0x13 ; 19 363a2: 9f ad ldd r25, Y+63 ; 0x3f 363a4: 63 97 sbiw r28, 0x13 ; 19 363a6: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 363aa: 87 ff sbrs r24, 7 363ac: 01 c6 rjmp .+3074 ; 0x36fb0 363ae: 6b 96 adiw r28, 0x1b ; 27 363b0: 2f ad ldd r18, Y+63 ; 0x3f 363b2: 6b 97 sbiw r28, 0x1b ; 27 363b4: 6d 96 adiw r28, 0x1d ; 29 363b6: 3f ad ldd r19, Y+63 ; 0x3f 363b8: 6d 97 sbiw r28, 0x1d ; 29 363ba: a8 01 movw r20, r16 363bc: 27 96 adiw r28, 0x07 ; 7 363be: 6f ad ldd r22, Y+63 ; 0x3f 363c0: 27 97 sbiw r28, 0x07 ; 7 363c2: 2b 96 adiw r28, 0x0b ; 11 363c4: 7f ad ldd r23, Y+63 ; 0x3f 363c6: 2b 97 sbiw r28, 0x0b ; 11 363c8: 2f 96 adiw r28, 0x0f ; 15 363ca: 8f ad ldd r24, Y+63 ; 0x3f 363cc: 2f 97 sbiw r28, 0x0f ; 15 363ce: 63 96 adiw r28, 0x13 ; 19 363d0: 9f ad ldd r25, Y+63 ; 0x3f 363d2: 63 97 sbiw r28, 0x13 ; 19 363d4: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 363d8: ec 96 adiw r28, 0x3c ; 60 363da: 6c af std Y+60, r22 ; 0x3c 363dc: 7d af std Y+61, r23 ; 0x3d 363de: 8e af std Y+62, r24 ; 0x3e 363e0: 9f af std Y+63, r25 ; 0x3f 363e2: 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; 363e4: 27 96 adiw r28, 0x07 ; 7 363e6: 8f ad ldd r24, Y+63 ; 0x3f 363e8: 27 97 sbiw r28, 0x07 ; 7 363ea: 8d af std Y+61, r24 ; 0x3d 363ec: 2b 96 adiw r28, 0x0b ; 11 363ee: 9f ad ldd r25, Y+63 ; 0x3f 363f0: 2b 97 sbiw r28, 0x0b ; 11 363f2: 9d ab std Y+53, r25 ; 0x35 363f4: 2f 96 adiw r28, 0x0f ; 15 363f6: af ad ldd r26, Y+63 ; 0x3f 363f8: 2f 97 sbiw r28, 0x0f ; 15 363fa: ae af std Y+62, r26 ; 0x3e 363fc: 63 96 adiw r28, 0x13 ; 19 363fe: bf ad ldd r27, Y+63 ; 0x3f 36400: 63 97 sbiw r28, 0x13 ; 19 36402: 23 96 adiw r28, 0x03 ; 3 36404: bf af std Y+63, r27 ; 0x3f 36406: 23 97 sbiw r28, 0x03 ; 3 36408: 20 ec ldi r18, 0xC0 ; 192 3640a: 34 e0 ldi r19, 0x04 ; 4 3640c: e8 96 adiw r28, 0x38 ; 56 3640e: 3f af std Y+63, r19 ; 0x3f 36410: 2e af std Y+62, r18 ; 0x3e 36412: e8 97 sbiw r28, 0x38 ; 56 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 36414: 41 2c mov r4, r1 36416: 51 2c mov r5, r1 36418: 30 e8 ldi r19, 0x80 ; 128 3641a: 63 2e mov r6, r19 3641c: 3f e3 ldi r19, 0x3F ; 63 3641e: 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]; 36420: e8 96 adiw r28, 0x38 ; 56 36422: ae ad ldd r26, Y+62 ; 0x3e 36424: bf ad ldd r27, Y+63 ; 0x3f 36426: e8 97 sbiw r28, 0x38 ; 56 36428: 8d 90 ld r8, X+ 3642a: 9d 90 ld r9, X+ 3642c: ad 90 ld r10, X+ 3642e: bd 90 ld r11, X+ 36430: e8 96 adiw r28, 0x38 ; 56 36432: bf af std Y+63, r27 ; 0x3f 36434: ae af std Y+62, r26 ; 0x3e 36436: e8 97 sbiw r28, 0x38 ; 56 float v_entry = current_speed [axis]; 36438: a0 96 adiw r28, 0x20 ; 32 3643a: ee ad ldd r30, Y+62 ; 0x3e 3643c: ff ad ldd r31, Y+63 ; 0x3f 3643e: a0 97 sbiw r28, 0x20 ; 32 36440: c1 90 ld r12, Z+ 36442: d1 90 ld r13, Z+ 36444: e1 90 ld r14, Z+ 36446: f1 90 ld r15, Z+ 36448: a0 96 adiw r28, 0x20 ; 32 3644a: ff af std Y+63, r31 ; 0x3f 3644c: ee af std Y+62, r30 ; 0x3e 3644e: a0 97 sbiw r28, 0x20 ; 32 if (prev_speed_larger) 36450: 6b 96 adiw r28, 0x1b ; 27 36452: 2f ad ldd r18, Y+63 ; 0x3f 36454: 6b 97 sbiw r28, 0x1b ; 27 36456: 6d 96 adiw r28, 0x1d ; 29 36458: 3f ad ldd r19, Y+63 ; 0x3f 3645a: 6d 97 sbiw r28, 0x1d ; 29 3645c: a8 01 movw r20, r16 3645e: 27 96 adiw r28, 0x07 ; 7 36460: 6f ad ldd r22, Y+63 ; 0x3f 36462: 27 97 sbiw r28, 0x07 ; 7 36464: 2b 96 adiw r28, 0x0b ; 11 36466: 7f ad ldd r23, Y+63 ; 0x3f 36468: 2b 97 sbiw r28, 0x0b ; 11 3646a: 2f 96 adiw r28, 0x0f ; 15 3646c: 8f ad ldd r24, Y+63 ; 0x3f 3646e: 2f 97 sbiw r28, 0x0f ; 15 36470: 63 96 adiw r28, 0x13 ; 19 36472: 9f ad ldd r25, Y+63 ; 0x3f 36474: 63 97 sbiw r28, 0x13 ; 19 36476: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 3647a: 87 ff sbrs r24, 7 3647c: 0c c0 rjmp .+24 ; 0x36496 v_exit *= smaller_speed_factor; 3647e: ec 96 adiw r28, 0x3c ; 60 36480: 2c ad ldd r18, Y+60 ; 0x3c 36482: 3d ad ldd r19, Y+61 ; 0x3d 36484: 4e ad ldd r20, Y+62 ; 0x3e 36486: 5f ad ldd r21, Y+63 ; 0x3f 36488: ec 97 sbiw r28, 0x3c ; 60 3648a: c5 01 movw r24, r10 3648c: b4 01 movw r22, r8 3648e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36492: 4b 01 movw r8, r22 36494: 5c 01 movw r10, r24 if (limited) { 36496: a2 96 adiw r28, 0x22 ; 34 36498: ff ad ldd r31, Y+63 ; 0x3f 3649a: a2 97 sbiw r28, 0x22 ; 34 3649c: ff 23 and r31, r31 3649e: 81 f0 breq .+32 ; 0x364c0 v_exit *= v_factor; 364a0: a3 01 movw r20, r6 364a2: 92 01 movw r18, r4 364a4: c5 01 movw r24, r10 364a6: b4 01 movw r22, r8 364a8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 364ac: 4b 01 movw r8, r22 364ae: 5c 01 movw r10, r24 v_entry *= v_factor; 364b0: a3 01 movw r20, r6 364b2: 92 01 movw r18, r4 364b4: c7 01 movw r24, r14 364b6: b6 01 movw r22, r12 364b8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 364bc: 6b 01 movw r12, r22 364be: 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) ? 364c0: a7 01 movw r20, r14 364c2: 96 01 movw r18, r12 364c4: c5 01 movw r24, r10 364c6: b4 01 movw r22, r8 364c8: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 364cc: 20 e0 ldi r18, 0x00 ; 0 364ce: 30 e0 ldi r19, 0x00 ; 0 364d0: 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) ? 364d2: 18 16 cp r1, r24 364d4: 0c f0 brlt .+2 ; 0x364d8 364d6: a3 c5 rjmp .+2886 ; 0x3701e ((v_entry > 0.f || v_exit < 0.f) ? 364d8: c7 01 movw r24, r14 364da: b6 01 movw r22, r12 364dc: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 364e0: 18 16 cp r1, r24 364e2: 4c f0 brlt .+18 ; 0x364f6 364e4: 20 e0 ldi r18, 0x00 ; 0 364e6: 30 e0 ldi r19, 0x00 ; 0 364e8: a9 01 movw r20, r18 364ea: c5 01 movw r24, r10 364ec: b4 01 movw r22, r8 364ee: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 364f2: 87 ff sbrs r24, 7 364f4: 85 c5 rjmp .+2826 ; 0x37000 364f6: a7 01 movw r20, r14 364f8: 96 01 movw r18, r12 364fa: c5 01 movw r24, r10 364fc: 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) ? 364fe: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 36502: 6b 01 movw r12, r22 36504: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 36506: ee 96 adiw r28, 0x3e ; 62 36508: ae ad ldd r26, Y+62 ; 0x3e 3650a: bf ad ldd r27, Y+63 ; 0x3f 3650c: ee 97 sbiw r28, 0x3e ; 62 3650e: 8d 90 ld r8, X+ 36510: 9d 90 ld r9, X+ 36512: ad 90 ld r10, X+ 36514: bd 90 ld r11, X+ 36516: ee 96 adiw r28, 0x3e ; 62 36518: bf af std Y+63, r27 ; 0x3f 3651a: ae af std Y+62, r26 ; 0x3e 3651c: ee 97 sbiw r28, 0x3e ; 62 3651e: a5 01 movw r20, r10 36520: 94 01 movw r18, r8 36522: c7 01 movw r24, r14 36524: b6 01 movw r22, r12 36526: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 3652a: 18 16 cp r1, r24 3652c: 94 f4 brge .+36 ; 0x36552 v_factor *= cs.max_jerk[axis] / jerk; 3652e: a7 01 movw r20, r14 36530: 96 01 movw r18, r12 36532: c5 01 movw r24, r10 36534: b4 01 movw r22, r8 36536: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 3653a: 9b 01 movw r18, r22 3653c: ac 01 movw r20, r24 3653e: c3 01 movw r24, r6 36540: b2 01 movw r22, r4 36542: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36546: 2b 01 movw r4, r22 36548: 3c 01 movw r6, r24 limited = true; 3654a: b1 e0 ldi r27, 0x01 ; 1 3654c: a2 96 adiw r28, 0x22 ; 34 3654e: bf af std Y+63, r27 ; 0x3f 36550: 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) { 36552: e0 ed ldi r30, 0xD0 ; 208 36554: f4 e0 ldi r31, 0x04 ; 4 36556: e8 96 adiw r28, 0x38 ; 56 36558: 2e ad ldd r18, Y+62 ; 0x3e 3655a: 3f ad ldd r19, Y+63 ; 0x3f 3655c: e8 97 sbiw r28, 0x38 ; 56 3655e: e2 17 cp r30, r18 36560: f3 07 cpc r31, r19 36562: 09 f0 breq .+2 ; 0x36566 36564: 5d cf rjmp .-326 ; 0x36420 if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 36566: a2 96 adiw r28, 0x22 ; 34 36568: 3f ad ldd r19, Y+63 ; 0x3f 3656a: a2 97 sbiw r28, 0x22 ; 34 3656c: 33 23 and r19, r19 3656e: 81 f0 breq .+32 ; 0x36590 vmax_junction *= v_factor; 36570: a3 01 movw r20, r6 36572: 92 01 movw r18, r4 36574: 6d ad ldd r22, Y+61 ; 0x3d 36576: 7d a9 ldd r23, Y+53 ; 0x35 36578: 8e ad ldd r24, Y+62 ; 0x3e 3657a: 23 96 adiw r28, 0x03 ; 3 3657c: 9f ad ldd r25, Y+63 ; 0x3f 3657e: 23 97 sbiw r28, 0x03 ; 3 36580: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36584: 6d af std Y+61, r22 ; 0x3d 36586: 7d ab std Y+53, r23 ; 0x35 36588: 8e af std Y+62, r24 ; 0x3e 3658a: 23 96 adiw r28, 0x03 ; 3 3658c: 9f af std Y+63, r25 ; 0x3f 3658e: 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; 36590: 24 ea ldi r18, 0xA4 ; 164 36592: 30 e7 ldi r19, 0x70 ; 112 36594: 4d e7 ldi r20, 0x7D ; 125 36596: 5f e3 ldi r21, 0x3F ; 63 36598: 6d ad ldd r22, Y+61 ; 0x3d 3659a: 7d a9 ldd r23, Y+53 ; 0x35 3659c: 8e ad ldd r24, Y+62 ; 0x3e 3659e: 23 96 adiw r28, 0x03 ; 3 365a0: 9f ad ldd r25, Y+63 ; 0x3f 365a2: 23 97 sbiw r28, 0x03 ; 3 365a4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 365a8: 6b 01 movw r12, r22 365aa: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 365ac: ac 01 movw r20, r24 365ae: 9b 01 movw r18, r22 365b0: 60 91 ec 17 lds r22, 0x17EC ; 0x8017ec 365b4: 70 91 ed 17 lds r23, 0x17ED ; 0x8017ed 365b8: 80 91 ee 17 lds r24, 0x17EE ; 0x8017ee 365bc: 90 91 ef 17 lds r25, 0x17EF ; 0x8017ef 365c0: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 365c4: 18 16 cp r1, r24 365c6: fc f4 brge .+62 ; 0x36606 365c8: 29 a5 ldd r18, Y+41 ; 0x29 365ca: 3d a5 ldd r19, Y+45 ; 0x2d 365cc: 49 a9 ldd r20, Y+49 ; 0x31 365ce: 59 ad ldd r21, Y+57 ; 0x39 365d0: c7 01 movw r24, r14 365d2: b6 01 movw r22, r12 365d4: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 365d8: 87 ff sbrs r24, 7 365da: 15 c0 rjmp .+42 ; 0x36606 // 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; 365dc: 8e e6 ldi r24, 0x6E ; 110 365de: 82 9d mul r24, r2 365e0: f0 01 movw r30, r0 365e2: 83 9d mul r24, r3 365e4: f0 0d add r31, r0 365e6: 11 24 eor r1, r1 365e8: ea 58 subi r30, 0x8A ; 138 365ea: f8 4f sbci r31, 0xF8 ; 248 365ec: 85 a9 ldd r24, Z+53 ; 0x35 365ee: 84 60 ori r24, 0x04 ; 4 365f0: 85 ab std Z+53, r24 ; 0x35 365f2: 49 a5 ldd r20, Y+41 ; 0x29 365f4: 4d af std Y+61, r20 ; 0x3d 365f6: 5d a5 ldd r21, Y+45 ; 0x2d 365f8: 5d ab std Y+53, r21 ; 0x35 365fa: 89 a9 ldd r24, Y+49 ; 0x31 365fc: 8e af std Y+62, r24 ; 0x3e 365fe: 99 ad ldd r25, Y+57 ; 0x39 36600: 23 96 adiw r28, 0x03 ; 3 36602: 9f af std Y+63, r25 ; 0x3f 36604: 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; 36606: 8e e6 ldi r24, 0x6E ; 110 36608: 82 9d mul r24, r2 3660a: 80 01 movw r16, r0 3660c: 83 9d mul r24, r3 3660e: 10 0d add r17, r0 36610: 11 24 eor r1, r1 36612: 0a 58 subi r16, 0x8A ; 138 36614: 18 4f sbci r17, 0xF8 ; 248 36616: 8d ad ldd r24, Y+61 ; 0x3d 36618: 9d a9 ldd r25, Y+53 ; 0x35 3661a: ae ad ldd r26, Y+62 ; 0x3e 3661c: 23 96 adiw r28, 0x03 ; 3 3661e: bf ad ldd r27, Y+63 ; 0x3f 36620: 23 97 sbiw r28, 0x03 ; 3 36622: f8 01 movw r30, r16 36624: 81 a7 std Z+41, r24 ; 0x29 36626: 92 a7 std Z+42, r25 ; 0x2a 36628: a3 a7 std Z+43, r26 ; 0x2b 3662a: 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); 3662c: 29 a5 ldd r18, Y+41 ; 0x29 3662e: 3d a5 ldd r19, Y+45 ; 0x2d 36630: 49 a9 ldd r20, Y+49 ; 0x31 36632: 59 ad ldd r21, Y+57 ; 0x39 36634: 69 a5 ldd r22, Y+41 ; 0x29 36636: 7d a5 ldd r23, Y+45 ; 0x2d 36638: 89 a9 ldd r24, Y+49 ; 0x31 3663a: 99 ad ldd r25, Y+57 ; 0x39 3663c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36640: 6b 01 movw r12, r22 36642: 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); 36644: e2 96 adiw r28, 0x32 ; 50 36646: 6c ad ldd r22, Y+60 ; 0x3c 36648: 7d ad ldd r23, Y+61 ; 0x3d 3664a: 8e ad ldd r24, Y+62 ; 0x3e 3664c: 9f ad ldd r25, Y+63 ; 0x3f 3664e: e2 97 sbiw r28, 0x32 ; 50 36650: 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); 36652: 9b 01 movw r18, r22 36654: ac 01 movw r20, r24 36656: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3665a: d8 01 movw r26, r16 3665c: 9d 96 adiw r26, 0x2d ; 45 3665e: 2d 91 ld r18, X+ 36660: 3d 91 ld r19, X+ 36662: 4d 91 ld r20, X+ 36664: 5c 91 ld r21, X 36666: d0 97 sbiw r26, 0x30 ; 48 36668: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3666c: 9b 01 movw r18, r22 3666e: ac 01 movw r20, r24 36670: c7 01 movw r24, r14 36672: b6 01 movw r22, r12 36674: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 36678: 0f 94 51 e2 call 0x3c4a2 ; 0x3c4a2 3667c: d6 2e mov r13, r22 3667e: e7 2e mov r14, r23 36680: 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); 36682: 2d ad ldd r18, Y+61 ; 0x3d 36684: 3d a9 ldd r19, Y+53 ; 0x35 36686: 4e ad ldd r20, Y+62 ; 0x3e 36688: 23 96 adiw r28, 0x03 ; 3 3668a: 5f ad ldd r21, Y+63 ; 0x3f 3668c: 23 97 sbiw r28, 0x03 ; 3 3668e: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 36692: 18 16 cp r1, r24 36694: 34 f0 brlt .+12 ; 0x366a2 36696: dd ae std Y+61, r13 ; 0x3d 36698: ed aa std Y+53, r14 ; 0x35 3669a: 0e af std Y+62, r16 ; 0x3e 3669c: 23 96 adiw r28, 0x03 ; 3 3669e: 1f af std Y+63, r17 ; 0x3f 366a0: 23 97 sbiw r28, 0x03 ; 3 366a2: 8e e6 ldi r24, 0x6E ; 110 366a4: 82 9d mul r24, r2 366a6: f0 01 movw r30, r0 366a8: 83 9d mul r24, r3 366aa: f0 0d add r31, r0 366ac: 11 24 eor r1, r1 366ae: ea 58 subi r30, 0x8A ; 138 366b0: f8 4f sbci r31, 0xF8 ; 248 366b2: 8d ad ldd r24, Y+61 ; 0x3d 366b4: 9d a9 ldd r25, Y+53 ; 0x35 366b6: ae ad ldd r26, Y+62 ; 0x3e 366b8: 23 96 adiw r28, 0x03 ; 3 366ba: bf ad ldd r27, Y+63 ; 0x3f 366bc: 23 97 sbiw r28, 0x03 ; 3 366be: 85 a3 std Z+37, r24 ; 0x25 366c0: 96 a3 std Z+38, r25 ; 0x26 366c2: a7 a3 std Z+39, r26 ; 0x27 366c4: 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; 366c6: f5 a8 ldd r15, Z+53 ; 0x35 366c8: 2d 2d mov r18, r13 366ca: 3e 2d mov r19, r14 366cc: a8 01 movw r20, r16 366ce: 27 96 adiw r28, 0x07 ; 7 366d0: 6f ad ldd r22, Y+63 ; 0x3f 366d2: 27 97 sbiw r28, 0x07 ; 7 366d4: 2b 96 adiw r28, 0x0b ; 11 366d6: 7f ad ldd r23, Y+63 ; 0x3f 366d8: 2b 97 sbiw r28, 0x0b ; 11 366da: 2f 96 adiw r28, 0x0f ; 15 366dc: 8f ad ldd r24, Y+63 ; 0x3f 366de: 2f 97 sbiw r28, 0x0f ; 15 366e0: 63 96 adiw r28, 0x13 ; 19 366e2: 9f ad ldd r25, Y+63 ; 0x3f 366e4: 63 97 sbiw r28, 0x13 ; 19 366e6: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 366ea: 18 16 cp r1, r24 366ec: 0c f4 brge .+2 ; 0x366f0 366ee: cf c4 rjmp .+2462 ; 0x3708e 366f0: 83 e0 ldi r24, 0x03 ; 3 366f2: 9e e6 ldi r25, 0x6E ; 110 366f4: 92 9d mul r25, r2 366f6: 80 01 movw r16, r0 366f8: 93 9d mul r25, r3 366fa: 10 0d add r17, r0 366fc: 11 24 eor r1, r1 366fe: 0a 58 subi r16, 0x8A ; 138 36700: 18 4f sbci r17, 0xF8 ; 248 36702: f8 2a or r15, r24 36704: f8 01 movw r30, r16 36706: 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[] 36708: 80 e1 ldi r24, 0x10 ; 16 3670a: fe 01 movw r30, r28 3670c: 71 96 adiw r30, 0x11 ; 17 3670e: a0 ec ldi r26, 0xC0 ; 192 36710: b4 e0 ldi r27, 0x04 ; 4 36712: 01 90 ld r0, Z+ 36714: 0d 92 st X+, r0 36716: 8a 95 dec r24 36718: e1 f7 brne .-8 ; 0x36712 previous_nominal_speed = block->nominal_speed; 3671a: 27 96 adiw r28, 0x07 ; 7 3671c: 8f ad ldd r24, Y+63 ; 0x3f 3671e: 27 97 sbiw r28, 0x07 ; 7 36720: 2b 96 adiw r28, 0x0b ; 11 36722: 9f ad ldd r25, Y+63 ; 0x3f 36724: 2b 97 sbiw r28, 0x0b ; 11 36726: 2f 96 adiw r28, 0x0f ; 15 36728: af ad ldd r26, Y+63 ; 0x3f 3672a: 2f 97 sbiw r28, 0x0f ; 15 3672c: 63 96 adiw r28, 0x13 ; 19 3672e: bf ad ldd r27, Y+63 ; 0x3f 36730: 63 97 sbiw r28, 0x13 ; 19 36732: 80 93 bc 04 sts 0x04BC, r24 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.505> 36736: 90 93 bd 04 sts 0x04BD, r25 ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.505+0x1> 3673a: a0 93 be 04 sts 0x04BE, r26 ; 0x8004be <_ZL22previous_nominal_speed.lto_priv.505+0x2> 3673e: b0 93 bf 04 sts 0x04BF, r27 ; 0x8004bf <_ZL22previous_nominal_speed.lto_priv.505+0x3> previous_safe_speed = safe_speed; 36742: 89 a5 ldd r24, Y+41 ; 0x29 36744: 9d a5 ldd r25, Y+45 ; 0x2d 36746: a9 a9 ldd r26, Y+49 ; 0x31 36748: b9 ad ldd r27, Y+57 ; 0x39 3674a: 80 93 ec 17 sts 0x17EC, r24 ; 0x8017ec 3674e: 90 93 ed 17 sts 0x17ED, r25 ; 0x8017ed 36752: a0 93 ee 17 sts 0x17EE, r26 ; 0x8017ee 36756: b0 93 ef 17 sts 0x17EF, r27 ; 0x8017ef // 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; 3675a: d8 01 movw r26, r16 3675c: d6 96 adiw r26, 0x36 ; 54 3675e: 6d 91 ld r22, X+ 36760: 7d 91 ld r23, X+ 36762: 8d 91 ld r24, X+ 36764: 9c 91 ld r25, X 36766: d9 97 sbiw r26, 0x39 ; 57 36768: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 3676c: 27 96 adiw r28, 0x07 ; 7 3676e: 2f ad ldd r18, Y+63 ; 0x3f 36770: 27 97 sbiw r28, 0x07 ; 7 36772: 2b 96 adiw r28, 0x0b ; 11 36774: 3f ad ldd r19, Y+63 ; 0x3f 36776: 2b 97 sbiw r28, 0x0b ; 11 36778: 2f 96 adiw r28, 0x0f ; 15 3677a: 4f ad ldd r20, Y+63 ; 0x3f 3677c: 2f 97 sbiw r28, 0x0f ; 15 3677e: 63 96 adiw r28, 0x13 ; 19 36780: 5f ad ldd r21, Y+63 ; 0x3f 36782: 63 97 sbiw r28, 0x13 ; 19 36784: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 36788: 2b 01 movw r4, r22 3678a: 3c 01 movw r6, r24 3678c: f8 01 movw r30, r16 3678e: e8 5b subi r30, 0xB8 ; 184 36790: ff 4f sbci r31, 0xFF ; 255 36792: 40 82 st Z, r4 36794: 51 82 std Z+1, r5 ; 0x01 36796: 62 82 std Z+2, r6 ; 0x02 36798: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 3679a: 34 96 adiw r30, 0x04 ; 4 3679c: 80 81 ld r24, Z 3679e: 88 23 and r24, r24 367a0: 09 f4 brne .+2 ; 0x367a4 367a2: 89 c0 rjmp .+274 ; 0x368b6 // 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)) 367a4: 20 91 07 18 lds r18, 0x1807 ; 0x801807 367a8: 30 91 08 18 lds r19, 0x1808 ; 0x801808 367ac: 40 91 09 18 lds r20, 0x1809 ; 0x801809 367b0: 50 91 0a 18 lds r21, 0x180A ; 0x80180a 367b4: 6a 96 adiw r28, 0x1a ; 26 367b6: 6c ad ldd r22, Y+60 ; 0x3c 367b8: 7d ad ldd r23, Y+61 ; 0x3d 367ba: 8e ad ldd r24, Y+62 ; 0x3e 367bc: 9f ad ldd r25, Y+63 ; 0x3f 367be: 6a 97 sbiw r28, 0x1a ; 26 367c0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 367c4: 4b 01 movw r8, r22 367c6: 5c 01 movw r10, r24 367c8: c0 90 7e 06 lds r12, 0x067E ; 0x80067e 367cc: d0 90 7f 06 lds r13, 0x067F ; 0x80067f 367d0: e0 90 80 06 lds r14, 0x0680 ; 0x800680 367d4: f0 90 81 06 lds r15, 0x0681 ; 0x800681 block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 367d8: 0c 5a subi r16, 0xAC ; 172 367da: 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)) 367dc: a7 01 movw r20, r14 367de: 96 01 movw r18, r12 367e0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 367e4: a3 01 movw r20, r6 367e6: 92 01 movw r18, r4 367e8: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 367ec: f8 01 movw r30, r16 367ee: 60 83 st Z, r22 367f0: 71 83 std Z+1, r23 ; 0x01 367f2: 82 83 std Z+2, r24 ; 0x02 367f4: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 367f6: 20 e0 ldi r18, 0x00 ; 0 367f8: 30 e0 ldi r19, 0x00 ; 0 367fa: a9 01 movw r20, r18 367fc: 6a 96 adiw r28, 0x1a ; 26 367fe: 6c ad ldd r22, Y+60 ; 0x3c 36800: 7d ad ldd r23, Y+61 ; 0x3d 36802: 8e ad ldd r24, Y+62 ; 0x3e 36804: 9f ad ldd r25, Y+63 ; 0x3f 36806: 6a 97 sbiw r28, 0x1a ; 26 36808: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 3680c: 18 16 cp r1, r24 3680e: 0c f0 brlt .+2 ; 0x36812 36810: 40 c4 rjmp .+2176 ; 0x37092 advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 36812: a5 01 movw r20, r10 36814: 94 01 movw r18, r8 36816: e2 96 adiw r28, 0x32 ; 50 36818: 6c ad ldd r22, Y+60 ; 0x3c 3681a: 7d ad ldd r23, Y+61 ; 0x3d 3681c: 8e ad ldd r24, Y+62 ; 0x3e 3681e: 9f ad ldd r25, Y+63 ; 0x3f 36820: e2 97 sbiw r28, 0x32 ; 50 36822: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36826: a7 01 movw r20, r14 36828: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 3682a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3682e: 6b 01 movw r12, r22 36830: 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; 36832: 20 e0 ldi r18, 0x00 ; 0 36834: 30 e4 ldi r19, 0x40 ; 64 36836: 4c e1 ldi r20, 0x1C ; 28 36838: 57 e4 ldi r21, 0x47 ; 71 3683a: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 3683e: 18 16 cp r1, r24 36840: 3c f4 brge .+14 ; 0x36850 36842: c1 2c mov r12, r1 36844: 20 e4 ldi r18, 0x40 ; 64 36846: d2 2e mov r13, r18 36848: 2c e1 ldi r18, 0x1C ; 28 3684a: e2 2e mov r14, r18 3684c: 27 e4 ldi r18, 0x47 ; 71 3684e: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 36850: a7 01 movw r20, r14 36852: 96 01 movw r18, r12 36854: 60 e0 ldi r22, 0x00 ; 0 36856: 74 e2 ldi r23, 0x24 ; 36 36858: 84 ef ldi r24, 0xF4 ; 244 3685a: 99 e4 ldi r25, 0x49 ; 73 3685c: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 36860: 4b 01 movw r8, r22 36862: 5c 01 movw r10, r24 if (advance_speed > 20000) { 36864: 20 e0 ldi r18, 0x00 ; 0 36866: 30 e4 ldi r19, 0x40 ; 64 36868: 4c e9 ldi r20, 0x9C ; 156 3686a: 56 e4 ldi r21, 0x46 ; 70 3686c: c7 01 movw r24, r14 3686e: b6 01 movw r22, r12 36870: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 36874: 18 16 cp r1, r24 36876: 0c f0 brlt .+2 ; 0x3687a 36878: 17 c4 rjmp .+2094 ; 0x370a8 block->advance_rate = advance_rate * 4; 3687a: 8e e6 ldi r24, 0x6E ; 110 3687c: 82 9d mul r24, r2 3687e: 80 01 movw r16, r0 36880: 83 9d mul r24, r3 36882: 10 0d add r17, r0 36884: 11 24 eor r1, r1 36886: 0a 58 subi r16, 0x8A ; 138 36888: 18 4f sbci r17, 0xF8 ; 248 3688a: 78 01 movw r14, r16 3688c: fd e4 ldi r31, 0x4D ; 77 3688e: ef 0e add r14, r31 36890: f1 1c adc r15, r1 36892: 20 e0 ldi r18, 0x00 ; 0 36894: 30 e0 ldi r19, 0x00 ; 0 36896: 40 e8 ldi r20, 0x80 ; 128 36898: 50 e4 ldi r21, 0x40 ; 64 3689a: c5 01 movw r24, r10 3689c: b4 01 movw r22, r8 3689e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 368a2: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 368a6: d7 01 movw r26, r14 368a8: 6d 93 st X+, r22 368aa: 7c 93 st X, r23 block->advance_step_loops = 4; 368ac: f8 01 movw r30, r16 368ae: ed 5a subi r30, 0xAD ; 173 368b0: ff 4f sbci r31, 0xFF ; 255 368b2: 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; 368b4: 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); 368b6: 09 a5 ldd r16, Y+41 ; 0x29 368b8: 1d a5 ldd r17, Y+45 ; 0x2d 368ba: 29 a9 ldd r18, Y+49 ; 0x31 368bc: 39 ad ldd r19, Y+57 ; 0x39 368be: 4d ad ldd r20, Y+61 ; 0x3d 368c0: 5d a9 ldd r21, Y+53 ; 0x35 368c2: 6e ad ldd r22, Y+62 ; 0x3e 368c4: 23 96 adiw r28, 0x03 ; 3 368c6: 7f ad ldd r23, Y+63 ; 0x3f 368c8: 23 97 sbiw r28, 0x03 ; 3 368ca: a4 96 adiw r28, 0x24 ; 36 368cc: 8e ad ldd r24, Y+62 ; 0x3e 368ce: 9f ad ldd r25, Y+63 ; 0x3f 368d0: a4 97 sbiw r28, 0x24 ; 36 368d2: 8a 58 subi r24, 0x8A ; 138 368d4: 98 4f sbci r25, 0xF8 ; 248 368d6: 0f 94 4f a1 call 0x3429e ; 0x3429e if (block->step_event_count.wide <= 32767) 368da: 8e e6 ldi r24, 0x6E ; 110 368dc: 82 9d mul r24, r2 368de: f0 01 movw r30, r0 368e0: 83 9d mul r24, r3 368e2: f0 0d add r31, r0 368e4: 11 24 eor r1, r1 368e6: ea 58 subi r30, 0x8A ; 138 368e8: f8 4f sbci r31, 0xF8 ; 248 368ea: 80 89 ldd r24, Z+16 ; 0x10 368ec: 91 89 ldd r25, Z+17 ; 0x11 368ee: a2 89 ldd r26, Z+18 ; 0x12 368f0: b3 89 ldd r27, Z+19 ; 0x13 368f2: 81 15 cp r24, r1 368f4: 90 48 sbci r25, 0x80 ; 128 368f6: a1 05 cpc r26, r1 368f8: b1 05 cpc r27, r1 368fa: 18 f4 brcc .+6 ; 0x36902 block->flag |= BLOCK_FLAG_DDA_LOWRES; 368fc: 85 a9 ldd r24, Z+53 ; 0x35 368fe: 88 60 ori r24, 0x08 ; 8 36900: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 36902: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 36904: 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; 36906: 90 91 5d 0e lds r25, 0x0E5D ; 0x800e5d 3690a: 91 11 cpse r25, r1 3690c: 93 c4 rjmp .+2342 ; 0x37234 block_buffer_head = next_buffer_head; 3690e: a1 96 adiw r28, 0x21 ; 33 36910: 3f ad ldd r19, Y+63 ; 0x3f 36912: a1 97 sbiw r28, 0x21 ; 33 36914: 30 93 56 0e sts 0x0E56, r19 ; 0x800e56 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 36918: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 3691a: c2 58 subi r28, 0x82 ; 130 3691c: df 4f sbci r29, 0xFF ; 255 3691e: 88 81 ld r24, Y 36920: 99 81 ldd r25, Y+1 ; 0x01 36922: aa 81 ldd r26, Y+2 ; 0x02 36924: bb 81 ldd r27, Y+3 ; 0x03 36926: ce 57 subi r28, 0x7E ; 126 36928: d0 40 sbci r29, 0x00 ; 0 3692a: 80 93 54 07 sts 0x0754, r24 ; 0x800754 3692e: 90 93 55 07 sts 0x0755, r25 ; 0x800755 36932: a0 93 56 07 sts 0x0756, r26 ; 0x800756 36936: b0 93 57 07 sts 0x0757, r27 ; 0x800757 3693a: ce 57 subi r28, 0x7E ; 126 3693c: df 4f sbci r29, 0xFF ; 255 3693e: 28 81 ld r18, Y 36940: 39 81 ldd r19, Y+1 ; 0x01 36942: 4a 81 ldd r20, Y+2 ; 0x02 36944: 5b 81 ldd r21, Y+3 ; 0x03 36946: c2 58 subi r28, 0x82 ; 130 36948: d0 40 sbci r29, 0x00 ; 0 3694a: 20 93 58 07 sts 0x0758, r18 ; 0x800758 3694e: 30 93 59 07 sts 0x0759, r19 ; 0x800759 36952: 40 93 5a 07 sts 0x075A, r20 ; 0x80075a 36956: 50 93 5b 07 sts 0x075B, r21 ; 0x80075b 3695a: e6 96 adiw r28, 0x36 ; 54 3695c: 8c ad ldd r24, Y+60 ; 0x3c 3695e: 9d ad ldd r25, Y+61 ; 0x3d 36960: ae ad ldd r26, Y+62 ; 0x3e 36962: bf ad ldd r27, Y+63 ; 0x3f 36964: e6 97 sbiw r28, 0x36 ; 54 36966: 80 93 5c 07 sts 0x075C, r24 ; 0x80075c 3696a: 90 93 5d 07 sts 0x075D, r25 ; 0x80075d 3696e: a0 93 5e 07 sts 0x075E, r26 ; 0x80075e 36972: b0 93 5f 07 sts 0x075F, r27 ; 0x80075f 36976: ae 96 adiw r28, 0x2e ; 46 36978: 2c ad ldd r18, Y+60 ; 0x3c 3697a: 3d ad ldd r19, Y+61 ; 0x3d 3697c: 4e ad ldd r20, Y+62 ; 0x3e 3697e: 5f ad ldd r21, Y+63 ; 0x3f 36980: ae 97 sbiw r28, 0x2e ; 46 36982: 20 93 60 07 sts 0x0760, r18 ; 0x800760 36986: 30 93 61 07 sts 0x0761, r19 ; 0x800761 3698a: 40 93 62 07 sts 0x0762, r20 ; 0x800762 3698e: 50 93 63 07 sts 0x0763, r21 ; 0x800763 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 36992: 89 a1 ldd r24, Y+33 ; 0x21 36994: 9a a1 ldd r25, Y+34 ; 0x22 36996: ab a1 ldd r26, Y+35 ; 0x23 36998: bc a1 ldd r27, Y+36 ; 0x24 3699a: 80 93 d0 04 sts 0x04D0, r24 ; 0x8004d0 3699e: 90 93 d1 04 sts 0x04D1, r25 ; 0x8004d1 369a2: a0 93 d2 04 sts 0x04D2, r26 ; 0x8004d2 369a6: b0 93 d3 04 sts 0x04D3, r27 ; 0x8004d3 position_float[Y_AXIS] = y; 369aa: 8d a1 ldd r24, Y+37 ; 0x25 369ac: 9e a1 ldd r25, Y+38 ; 0x26 369ae: af a1 ldd r26, Y+39 ; 0x27 369b0: b8 a5 ldd r27, Y+40 ; 0x28 369b2: 80 93 d4 04 sts 0x04D4, r24 ; 0x8004d4 369b6: 90 93 d5 04 sts 0x04D5, r25 ; 0x8004d5 369ba: a0 93 d6 04 sts 0x04D6, r26 ; 0x8004d6 369be: b0 93 d7 04 sts 0x04D7, r27 ; 0x8004d7 position_float[Z_AXIS] = z; 369c2: a8 96 adiw r28, 0x28 ; 40 369c4: 8c ad ldd r24, Y+60 ; 0x3c 369c6: 9d ad ldd r25, Y+61 ; 0x3d 369c8: ae ad ldd r26, Y+62 ; 0x3e 369ca: bf ad ldd r27, Y+63 ; 0x3f 369cc: a8 97 sbiw r28, 0x28 ; 40 369ce: 80 93 d8 04 sts 0x04D8, r24 ; 0x8004d8 369d2: 90 93 d9 04 sts 0x04D9, r25 ; 0x8004d9 369d6: a0 93 da 04 sts 0x04DA, r26 ; 0x8004da 369da: b0 93 db 04 sts 0x04DB, r27 ; 0x8004db position_float[E_AXIS] = e; 369de: aa 96 adiw r28, 0x2a ; 42 369e0: ee ad ldd r30, Y+62 ; 0x3e 369e2: ff ad ldd r31, Y+63 ; 0x3f 369e4: aa 97 sbiw r28, 0x2a ; 42 369e6: 80 81 ld r24, Z 369e8: 91 81 ldd r25, Z+1 ; 0x01 369ea: a2 81 ldd r26, Z+2 ; 0x02 369ec: b3 81 ldd r27, Z+3 ; 0x03 369ee: 80 93 dc 04 sts 0x04DC, r24 ; 0x8004dc 369f2: 90 93 dd 04 sts 0x04DD, r25 ; 0x8004dd 369f6: a0 93 de 04 sts 0x04DE, r26 ; 0x8004de 369fa: b0 93 df 04 sts 0x04DF, r27 ; 0x8004df 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; 369fe: f0 90 57 0e lds r15, 0x0E57 ; 0x800e57 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); 36a02: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 36a06: 8f 19 sub r24, r15 36a08: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 36a0a: 83 30 cpi r24, 0x03 ; 3 36a0c: 40 f1 brcs .+80 ; 0x36a5e // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 36a0e: 10 91 56 0e lds r17, 0x0E56 ; 0x800e56 } // 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) 36a12: 11 11 cpse r17, r1 36a14: 01 c0 rjmp .+2 ; 0x36a18 block_index = BLOCK_BUFFER_SIZE; 36a16: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 36a18: 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; 36a1a: fe e6 ldi r31, 0x6E ; 110 36a1c: 1f 9f mul r17, r31 36a1e: c0 01 movw r24, r0 36a20: 11 24 eor r1, r1 36a22: 9c 01 movw r18, r24 36a24: 2a 58 subi r18, 0x8A ; 138 36a26: 38 4f sbci r19, 0xF8 ; 248 36a28: 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) 36a2a: 11 11 cpse r17, r1 36a2c: 01 c0 rjmp .+2 ; 0x36a30 block_index = BLOCK_BUFFER_SIZE; 36a2e: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 36a30: 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)); 36a32: 3e e6 ldi r19, 0x6E ; 110 36a34: 13 9f mul r17, r19 36a36: c0 01 movw r24, r0 36a38: 11 24 eor r1, r1 36a3a: ac 01 movw r20, r24 36a3c: 4a 58 subi r20, 0x8A ; 138 36a3e: 58 4f sbci r21, 0xF8 ; 248 36a40: 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)); 36a42: 9e e6 ldi r25, 0x6E ; 110 36a44: 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) { 36a46: f1 16 cp r15, r17 36a48: 69 f0 breq .+26 ; 0x36a64 if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 36a4a: d6 01 movw r26, r12 36a4c: d5 96 adiw r26, 0x35 ; 53 36a4e: 0c 91 ld r16, X 36a50: 02 ff sbrs r16, 2 36a52: 7e c3 rjmp .+1788 ; 0x37150 // 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); 36a54: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 36a58: 81 1b sub r24, r17 36a5a: 8f 70 andi r24, 0x0F ; 15 36a5c: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 36a5e: 82 30 cpi r24, 0x02 ; 2 36a60: 08 f4 brcc .+2 ; 0x36a64 36a62: a3 c0 rjmp .+326 ; 0x36baa // 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; 36a64: 3e e6 ldi r19, 0x6E ; 110 36a66: f3 9e mul r15, r19 36a68: c0 01 movw r24, r0 36a6a: 11 24 eor r1, r1 36a6c: ac 01 movw r20, r24 36a6e: 4a 58 subi r20, 0x8A ; 138 36a70: 58 4f sbci r21, 0xF8 ; 248 36a72: 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) 36a74: f3 94 inc r15 36a76: 50 e1 ldi r21, 0x10 ; 16 36a78: f5 12 cpse r15, r21 36a7a: 01 c0 rjmp .+2 ; 0x36a7e block_index = 0; 36a7c: 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)); 36a7e: ae e6 ldi r26, 0x6E ; 110 36a80: fa 9e mul r15, r26 36a82: c0 01 movw r24, r0 36a84: 11 24 eor r1, r1 36a86: fc 01 movw r30, r24 36a88: ea 58 subi r30, 0x8A ; 138 36a8a: f8 4f sbci r31, 0xF8 ; 248 36a8c: 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)); 36a8e: 8e e6 ldi r24, 0x6E ; 110 36a90: 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) { 36a92: d5 01 movw r26, r10 36a94: d5 96 adiw r26, 0x35 ; 53 36a96: 8c 91 ld r24, X 36a98: d5 97 sbiw r26, 0x35 ; 53 36a9a: 81 fd sbrc r24, 1 36a9c: 5a c0 rjmp .+180 ; 0x36b52 36a9e: 95 96 adiw r26, 0x25 ; 37 36aa0: 4d 90 ld r4, X+ 36aa2: 5d 90 ld r5, X+ 36aa4: 6d 90 ld r6, X+ 36aa6: 7c 90 ld r7, X 36aa8: 98 97 sbiw r26, 0x28 ; 40 36aaa: f6 01 movw r30, r12 36aac: 95 a0 ldd r9, Z+37 ; 0x25 36aae: e6 a0 ldd r14, Z+38 ; 0x26 36ab0: 07 a1 ldd r16, Z+39 ; 0x27 36ab2: 10 a5 ldd r17, Z+40 ; 0x28 36ab4: 29 2d mov r18, r9 36ab6: 3e 2d mov r19, r14 36ab8: a8 01 movw r20, r16 36aba: c3 01 movw r24, r6 36abc: b2 01 movw r22, r4 36abe: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 36ac2: 87 ff sbrs r24, 7 36ac4: 46 c0 rjmp .+140 ; 0x36b52 // 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); 36ac6: a3 01 movw r20, r6 36ac8: 92 01 movw r18, r4 36aca: c3 01 movw r24, r6 36acc: b2 01 movw r22, r4 36ace: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36ad2: 2b 01 movw r4, r22 36ad4: 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)); 36ad6: d5 01 movw r26, r10 36ad8: d1 96 adiw r26, 0x31 ; 49 36ada: 6d 91 ld r22, X+ 36adc: 7d 91 ld r23, X+ 36ade: 8d 91 ld r24, X+ 36ae0: 9c 91 ld r25, X 36ae2: d4 97 sbiw r26, 0x34 ; 52 36ae4: 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); 36ae6: 9b 01 movw r18, r22 36ae8: ac 01 movw r20, r24 36aea: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 36aee: f5 01 movw r30, r10 36af0: 25 a5 ldd r18, Z+45 ; 0x2d 36af2: 36 a5 ldd r19, Z+46 ; 0x2e 36af4: 47 a5 ldd r20, Z+47 ; 0x2f 36af6: 50 a9 ldd r21, Z+48 ; 0x30 36af8: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36afc: 9b 01 movw r18, r22 36afe: ac 01 movw r20, r24 36b00: c3 01 movw r24, r6 36b02: b2 01 movw r22, r4 36b04: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 36b08: 0f 94 51 e2 call 0x3c4a2 ; 0x3c4a2 36b0c: 2b 01 movw r4, r22 36b0e: 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)); 36b10: 9b 01 movw r18, r22 36b12: ac 01 movw r20, r24 36b14: 69 2d mov r22, r9 36b16: 7e 2d mov r23, r14 36b18: c8 01 movw r24, r16 36b1a: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 36b1e: 87 ff sbrs r24, 7 36b20: 03 c0 rjmp .+6 ; 0x36b28 36b22: 49 2c mov r4, r9 36b24: 5e 2c mov r5, r14 36b26: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 36b28: 92 01 movw r18, r4 36b2a: a3 01 movw r20, r6 36b2c: 69 2d mov r22, r9 36b2e: 7e 2d mov r23, r14 36b30: c8 01 movw r24, r16 36b32: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 36b36: 88 23 and r24, r24 36b38: 61 f0 breq .+24 ; 0x36b52 36b3a: d6 01 movw r26, r12 36b3c: d5 96 adiw r26, 0x35 ; 53 36b3e: 2c 91 ld r18, X current->entry_speed = entry_speed; 36b40: c2 01 movw r24, r4 36b42: d3 01 movw r26, r6 36b44: f6 01 movw r30, r12 36b46: 85 a3 std Z+37, r24 ; 0x25 36b48: 96 a3 std Z+38, r25 ; 0x26 36b4a: a7 a3 std Z+39, r26 ; 0x27 36b4c: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 36b4e: 21 60 ori r18, 0x01 ; 1 36b50: 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) { 36b52: d5 01 movw r26, r10 36b54: d5 96 adiw r26, 0x35 ; 53 36b56: 8c 91 ld r24, X 36b58: d5 97 sbiw r26, 0x35 ; 53 36b5a: f6 01 movw r30, r12 36b5c: 95 a9 ldd r25, Z+53 ; 0x35 36b5e: 89 2b or r24, r25 36b60: 80 ff sbrs r24, 0 36b62: 14 c0 rjmp .+40 ; 0x36b8c // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 36b64: 05 a1 ldd r16, Z+37 ; 0x25 36b66: 16 a1 ldd r17, Z+38 ; 0x26 36b68: 27 a1 ldd r18, Z+39 ; 0x27 36b6a: 30 a5 ldd r19, Z+40 ; 0x28 36b6c: 95 96 adiw r26, 0x25 ; 37 36b6e: 4d 91 ld r20, X+ 36b70: 5d 91 ld r21, X+ 36b72: 6d 91 ld r22, X+ 36b74: 7c 91 ld r23, X 36b76: 98 97 sbiw r26, 0x28 ; 40 36b78: c5 01 movw r24, r10 36b7a: 0f 94 4f a1 call 0x3429e ; 0x3429e // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 36b7e: d5 01 movw r26, r10 36b80: d5 96 adiw r26, 0x35 ; 53 36b82: 8c 91 ld r24, X 36b84: d5 97 sbiw r26, 0x35 ; 53 36b86: 8e 7f andi r24, 0xFE ; 254 36b88: d5 96 adiw r26, 0x35 ; 53 36b8a: 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) 36b8c: f3 94 inc r15 36b8e: b0 e1 ldi r27, 0x10 ; 16 36b90: fb 12 cpse r15, r27 36b92: 01 c0 rjmp .+2 ; 0x36b96 block_index = 0; 36b94: 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)); 36b96: f8 9c mul r15, r8 36b98: c0 01 movw r24, r0 36b9a: 11 24 eor r1, r1 36b9c: 8a 58 subi r24, 0x8A ; 138 36b9e: 98 4f sbci r25, 0xF8 ; 248 } while (block_index != block_buffer_head); 36ba0: 20 91 56 0e lds r18, 0x0E56 ; 0x800e56 // 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; 36ba4: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 36ba6: f2 12 cpse r15, r18 36ba8: 43 c3 rjmp .+1670 ; 0x37230 } // 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); 36baa: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 } // 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) 36bae: 81 11 cpse r24, r1 36bb0: 01 c0 rjmp .+2 ; 0x36bb4 block_index = BLOCK_BUFFER_SIZE; 36bb2: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 36bb4: 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); 36bb6: ee e6 ldi r30, 0x6E ; 110 36bb8: 8e 9f mul r24, r30 36bba: c0 01 movw r24, r0 36bbc: 11 24 eor r1, r1 36bbe: 9c 01 movw r18, r24 36bc0: 2a 58 subi r18, 0x8A ; 138 36bc2: 38 4f sbci r19, 0xF8 ; 248 36bc4: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 36bc6: d9 01 movw r26, r18 36bc8: 95 96 adiw r26, 0x25 ; 37 36bca: 4d 91 ld r20, X+ 36bcc: 5d 91 ld r21, X+ 36bce: 6d 91 ld r22, X+ 36bd0: 7c 91 ld r23, X 36bd2: 98 97 sbiw r26, 0x28 ; 40 36bd4: 09 a5 ldd r16, Y+41 ; 0x29 36bd6: 1d a5 ldd r17, Y+45 ; 0x2d 36bd8: 29 a9 ldd r18, Y+49 ; 0x31 36bda: 39 ad ldd r19, Y+57 ; 0x39 36bdc: c7 01 movw r24, r14 36bde: 0f 94 4f a1 call 0x3429e ; 0x3429e current->flag &= ~BLOCK_FLAG_RECALCULATE; 36be2: f7 01 movw r30, r14 36be4: 85 a9 ldd r24, Z+53 ; 0x35 36be6: 8e 7f andi r24, 0xFE ; 254 36be8: 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(); 36bea: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 36bee: 82 60 ori r24, 0x02 ; 2 36bf0: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 36bf4: 0d 94 6f ab jmp 0x356de ; 0x356de // 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)); 36bf8: a2 53 subi r26, 0x32 ; 50 36bfa: b8 4f sbci r27, 0xF8 ; 248 36bfc: 80 e1 ldi r24, 0x10 ; 16 36bfe: e3 e4 ldi r30, 0x43 ; 67 36c00: f7 e0 ldi r31, 0x07 ; 7 36c02: 0d 94 aa ab jmp 0x35754 ; 0x35754 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]); 36c06: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 36c0a: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 36c0e: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 36c12: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 36c16: a8 96 adiw r28, 0x28 ; 40 36c18: 6c ad ldd r22, Y+60 ; 0x3c 36c1a: 7d ad ldd r23, Y+61 ; 0x3d 36c1c: 8e ad ldd r24, Y+62 ; 0x3e 36c1e: 9f ad ldd r25, Y+63 ; 0x3f 36c20: a8 97 sbiw r28, 0x28 ; 40 36c22: 0d 94 40 ac jmp 0x35880 ; 0x35880 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); 36c26: 81 e0 ldi r24, 0x01 ; 1 36c28: 80 8f std Z+24, r24 ; 0x18 36c2a: 0d 94 e6 ad jmp 0x35bcc ; 0x35bcc { if(feed_rate 36c32: b0 90 ab 06 lds r11, 0x06AB ; 0x8006ab 36c36: 00 91 ac 06 lds r16, 0x06AC ; 0x8006ac 36c3a: 10 91 ad 06 lds r17, 0x06AD ; 0x8006ad 36c3e: 4c c8 rjmp .-3944 ; 0x35cd8 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])); 36c40: c5 01 movw r24, r10 36c42: b4 01 movw r22, r8 36c44: 0f 94 24 d8 call 0x3b048 ; 0x3b048 36c48: 4b 01 movw r8, r22 36c4a: 5c 01 movw r10, r24 36c4c: c7 01 movw r24, r14 36c4e: b6 01 movw r22, r12 36c50: 0f 94 24 d8 call 0x3b048 ; 0x3b048 36c54: 9b 01 movw r18, r22 36c56: ac 01 movw r20, r24 36c58: c5 01 movw r24, r10 36c5a: b4 01 movw r22, r8 36c5c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 36c60: 6b 01 movw r12, r22 36c62: 7c 01 movw r14, r24 36c64: 22 96 adiw r28, 0x02 ; 2 36c66: 6c ad ldd r22, Y+60 ; 0x3c 36c68: 7d ad ldd r23, Y+61 ; 0x3d 36c6a: 8e ad ldd r24, Y+62 ; 0x3e 36c6c: 9f ad ldd r25, Y+63 ; 0x3f 36c6e: 22 97 sbiw r28, 0x02 ; 2 36c70: 0f 94 24 d8 call 0x3b048 ; 0x3b048 36c74: 9b 01 movw r18, r22 36c76: ac 01 movw r20, r24 36c78: c7 01 movw r24, r14 36c7a: b6 01 movw r22, r12 36c7c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 36c80: 0f 94 51 e2 call 0x3c4a2 ; 0x3c4a2 36c84: 2e e6 ldi r18, 0x6E ; 110 36c86: 22 9d mul r18, r2 36c88: f0 01 movw r30, r0 36c8a: 23 9d mul r18, r3 36c8c: f0 0d add r31, r0 36c8e: 11 24 eor r1, r1 36c90: ea 58 subi r30, 0x8A ; 138 36c92: f8 4f sbci r31, 0xF8 ; 248 36c94: 65 a7 std Z+45, r22 ; 0x2d 36c96: 76 a7 std Z+46, r23 ; 0x2e 36c98: 87 a7 std Z+47, r24 ; 0x2f 36c9a: 90 ab std Z+48, r25 ; 0x30 36c9c: bb c8 rjmp .-3722 ; 0x35e14 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 36c9e: 2a 96 adiw r28, 0x0a ; 10 36ca0: 2c ad ldd r18, Y+60 ; 0x3c 36ca2: 3d ad ldd r19, Y+61 ; 0x3d 36ca4: 4e ad ldd r20, Y+62 ; 0x3e 36ca6: 5f ad ldd r21, Y+63 ; 0x3f 36ca8: 2a 97 sbiw r28, 0x0a ; 10 36caa: 23 2b or r18, r19 36cac: 24 2b or r18, r20 36cae: 25 2b or r18, r21 36cb0: 09 f4 brne .+2 ; 0x36cb4 36cb2: 0e c1 rjmp .+540 ; 0x36ed0 36cb4: 60 91 a2 06 lds r22, 0x06A2 ; 0x8006a2 36cb8: 70 91 a3 06 lds r23, 0x06A3 ; 0x8006a3 36cbc: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 36cc0: 90 91 a5 06 lds r25, 0x06A5 ; 0x8006a5 36cc4: 29 a5 ldd r18, Y+41 ; 0x29 36cc6: 3a a5 ldd r19, Y+42 ; 0x2a 36cc8: 4b a5 ldd r20, Y+43 ; 0x2b 36cca: 5c a5 ldd r21, Y+44 ; 0x2c 36ccc: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36cd0: 0f 94 61 df call 0x3bec2 ; 0x3bec2 36cd4: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 36cd8: 2b 01 movw r4, r22 36cda: 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 36cdc: 80 91 07 18 lds r24, 0x1807 ; 0x801807 36ce0: 90 91 08 18 lds r25, 0x1808 ; 0x801808 36ce4: a0 91 09 18 lds r26, 0x1809 ; 0x801809 36ce8: b0 91 0a 18 lds r27, 0x180A ; 0x80180a 36cec: 8d a7 std Y+45, r24 ; 0x2d 36cee: 9e a7 std Y+46, r25 ; 0x2e 36cf0: af a7 std Y+47, r26 ; 0x2f 36cf2: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 36cf4: 20 e0 ldi r18, 0x00 ; 0 36cf6: 30 e0 ldi r19, 0x00 ; 0 36cf8: a9 01 movw r20, r18 36cfa: bc 01 movw r22, r24 36cfc: cd 01 movw r24, r26 36cfe: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 36d02: 18 16 cp r1, r24 36d04: 0c f0 brlt .+2 ; 0x36d08 36d06: ed c0 rjmp .+474 ; 0x36ee2 * 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 36d08: 20 e0 ldi r18, 0x00 ; 0 36d0a: 30 e0 ldi r19, 0x00 ; 0 36d0c: a9 01 movw r20, r18 36d0e: 26 96 adiw r28, 0x06 ; 6 36d10: 6c ad ldd r22, Y+60 ; 0x3c 36d12: 7d ad ldd r23, Y+61 ; 0x3d 36d14: 8e ad ldd r24, Y+62 ; 0x3e 36d16: 9f ad ldd r25, Y+63 ; 0x3f 36d18: 26 97 sbiw r28, 0x06 ; 6 36d1a: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 36d1e: 87 fd sbrc r24, 7 36d20: e0 c0 rjmp .+448 ; 0x36ee2 && fabs(delta_mm[Z_AXIS]) < 0.5; 36d22: 22 96 adiw r28, 0x02 ; 2 36d24: 6c ad ldd r22, Y+60 ; 0x3c 36d26: 7d ad ldd r23, Y+61 ; 0x3d 36d28: 8e ad ldd r24, Y+62 ; 0x3e 36d2a: 9f ad ldd r25, Y+63 ; 0x3f 36d2c: 22 97 sbiw r28, 0x02 ; 2 36d2e: 9f 77 andi r25, 0x7F ; 127 36d30: 20 e0 ldi r18, 0x00 ; 0 36d32: 30 e0 ldi r19, 0x00 ; 0 36d34: 40 e0 ldi r20, 0x00 ; 0 36d36: 5f e3 ldi r21, 0x3F ; 63 36d38: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 36d3c: 87 ff sbrs r24, 7 36d3e: d1 c0 rjmp .+418 ; 0x36ee2 * * 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 36d40: 8e e6 ldi r24, 0x6E ; 110 36d42: 82 9d mul r24, r2 36d44: 80 01 movw r16, r0 36d46: 83 9d mul r24, r3 36d48: 10 0d add r17, r0 36d4a: 11 24 eor r1, r1 36d4c: 0e 53 subi r16, 0x3E ; 62 36d4e: 18 4f sbci r17, 0xF8 ; 248 36d50: 81 e0 ldi r24, 0x01 ; 1 36d52: d8 01 movw r26, r16 36d54: 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]) 36d56: 20 91 d0 04 lds r18, 0x04D0 ; 0x8004d0 36d5a: 30 91 d1 04 lds r19, 0x04D1 ; 0x8004d1 36d5e: 40 91 d2 04 lds r20, 0x04D2 ; 0x8004d2 36d62: 50 91 d3 04 lds r21, 0x04D3 ; 0x8004d3 36d66: 69 a1 ldd r22, Y+33 ; 0x21 36d68: 7a a1 ldd r23, Y+34 ; 0x22 36d6a: 8b a1 ldd r24, Y+35 ; 0x23 36d6c: 9c a1 ldd r25, Y+36 ; 0x24 36d6e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 36d72: 69 ab std Y+49, r22 ; 0x31 36d74: 7a ab std Y+50, r23 ; 0x32 36d76: 8b ab std Y+51, r24 ; 0x33 36d78: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 36d7a: 20 91 d4 04 lds r18, 0x04D4 ; 0x8004d4 36d7e: 30 91 d5 04 lds r19, 0x04D5 ; 0x8004d5 36d82: 40 91 d6 04 lds r20, 0x04D6 ; 0x8004d6 36d86: 50 91 d7 04 lds r21, 0x04D7 ; 0x8004d7 36d8a: 6d a1 ldd r22, Y+37 ; 0x25 36d8c: 7e a1 ldd r23, Y+38 ; 0x26 36d8e: 8f a1 ldd r24, Y+39 ; 0x27 36d90: 98 a5 ldd r25, Y+40 ; 0x28 36d92: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 36d96: 4b 01 movw r8, r22 36d98: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 36d9a: 20 91 d8 04 lds r18, 0x04D8 ; 0x8004d8 36d9e: 30 91 d9 04 lds r19, 0x04D9 ; 0x8004d9 36da2: 40 91 da 04 lds r20, 0x04DA ; 0x8004da 36da6: 50 91 db 04 lds r21, 0x04DB ; 0x8004db 36daa: a8 96 adiw r28, 0x28 ; 40 36dac: 6c ad ldd r22, Y+60 ; 0x3c 36dae: 7d ad ldd r23, Y+61 ; 0x3d 36db0: 8e ad ldd r24, Y+62 ; 0x3e 36db2: 9f ad ldd r25, Y+63 ; 0x3f 36db4: a8 97 sbiw r28, 0x28 ; 40 36db6: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 36dba: 6b 01 movw r12, r22 36dbc: 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]) 36dbe: 29 a9 ldd r18, Y+49 ; 0x31 36dc0: 3a a9 ldd r19, Y+50 ; 0x32 36dc2: 4b a9 ldd r20, Y+51 ; 0x33 36dc4: 5c a9 ldd r21, Y+52 ; 0x34 36dc6: ca 01 movw r24, r20 36dc8: b9 01 movw r22, r18 36dca: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36dce: 69 ab std Y+49, r22 ; 0x31 36dd0: 7a ab std Y+50, r23 ; 0x32 36dd2: 8b ab std Y+51, r24 ; 0x33 36dd4: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 36dd6: a5 01 movw r20, r10 36dd8: 94 01 movw r18, r8 36dda: c5 01 movw r24, r10 36ddc: b4 01 movw r22, r8 36dde: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36de2: 9b 01 movw r18, r22 36de4: ac 01 movw r20, r24 36de6: 69 a9 ldd r22, Y+49 ; 0x31 36de8: 7a a9 ldd r23, Y+50 ; 0x32 36dea: 8b a9 ldd r24, Y+51 ; 0x33 36dec: 9c a9 ldd r25, Y+52 ; 0x34 36dee: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 36df2: 4b 01 movw r8, r22 36df4: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 36df6: a7 01 movw r20, r14 36df8: 96 01 movw r18, r12 36dfa: c7 01 movw r24, r14 36dfc: b6 01 movw r22, r12 36dfe: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36e02: 9b 01 movw r18, r22 36e04: ac 01 movw r20, r24 36e06: c5 01 movw r24, r10 36e08: b4 01 movw r22, r8 36e0a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__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]) 36e0e: 0f 94 51 e2 call 0x3c4a2 ; 0x3c4a2 36e12: 6b 01 movw r12, r22 36e14: 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]); 36e16: 20 91 dc 04 lds r18, 0x04DC ; 0x8004dc 36e1a: 30 91 dd 04 lds r19, 0x04DD ; 0x8004dd 36e1e: 40 91 de 04 lds r20, 0x04DE ; 0x8004de 36e22: 50 91 df 04 lds r21, 0x04DF ; 0x8004df 36e26: aa 96 adiw r28, 0x2a ; 42 36e28: ee ad ldd r30, Y+62 ; 0x3e 36e2a: ff ad ldd r31, Y+63 ; 0x3f 36e2c: aa 97 sbiw r28, 0x2a ; 42 36e2e: 60 81 ld r22, Z 36e30: 71 81 ldd r23, Z+1 ; 0x01 36e32: 82 81 ldd r24, Z+2 ; 0x02 36e34: 93 81 ldd r25, Z+3 ; 0x03 36e36: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__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; 36e3a: a7 01 movw r20, r14 36e3c: 96 01 movw r18, r12 36e3e: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 36e42: 6a 96 adiw r28, 0x1a ; 26 36e44: 6c af std Y+60, r22 ; 0x3c 36e46: 7d af std Y+61, r23 ; 0x3d 36e48: 8e af std Y+62, r24 ; 0x3e 36e4a: 9f af std Y+63, r25 ; 0x3f 36e4c: 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) 36e4e: 20 e0 ldi r18, 0x00 ; 0 36e50: 30 e0 ldi r19, 0x00 ; 0 36e52: 40 e4 ldi r20, 0x40 ; 64 36e54: 50 e4 ldi r21, 0x40 ; 64 36e56: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 36e5a: 18 16 cp r1, r24 36e5c: 0c f4 brge .+2 ; 0x36e60 36e5e: 9e c0 rjmp .+316 ; 0x36f9c block->use_advance_lead = false; else if (e_D_ratio > 0) { 36e60: 20 e0 ldi r18, 0x00 ; 0 36e62: 30 e0 ldi r19, 0x00 ; 0 36e64: a9 01 movw r20, r18 36e66: 6a 96 adiw r28, 0x1a ; 26 36e68: 6c ad ldd r22, Y+60 ; 0x3c 36e6a: 7d ad ldd r23, Y+61 ; 0x3d 36e6c: 8e ad ldd r24, Y+62 ; 0x3e 36e6e: 9f ad ldd r25, Y+63 ; 0x3f 36e70: 6a 97 sbiw r28, 0x1a ; 26 36e72: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 36e76: 18 16 cp r1, r24 36e78: 0c f0 brlt .+2 ; 0x36e7c 36e7a: 42 c0 rjmp .+132 ; 0x36f00 const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 36e7c: 6a 96 adiw r28, 0x1a ; 26 36e7e: 2c ad ldd r18, Y+60 ; 0x3c 36e80: 3d ad ldd r19, Y+61 ; 0x3d 36e82: 4e ad ldd r20, Y+62 ; 0x3e 36e84: 5f ad ldd r21, Y+63 ; 0x3f 36e86: 6a 97 sbiw r28, 0x1a ; 26 36e88: 6d a5 ldd r22, Y+45 ; 0x2d 36e8a: 7e a5 ldd r23, Y+46 ; 0x2e 36e8c: 8f a5 ldd r24, Y+47 ; 0x2f 36e8e: 98 a9 ldd r25, Y+48 ; 0x30 36e90: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36e94: 9b 01 movw r18, r22 36e96: ac 01 movw r20, r24 36e98: 60 91 c2 06 lds r22, 0x06C2 ; 0x8006c2 36e9c: 70 91 c3 06 lds r23, 0x06C3 ; 0x8006c3 36ea0: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 36ea4: 90 91 c5 06 lds r25, 0x06C5 ; 0x8006c5 36ea8: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 36eac: 29 a5 ldd r18, Y+41 ; 0x29 36eae: 3a a5 ldd r19, Y+42 ; 0x2a 36eb0: 4b a5 ldd r20, Y+43 ; 0x2b 36eb2: 5c a5 ldd r21, Y+44 ; 0x2c 36eb4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36eb8: 0f 94 61 df call 0x3bec2 ; 0x3bec2 36ebc: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 36ec0: 64 15 cp r22, r4 36ec2: 75 05 cpc r23, r5 36ec4: 86 05 cpc r24, r6 36ec6: 97 05 cpc r25, r7 36ec8: d8 f4 brcc .+54 ; 0x36f00 36eca: 2b 01 movw r4, r22 36ecc: 3c 01 movw r6, r24 36ece: 18 c0 rjmp .+48 ; 0x36f00 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 36ed0: 60 91 2e 07 lds r22, 0x072E ; 0x80072e 36ed4: 70 91 2f 07 lds r23, 0x072F ; 0x80072f 36ed8: 80 91 30 07 lds r24, 0x0730 ; 0x800730 36edc: 90 91 31 07 lds r25, 0x0731 ; 0x800731 36ee0: f1 ce rjmp .-542 ; 0x36cc4 * * 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 36ee2: 8e e6 ldi r24, 0x6E ; 110 36ee4: 82 9d mul r24, r2 36ee6: f0 01 movw r30, r0 36ee8: 83 9d mul r24, r3 36eea: f0 0d add r31, r0 36eec: 11 24 eor r1, r1 36eee: ee 53 subi r30, 0x3E ; 62 36ef0: f8 4f sbci r31, 0xF8 ; 248 36ef2: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 36ef4: 6a 96 adiw r28, 0x1a ; 26 36ef6: 1c ae std Y+60, r1 ; 0x3c 36ef8: 1d ae std Y+61, r1 ; 0x3d 36efa: 1e ae std Y+62, r1 ; 0x3e 36efc: 1f ae std Y+63, r1 ; 0x3f 36efe: 6a 97 sbiw r28, 0x1a ; 26 36f00: 10 e0 ldi r17, 0x00 ; 0 36f02: 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) 36f04: a4 96 adiw r28, 0x24 ; 36 36f06: ee ad ldd r30, Y+62 ; 0x3e 36f08: ff ad ldd r31, Y+63 ; 0x3f 36f0a: a4 97 sbiw r28, 0x24 ; 36 36f0c: e0 0f add r30, r16 36f0e: f1 1f adc r31, r17 36f10: ea 58 subi r30, 0x8A ; 138 36f12: f8 4f sbci r31, 0xF8 ; 248 36f14: c0 80 ld r12, Z 36f16: d1 80 ldd r13, Z+1 ; 0x01 36f18: e2 80 ldd r14, Z+2 ; 0x02 36f1a: f3 80 ldd r15, Z+3 ; 0x03 36f1c: c1 14 cp r12, r1 36f1e: d1 04 cpc r13, r1 36f20: e1 04 cpc r14, r1 36f22: f1 04 cpc r15, r1 36f24: a1 f1 breq .+104 ; 0x36f8e 36f26: f8 01 movw r30, r16 36f28: e0 51 subi r30, 0x10 ; 16 36f2a: f8 4e sbci r31, 0xE8 ; 232 36f2c: 60 81 ld r22, Z 36f2e: 71 81 ldd r23, Z+1 ; 0x01 36f30: 82 81 ldd r24, Z+2 ; 0x02 36f32: 93 81 ldd r25, Z+3 ; 0x03 36f34: 64 15 cp r22, r4 36f36: 75 05 cpc r23, r5 36f38: 86 05 cpc r24, r6 36f3a: 97 05 cpc r25, r7 36f3c: 40 f5 brcc .+80 ; 0x36f8e { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 36f3e: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 36f42: 29 ad ldd r18, Y+57 ; 0x39 36f44: 3a ad ldd r19, Y+58 ; 0x3a 36f46: 4b ad ldd r20, Y+59 ; 0x3b 36f48: 5c ad ldd r21, Y+60 ; 0x3c 36f4a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 36f4e: 4b 01 movw r8, r22 36f50: 5c 01 movw r10, r24 36f52: c7 01 movw r24, r14 36f54: b6 01 movw r22, r12 36f56: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 36f5a: 9b 01 movw r18, r22 36f5c: ac 01 movw r20, r24 36f5e: c5 01 movw r24, r10 36f60: b4 01 movw r22, r8 36f62: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 36f66: 6b 01 movw r12, r22 36f68: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 36f6a: c3 01 movw r24, r6 36f6c: b2 01 movw r22, r4 36f6e: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 36f72: 9b 01 movw r18, r22 36f74: ac 01 movw r20, r24 36f76: c7 01 movw r24, r14 36f78: b6 01 movw r22, r12 36f7a: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 36f7e: 87 ff sbrs r24, 7 36f80: 06 c0 rjmp .+12 ; 0x36f8e 36f82: c7 01 movw r24, r14 36f84: b6 01 movw r22, r12 36f86: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 36f8a: 2b 01 movw r4, r22 36f8c: 3c 01 movw r6, r24 36f8e: 0c 5f subi r16, 0xFC ; 252 36f90: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 36f92: 00 31 cpi r16, 0x10 ; 16 36f94: 11 05 cpc r17, r1 36f96: 09 f0 breq .+2 ; 0x36f9a 36f98: b5 cf rjmp .-150 ; 0x36f04 36f9a: 01 c9 rjmp .-3582 ; 0x3619e // 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; 36f9c: d8 01 movw r26, r16 36f9e: 1c 92 st X, r1 36fa0: af cf rjmp .-162 ; 0x36f00 if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 36fa2: c9 a6 std Y+41, r12 ; 0x29 36fa4: dd a6 std Y+45, r13 ; 0x2d 36fa6: e9 aa std Y+49, r14 ; 0x31 36fa8: f9 ae std Y+57, r15 ; 0x39 limited = true; 36faa: 21 e0 ldi r18, 0x01 ; 1 36fac: 2d ab std Y+53, r18 ; 0x35 36fae: b1 c9 rjmp .-3230 ; 0x36312 // 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); 36fb0: 27 96 adiw r28, 0x07 ; 7 36fb2: 2f ad ldd r18, Y+63 ; 0x3f 36fb4: 27 97 sbiw r28, 0x07 ; 7 36fb6: 2b 96 adiw r28, 0x0b ; 11 36fb8: 3f ad ldd r19, Y+63 ; 0x3f 36fba: 2b 97 sbiw r28, 0x0b ; 11 36fbc: 2f 96 adiw r28, 0x0f ; 15 36fbe: 4f ad ldd r20, Y+63 ; 0x3f 36fc0: 2f 97 sbiw r28, 0x0f ; 15 36fc2: 63 96 adiw r28, 0x13 ; 19 36fc4: 5f ad ldd r21, Y+63 ; 0x3f 36fc6: 63 97 sbiw r28, 0x13 ; 19 36fc8: 6b 96 adiw r28, 0x1b ; 27 36fca: 6f ad ldd r22, Y+63 ; 0x3f 36fcc: 6b 97 sbiw r28, 0x1b ; 27 36fce: 6d 96 adiw r28, 0x1d ; 29 36fd0: 7f ad ldd r23, Y+63 ; 0x3f 36fd2: 6d 97 sbiw r28, 0x1d ; 29 36fd4: c8 01 movw r24, r16 36fd6: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 36fda: ec 96 adiw r28, 0x3c ; 60 36fdc: 6c af std Y+60, r22 ; 0x3c 36fde: 7d af std Y+61, r23 ; 0x3d 36fe0: 8e af std Y+62, r24 ; 0x3e 36fe2: 9f af std Y+63, r25 ; 0x3f 36fe4: 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; 36fe6: 6b 96 adiw r28, 0x1b ; 27 36fe8: ef ad ldd r30, Y+63 ; 0x3f 36fea: 6b 97 sbiw r28, 0x1b ; 27 36fec: ed af std Y+61, r30 ; 0x3d 36fee: 6d 96 adiw r28, 0x1d ; 29 36ff0: ff ad ldd r31, Y+63 ; 0x3f 36ff2: 6d 97 sbiw r28, 0x1d ; 29 36ff4: fd ab std Y+53, r31 ; 0x35 36ff6: 0e af std Y+62, r16 ; 0x3e 36ff8: 23 96 adiw r28, 0x03 ; 3 36ffa: 1f af std Y+63, r17 ; 0x3f 36ffc: 23 97 sbiw r28, 0x03 ; 3 36ffe: 04 ca rjmp .-3064 ; 0x36408 (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 37000: f7 fa bst r15, 7 37002: f0 94 com r15 37004: f7 f8 bld r15, 7 37006: f0 94 com r15 37008: a5 01 movw r20, r10 3700a: 94 01 movw r18, r8 3700c: c7 01 movw r24, r14 3700e: b6 01 movw r22, r12 37010: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 37014: 87 ff sbrs r24, 7 37016: 77 ca rjmp .-2834 ; 0x36506 // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 37018: 75 01 movw r14, r10 3701a: 64 01 movw r12, r8 3701c: 74 ca rjmp .-2840 ; 0x36506 // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 3701e: c7 01 movw r24, r14 37020: b6 01 movw r22, r12 37022: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 37026: 87 fd sbrc r24, 7 37028: 09 c0 rjmp .+18 ; 0x3703c 3702a: 20 e0 ldi r18, 0x00 ; 0 3702c: 30 e0 ldi r19, 0x00 ; 0 3702e: a9 01 movw r20, r18 37030: c5 01 movw r24, r10 37032: b4 01 movw r22, r8 37034: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 37038: 18 16 cp r1, r24 3703a: 2c f4 brge .+10 ; 0x37046 3703c: a5 01 movw r20, r10 3703e: 94 01 movw r18, r8 37040: c7 01 movw r24, r14 37042: b6 01 movw r22, r12 37044: 5c ca rjmp .-2888 ; 0x364fe // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 37046: b7 fa bst r11, 7 37048: b0 94 com r11 3704a: b7 f8 bld r11, 7 3704c: b0 94 com r11 3704e: a7 01 movw r20, r14 37050: 96 01 movw r18, r12 37052: c5 01 movw r24, r10 37054: b4 01 movw r22, r8 37056: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 3705a: 18 16 cp r1, r24 3705c: 0c f0 brlt .+2 ; 0x37060 3705e: 53 ca rjmp .-2906 ; 0x36506 37060: db cf rjmp .-74 ; 0x37018 // 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; 37062: 8e e6 ldi r24, 0x6E ; 110 37064: 82 9d mul r24, r2 37066: f0 01 movw r30, r0 37068: 83 9d mul r24, r3 3706a: f0 0d add r31, r0 3706c: 11 24 eor r1, r1 3706e: ea 58 subi r30, 0x8A ; 138 37070: f8 4f sbci r31, 0xF8 ; 248 37072: 85 a9 ldd r24, Z+53 ; 0x35 37074: 84 60 ori r24, 0x04 ; 4 37076: 85 ab std Z+53, r24 ; 0x35 37078: a9 a5 ldd r26, Y+41 ; 0x29 3707a: ad af std Y+61, r26 ; 0x3d 3707c: bd a5 ldd r27, Y+45 ; 0x2d 3707e: bd ab std Y+53, r27 ; 0x35 37080: e9 a9 ldd r30, Y+49 ; 0x31 37082: ee af std Y+62, r30 ; 0x3e 37084: f9 ad ldd r31, Y+57 ; 0x39 37086: 23 96 adiw r28, 0x03 ; 3 37088: ff af std Y+63, r31 ; 0x3f 3708a: 23 97 sbiw r28, 0x03 ; 3 3708c: bc ca rjmp .-2696 ; 0x36606 // 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; 3708e: 81 e0 ldi r24, 0x01 ; 1 37090: 30 cb rjmp .-2464 ; 0x366f2 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]; 37092: 20 91 c2 06 lds r18, 0x06C2 ; 0x8006c2 37096: 30 91 c3 06 lds r19, 0x06C3 ; 0x8006c3 3709a: 40 91 c4 06 lds r20, 0x06C4 ; 0x8006c4 3709e: 50 91 c5 06 lds r21, 0x06C5 ; 0x8006c5 370a2: c7 01 movw r24, r14 370a4: b6 01 movw r22, r12 370a6: c1 cb rjmp .-2174 ; 0x3682a 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) { 370a8: 20 e0 ldi r18, 0x00 ; 0 370aa: 30 e4 ldi r19, 0x40 ; 64 370ac: 4c e1 ldi r20, 0x1C ; 28 370ae: 56 e4 ldi r21, 0x46 ; 70 370b0: c7 01 movw r24, r14 370b2: b6 01 movw r22, r12 370b4: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 370b8: 18 16 cp r1, r24 370ba: d4 f4 brge .+52 ; 0x370f0 block->advance_rate = advance_rate * 2; 370bc: 8e e6 ldi r24, 0x6E ; 110 370be: 82 9d mul r24, r2 370c0: 80 01 movw r16, r0 370c2: 83 9d mul r24, r3 370c4: 10 0d add r17, r0 370c6: 11 24 eor r1, r1 370c8: 0a 58 subi r16, 0x8A ; 138 370ca: 18 4f sbci r17, 0xF8 ; 248 370cc: 78 01 movw r14, r16 370ce: bd e4 ldi r27, 0x4D ; 77 370d0: eb 0e add r14, r27 370d2: f1 1c adc r15, r1 370d4: a5 01 movw r20, r10 370d6: 94 01 movw r18, r8 370d8: c5 01 movw r24, r10 370da: b4 01 movw r22, r8 370dc: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 370e0: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 370e4: f7 01 movw r30, r14 370e6: 71 83 std Z+1, r23 ; 0x01 370e8: 60 83 st Z, r22 block->advance_step_loops = 2; 370ea: 36 96 adiw r30, 0x06 ; 6 370ec: 82 e0 ldi r24, 0x02 ; 2 370ee: e2 cb rjmp .-2108 ; 0x368b4 } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 370f0: 20 e0 ldi r18, 0x00 ; 0 370f2: 3f ef ldi r19, 0xFF ; 255 370f4: 4f e7 ldi r20, 0x7F ; 127 370f6: 57 e4 ldi r21, 0x47 ; 71 370f8: c5 01 movw r24, r10 370fa: b4 01 movw r22, r8 370fc: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 37100: 87 ff sbrs r24, 7 37102: 19 c0 rjmp .+50 ; 0x37136 block->advance_rate = advance_rate; 37104: 8e e6 ldi r24, 0x6E ; 110 37106: 82 9d mul r24, r2 37108: 80 01 movw r16, r0 3710a: 83 9d mul r24, r3 3710c: 10 0d add r17, r0 3710e: 11 24 eor r1, r1 37110: 0d 53 subi r16, 0x3D ; 61 37112: 18 4f sbci r17, 0xF8 ; 248 37114: c5 01 movw r24, r10 37116: b4 01 movw r22, r8 37118: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 3711c: d8 01 movw r26, r16 3711e: 6d 93 st X+, r22 37120: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 37122: 8e e6 ldi r24, 0x6E ; 110 37124: 82 9d mul r24, r2 37126: f0 01 movw r30, r0 37128: 83 9d mul r24, r3 3712a: f0 0d add r31, r0 3712c: 11 24 eor r1, r1 3712e: e7 53 subi r30, 0x37 ; 55 37130: f8 4f sbci r31, 0xF8 ; 248 37132: 81 e0 ldi r24, 0x01 ; 1 37134: bf cb rjmp .-2178 ; 0x368b4 { // 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; 37136: 8e e6 ldi r24, 0x6E ; 110 37138: 82 9d mul r24, r2 3713a: f0 01 movw r30, r0 3713c: 83 9d mul r24, r3 3713e: f0 0d add r31, r0 37140: 11 24 eor r1, r1 37142: ed 53 subi r30, 0x3D ; 61 37144: f8 4f sbci r31, 0xF8 ; 248 37146: 8f ef ldi r24, 0xFF ; 255 37148: 9f ef ldi r25, 0xFF ; 255 3714a: 91 83 std Z+1, r25 ; 0x01 3714c: 80 83 st Z, r24 3714e: e9 cf rjmp .-46 ; 0x37122 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) { 37150: f6 01 movw r30, r12 37152: 71 a4 ldd r7, Z+41 ; 0x29 37154: 82 a4 ldd r8, Z+42 ; 0x2a 37156: 93 a4 ldd r9, Z+43 ; 0x2b 37158: e4 a4 ldd r14, Z+44 ; 0x2c 3715a: 27 2d mov r18, r7 3715c: 38 2d mov r19, r8 3715e: 49 2d mov r20, r9 37160: 5e 2d mov r21, r14 37162: 65 a1 ldd r22, Z+37 ; 0x25 37164: 76 a1 ldd r23, Z+38 ; 0x26 37166: 87 a1 ldd r24, Z+39 ; 0x27 37168: 90 a5 ldd r25, Z+40 ; 0x28 3716a: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 3716e: 88 23 and r24, r24 37170: 09 f4 brne .+2 ; 0x37174 37172: 51 c0 rjmp .+162 ; 0x37216 // 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) ? 37174: 01 fd sbrc r16, 1 37176: 44 c0 rjmp .+136 ; 0x37200 37178: d5 01 movw r26, r10 3717a: 95 96 adiw r26, 0x25 ; 37 3717c: 2d 90 ld r2, X+ 3717e: 3d 90 ld r3, X+ 37180: 4d 90 ld r4, X+ 37182: 5c 90 ld r5, X 37184: 98 97 sbiw r26, 0x28 ; 40 37186: a2 01 movw r20, r4 37188: 91 01 movw r18, r2 3718a: 67 2d mov r22, r7 3718c: 78 2d mov r23, r8 3718e: 89 2d mov r24, r9 37190: 9e 2d mov r25, r14 37192: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 37196: 18 16 cp r1, r24 37198: 9c f5 brge .+102 ; 0x37200 // 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); 3719a: a2 01 movw r20, r4 3719c: 91 01 movw r18, r2 3719e: c2 01 movw r24, r4 371a0: b1 01 movw r22, r2 371a2: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 371a6: 1b 01 movw r2, r22 371a8: 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)); 371aa: f6 01 movw r30, r12 371ac: 61 a9 ldd r22, Z+49 ; 0x31 371ae: 72 a9 ldd r23, Z+50 ; 0x32 371b0: 83 a9 ldd r24, Z+51 ; 0x33 371b2: 94 a9 ldd r25, Z+52 ; 0x34 371b4: 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); 371b6: 9b 01 movw r18, r22 371b8: ac 01 movw r20, r24 371ba: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 371be: d6 01 movw r26, r12 371c0: 9d 96 adiw r26, 0x2d ; 45 371c2: 2d 91 ld r18, X+ 371c4: 3d 91 ld r19, X+ 371c6: 4d 91 ld r20, X+ 371c8: 5c 91 ld r21, X 371ca: d0 97 sbiw r26, 0x30 ; 48 371cc: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 371d0: 9b 01 movw r18, r22 371d2: ac 01 movw r20, r24 371d4: c2 01 movw r24, r4 371d6: b1 01 movw r22, r2 371d8: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 371dc: 0f 94 51 e2 call 0x3c4a2 ; 0x3c4a2 371e0: 2b 01 movw r4, r22 371e2: 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)); 371e4: 9b 01 movw r18, r22 371e6: ac 01 movw r20, r24 371e8: 67 2d mov r22, r7 371ea: 78 2d mov r23, r8 371ec: 89 2d mov r24, r9 371ee: 9e 2d mov r25, r14 371f0: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 371f4: 87 fd sbrc r24, 7 371f6: 04 c0 rjmp .+8 ; 0x37200 371f8: 74 2c mov r7, r4 371fa: 85 2c mov r8, r5 371fc: 9a 2c mov r9, r10 371fe: 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) ? 37200: 87 2d mov r24, r7 37202: 98 2d mov r25, r8 37204: a9 2d mov r26, r9 37206: be 2d mov r27, r14 37208: f6 01 movw r30, r12 3720a: 85 a3 std Z+37, r24 ; 0x25 3720c: 96 a3 std Z+38, r25 ; 0x26 3720e: a7 a3 std Z+39, r26 ; 0x27 37210: 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; 37212: 01 60 ori r16, 0x01 ; 1 37214: 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) 37216: 11 11 cpse r17, r1 37218: 01 c0 rjmp .+2 ; 0x3721c block_index = BLOCK_BUFFER_SIZE; 3721a: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 3721c: 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)); 3721e: 16 9d mul r17, r6 37220: c0 01 movw r24, r0 37222: 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; 37224: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 37226: 9c 01 movw r18, r24 37228: 2a 58 subi r18, 0x8A ; 138 3722a: 38 4f sbci r19, 0xF8 ; 248 3722c: 69 01 movw r12, r18 3722e: 0b cc rjmp .-2026 ; 0x36a46 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)); 37230: 6c 01 movw r12, r24 37232: 2f cc rjmp .-1954 ; 0x36a92 37234: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 37236: 0d 94 6f ab jmp 0x356de ; 0x356de 0003723a : 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(){ 3723a: 4f 92 push r4 3723c: 5f 92 push r5 3723e: 6f 92 push r6 37240: 7f 92 push r7 37242: 8f 92 push r8 37244: 9f 92 push r9 37246: af 92 push r10 37248: bf 92 push r11 3724a: cf 92 push r12 3724c: df 92 push r13 3724e: ef 92 push r14 37250: ff 92 push r15 37252: cf 93 push r28 37254: df 93 push r29 37256: cd b7 in r28, 0x3d ; 61 37258: de b7 in r29, 0x3e ; 62 3725a: 2c 97 sbiw r28, 0x0c ; 12 3725c: 0f b6 in r0, 0x3f ; 63 3725e: f8 94 cli 37260: de bf out 0x3e, r29 ; 62 37262: 0f be out 0x3f, r0 ; 63 37264: 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]); 37266: c0 90 4b 07 lds r12, 0x074B ; 0x80074b 3726a: d0 90 4c 07 lds r13, 0x074C ; 0x80074c 3726e: e0 90 4d 07 lds r14, 0x074D ; 0x80074d 37272: f0 90 4e 07 lds r15, 0x074E ; 0x80074e 37276: 80 91 47 07 lds r24, 0x0747 ; 0x800747 3727a: 90 91 48 07 lds r25, 0x0748 ; 0x800748 3727e: a0 91 49 07 lds r26, 0x0749 ; 0x800749 37282: b0 91 4a 07 lds r27, 0x074A ; 0x80074a 37286: 40 91 43 07 lds r20, 0x0743 ; 0x800743 3728a: 50 91 44 07 lds r21, 0x0744 ; 0x800744 3728e: 60 91 45 07 lds r22, 0x0745 ; 0x800745 37292: 70 91 46 07 lds r23, 0x0746 ; 0x800746 37296: 4d 83 std Y+5, r20 ; 0x05 37298: 5e 83 std Y+6, r21 ; 0x06 3729a: 6f 83 std Y+7, r22 ; 0x07 3729c: 78 87 std Y+8, r23 ; 0x08 3729e: 89 83 std Y+1, r24 ; 0x01 372a0: 9a 83 std Y+2, r25 ; 0x02 372a2: ab 83 std Y+3, r26 ; 0x03 372a4: 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); 372a6: be 01 movw r22, r28 372a8: 6f 5f subi r22, 0xFF ; 255 372aa: 7f 4f sbci r23, 0xFF ; 255 372ac: ce 01 movw r24, r28 372ae: 05 96 adiw r24, 0x05 ; 5 372b0: 0e 94 37 6b call 0xd66e ; 0xd66e position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 372b4: 4d 80 ldd r4, Y+5 ; 0x05 372b6: 5e 80 ldd r5, Y+6 ; 0x06 372b8: 6f 80 ldd r6, Y+7 ; 0x07 372ba: 78 84 ldd r7, Y+8 ; 0x08 372bc: 20 91 72 06 lds r18, 0x0672 ; 0x800672 372c0: 30 91 73 06 lds r19, 0x0673 ; 0x800673 372c4: 40 91 74 06 lds r20, 0x0674 ; 0x800674 372c8: 50 91 75 06 lds r21, 0x0675 ; 0x800675 372cc: c3 01 movw r24, r6 372ce: b2 01 movw r22, r4 372d0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 372d4: 0f 94 c0 e1 call 0x3c380 ; 0x3c380 372d8: 60 93 54 07 sts 0x0754, r22 ; 0x800754 372dc: 70 93 55 07 sts 0x0755, r23 ; 0x800755 372e0: 80 93 56 07 sts 0x0756, r24 ; 0x800756 372e4: 90 93 57 07 sts 0x0757, r25 ; 0x800757 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 372e8: 89 80 ldd r8, Y+1 ; 0x01 372ea: 9a 80 ldd r9, Y+2 ; 0x02 372ec: ab 80 ldd r10, Y+3 ; 0x03 372ee: bc 80 ldd r11, Y+4 ; 0x04 372f0: 20 91 76 06 lds r18, 0x0676 ; 0x800676 372f4: 30 91 77 06 lds r19, 0x0677 ; 0x800677 372f8: 40 91 78 06 lds r20, 0x0678 ; 0x800678 372fc: 50 91 79 06 lds r21, 0x0679 ; 0x800679 37300: c5 01 movw r24, r10 37302: b4 01 movw r22, r8 37304: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 37308: 0f 94 c0 e1 call 0x3c380 ; 0x3c380 3730c: 60 93 58 07 sts 0x0758, r22 ; 0x800758 37310: 70 93 59 07 sts 0x0759, r23 ; 0x800759 37314: 80 93 5a 07 sts 0x075A, r24 ; 0x80075a 37318: 90 93 5b 07 sts 0x075B, r25 ; 0x80075b #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 3731c: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 37320: 88 23 and r24, r24 37322: 09 f4 brne .+2 ; 0x37326 37324: 8c c0 rjmp .+280 ; 0x3743e lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 37326: a5 01 movw r20, r10 37328: 94 01 movw r18, r8 3732a: c3 01 movw r24, r6 3732c: b2 01 movw r22, r4 3732e: 0f 94 1d 96 call 0x32c3a ; 0x32c3a 37332: 9b 01 movw r18, r22 37334: ac 01 movw r20, r24 37336: c7 01 movw r24, r14 37338: b6 01 movw r22, r12 3733a: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3733e: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 37342: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 37346: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 3734a: 50 91 7d 06 lds r21, 0x067D ; 0x80067d lround(z*cs.axis_steps_per_mm[Z_AXIS]); 3734e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__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 ? 37352: 0f 94 c0 e1 call 0x3c380 ; 0x3c380 37356: 60 93 5c 07 sts 0x075C, r22 ; 0x80075c 3735a: 70 93 5d 07 sts 0x075D, r23 ; 0x80075d 3735e: 80 93 5e 07 sts 0x075E, r24 ; 0x80075e 37362: 90 93 5f 07 sts 0x075F, r25 ; 0x80075f 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]); 37366: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 3736a: 90 91 50 07 lds r25, 0x0750 ; 0x800750 3736e: a0 91 51 07 lds r26, 0x0751 ; 0x800751 37372: b0 91 52 07 lds r27, 0x0752 ; 0x800752 37376: 89 87 std Y+9, r24 ; 0x09 37378: 9a 87 std Y+10, r25 ; 0x0a 3737a: ab 87 std Y+11, r26 ; 0x0b 3737c: bc 87 std Y+12, r27 ; 0x0c 3737e: 20 91 7e 06 lds r18, 0x067E ; 0x80067e 37382: 30 91 7f 06 lds r19, 0x067F ; 0x80067f 37386: 40 91 80 06 lds r20, 0x0680 ; 0x800680 3738a: 50 91 81 06 lds r21, 0x0681 ; 0x800681 3738e: bc 01 movw r22, r24 37390: cd 01 movw r24, r26 37392: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 37396: 0f 94 c0 e1 call 0x3c380 ; 0x3c380 3739a: 60 93 60 07 sts 0x0760, r22 ; 0x800760 3739e: 70 93 61 07 sts 0x0761, r23 ; 0x800761 373a2: 80 93 62 07 sts 0x0762, r24 ; 0x800762 373a6: 90 93 63 07 sts 0x0763, r25 ; 0x800763 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 373aa: 40 92 d0 04 sts 0x04D0, r4 ; 0x8004d0 373ae: 50 92 d1 04 sts 0x04D1, r5 ; 0x8004d1 373b2: 60 92 d2 04 sts 0x04D2, r6 ; 0x8004d2 373b6: 70 92 d3 04 sts 0x04D3, r7 ; 0x8004d3 position_float[Y_AXIS] = y; 373ba: 80 92 d4 04 sts 0x04D4, r8 ; 0x8004d4 373be: 90 92 d5 04 sts 0x04D5, r9 ; 0x8004d5 373c2: a0 92 d6 04 sts 0x04D6, r10 ; 0x8004d6 373c6: b0 92 d7 04 sts 0x04D7, r11 ; 0x8004d7 position_float[Z_AXIS] = z; 373ca: c0 92 d8 04 sts 0x04D8, r12 ; 0x8004d8 373ce: d0 92 d9 04 sts 0x04D9, r13 ; 0x8004d9 373d2: e0 92 da 04 sts 0x04DA, r14 ; 0x8004da 373d6: f0 92 db 04 sts 0x04DB, r15 ; 0x8004db position_float[E_AXIS] = e; 373da: 89 85 ldd r24, Y+9 ; 0x09 373dc: 9a 85 ldd r25, Y+10 ; 0x0a 373de: ab 85 ldd r26, Y+11 ; 0x0b 373e0: bc 85 ldd r27, Y+12 ; 0x0c 373e2: 80 93 dc 04 sts 0x04DC, r24 ; 0x8004dc 373e6: 90 93 dd 04 sts 0x04DD, r25 ; 0x8004dd 373ea: a0 93 de 04 sts 0x04DE, r26 ; 0x8004de 373ee: b0 93 df 04 sts 0x04DF, r27 ; 0x8004df #endif st_set_position(position); 373f2: 0f 94 87 87 call 0x30f0e ; 0x30f0e previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 373f6: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.505> 373fa: 10 92 bd 04 sts 0x04BD, r1 ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.505+0x1> 373fe: 10 92 be 04 sts 0x04BE, r1 ; 0x8004be <_ZL22previous_nominal_speed.lto_priv.505+0x2> 37402: 10 92 bf 04 sts 0x04BF, r1 ; 0x8004bf <_ZL22previous_nominal_speed.lto_priv.505+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 37406: e0 ec ldi r30, 0xC0 ; 192 37408: f4 e0 ldi r31, 0x04 ; 4 3740a: 80 e1 ldi r24, 0x10 ; 16 3740c: df 01 movw r26, r30 3740e: 1d 92 st X+, r1 37410: 8a 95 dec r24 37412: e9 f7 brne .-6 ; 0x3740e 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]); } 37414: 2c 96 adiw r28, 0x0c ; 12 37416: 0f b6 in r0, 0x3f ; 63 37418: f8 94 cli 3741a: de bf out 0x3e, r29 ; 62 3741c: 0f be out 0x3f, r0 ; 63 3741e: cd bf out 0x3d, r28 ; 61 37420: df 91 pop r29 37422: cf 91 pop r28 37424: ff 90 pop r15 37426: ef 90 pop r14 37428: df 90 pop r13 3742a: cf 90 pop r12 3742c: bf 90 pop r11 3742e: af 90 pop r10 37430: 9f 90 pop r9 37432: 8f 90 pop r8 37434: 7f 90 pop r7 37436: 6f 90 pop r6 37438: 5f 90 pop r5 3743a: 4f 90 pop r4 3743c: 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]); 3743e: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 37442: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 37446: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 3744a: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 3744e: c7 01 movw r24, r14 37450: b6 01 movw r22, r12 37452: 7d cf rjmp .-262 ; 0x3734e 00037454 : 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) { 37454: 8f 92 push r8 37456: 9f 92 push r9 37458: af 92 push r10 3745a: bf 92 push r11 3745c: cf 92 push r12 3745e: df 92 push r13 37460: ef 92 push r14 37462: ff 92 push r15 37464: 0f 93 push r16 37466: 1f 93 push r17 37468: 4b 01 movw r8, r22 3746a: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 3746c: e4 e5 ldi r30, 0x54 ; 84 3746e: f5 e0 ldi r31, 0x05 ; 5 37470: e0 84 ldd r14, Z+8 ; 0x08 37472: f1 84 ldd r15, Z+9 ; 0x09 37474: 02 85 ldd r16, Z+10 ; 0x0a 37476: 13 85 ldd r17, Z+11 ; 0x0b 37478: 24 81 ldd r18, Z+4 ; 0x04 3747a: 35 81 ldd r19, Z+5 ; 0x05 3747c: 46 81 ldd r20, Z+6 ; 0x06 3747e: 57 81 ldd r21, Z+7 ; 0x07 37480: 60 81 ld r22, Z 37482: 71 81 ldd r23, Z+1 ; 0x01 37484: 82 81 ldd r24, Z+2 ; 0x02 37486: 93 81 ldd r25, Z+3 ; 0x03 37488: 1f 92 push r1 3748a: 1f 92 push r1 3748c: 1f 92 push r1 3748e: 1f 92 push r1 37490: e0 e6 ldi r30, 0x60 ; 96 37492: ce 2e mov r12, r30 37494: e5 e0 ldi r30, 0x05 ; 5 37496: de 2e mov r13, r30 37498: 0f 94 08 ab call 0x35610 ; 0x35610 3749c: 0f 90 pop r0 3749e: 0f 90 pop r0 374a0: 0f 90 pop r0 374a2: 0f 90 pop r0 } 374a4: 1f 91 pop r17 374a6: 0f 91 pop r16 374a8: ff 90 pop r15 374aa: ef 90 pop r14 374ac: df 90 pop r13 374ae: cf 90 pop r12 374b0: bf 90 pop r11 374b2: af 90 pop r10 374b4: 9f 90 pop r9 374b6: 8f 90 pop r8 374b8: 08 95 ret 000374ba : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 374ba: 8f 92 push r8 374bc: 9f 92 push r9 374be: af 92 push r10 374c0: bf 92 push r11 374c2: cf 92 push r12 374c4: df 92 push r13 374c6: ef 92 push r14 374c8: ff 92 push r15 374ca: 0f 93 push r16 374cc: 1f 93 push r17 374ce: 4b 01 movw r8, r22 374d0: 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); 374d2: e3 e4 ldi r30, 0x43 ; 67 374d4: f7 e0 ldi r31, 0x07 ; 7 374d6: e0 84 ldd r14, Z+8 ; 0x08 374d8: f1 84 ldd r15, Z+9 ; 0x09 374da: 02 85 ldd r16, Z+10 ; 0x0a 374dc: 13 85 ldd r17, Z+11 ; 0x0b 374de: 24 81 ldd r18, Z+4 ; 0x04 374e0: 35 81 ldd r19, Z+5 ; 0x05 374e2: 46 81 ldd r20, Z+6 ; 0x06 374e4: 57 81 ldd r21, Z+7 ; 0x07 374e6: 60 81 ld r22, Z 374e8: 71 81 ldd r23, Z+1 ; 0x01 374ea: 82 81 ldd r24, Z+2 ; 0x02 374ec: 93 81 ldd r25, Z+3 ; 0x03 374ee: 1f 92 push r1 374f0: 1f 92 push r1 374f2: 1f 92 push r1 374f4: 1f 92 push r1 374f6: ef e4 ldi r30, 0x4F ; 79 374f8: ce 2e mov r12, r30 374fa: e7 e0 ldi r30, 0x07 ; 7 374fc: de 2e mov r13, r30 374fe: 0f 94 08 ab call 0x35610 ; 0x35610 37502: 0f 90 pop r0 37504: 0f 90 pop r0 37506: 0f 90 pop r0 37508: 0f 90 pop r0 } 3750a: 1f 91 pop r17 3750c: 0f 91 pop r16 3750e: ff 90 pop r15 37510: ef 90 pop r14 37512: df 90 pop r13 37514: cf 90 pop r12 37516: bf 90 pop r11 37518: af 90 pop r10 3751a: 9f 90 pop r9 3751c: 8f 90 pop r8 3751e: 08 95 ret 00037520 : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 37520: 4f 92 push r4 37522: 5f 92 push r5 37524: 6f 92 push r6 37526: 7f 92 push r7 37528: 8f 92 push r8 3752a: 9f 92 push r9 3752c: af 92 push r10 3752e: bf 92 push r11 37530: cf 92 push r12 37532: df 92 push r13 37534: ef 92 push r14 37536: ff 92 push r15 37538: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 3753a: 80 e0 ldi r24, 0x00 ; 0 3753c: 0f 94 05 58 call 0x2b00a ; 0x2b00a 37540: 60 93 54 07 sts 0x0754, r22 ; 0x800754 37544: 70 93 55 07 sts 0x0755, r23 ; 0x800755 37548: 80 93 56 07 sts 0x0756, r24 ; 0x800756 3754c: 90 93 57 07 sts 0x0757, r25 ; 0x800757 position[Y_AXIS] = st_get_position(Y_AXIS); 37550: 81 e0 ldi r24, 0x01 ; 1 37552: 0f 94 05 58 call 0x2b00a ; 0x2b00a 37556: 60 93 58 07 sts 0x0758, r22 ; 0x800758 3755a: 70 93 59 07 sts 0x0759, r23 ; 0x800759 3755e: 80 93 5a 07 sts 0x075A, r24 ; 0x80075a 37562: 90 93 5b 07 sts 0x075B, r25 ; 0x80075b position[Z_AXIS] = st_get_position(Z_AXIS); 37566: 82 e0 ldi r24, 0x02 ; 2 37568: 0f 94 05 58 call 0x2b00a ; 0x2b00a 3756c: 60 93 5c 07 sts 0x075C, r22 ; 0x80075c 37570: 70 93 5d 07 sts 0x075D, r23 ; 0x80075d 37574: 80 93 5e 07 sts 0x075E, r24 ; 0x80075e 37578: 90 93 5f 07 sts 0x075F, r25 ; 0x80075f position[E_AXIS] = st_get_position(E_AXIS); 3757c: 83 e0 ldi r24, 0x03 ; 3 3757e: 0f 94 05 58 call 0x2b00a ; 0x2b00a 37582: 60 93 60 07 sts 0x0760, r22 ; 0x800760 37586: 70 93 61 07 sts 0x0761, r23 ; 0x800761 3758a: 80 93 62 07 sts 0x0762, r24 ; 0x800762 3758e: 90 93 63 07 sts 0x0763, r25 ; 0x800763 // Second update the current position of the front end. current_position[X_AXIS] = st_get_position_mm(X_AXIS); 37592: 80 e0 ldi r24, 0x00 ; 0 37594: 0f 94 13 58 call 0x2b026 ; 0x2b026 37598: 60 93 43 07 sts 0x0743, r22 ; 0x800743 3759c: 70 93 44 07 sts 0x0744, r23 ; 0x800744 375a0: 80 93 45 07 sts 0x0745, r24 ; 0x800745 375a4: 90 93 46 07 sts 0x0746, r25 ; 0x800746 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 375a8: 81 e0 ldi r24, 0x01 ; 1 375aa: 0f 94 13 58 call 0x2b026 ; 0x2b026 375ae: 60 93 47 07 sts 0x0747, r22 ; 0x800747 375b2: 70 93 48 07 sts 0x0748, r23 ; 0x800748 375b6: 80 93 49 07 sts 0x0749, r24 ; 0x800749 375ba: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 375be: 82 e0 ldi r24, 0x02 ; 2 375c0: 0f 94 13 58 call 0x2b026 ; 0x2b026 375c4: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 375c8: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 375cc: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 375d0: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e current_position[E_AXIS] = st_get_position_mm(E_AXIS); 375d4: 83 e0 ldi r24, 0x03 ; 3 375d6: 0f 94 13 58 call 0x2b026 ; 0x2b026 375da: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 375de: 70 93 50 07 sts 0x0750, r23 ; 0x800750 375e2: 80 93 51 07 sts 0x0751, r24 ; 0x800751 375e6: 90 93 52 07 sts 0x0752, r25 ; 0x800752 // Apply the mesh bed leveling correction to the Z axis. #ifdef MESH_BED_LEVELING if (mbl.active) { 375ea: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 375ee: 88 23 and r24, r24 375f0: 31 f1 breq .+76 ; 0x3763e #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]); 375f2: 20 91 47 07 lds r18, 0x0747 ; 0x800747 375f6: 30 91 48 07 lds r19, 0x0748 ; 0x800748 375fa: 40 91 49 07 lds r20, 0x0749 ; 0x800749 375fe: 50 91 4a 07 lds r21, 0x074A ; 0x80074a 37602: 60 91 43 07 lds r22, 0x0743 ; 0x800743 37606: 70 91 44 07 lds r23, 0x0744 ; 0x800744 3760a: 80 91 45 07 lds r24, 0x0745 ; 0x800745 3760e: 90 91 46 07 lds r25, 0x0746 ; 0x800746 37612: 0f 94 1d 96 call 0x32c3a ; 0x32c3a 37616: 9b 01 movw r18, r22 37618: ac 01 movw r20, r24 3761a: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 3761e: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 37622: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 37626: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 3762a: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 3762e: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 37632: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 37636: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 3763a: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 3763e: c0 91 eb 17 lds r28, 0x17EB ; 0x8017eb 37642: cc 23 and r28, r28 37644: 09 f4 brne .+2 ; 0x37648 37646: 9a c0 rjmp .+308 ; 0x3777c // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 37648: c0 ff sbrs r28, 0 3764a: 34 c0 rjmp .+104 ; 0x376b4 // Then add the offset. x -= world2machine_shift[0]; 3764c: 20 91 e3 17 lds r18, 0x17E3 ; 0x8017e3 37650: 30 91 e4 17 lds r19, 0x17E4 ; 0x8017e4 37654: 40 91 e5 17 lds r20, 0x17E5 ; 0x8017e5 37658: 50 91 e6 17 lds r21, 0x17E6 ; 0x8017e6 3765c: 60 91 43 07 lds r22, 0x0743 ; 0x800743 37660: 70 91 44 07 lds r23, 0x0744 ; 0x800744 37664: 80 91 45 07 lds r24, 0x0745 ; 0x800745 37668: 90 91 46 07 lds r25, 0x0746 ; 0x800746 3766c: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 37670: 60 93 43 07 sts 0x0743, r22 ; 0x800743 37674: 70 93 44 07 sts 0x0744, r23 ; 0x800744 37678: 80 93 45 07 sts 0x0745, r24 ; 0x800745 3767c: 90 93 46 07 sts 0x0746, r25 ; 0x800746 y -= world2machine_shift[1]; 37680: 20 91 e7 17 lds r18, 0x17E7 ; 0x8017e7 37684: 30 91 e8 17 lds r19, 0x17E8 ; 0x8017e8 37688: 40 91 e9 17 lds r20, 0x17E9 ; 0x8017e9 3768c: 50 91 ea 17 lds r21, 0x17EA ; 0x8017ea 37690: 60 91 47 07 lds r22, 0x0747 ; 0x800747 37694: 70 91 48 07 lds r23, 0x0748 ; 0x800748 37698: 80 91 49 07 lds r24, 0x0749 ; 0x800749 3769c: 90 91 4a 07 lds r25, 0x074A ; 0x80074a 376a0: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 376a4: 60 93 47 07 sts 0x0747, r22 ; 0x800747 376a8: 70 93 48 07 sts 0x0748, r23 ; 0x800748 376ac: 80 93 49 07 sts 0x0749, r24 ; 0x800749 376b0: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 376b4: c1 ff sbrs r28, 1 376b6: 62 c0 rjmp .+196 ; 0x3777c // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 376b8: 80 90 43 07 lds r8, 0x0743 ; 0x800743 376bc: 90 90 44 07 lds r9, 0x0744 ; 0x800744 376c0: a0 90 45 07 lds r10, 0x0745 ; 0x800745 376c4: b0 90 46 07 lds r11, 0x0746 ; 0x800746 376c8: c0 90 47 07 lds r12, 0x0747 ; 0x800747 376cc: d0 90 48 07 lds r13, 0x0748 ; 0x800748 376d0: e0 90 49 07 lds r14, 0x0749 ; 0x800749 376d4: f0 90 4a 07 lds r15, 0x074A ; 0x80074a float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; 376d8: 20 91 db 17 lds r18, 0x17DB ; 0x8017db 376dc: 30 91 dc 17 lds r19, 0x17DC ; 0x8017dc 376e0: 40 91 dd 17 lds r20, 0x17DD ; 0x8017dd 376e4: 50 91 de 17 lds r21, 0x17DE ; 0x8017de 376e8: c5 01 movw r24, r10 376ea: b4 01 movw r22, r8 376ec: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 376f0: 2b 01 movw r4, r22 376f2: 3c 01 movw r6, r24 376f4: 20 91 df 17 lds r18, 0x17DF ; 0x8017df 376f8: 30 91 e0 17 lds r19, 0x17E0 ; 0x8017e0 376fc: 40 91 e1 17 lds r20, 0x17E1 ; 0x8017e1 37700: 50 91 e2 17 lds r21, 0x17E2 ; 0x8017e2 37704: c7 01 movw r24, r14 37706: b6 01 movw r22, r12 37708: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3770c: 9b 01 movw r18, r22 3770e: ac 01 movw r20, r24 37710: c3 01 movw r24, r6 37712: b2 01 movw r22, r4 37714: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 37718: 2b 01 movw r4, r22 3771a: 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; 3771c: 20 91 d3 17 lds r18, 0x17D3 ; 0x8017d3 37720: 30 91 d4 17 lds r19, 0x17D4 ; 0x8017d4 37724: 40 91 d5 17 lds r20, 0x17D5 ; 0x8017d5 37728: 50 91 d6 17 lds r21, 0x17D6 ; 0x8017d6 3772c: c5 01 movw r24, r10 3772e: b4 01 movw r22, r8 37730: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 37734: 4b 01 movw r8, r22 37736: 5c 01 movw r10, r24 37738: 20 91 d7 17 lds r18, 0x17D7 ; 0x8017d7 3773c: 30 91 d8 17 lds r19, 0x17D8 ; 0x8017d8 37740: 40 91 d9 17 lds r20, 0x17D9 ; 0x8017d9 37744: 50 91 da 17 lds r21, 0x17DA ; 0x8017da 37748: c7 01 movw r24, r14 3774a: b6 01 movw r22, r12 3774c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 37750: 9b 01 movw r18, r22 37752: ac 01 movw r20, r24 37754: c5 01 movw r24, r10 37756: b4 01 movw r22, r8 37758: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 3775c: 60 93 43 07 sts 0x0743, r22 ; 0x800743 37760: 70 93 44 07 sts 0x0744, r23 ; 0x800744 37764: 80 93 45 07 sts 0x0745, r24 ; 0x800745 37768: 90 93 46 07 sts 0x0746, r25 ; 0x800746 y = out_y; 3776c: 40 92 47 07 sts 0x0747, r4 ; 0x800747 37770: 50 92 48 07 sts 0x0748, r5 ; 0x800748 37774: 60 92 49 07 sts 0x0749, r6 ; 0x800749 37778: 70 92 4a 07 sts 0x074A, r7 ; 0x80074a } #endif // Apply inverse world correction matrix. machine2world(current_position[X_AXIS], current_position[Y_AXIS]); set_destination_to_current(); 3777c: 0e 94 6f 69 call 0xd2de ; 0xd2de #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 37780: 80 e1 ldi r24, 0x10 ; 16 37782: e3 e4 ldi r30, 0x43 ; 67 37784: f7 e0 ldi r31, 0x07 ; 7 37786: a0 ed ldi r26, 0xD0 ; 208 37788: b4 e0 ldi r27, 0x04 ; 4 3778a: 01 90 ld r0, Z+ 3778c: 0d 92 st X+, r0 3778e: 8a 95 dec r24 37790: e1 f7 brne .-8 ; 0x3778a #endif } 37792: cf 91 pop r28 37794: ff 90 pop r15 37796: ef 90 pop r14 37798: df 90 pop r13 3779a: cf 90 pop r12 3779c: bf 90 pop r11 3779e: af 90 pop r10 377a0: 9f 90 pop r9 377a2: 8f 90 pop r8 377a4: 7f 90 pop r7 377a6: 6f 90 pop r6 377a8: 5f 90 pop r5 377aa: 4f 90 pop r4 377ac: 08 95 ret 000377ae : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 377ae: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 377b2: 8d 7f andi r24, 0xFD ; 253 377b4: 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(); 377b8: 0f 94 90 ba call 0x37520 ; 0x37520 // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 377bc: 81 e0 ldi r24, 0x01 ; 1 377be: 80 93 5d 0e sts 0x0E5D, r24 ; 0x800e5d } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 377c2: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 377c6: 8d 7f andi r24, 0xFD ; 253 377c8: 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); 377cc: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 377d0: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 while (blocks_queued()) plan_discard_current_block(); 377d4: 98 17 cp r25, r24 377d6: 69 f0 breq .+26 ; 0x377f2 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) { 377d8: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 377dc: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 377e0: 98 17 cp r25, r24 377e2: a1 f3 breq .-24 ; 0x377cc block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 377e4: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 377e8: 8f 5f subi r24, 0xFF ; 255 377ea: 8f 70 andi r24, 0x0F ; 15 377ec: 80 93 57 0e sts 0x0E57, r24 ; 0x800e57 377f0: ed cf rjmp .-38 ; 0x377cc current_block = NULL; 377f2: 10 92 a3 05 sts 0x05A3, r1 ; 0x8005a3 377f6: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 377fa: 8f ef ldi r24, 0xFF ; 255 377fc: 9f ef ldi r25, 0xFF ; 255 377fe: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.491+0x1> 37802: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.491> current_adv_steps = 0; 37806: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.493+0x1> 3780a: 10 92 e2 04 sts 0x04E2, r1 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.493> #endif st_reset_timer(); 3780e: 0f 94 81 58 call 0x2b102 ; 0x2b102 ENABLE_STEPPER_DRIVER_INTERRUPT(); 37812: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 37816: 82 60 ori r24, 0x02 ; 2 37818: 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; 3781c: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.505> 37820: 10 92 bd 04 sts 0x04BD, r1 ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.505+0x1> 37824: 10 92 be 04 sts 0x04BE, r1 ; 0x8004be <_ZL22previous_nominal_speed.lto_priv.505+0x2> 37828: 10 92 bf 04 sts 0x04BF, r1 ; 0x8004bf <_ZL22previous_nominal_speed.lto_priv.505+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 3782c: e0 ec ldi r30, 0xC0 ; 192 3782e: f4 e0 ldi r31, 0x04 ; 4 37830: 80 e1 ldi r24, 0x10 ; 16 37832: df 01 movw r26, r30 37834: 1d 92 st X+, r1 37836: 8a 95 dec r24 37838: e9 f7 brne .-6 ; 0x37834 // Reset position sync requests plan_reset_next_e_queue = false; 3783a: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL23plan_reset_next_e_queue.lto_priv.503> plan_reset_next_e_sched = false; 3783e: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL23plan_reset_next_e_sched.lto_priv.504> } 37842: 08 95 ret 00037844 <__vector_5>: SERIAL_ECHOLNRPGM(MSG_INT4); uvlo_drain_reset(); } } ISR(INT4_vect) { 37844: 1f 92 push r1 37846: 0f 92 push r0 37848: 0f b6 in r0, 0x3f ; 63 3784a: 0f 92 push r0 3784c: 11 24 eor r1, r1 3784e: 0b b6 in r0, 0x3b ; 59 37850: 0f 92 push r0 37852: 8f 92 push r8 37854: 9f 92 push r9 37856: af 92 push r10 37858: bf 92 push r11 3785a: cf 92 push r12 3785c: df 92 push r13 3785e: ef 92 push r14 37860: ff 92 push r15 37862: 0f 93 push r16 37864: 1f 93 push r17 37866: 2f 93 push r18 37868: 3f 93 push r19 3786a: 4f 93 push r20 3786c: 5f 93 push r21 3786e: 6f 93 push r22 37870: 7f 93 push r23 37872: 8f 93 push r24 37874: 9f 93 push r25 37876: af 93 push r26 37878: bf 93 push r27 3787a: cf 93 push r28 3787c: df 93 push r29 3787e: ef 93 push r30 37880: ff 93 push r31 EIMSK &= ~(1 << 4); //disable INT4 interrupt to make sure that this code will be executed just once 37882: ec 98 cbi 0x1d, 4 ; 29 SERIAL_ECHOLNRPGM(MSG_INT4); 37884: 81 e7 ldi r24, 0x71 ; 113 37886: 90 e9 ldi r25, 0x90 ; 144 37888: 0e 94 86 7b call 0xf70c ; 0xf70c if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::NO_PENDING_RECOVERY) 3788c: 85 ea ldi r24, 0xA5 ; 165 3788e: 9f e0 ldi r25, 0x0F ; 15 37890: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 37894: 18 2f mov r17, r24 37896: 81 11 cpse r24, r1 37898: de c2 rjmp .+1468 ; 0x37e56 <__vector_5+0x612> { if(printer_active()) { 3789a: 0e 94 16 69 call 0xd22c ; 0xd22c 3789e: 88 23 and r24, r24 378a0: 09 f4 brne .+2 ; 0x378a4 <__vector_5+0x60> 378a2: a9 c3 rjmp .+1874 ; 0x37ff6 <__vector_5+0x7b2> while(1); } void uvlo_() { unsigned long time_start = _millis(); 378a4: 0f 94 86 3e call 0x27d0c ; 0x27d0c 378a8: 6b 01 movw r12, r22 378aa: 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); 378ac: c0 91 5a 0e lds r28, 0x0E5A ; 0x800e5a 378b0: cc 23 and r28, r28 378b2: 31 f0 breq .+12 ; 0x378c0 <__vector_5+0x7c> 378b4: c1 e0 ldi r28, 0x01 ; 1 378b6: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 378ba: 82 30 cpi r24, 0x02 ; 2 378bc: 09 f4 brne .+2 ; 0x378c0 <__vector_5+0x7c> 378be: c0 e0 ldi r28, 0x00 ; 0 const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 378c0: d0 91 59 0e lds r29, 0x0E59 ; 0x800e59 378c4: d1 11 cpse r29, r1 378c6: 02 c0 rjmp .+4 ; 0x378cc <__vector_5+0x88> 378c8: d0 91 58 0e lds r29, 0x0E58 ; 0x800e58 // Conserve as much power as soon as possible // Turn off the LCD backlight #ifdef LCD_BL_PIN backlightMode = BACKLIGHT_MODE_DIM; 378cc: 10 92 4f 02 sts 0x024F, r1 ; 0x80024f backlightLevel_LOW = 0; 378d0: 10 92 fc 03 sts 0x03FC, r1 ; 0x8003fc backlight_update(); 378d4: 0e 94 b1 8b call 0x11762 ; 0x11762 #endif //LCD_BL_PIN // Disable X and Y motors to conserve power disable_x(); 378d8: 17 9a sbi 0x02, 7 ; 2 378da: 10 92 40 07 sts 0x0740, r1 ; 0x800740 disable_y(); 378de: 16 9a sbi 0x02, 6 ; 2 378e0: 10 92 41 07 sts 0x0741, r1 ; 0x800741 // Minimise Z and E motor currents (Hold and Run) #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 378e4: 64 e1 ldi r22, 0x14 ; 20 378e6: 83 e6 ldi r24, 0x63 ; 99 378e8: 92 e0 ldi r25, 0x02 ; 2 378ea: 0e 94 33 69 call 0xd266 ; 0xd266 currents[Z_AXIS].setiRun(20); 378ee: 64 e1 ldi r22, 0x14 ; 20 378f0: 83 e6 ldi r24, 0x63 ; 99 378f2: 92 e0 ldi r25, 0x02 ; 2 378f4: 0e 94 3b 69 call 0xd276 ; 0xd276 tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 378f8: 50 e0 ldi r21, 0x00 ; 0 378fa: 40 e0 ldi r20, 0x00 ; 0 378fc: 60 91 fa 04 lds r22, 0x04FA ; 0x8004fa 37900: 82 e0 ldi r24, 0x02 ; 2 37902: 0f 94 45 39 call 0x2728a ; 0x2728a currents[E_AXIS].setiHold(20); 37906: 64 e1 ldi r22, 0x14 ; 20 37908: 86 e6 ldi r24, 0x66 ; 102 3790a: 92 e0 ldi r25, 0x02 ; 2 3790c: 0e 94 33 69 call 0xd266 ; 0xd266 currents[E_AXIS].setiRun(20); 37910: 64 e1 ldi r22, 0x14 ; 20 37912: 86 e6 ldi r24, 0x66 ; 102 37914: 92 e0 ldi r25, 0x02 ; 2 37916: 0e 94 3b 69 call 0xd276 ; 0xd276 tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 3791a: 50 e0 ldi r21, 0x00 ; 0 3791c: 40 e0 ldi r20, 0x00 ; 0 3791e: 60 91 fb 04 lds r22, 0x04FB ; 0x8004fb 37922: 83 e0 ldi r24, 0x03 ; 3 37924: 0f 94 45 39 call 0x2728a ; 0x2728a #endif //TMC2130 if (!print_saved_in_ram && !isPartialBackupAvailable) 37928: c1 11 cpse r28, r1 3792a: 1b c0 rjmp .+54 ; 0x37962 <__vector_5+0x11e> 3792c: 80 91 53 07 lds r24, 0x0753 ; 0x800753 37930: 81 11 cpse r24, r1 37932: 17 c0 rjmp .+46 ; 0x37962 <__vector_5+0x11e> { saved_bed_temperature = target_temperature_bed; 37934: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 37938: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af saved_extruder_temperature = target_temperature[active_extruder]; 3793c: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 37940: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 37944: 90 93 ae 05 sts 0x05AE, r25 ; 0x8005ae 37948: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 3794c: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 37950: 83 fb bst r24, 3 37952: 88 27 eor r24, r24 37954: 80 f9 bld r24, 0 37956: 80 93 06 18 sts 0x1806, r24 ; 0x801806 saved_fan_speed = fanSpeed; 3795a: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 3795e: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac } // Stop all heaters before continuing disable_heater(); 37962: 0f 94 52 44 call 0x288a4 ; 0x288a4 // Fetch data not included in a partial back-up if (!print_saved_in_ram) { 37966: c1 11 cpse r28, r1 37968: 04 c0 rjmp .+8 ; 0x37972 <__vector_5+0x12e> // Calculate the file position, from which to resume this print. save_print_file_state(); 3796a: 0e 94 6f 66 call 0xccde ; 0xccde // save the global state at planning time save_planner_global_state(); 3796e: 0e 94 25 66 call 0xcc4a ; 0xcc4a } // 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; 37972: 00 91 a0 13 lds r16, 0x13A0 ; 0x8013a0 mbl.active = false; 37976: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 // 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(); 3797a: 0f 94 d7 bb call 0x377ae ; 0x377ae // 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) 3797e: c1 11 cpse r28, r1 37980: 1b c0 rjmp .+54 ; 0x379b8 <__vector_5+0x174> 37982: 80 91 53 07 lds r24, 0x0753 ; 0x800753 37986: 81 11 cpse r24, r1 37988: 17 c0 rjmp .+46 ; 0x379b8 <__vector_5+0x174> { memcpy(saved_pos, current_position, sizeof(saved_pos)); 3798a: 80 e1 ldi r24, 0x10 ; 16 3798c: e3 e4 ldi r30, 0x43 ; 67 3798e: f7 e0 ldi r31, 0x07 ; 7 37990: ab e9 ldi r26, 0x9B ; 155 37992: b2 e0 ldi r27, 0x02 ; 2 37994: 01 90 ld r0, Z+ 37996: 0d 92 st X+, r0 37998: 8a 95 dec r24 3799a: e1 f7 brne .-8 ; 0x37994 <__vector_5+0x150> if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 3799c: dd 23 and r29, r29 3799e: 61 f0 breq .+24 ; 0x379b8 <__vector_5+0x174> 379a0: 80 e0 ldi r24, 0x00 ; 0 379a2: 90 e0 ldi r25, 0x00 ; 0 379a4: a0 e8 ldi r26, 0x80 ; 128 379a6: bf eb ldi r27, 0xBF ; 191 379a8: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b 379ac: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c 379b0: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d 379b4: b0 93 9e 02 sts 0x029E, r27 ; 0x80029e } // 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]; 379b8: 80 90 a3 02 lds r8, 0x02A3 ; 0x8002a3 379bc: 90 90 a4 02 lds r9, 0x02A4 ; 0x8002a4 379c0: a0 90 a5 02 lds r10, 0x02A5 ; 0x8002a5 379c4: b0 90 a6 02 lds r11, 0x02A6 ; 0x8002a6 if(mbl_was_active) { 379c8: 00 23 and r16, r16 379ca: d1 f0 breq .+52 ; 0x37a00 <__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]); 379cc: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 379d0: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 379d4: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 379d8: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 379dc: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 379e0: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 379e4: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 379e8: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 379ec: 0f 94 1d 96 call 0x32c3a ; 0x32c3a 379f0: 9b 01 movw r18, r22 379f2: ac 01 movw r20, r24 379f4: c5 01 movw r24, r10 379f6: b4 01 movw r22, r8 379f8: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 379fc: 4b 01 movw r8, r22 379fe: 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); 37a00: b5 01 movw r22, r10 37a02: a4 01 movw r20, r8 37a04: 8d e8 ldi r24, 0x8D ; 141 37a06: 9f e0 ldi r25, 0x0F ; 15 37a08: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 37a0c: 40 91 a7 02 lds r20, 0x02A7 ; 0x8002a7 37a10: 50 91 a8 02 lds r21, 0x02A8 ; 0x8002a8 37a14: 60 91 a9 02 lds r22, 0x02A9 ; 0x8002a9 37a18: 70 91 aa 02 lds r23, 0x02AA ; 0x8002aa 37a1c: 8e e6 ldi r24, 0x6E ; 110 37a1e: 9f e0 ldi r25, 0x0F ; 15 37a20: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 } 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); 37a24: 60 91 06 18 lds r22, 0x1806 ; 0x801806 37a28: c1 e0 ldi r28, 0x01 ; 1 37a2a: 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); 37a2c: 82 e7 ldi r24, 0x72 ; 114 37a2e: 9f e0 ldi r25, 0x0F ; 15 37a30: 0f 94 7f dd call 0x3bafe ; 0x3bafe // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 37a34: 0e 94 4f 81 call 0x1029e ; 0x1029e card.sdprinting = false; 37a38: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e saved_printing = true; 37a3c: c0 93 5a 0e sts 0x0E5A, r28 ; 0x800e5a // 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; 37a40: 10 92 5d 0e sts 0x0E5D, r1 ; 0x800e5d sei(); 37a44: 78 94 sei // Retract current_position[E_AXIS] -= default_retraction; 37a46: 20 e0 ldi r18, 0x00 ; 0 37a48: 30 e0 ldi r19, 0x00 ; 0 37a4a: 40 e8 ldi r20, 0x80 ; 128 37a4c: 5f e3 ldi r21, 0x3F ; 63 37a4e: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 37a52: 70 91 50 07 lds r23, 0x0750 ; 0x800750 37a56: 80 91 51 07 lds r24, 0x0751 ; 0x800751 37a5a: 90 91 52 07 lds r25, 0x0752 ; 0x800752 37a5e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 37a62: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 37a66: 70 93 50 07 sts 0x0750, r23 ; 0x800750 37a6a: 80 93 51 07 sts 0x0751, r24 ; 0x800751 37a6e: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(95); 37a72: 60 e0 ldi r22, 0x00 ; 0 37a74: 70 e0 ldi r23, 0x00 ; 0 37a76: 8e eb ldi r24, 0xBE ; 190 37a78: 92 e4 ldi r25, 0x42 ; 66 37a7a: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 37a7e: 0f 94 27 58 call 0x2b04e ; 0x2b04e disable_e0(); 37a82: 14 9a sbi 0x02, 4 ; 2 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 37a84: 80 91 fa 04 lds r24, 0x04FA ; 0x8004fa 37a88: c0 e0 ldi r28, 0x00 ; 0 37a8a: d1 e0 ldi r29, 0x01 ; 1 37a8c: 02 c0 rjmp .+4 ; 0x37a92 <__vector_5+0x24e> 37a8e: d6 95 lsr r29 37a90: c7 95 ror r28 37a92: 8a 95 dec r24 37a94: e2 f7 brpl .-8 ; 0x37a8e <__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); 37a96: 82 e0 ldi r24, 0x02 ; 2 37a98: 0f 94 2b 39 call 0x27256 ; 0x27256 current_position[Z_AXIS] += float(1024 - z_microsteps) 37a9c: 60 e0 ldi r22, 0x00 ; 0 37a9e: 74 e0 ldi r23, 0x04 ; 4 37aa0: 68 1b sub r22, r24 37aa2: 79 0b sbc r23, r25 37aa4: 90 e0 ldi r25, 0x00 ; 0 37aa6: 80 e0 ldi r24, 0x00 ; 0 37aa8: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 37aac: 4b 01 movw r8, r22 37aae: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 37ab0: be 01 movw r22, r28 37ab2: 90 e0 ldi r25, 0x00 ; 0 37ab4: 80 e0 ldi r24, 0x00 ; 0 37ab6: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 37aba: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 37abe: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 37ac2: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 37ac6: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 37aca: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 37ace: 9b 01 movw r18, r22 37ad0: ac 01 movw r20, r24 37ad2: c5 01 movw r24, r10 37ad4: b4 01 movw r22, r8 37ad6: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> + UVLO_Z_AXIS_SHIFT; 37ada: 2a e0 ldi r18, 0x0A ; 10 37adc: 37 ed ldi r19, 0xD7 ; 215 37ade: 43 e2 ldi r20, 0x23 ; 35 37ae0: 5f e3 ldi r21, 0x3F ; 63 37ae2: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__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) 37ae6: 20 91 4b 07 lds r18, 0x074B ; 0x80074b 37aea: 30 91 4c 07 lds r19, 0x074C ; 0x80074c 37aee: 40 91 4d 07 lds r20, 0x074D ; 0x80074d 37af2: 50 91 4e 07 lds r21, 0x074E ; 0x80074e 37af6: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 37afa: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 37afe: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 37b02: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 37b06: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 37b0a: 65 e5 ldi r22, 0x55 ; 85 37b0c: 75 e5 ldi r23, 0x55 ; 85 37b0e: 85 e5 ldi r24, 0x55 ; 85 37b10: 91 e4 ldi r25, 0x41 ; 65 37b12: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 37b16: 0f 94 27 58 call 0x2b04e ; 0x2b04e if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 37b1a: 40 91 02 18 lds r20, 0x1802 ; 0x801802 37b1e: 50 91 03 18 lds r21, 0x1803 ; 0x801803 37b22: 60 91 04 18 lds r22, 0x1804 ; 0x801804 37b26: 70 91 05 18 lds r23, 0x1805 ; 0x801805 37b2a: 81 e9 ldi r24, 0x91 ; 145 37b2c: 9f e0 ldi r25, 0x0F ; 15 37b2e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 37b32: ce ea ldi r28, 0xAE ; 174 37b34: 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; 37b36: 97 e0 ldi r25, 0x07 ; 7 37b38: 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; 37b3a: 70 e0 ldi r23, 0x00 ; 0 37b3c: 60 e0 ldi r22, 0x00 ; 0 37b3e: 00 23 and r16, r16 37b40: 19 f1 breq .+70 ; 0x37b88 <__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; 37b42: 81 2f mov r24, r17 37b44: 6b 2d mov r22, r11 37b46: 0f 94 0a de call 0x3bc14 ; 0x3bc14 <__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; 37b4a: b8 9e mul r11, r24 37b4c: f0 01 movw r30, r0 37b4e: 11 24 eor r1, r1 37b50: e9 0f add r30, r25 37b52: f1 1d adc r31, r1 37b54: ee 0f add r30, r30 37b56: ff 1f adc r31, r31 37b58: ee 0f add r30, r30 37b5a: ff 1f adc r31, r31 37b5c: e0 56 subi r30, 0x60 ; 96 37b5e: fc 4e sbci r31, 0xEC ; 236 37b60: 20 e0 ldi r18, 0x00 ; 0 37b62: 30 e0 ldi r19, 0x00 ; 0 37b64: 4a e7 ldi r20, 0x7A ; 122 37b66: 54 e4 ldi r21, 0x44 ; 68 37b68: 61 81 ldd r22, Z+1 ; 0x01 37b6a: 72 81 ldd r23, Z+2 ; 0x02 37b6c: 83 81 ldd r24, Z+3 ; 0x03 37b6e: 94 81 ldd r25, Z+4 ; 0x04 37b70: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 37b74: 20 e0 ldi r18, 0x00 ; 0 37b76: 30 e0 ldi r19, 0x00 ; 0 37b78: 40 e0 ldi r20, 0x00 ; 0 37b7a: 5f e3 ldi r21, 0x3F ; 63 37b7c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 37b80: 0f 94 2a e0 call 0x3c054 ; 0x3c054 37b84: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37b88: ce 01 movw r24, r28 37b8a: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a // 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) 37b8e: 1f 5f subi r17, 0xFF ; 255 37b90: 22 96 adiw r28, 0x02 ; 2 37b92: 11 33 cpi r17, 0x31 ; 49 37b94: 91 f6 brne .-92 ; 0x37b3a <__vector_5+0x2f6> if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37b96: 40 91 4b 07 lds r20, 0x074B ; 0x80074b 37b9a: 50 91 4c 07 lds r21, 0x074C ; 0x80074c 37b9e: 60 91 4d 07 lds r22, 0x074D ; 0x80074d 37ba2: 70 91 4e 07 lds r23, 0x074E ; 0x80074e 37ba6: 8a ed ldi r24, 0xDA ; 218 37ba8: 9e e0 ldi r25, 0x0E ; 14 37baa: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 37bae: 40 91 9b 02 lds r20, 0x029B ; 0x80029b 37bb2: 50 91 9c 02 lds r21, 0x029C ; 0x80029c 37bb6: 60 91 9d 02 lds r22, 0x029D ; 0x80029d 37bba: 70 91 9e 02 lds r23, 0x029E ; 0x80029e 37bbe: 8d e9 ldi r24, 0x9D ; 157 37bc0: 9f e0 ldi r25, 0x0F ; 15 37bc2: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 37bc6: 40 91 9f 02 lds r20, 0x029F ; 0x80029f 37bca: 50 91 a0 02 lds r21, 0x02A0 ; 0x8002a0 37bce: 60 91 a1 02 lds r22, 0x02A1 ; 0x8002a1 37bd2: 70 91 a2 02 lds r23, 0x02A2 ; 0x8002a2 37bd6: 81 ea ldi r24, 0xA1 ; 161 37bd8: 9f e0 ldi r25, 0x0F ; 15 37bda: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37bde: 60 91 00 18 lds r22, 0x1800 ; 0x801800 37be2: 70 91 01 18 lds r23, 0x1801 ; 0x801801 37be6: 89 e8 ldi r24, 0x89 ; 137 37be8: 9f e0 ldi r25, 0x0F ; 15 37bea: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 37bee: 60 91 39 02 lds r22, 0x0239 ; 0x800239 37bf2: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 37bf6: 85 e3 ldi r24, 0x35 ; 53 37bf8: 9d e0 ldi r25, 0x0D ; 13 37bfa: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 37bfe: 60 91 ad 05 lds r22, 0x05AD ; 0x8005ad 37c02: 70 91 ae 05 lds r23, 0x05AE ; 0x8005ae 37c06: 88 ed ldi r24, 0xD8 ; 216 37c08: 9e e0 ldi r25, 0x0E ; 14 37c0a: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37c0e: 60 91 af 05 lds r22, 0x05AF ; 0x8005af 37c12: 8b e8 ldi r24, 0x8B ; 139 37c14: 9f e0 ldi r25, 0x0F ; 15 37c16: 0f 94 7f dd call 0x3bafe ; 0x3bafe 37c1a: 60 91 ac 05 lds r22, 0x05AC ; 0x8005ac 37c1e: 88 e8 ldi r24, 0x88 ; 136 37c20: 9f e0 ldi r25, 0x0F ; 15 37c22: 0f 94 7f dd call 0x3bafe ; 0x3bafe if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37c26: 40 91 bb 02 lds r20, 0x02BB ; 0x8002bb 37c2a: 50 91 bc 02 lds r21, 0x02BC ; 0x8002bc 37c2e: 60 91 bd 02 lds r22, 0x02BD ; 0x8002bd 37c32: 70 91 be 02 lds r23, 0x02BE ; 0x8002be 37c36: 88 ee ldi r24, 0xE8 ; 232 37c38: 9e e0 ldi r25, 0x0E ; 14 37c3a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37c3e: 60 91 94 02 lds r22, 0x0294 ; 0x800294 37c42: 70 91 95 02 lds r23, 0x0295 ; 0x800295 37c46: 8e ed ldi r24, 0xDE ; 222 37c48: 9e e0 ldi r25, 0x0E ; 14 37c4a: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37c4e: 40 91 a2 06 lds r20, 0x06A2 ; 0x8006a2 37c52: 50 91 a3 06 lds r21, 0x06A3 ; 0x8006a3 37c56: 60 91 a4 06 lds r22, 0x06A4 ; 0x8006a4 37c5a: 70 91 a5 06 lds r23, 0x06A5 ; 0x8006a5 37c5e: 81 e1 ldi r24, 0x11 ; 17 37c60: 9d e0 ldi r25, 0x0D ; 13 37c62: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 37c66: 40 91 a6 06 lds r20, 0x06A6 ; 0x8006a6 37c6a: 50 91 a7 06 lds r21, 0x06A7 ; 0x8006a7 37c6e: 60 91 a8 06 lds r22, 0x06A8 ; 0x8006a8 37c72: 70 91 a9 06 lds r23, 0x06A9 ; 0x8006a9 37c76: 8d e0 ldi r24, 0x0D ; 13 37c78: 9d e0 ldi r25, 0x0D ; 13 37c7a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 37c7e: 40 91 2e 07 lds r20, 0x072E ; 0x80072e 37c82: 50 91 2f 07 lds r21, 0x072F ; 0x80072f 37c86: 60 91 30 07 lds r22, 0x0730 ; 0x800730 37c8a: 70 91 31 07 lds r23, 0x0731 ; 0x800731 37c8e: 89 e0 ldi r24, 0x09 ; 9 37c90: 9d e0 ldi r25, 0x0D ; 13 37c92: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 #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); 37c96: 40 e1 ldi r20, 0x10 ; 16 37c98: 50 e0 ldi r21, 0x00 ; 0 37c9a: 67 e3 ldi r22, 0x37 ; 55 37c9c: 7d e0 ldi r23, 0x0D ; 13 37c9e: 8b ea ldi r24, 0xAB ; 171 37ca0: 92 e0 ldi r25, 0x02 ; 2 37ca2: 0f 94 6f dd call 0x3bade ; 0x3bade if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37ca6: 60 91 0b 18 lds r22, 0x180B ; 0x80180b 37caa: 70 91 0c 18 lds r23, 0x180C ; 0x80180c 37cae: 8c e6 ldi r24, 0x6C ; 108 37cb0: 9f e0 ldi r25, 0x0F ; 15 37cb2: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37cb6: 60 91 6a 02 lds r22, 0x026A ; 0x80026a 37cba: 8c e8 ldi r24, 0x8C ; 140 37cbc: 9f e0 ldi r25, 0x0F ; 15 37cbe: 0f 94 7f dd call 0x3bafe ; 0x3bafe if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37cc2: 40 91 07 18 lds r20, 0x1807 ; 0x801807 37cc6: 50 91 08 18 lds r21, 0x1808 ; 0x801808 37cca: 60 91 09 18 lds r22, 0x1809 ; 0x801809 37cce: 70 91 0a 18 lds r23, 0x180A ; 0x80180a 37cd2: 8c e2 ldi r24, 0x2C ; 44 37cd4: 9d e0 ldi r25, 0x0D ; 13 37cd6: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37cda: 60 91 6b 02 lds r22, 0x026B ; 0x80026b 37cde: 70 91 6c 02 lds r23, 0x026C ; 0x80026c 37ce2: 8d e7 ldi r24, 0x7D ; 125 37ce4: 9c e0 ldi r25, 0x0C ; 12 37ce6: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a #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); 37cea: 40 e1 ldi r20, 0x10 ; 16 37cec: 50 e0 ldi r21, 0x00 ; 0 37cee: 6d e6 ldi r22, 0x6D ; 109 37cf0: 7c e0 ldi r23, 0x0C ; 12 37cf2: 82 e9 ldi r24, 0x92 ; 146 37cf4: 96 e0 ldi r25, 0x06 ; 6 37cf6: 0f 94 6f dd call 0x3bade ; 0x3bade 37cfa: 40 e1 ldi r20, 0x10 ; 16 37cfc: 50 e0 ldi r21, 0x00 ; 0 37cfe: 6d e5 ldi r22, 0x5D ; 93 37d00: 7c e0 ldi r23, 0x0C ; 12 37d02: 8a e1 ldi r24, 0x1A ; 26 37d04: 97 e0 ldi r25, 0x07 ; 7 37d06: 0f 94 6f dd call 0x3bade ; 0x3bade 37d0a: 40 e1 ldi r20, 0x10 ; 16 37d0c: 50 e0 ldi r21, 0x00 ; 0 37d0e: 6d e4 ldi r22, 0x4D ; 77 37d10: 7c e0 ldi r23, 0x0C ; 12 37d12: 82 e8 ldi r24, 0x82 ; 130 37d14: 96 e0 ldi r25, 0x06 ; 6 37d16: 0f 94 6f dd call 0x3bade ; 0x3bade 37d1a: 40 e1 ldi r20, 0x10 ; 16 37d1c: 50 e0 ldi r21, 0x00 ; 0 37d1e: 6d e3 ldi r22, 0x3D ; 61 37d20: 7c e0 ldi r23, 0x0C ; 12 37d22: 8a e0 ldi r24, 0x0A ; 10 37d24: 97 e0 ldi r25, 0x07 ; 7 37d26: 0f 94 6f dd call 0x3bade ; 0x3bade if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37d2a: 40 91 aa 06 lds r20, 0x06AA ; 0x8006aa 37d2e: 50 91 ab 06 lds r21, 0x06AB ; 0x8006ab 37d32: 60 91 ac 06 lds r22, 0x06AC ; 0x8006ac 37d36: 70 91 ad 06 lds r23, 0x06AD ; 0x8006ad 37d3a: 89 e3 ldi r24, 0x39 ; 57 37d3c: 9c e0 ldi r25, 0x0C ; 12 37d3e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 37d42: 40 91 ae 06 lds r20, 0x06AE ; 0x8006ae 37d46: 50 91 af 06 lds r21, 0x06AF ; 0x8006af 37d4a: 60 91 b0 06 lds r22, 0x06B0 ; 0x8006b0 37d4e: 70 91 b1 06 lds r23, 0x06B1 ; 0x8006b1 37d52: 85 e3 ldi r24, 0x35 ; 53 37d54: 9c e0 ldi r25, 0x0C ; 12 37d56: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 37d5a: 40 91 b2 06 lds r20, 0x06B2 ; 0x8006b2 37d5e: 50 91 b3 06 lds r21, 0x06B3 ; 0x8006b3 37d62: 60 91 b4 06 lds r22, 0x06B4 ; 0x8006b4 37d66: 70 91 b5 06 lds r23, 0x06B5 ; 0x8006b5 37d6a: 81 e3 ldi r24, 0x31 ; 49 37d6c: 9c e0 ldi r25, 0x0C ; 12 37d6e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 #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); 37d72: 40 e1 ldi r20, 0x10 ; 16 37d74: 50 e0 ldi r21, 0x00 ; 0 37d76: 61 e2 ldi r22, 0x21 ; 33 37d78: 7c e0 ldi r23, 0x0C ; 12 37d7a: 86 eb ldi r24, 0xB6 ; 182 37d7c: 96 e0 ldi r25, 0x06 ; 6 37d7e: 0f 94 6f dd call 0x3bade ; 0x3bade 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) { 37d82: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 37d86: 88 23 and r24, r24 37d88: 29 f0 breq .+10 ; 0x37d94 <__vector_5+0x550> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37d8a: 61 e0 ldi r22, 0x01 ; 1 37d8c: 8f e7 ldi r24, 0x7F ; 127 37d8e: 9c e0 ldi r25, 0x0C ; 12 37d90: 0f 94 7f dd call 0x3bafe ; 0x3bafe 37d94: 61 e0 ldi r22, 0x01 ; 1 37d96: 85 ea ldi r24, 0xA5 ; 165 37d98: 9f e0 ldi r25, 0x0F ; 15 37d9a: 0f 94 7f dd call 0x3bafe ; 0x3bafe } eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY); // Increment power failure counter eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT); 37d9e: 84 e6 ldi r24, 0x64 ; 100 37da0: 9f e0 ldi r25, 0x0F ; 15 37da2: 0e 94 33 78 call 0xf066 ; 0xf066 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 37da6: 8f ef ldi r24, 0xFF ; 255 37da8: 9e e0 ldi r25, 0x0E ; 14 37daa: 0e 94 26 78 call 0xf04c ; 0xf04c printf_P(_N("UVLO - end %d\n"), _millis() - time_start); 37dae: 0f 94 86 3e call 0x27d0c ; 0x27d0c 37db2: dc 01 movw r26, r24 37db4: cb 01 movw r24, r22 37db6: 8c 19 sub r24, r12 37db8: 9d 09 sbc r25, r13 37dba: ae 09 sbc r26, r14 37dbc: bf 09 sbc r27, r15 37dbe: bf 93 push r27 37dc0: af 93 push r26 37dc2: 9f 93 push r25 37dc4: 8f 93 push r24 37dc6: 88 ef ldi r24, 0xF8 ; 248 37dc8: 91 e7 ldi r25, 0x71 ; 113 37dca: 9f 93 push r25 37dcc: 8f 93 push r24 37dce: 0f 94 1d dc call 0x3b83a ; 0x3b83a WRITE(BEEPER,HIGH); 37dd2: 9f b7 in r25, 0x3f ; 63 37dd4: f8 94 cli 37dd6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 37dda: 84 60 ori r24, 0x04 ; 4 37ddc: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 37de0: 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(); 37de2: 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; 37de4: 0f 90 pop r0 37de6: 0f 90 pop r0 37de8: 0f 90 pop r0 37dea: 0f 90 pop r0 37dec: 0f 90 pop r0 37dee: 0f 90 pop r0 37df0: 20 e0 ldi r18, 0x00 ; 0 37df2: 30 e0 ldi r19, 0x00 ; 0 37df4: 4f ef ldi r20, 0xFF ; 255 37df6: 52 e4 ldi r21, 0x42 ; 66 37df8: 60 91 43 07 lds r22, 0x0743 ; 0x800743 37dfc: 70 91 44 07 lds r23, 0x0744 ; 0x800744 37e00: 80 91 45 07 lds r24, 0x0745 ; 0x800745 37e04: 90 91 46 07 lds r25, 0x0746 ; 0x800746 37e08: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 37e0c: 87 fd sbrc r24, 7 37e0e: 1f c0 rjmp .+62 ; 0x37e4e <__vector_5+0x60a> 37e10: 80 e0 ldi r24, 0x00 ; 0 37e12: 90 e0 ldi r25, 0x00 ; 0 37e14: af e7 ldi r26, 0x7F ; 127 37e16: b3 e4 ldi r27, 0x43 ; 67 37e18: 80 93 43 07 sts 0x0743, r24 ; 0x800743 37e1c: 90 93 44 07 sts 0x0744, r25 ; 0x800744 37e20: a0 93 45 07 sts 0x0745, r26 ; 0x800745 37e24: b0 93 46 07 sts 0x0746, r27 ; 0x800746 plan_buffer_line_curposXYZE(500); 37e28: 60 e0 ldi r22, 0x00 ; 0 37e2a: 70 e0 ldi r23, 0x00 ; 0 37e2c: 8a ef ldi r24, 0xFA ; 250 37e2e: 93 e4 ldi r25, 0x43 ; 67 37e30: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 37e34: 0f 94 27 58 call 0x2b04e ; 0x2b04e 37e38: 88 e1 ldi r24, 0x18 ; 24 37e3a: 9e e0 ldi r25, 0x0E ; 14 37e3c: 0f b6 in r0, 0x3f ; 63 37e3e: f8 94 cli 37e40: a8 95 wdr 37e42: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 37e46: 0f be out 0x3f, r0 ; 63 37e48: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 37e4c: ff cf rjmp .-2 ; 0x37e4c <__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; 37e4e: 80 e0 ldi r24, 0x00 ; 0 37e50: 90 e0 ldi r25, 0x00 ; 0 37e52: dc 01 movw r26, r24 37e54: e1 cf rjmp .-62 ; 0x37e18 <__vector_5+0x5d4> while(1); } static void uvlo_tiny() { unsigned long time_start = _millis(); 37e56: 0f 94 86 3e call 0x27d0c ; 0x27d0c 37e5a: 6b 01 movw r12, r22 37e5c: 7c 01 movw r14, r24 // Conserve power as soon as possible. disable_x(); 37e5e: 17 9a sbi 0x02, 7 ; 2 37e60: 10 92 40 07 sts 0x0740, r1 ; 0x800740 disable_y(); 37e64: 16 9a sbi 0x02, 6 ; 2 37e66: 10 92 41 07 sts 0x0741, r1 ; 0x800741 disable_e0(); 37e6a: 14 9a sbi 0x02, 4 ; 2 #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 37e6c: 64 e1 ldi r22, 0x14 ; 20 37e6e: 83 e6 ldi r24, 0x63 ; 99 37e70: 92 e0 ldi r25, 0x02 ; 2 37e72: 0e 94 33 69 call 0xd266 ; 0xd266 currents[Z_AXIS].setiRun(20); 37e76: 64 e1 ldi r22, 0x14 ; 20 37e78: 83 e6 ldi r24, 0x63 ; 99 37e7a: 92 e0 ldi r25, 0x02 ; 2 37e7c: 0e 94 3b 69 call 0xd276 ; 0xd276 tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 37e80: 50 e0 ldi r21, 0x00 ; 0 37e82: 40 e0 ldi r20, 0x00 ; 0 37e84: 60 91 fa 04 lds r22, 0x04FA ; 0x8004fa 37e88: 82 e0 ldi r24, 0x02 ; 2 37e8a: 0f 94 45 39 call 0x2728a ; 0x2728a #endif //TMC2130 // Stop all heaters disable_heater(); 37e8e: 0f 94 52 44 call 0x288a4 ; 0x288a4 // 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; 37e92: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 planner_abort_hard(); 37e96: 0f 94 d7 bb call 0x377ae ; 0x377ae // 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]) 37e9a: 80 90 4b 07 lds r8, 0x074B ; 0x80074b 37e9e: 90 90 4c 07 lds r9, 0x074C ; 0x80074c 37ea2: a0 90 4d 07 lds r10, 0x074D ; 0x80074d 37ea6: b0 90 4e 07 lds r11, 0x074E ; 0x80074e 37eaa: 8a ed ldi r24, 0xDA ; 218 37eac: 9e e0 ldi r25, 0x0E ; 14 37eae: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 37eb2: 9b 01 movw r18, r22 37eb4: ac 01 movw r20, r24 37eb6: c5 01 movw r24, r10 37eb8: b4 01 movw r22, r8 37eba: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 37ebe: 4b 01 movw r8, r22 37ec0: 5c 01 movw r10, r24 37ec2: e8 94 clt 37ec4: b7 f8 bld r11, 7 37ec6: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 37eca: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 37ece: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 37ed2: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 37ed6: 60 e0 ldi r22, 0x00 ; 0 37ed8: 70 e0 ldi r23, 0x00 ; 0 37eda: 80 e8 ldi r24, 0x80 ; 128 37edc: 9f e3 ldi r25, 0x3F ; 63 37ede: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 37ee2: 9b 01 movw r18, r22 37ee4: ac 01 movw r20, r24 37ee6: c5 01 movw r24, r10 37ee8: b4 01 movw r22, r8 37eea: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 37eee: 87 fd sbrc r24, 7 37ef0: 61 c0 rjmp .+194 ; 0x37fb4 <__vector_5+0x770> { // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 37ef2: 0e 94 4f 81 call 0x1029e ; 0x1029e card.sdprinting = false; 37ef6: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e saved_printing = true; 37efa: 81 e0 ldi r24, 0x01 ; 1 37efc: 80 93 5a 0e sts 0x0E5A, r24 ; 0x800e5a // 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; 37f00: 10 92 5d 0e sts 0x0E5D, r1 ; 0x800e5d sei(); 37f04: 78 94 sei 37f06: 80 91 fa 04 lds r24, 0x04FA ; 0x8004fa 37f0a: c0 e0 ldi r28, 0x00 ; 0 37f0c: d1 e0 ldi r29, 0x01 ; 1 37f0e: 02 c0 rjmp .+4 ; 0x37f14 <__vector_5+0x6d0> 37f10: d6 95 lsr r29 37f12: c7 95 ror r28 37f14: 8a 95 dec r24 37f16: e2 f7 brpl .-8 ; 0x37f10 <__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); 37f18: 82 e0 ldi r24, 0x02 ; 2 37f1a: 0f 94 2b 39 call 0x27256 ; 0x27256 current_position[Z_AXIS] += float(1024 - z_microsteps) 37f1e: 60 e0 ldi r22, 0x00 ; 0 37f20: 74 e0 ldi r23, 0x04 ; 4 37f22: 68 1b sub r22, r24 37f24: 79 0b sbc r23, r25 37f26: 90 e0 ldi r25, 0x00 ; 0 37f28: 80 e0 ldi r24, 0x00 ; 0 37f2a: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 37f2e: 4b 01 movw r8, r22 37f30: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 37f32: be 01 movw r22, r28 37f34: 90 e0 ldi r25, 0x00 ; 0 37f36: 80 e0 ldi r24, 0x00 ; 0 37f38: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 37f3c: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 37f40: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 37f44: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 37f48: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 37f4c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 37f50: 9b 01 movw r18, r22 37f52: ac 01 movw r20, r24 37f54: c5 01 movw r24, r10 37f56: b4 01 movw r22, r8 37f58: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> + UVLO_TINY_Z_AXIS_SHIFT; 37f5c: 2a e0 ldi r18, 0x0A ; 10 37f5e: 37 ed ldi r19, 0xD7 ; 215 37f60: 43 e2 ldi r20, 0x23 ; 35 37f62: 5e e3 ldi r21, 0x3E ; 62 37f64: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__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) 37f68: 20 91 4b 07 lds r18, 0x074B ; 0x80074b 37f6c: 30 91 4c 07 lds r19, 0x074C ; 0x80074c 37f70: 40 91 4d 07 lds r20, 0x074D ; 0x80074d 37f74: 50 91 4e 07 lds r21, 0x074E ; 0x80074e 37f78: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 37f7c: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 37f80: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 37f84: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 37f88: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_TINY_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 37f8c: 65 e5 ldi r22, 0x55 ; 85 37f8e: 75 e5 ldi r23, 0x55 ; 85 37f90: 85 e5 ldi r24, 0x55 ; 85 37f92: 91 e4 ldi r25, 0x41 ; 65 37f94: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 37f98: 0f 94 27 58 call 0x2b04e ; 0x2b04e if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37f9c: 40 91 4b 07 lds r20, 0x074B ; 0x80074b 37fa0: 50 91 4c 07 lds r21, 0x074C ; 0x80074c 37fa4: 60 91 4d 07 lds r22, 0x074D ; 0x80074d 37fa8: 70 91 4e 07 lds r23, 0x074E ; 0x80074e 37fac: 8a ed ldi r24, 0xDA ; 218 37fae: 9e e0 ldi r25, 0x0E ; 14 37fb0: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37fb4: 62 e0 ldi r22, 0x02 ; 2 37fb6: 85 ea ldi r24, 0xA5 ; 165 37fb8: 9f e0 ldi r25, 0x0F ; 15 37fba: 0f 94 7f dd call 0x3bafe ; 0x3bafe // 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); 37fbe: 84 e6 ldi r24, 0x64 ; 100 37fc0: 9f e0 ldi r25, 0x0F ; 15 37fc2: 0e 94 33 78 call 0xf066 ; 0xf066 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 37fc6: 8f ef ldi r24, 0xFF ; 255 37fc8: 9e e0 ldi r25, 0x0E ; 14 37fca: 0e 94 26 78 call 0xf04c ; 0xf04c printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); 37fce: 0f 94 86 3e call 0x27d0c ; 0x27d0c 37fd2: dc 01 movw r26, r24 37fd4: cb 01 movw r24, r22 37fd6: 8c 19 sub r24, r12 37fd8: 9d 09 sbc r25, r13 37fda: ae 09 sbc r26, r14 37fdc: bf 09 sbc r27, r15 37fde: bf 93 push r27 37fe0: af 93 push r26 37fe2: 9f 93 push r25 37fe4: 8f 93 push r24 37fe6: 87 e0 ldi r24, 0x07 ; 7 37fe8: 92 e7 ldi r25, 0x72 ; 114 37fea: 9f 93 push r25 37fec: 8f 93 push r24 37fee: 0f 94 1d dc call 0x3b83a ; 0x3b83a uvlo_drain_reset(); 37ff2: 0f 94 04 aa call 0x35408 ; 0x35408 // 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(); } } 37ff6: ff 91 pop r31 37ff8: ef 91 pop r30 37ffa: df 91 pop r29 37ffc: cf 91 pop r28 37ffe: bf 91 pop r27 38000: af 91 pop r26 38002: 9f 91 pop r25 38004: 8f 91 pop r24 38006: 7f 91 pop r23 38008: 6f 91 pop r22 3800a: 5f 91 pop r21 3800c: 4f 91 pop r20 3800e: 3f 91 pop r19 38010: 2f 91 pop r18 38012: 1f 91 pop r17 38014: 0f 91 pop r16 38016: ff 90 pop r15 38018: ef 90 pop r14 3801a: df 90 pop r13 3801c: cf 90 pop r12 3801e: bf 90 pop r11 38020: af 90 pop r10 38022: 9f 90 pop r9 38024: 8f 90 pop r8 38026: 0f 90 pop r0 38028: 0b be out 0x3b, r0 ; 59 3802a: 0f 90 pop r0 3802c: 0f be out 0x3f, r0 ; 63 3802e: 0f 90 pop r0 38030: 1f 90 pop r1 38032: 18 95 reti 00038034 : extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 38034: 84 b1 in r24, 0x04 ; 4 38036: 81 7f andi r24, 0xF1 ; 241 38038: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 3803a: 84 b1 in r24, 0x04 ; 4 3803c: 87 60 ori r24, 0x07 ; 7 3803e: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 38040: 85 b1 in r24, 0x05 ; 5 38042: 81 7f andi r24, 0xF1 ; 241 38044: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 38046: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 38048: 80 e5 ldi r24, 0x50 ; 80 3804a: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 3804c: 1d bc out 0x2d, r1 ; 45 } 3804e: 08 95 ret 00038050 : //! @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() { 38050: 2f 92 push r2 38052: 3f 92 push r3 38054: 4f 92 push r4 38056: 5f 92 push r5 38058: 6f 92 push r6 3805a: 7f 92 push r7 3805c: 8f 92 push r8 3805e: 9f 92 push r9 38060: af 92 push r10 38062: bf 92 push r11 38064: cf 92 push r12 38066: df 92 push r13 38068: ef 92 push r14 3806a: ff 92 push r15 3806c: 0f 93 push r16 3806e: 1f 93 push r17 38070: cf 93 push r28 38072: df 93 push r29 38074: cd b7 in r28, 0x3d ; 61 38076: de b7 in r29, 0x3e ; 62 38078: c6 50 subi r28, 0x06 ; 6 3807a: d1 40 sbci r29, 0x01 ; 1 3807c: 0f b6 in r0, 0x3f ; 63 3807e: f8 94 cli 38080: de bf out 0x3e, r29 ; 62 38082: 0f be out 0x3f, r0 ; 63 38084: 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; 38086: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7e3> 3808a: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7e4> 3808e: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7e5> 38092: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7e6> 38096: 8a 3a cpi r24, 0xAA ; 170 38098: 95 45 sbci r25, 0x55 ; 85 3809a: aa 4a sbci r26, 0xAA ; 170 3809c: b5 45 sbci r27, 0x55 ; 85 3809e: 21 f4 brne .+8 ; 0x380a8 380a0: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e2> 380a4: 87 fd sbrc r24, 7 380a6: c2 c1 rjmp .+900 ; 0x3842c 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(); 380a8: a8 95 wdr const char *ptr = entry_magic_send; const char *end = strlen_P(entry_magic_send) + ptr; const uint8_t selectedSerialPort_bak = selectedSerialPort; 380aa: d0 90 21 05 lds r13, 0x0521 ; 0x800521 // Flush the serial line. while (RECV_READY) { 380ae: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 380b2: 87 ff sbrs r24, 7 380b4: 04 c0 rjmp .+8 ; 0x380be wdt_reset(); 380b6: a8 95 wdr // Dummy register read (discard) (void)(*(char *)UDR0); 380b8: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 380bc: f8 cf rjmp .-16 ; 0x380ae } selectedSerialPort = 0; //switch to Serial0 380be: 10 92 21 05 sts 0x0521, r1 ; 0x800521 // 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; 380c2: 00 91 95 04 lds r16, 0x0495 ; 0x800495 380c6: 10 91 96 04 lds r17, 0x0496 ; 0x800496 380ca: 10 93 94 04 sts 0x0494, r17 ; 0x800494 380ce: 00 93 93 04 sts 0x0493, r16 ; 0x800493 380d2: 51 e9 ldi r21, 0x91 ; 145 380d4: e5 2e mov r14, r21 380d6: 5c ea ldi r21, 0xAC ; 172 380d8: f5 2e mov r15, r21 380da: 67 e9 ldi r22, 0x97 ; 151 380dc: a6 2e mov r10, r22 380de: 6c ea ldi r22, 0xAC ; 172 380e0: 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 ++)); 380e2: f7 01 movw r30, r14 380e4: 84 91 lpm r24, Z 380e6: 0f 94 32 a1 call 0x34264 ; 0x34264 380ea: ff ef ldi r31, 0xFF ; 255 380ec: ef 1a sub r14, r31 380ee: 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) 380f0: ae 14 cp r10, r14 380f2: bf 04 cpc r11, r15 380f4: b1 f7 brne .-20 ; 0x380e2 putch(pgm_read_byte(ptr ++)); wdt_reset(); 380f6: a8 95 wdr 380f8: 8f e0 ldi r24, 0x0F ; 15 380fa: 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) 380fc: 20 e9 ldi r18, 0x90 ; 144 380fe: 3c ea ldi r19, 0xAC ; 172 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(); 38100: 40 e8 ldi r20, 0x80 ; 128 38102: 54 e8 ldi r21, 0x84 ; 132 38104: 6e e1 ldi r22, 0x1E ; 30 38106: 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) { 38108: e0 91 93 04 lds r30, 0x0493 ; 0x800493 3810c: f0 91 94 04 lds r31, 0x0494 ; 0x800494 38110: e0 17 cp r30, r16 38112: f1 07 cpc r31, r17 38114: 19 f5 brne .+70 ; 0x3815c wdt_reset(); 38116: a8 95 wdr 38118: 41 50 subi r20, 0x01 ; 1 3811a: 51 09 sbc r21, r1 3811c: 61 09 sbc r22, r1 3811e: 71 09 sbc r23, r1 if ( --boot_timer == 0) { 38120: 99 f7 brne .-26 ; 0x38108 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 38122: d0 92 21 05 sts 0x0521, r13 ; 0x800521 return 0; 38126: 80 e0 ldi r24, 0x00 ; 0 // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); } } 38128: ca 5f subi r28, 0xFA ; 250 3812a: de 4f sbci r29, 0xFE ; 254 3812c: 0f b6 in r0, 0x3f ; 63 3812e: f8 94 cli 38130: de bf out 0x3e, r29 ; 62 38132: 0f be out 0x3f, r0 ; 63 38134: cd bf out 0x3d, r28 ; 61 38136: df 91 pop r29 38138: cf 91 pop r28 3813a: 1f 91 pop r17 3813c: 0f 91 pop r16 3813e: ff 90 pop r15 38140: ef 90 pop r14 38142: df 90 pop r13 38144: cf 90 pop r12 38146: bf 90 pop r11 38148: af 90 pop r10 3814a: 9f 90 pop r9 3814c: 8f 90 pop r8 3814e: 7f 90 pop r7 38150: 6f 90 pop r6 38152: 5f 90 pop r5 38154: 4f 90 pop r4 38156: 3f 90 pop r3 38158: 2f 90 pop r2 3815a: 08 95 ret // Timeout expired, continue with the application. selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } } ch = rx_buffer.buffer[SerialHead]; 3815c: f8 01 movw r30, r16 3815e: ed 5e subi r30, 0xED ; 237 38160: fb 4f sbci r31, 0xFB ; 251 38162: 40 81 ld r20, Z SerialHead = (unsigned int)(SerialHead + 1) % RX_BUFFER_SIZE; 38164: 0f 5f subi r16, 0xFF ; 255 38166: 1f 4f sbci r17, 0xFF ; 255 38168: 0f 77 andi r16, 0x7F ; 127 3816a: 11 27 eor r17, r17 if (pgm_read_byte(ptr ++) != ch) 3816c: f9 01 movw r30, r18 3816e: e8 1b sub r30, r24 38170: f9 0b sbc r31, r25 38172: e4 91 lpm r30, Z 38174: 4e 13 cpse r20, r30 38176: d5 cf rjmp .-86 ; 0x38122 { // Magic was not received correctly, continue with the application selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); 38178: a8 95 wdr 3817a: 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) { 3817c: 09 f0 breq .+2 ; 0x38180 3817e: c0 cf rjmp .-128 ; 0x38100 selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); } cbi(UCSR0B, RXCIE0); //disable the MarlinSerial0 interrupt 38180: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 38184: 8f 77 andi r24, 0x7F ; 127 38186: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 3818a: 03 e7 ldi r16, 0x73 ; 115 3818c: 1c ea ldi r17, 0xAC ; 172 // Send the cfm magic string. ptr = entry_magic_cfm; end = strlen_P(entry_magic_cfm) + ptr; while (ptr != end) putch(pgm_read_byte(ptr ++)); 3818e: f8 01 movw r30, r16 38190: 84 91 lpm r24, Z 38192: 0f 94 32 a1 call 0x34264 ; 0x34264 38196: 0f 5f subi r16, 0xFF ; 255 38198: 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) 3819a: fc ea ldi r31, 0xAC ; 172 3819c: 00 38 cpi r16, 0x80 ; 128 3819e: 1f 07 cpc r17, r31 381a0: b1 f7 brne .-20 ; 0x3818e putch(pgm_read_byte(ptr ++)); } spi_init(); 381a2: 0f 94 1a c0 call 0x38034 ; 0x38034 xflash_init(); 381a6: 0e 94 b9 e3 call 0x1c772 ; 0x1c772 "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" ); 381aa: 0f b6 in r0, 0x3f ; 63 381ac: f8 94 cli 381ae: a8 95 wdr 381b0: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 381b4: 88 61 ori r24, 0x18 ; 24 381b6: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 381ba: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 381be: 0f be out 0x3f, r0 ; 63 wdt_disable(); lcd_clear(); 381c0: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 1, PSTR(" Upgrading xflash\n Do not disconnect!")); 381c4: 4d e4 ldi r20, 0x4D ; 77 381c6: 5c ea ldi r21, 0xAC ; 172 381c8: 61 e0 ldi r22, 0x01 ; 1 381ca: 80 e0 ldi r24, 0x00 ; 0 381cc: 0e 94 29 70 call 0xe052 ; 0xe052 boot_app_magic = 0; //disable the bootapp if a watchdog reset is going to be used 381d0: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e3> 381d4: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e4> 381d8: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e5> 381dc: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e6> 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; 381e0: cb 5f subi r28, 0xFB ; 251 381e2: de 4f sbci r29, 0xFE ; 254 381e4: 18 82 st Y, r1 381e6: c5 50 subi r28, 0x05 ; 5 381e8: 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; 381ea: 10 e0 ldi r17, 0x00 ; 0 381ec: 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; 381ee: 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); 381f0: ae 01 movw r20, r28 381f2: 4f 5f subi r20, 0xFF ; 255 381f4: 5f 4f sbci r21, 0xFF ; 255 381f6: 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(); 381f8: 0f 94 39 a1 call 0x34272 ; 0x34272 if(ch == STK_GET_PARAMETER) { 381fc: 81 34 cpi r24, 0x41 ; 65 381fe: a9 f4 brne .+42 ; 0x3822a unsigned char which = getch(); 38200: 0f 94 39 a1 call 0x34272 ; 0x34272 38204: e8 2e mov r14, r24 verifySpace(); 38206: 0f 94 b1 a3 call 0x34762 ; 0x34762 /* * Send optiboot version as "SW version" * Note that the references to memory are optimized away. */ if (which == STK_SW_MINOR) { 3820a: 52 e8 ldi r21, 0x82 ; 130 putch(optiboot_version & 0xFF); 3820c: 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) { 3820e: e5 16 cp r14, r21 38210: 21 f0 breq .+8 ; 0x3821a putch(optiboot_version & 0xFF); } else if (which == STK_SW_MAJOR) { 38212: 81 e8 ldi r24, 0x81 ; 129 38214: e8 12 cpse r14, r24 38216: 07 c0 rjmp .+14 ; 0x38226 putch(optiboot_version >> 8); 38218: 86 e0 ldi r24, 0x06 ; 6 3821a: 0f 94 32 a1 call 0x34264 ; 0x34264 } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); 3821e: 80 e1 ldi r24, 0x10 ; 16 38220: 0f 94 32 a1 call 0x34264 ; 0x34264 38224: e9 cf rjmp .-46 ; 0x381f8 } else { /* * GET PARAMETER returns a generic 0x03 reply for * other parameters - enough to keep Avrdude happy */ putch(0x03); 38226: 83 e0 ldi r24, 0x03 ; 3 38228: f8 cf rjmp .-16 ; 0x3821a } } else if(ch == STK_SET_DEVICE) { 3822a: 82 34 cpi r24, 0x42 ; 66 3822c: 21 f4 brne .+8 ; 0x38236 // SET DEVICE is ignored getNch(20); 3822e: 84 e1 ldi r24, 0x14 ; 20 } else if(ch == STK_SET_DEVICE_EXT) { // SET DEVICE EXT is ignored getNch(5); 38230: 0f 94 bd a3 call 0x3477a ; 0x3477a 38234: f4 cf rjmp .-24 ; 0x3821e } else if(ch == STK_SET_DEVICE) { // SET DEVICE is ignored getNch(20); } else if(ch == STK_SET_DEVICE_EXT) { 38236: 85 34 cpi r24, 0x45 ; 69 38238: 11 f4 brne .+4 ; 0x3823e // SET DEVICE EXT is ignored getNch(5); 3823a: 85 e0 ldi r24, 0x05 ; 5 3823c: f9 cf rjmp .-14 ; 0x38230 } else if(ch == STK_LOAD_ADDRESS) { 3823e: 85 35 cpi r24, 0x55 ; 85 38240: c9 f4 brne .+50 ; 0x38274 // 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(); 38242: 0f 94 39 a1 call 0x34272 ; 0x34272 38246: 08 2f mov r16, r24 newAddress |= getch(); 38248: 0f 94 39 a1 call 0x34272 ; 0x34272 3824c: 08 2b or r16, r24 3824e: 10 e0 ldi r17, 0x00 ; 0 newAddress |= (((uint16_t)getch()) << 8); 38250: 0f 94 39 a1 call 0x34272 ; 0x34272 38254: 18 2b or r17, r24 newAddress |= (((uint16_t)getch()) << 8); 38256: 0f 94 39 a1 call 0x34272 ; 0x34272 3825a: 18 2b or r17, r24 // Transfer top bit to LSB in rampz if (newAddress & 0x8000) 3825c: 17 ff sbrs r17, 7 3825e: 07 c0 rjmp .+14 ; 0x3826e rampz |= 0x01; 38260: 68 94 set 38262: f0 f8 bld r15, 0 else rampz &= 0xFE; newAddress += newAddress; // Convert from word address to byte address 38264: 00 0f add r16, r16 38266: 11 1f adc r17, r17 wdt_enable(WATCHDOG_SOFT_RESET_VALUE); verifySpace(); } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); 38268: 0f 94 b1 a3 call 0x34762 ; 0x34762 3826c: d8 cf rjmp .-80 ; 0x3821e newAddress |= (((uint16_t)getch()) << 8); // Transfer top bit to LSB in rampz if (newAddress & 0x8000) rampz |= 0x01; else rampz &= 0xFE; 3826e: e8 94 clt 38270: f0 f8 bld r15, 0 38272: f8 cf rjmp .-16 ; 0x38264 newAddress += newAddress; // Convert from word address to byte address address = newAddress; verifySpace(); } else if(ch == STK_UNIVERSAL) { 38274: 86 35 cpi r24, 0x56 ; 86 38276: a1 f4 brne .+40 ; 0x382a0 // LOAD_EXTENDED_ADDRESS is needed in STK_UNIVERSAL for addressing more than 128kB if ( AVR_OP_LOAD_EXT_ADDR == getch() ) { 38278: 0f 94 39 a1 call 0x34272 ; 0x34272 3827c: 8d 34 cpi r24, 0x4D ; 77 3827e: 71 f4 brne .+28 ; 0x3829c // get address getch(); // get '0' 38280: 0f 94 39 a1 call 0x34272 ; 0x34272 rampz = (rampz & 0x01) | ((getch() << 1) & 0xff); // get address and put it in rampz 38284: 0f 94 39 a1 call 0x34272 ; 0x34272 38288: 9f 2d mov r25, r15 3828a: 91 70 andi r25, 0x01 ; 1 3828c: f9 2e mov r15, r25 3828e: 88 0f add r24, r24 38290: f8 2a or r15, r24 getNch(1); // get last '0' 38292: 81 e0 ldi r24, 0x01 ; 1 // response putch(0x00); } else { // everything else is ignored getNch(3); 38294: 0f 94 bd a3 call 0x3477a ; 0x3477a putch(0x00); 38298: 80 e0 ldi r24, 0x00 ; 0 3829a: bf cf rjmp .-130 ; 0x3821a // response putch(0x00); } else { // everything else is ignored getNch(3); 3829c: 83 e0 ldi r24, 0x03 ; 3 3829e: fa cf rjmp .-12 ; 0x38294 putch(0x00); } } /* Write memory, length is big endian and is in bytes */ else if(ch == STK_PROG_PAGE) { 382a0: 84 36 cpi r24, 0x64 ; 100 382a2: 09 f0 breq .+2 ; 0x382a6 382a4: 77 c0 rjmp .+238 ; 0x38394 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; 382a6: 0f 94 39 a1 call 0x34272 ; 0x34272 382aa: b8 2e mov r11, r24 length |= ((pagelen_t)getch()) << 8; 382ac: 0f 94 39 a1 call 0x34272 ; 0x34272 382b0: c8 2e mov r12, r24 length |= getch(); 382b2: 0f 94 39 a1 call 0x34272 ; 0x34272 382b6: e8 2e mov r14, r24 length |= getch(); 382b8: 0f 94 39 a1 call 0x34272 ; 0x34272 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; 382bc: d1 2c mov r13, r1 382be: dc 2c mov r13, r12 382c0: cc 24 eor r12, r12 382c2: db 28 or r13, r11 length |= getch(); length |= getch(); 382c4: 8e 29 or r24, r14 382c6: c8 2a or r12, r24 savelength = length; // Read the destination type. It should always be 'F' as flash. desttype = getch(); 382c8: 0f 94 39 a1 call 0x34272 ; 0x34272 382cc: 58 2e mov r5, r24 382ce: fe 01 movw r30, r28 382d0: 31 96 adiw r30, 0x01 ; 1 382d2: 5f 01 movw r10, r30 382d4: 46 01 movw r8, r12 382d6: 8e 0e add r8, r30 382d8: 9f 1e adc r9, r31 382da: ee 2e mov r14, r30 382dc: ca 5f subi r28, 0xFA ; 250 382de: de 4f sbci r29, 0xFE ; 254 382e0: b8 82 st Y, r11 382e2: c6 50 subi r28, 0x06 ; 6 382e4: d1 40 sbci r29, 0x01 ; 1 // read a page worth of contents bufPtr = buff; do *bufPtr++ = getch(); 382e6: 0f 94 39 a1 call 0x34272 ; 0x34272 382ea: f5 01 movw r30, r10 382ec: 81 93 st Z+, r24 382ee: 5f 01 movw r10, r30 while (--length); 382f0: 8e 16 cp r8, r30 382f2: 9f 06 cpc r9, r31 382f4: c1 f7 brne .-16 ; 0x382e6 // Read command terminator, start reply verifySpace(); 382f6: 0f 94 b1 a3 call 0x34762 ; 0x34762 if (desttype == 'E') { 382fa: f5 e4 ldi r31, 0x45 ; 69 382fc: 5f 12 cpse r5, r31 382fe: 01 c0 rjmp .+2 ; 0x38302 38300: ff cf rjmp .-2 ; 0x38300 while (1) ; // Error: wait for WDT } else { uint32_t addr = (((uint32_t)rampz) << 16) | address; 38302: 18 01 movw r2, r16 38304: 51 2c mov r5, r1 38306: 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) { 38308: 01 15 cp r16, r1 3830a: 11 05 cpc r17, r1 3830c: 61 f5 brne .+88 ; 0x38366 3830e: 42 01 movw r8, r4 38310: aa 24 eor r10, r10 38312: bb 24 eor r11, r11 38314: cb 5f subi r28, 0xFB ; 251 38316: de 4f sbci r29, 0xFE ; 254 38318: 28 81 ld r18, Y 3831a: c5 50 subi r28, 0x05 ; 5 3831c: d1 40 sbci r29, 0x01 ; 1 3831e: 82 2f mov r24, r18 38320: 90 e0 ldi r25, 0x00 ; 0 38322: 08 2c mov r0, r8 38324: 02 c0 rjmp .+4 ; 0x3832a 38326: 95 95 asr r25 38328: 87 95 ror r24 3832a: 0a 94 dec r0 3832c: e2 f7 brpl .-8 ; 0x38326 3832e: 80 fd sbrc r24, 0 38330: 1a c0 rjmp .+52 ; 0x38366 xflash_wait_busy(); 38332: 0e 94 46 e2 call 0x1c48c ; 0x1c48c xflash_enable_wr(); 38336: 0e 94 e2 e2 call 0x1c5c4 ; 0x1c5c4 return xflash_erase(_CMD_BLOCK32_ERASE, addr); } void xflash_block64_erase(uint32_t addr) { return xflash_erase(_CMD_BLOCK64_ERASE, addr); 3833a: b2 01 movw r22, r4 3833c: a8 01 movw r20, r16 3833e: 88 ed ldi r24, 0xD8 ; 216 38340: 0e 94 64 e2 call 0x1c4c8 ; 0x1c4c8 xflash_block64_erase(addr); pages_erased |= (1 << (addr >> 16)); 38344: 81 e0 ldi r24, 0x01 ; 1 38346: 90 e0 ldi r25, 0x00 ; 0 38348: 01 c0 rjmp .+2 ; 0x3834c 3834a: 88 0f add r24, r24 3834c: 8a 94 dec r8 3834e: ea f7 brpl .-6 ; 0x3834a 38350: cb 5f subi r28, 0xFB ; 251 38352: de 4f sbci r29, 0xFE ; 254 38354: 48 81 ld r20, Y 38356: c5 50 subi r28, 0x05 ; 5 38358: d1 40 sbci r29, 0x01 ; 1 3835a: 48 2b or r20, r24 3835c: cb 5f subi r28, 0xFB ; 251 3835e: de 4f sbci r29, 0xFE ; 254 38360: 48 83 st Y, r20 38362: c5 50 subi r28, 0x05 ; 5 38364: d1 40 sbci r29, 0x01 ; 1 } xflash_wait_busy(); 38366: 0e 94 46 e2 call 0x1c48c ; 0x1c48c xflash_enable_wr(); 3836a: 0e 94 e2 e2 call 0x1c5c4 ; 0x1c5c4 xflash_page_program(addr, buff, savelength); 3836e: 96 01 movw r18, r12 38370: 4e 2d mov r20, r14 38372: ca 5f subi r28, 0xFA ; 250 38374: de 4f sbci r29, 0xFE ; 254 38376: 58 81 ld r21, Y 38378: c6 50 subi r28, 0x06 ; 6 3837a: d1 40 sbci r29, 0x01 ; 1 3837c: c2 01 movw r24, r4 3837e: b1 01 movw r22, r2 38380: 0e 94 69 e2 call 0x1c4d2 ; 0x1c4d2 xflash_wait_busy(); 38384: 0e 94 46 e2 call 0x1c48c ; 0x1c48c _CS_HIGH(); } void xflash_disable_wr(void) { _CS_LOW(); 38388: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_DISABLE_WR); // send command 0x04 3838a: 84 e0 ldi r24, 0x04 ; 4 3838c: 0e 94 40 e2 call 0x1c480 ; 0x1c480 _CS_HIGH(); 38390: 45 9a sbi 0x08, 5 ; 8 38392: 45 cf rjmp .-374 ; 0x3821e xflash_disable_wr(); } } /* Read memory block mode, length is big endian. */ else if(ch == STK_READ_PAGE) { 38394: 84 37 cpi r24, 0x74 ; 116 38396: 81 f5 brne .+96 ; 0x383f8 uint32_t addr = (((uint32_t)rampz) << 16) | address; 38398: b1 2c mov r11, r1 3839a: 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; 3839c: 0f 94 39 a1 call 0x34272 ; 0x34272 383a0: d8 2e mov r13, r24 length |= ((pagelen_t)getch()) << 8; 383a2: 0f 94 39 a1 call 0x34272 ; 0x34272 383a6: c8 2e mov r12, r24 length |= getch(); 383a8: 0f 94 39 a1 call 0x34272 ; 0x34272 383ac: e8 2e mov r14, r24 length |= getch(); 383ae: 0f 94 39 a1 call 0x34272 ; 0x34272 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; 383b2: 2c 2d mov r18, r12 383b4: 30 e0 ldi r19, 0x00 ; 0 383b6: 32 2f mov r19, r18 383b8: 22 27 eor r18, r18 383ba: f9 01 movw r30, r18 383bc: fd 29 or r31, r13 383be: 6f 01 movw r12, r30 length |= getch(); length |= getch(); 383c0: 8e 29 or r24, r14 383c2: c8 2a or r12, r24 // Read the destination type. It should always be 'F' as flash. It is not checked. (void)getch(); 383c4: 0f 94 39 a1 call 0x34272 ; 0x34272 verifySpace(); 383c8: 0f 94 b1 a3 call 0x34762 ; 0x34762 xflash_wait_busy(); 383cc: 0e 94 46 e2 call 0x1c48c ; 0x1c48c xflash_rd_data(addr, buff, length); 383d0: 96 01 movw r18, r12 383d2: a3 01 movw r20, r6 383d4: c5 01 movw r24, r10 383d6: b8 01 movw r22, r16 383d8: 0e 94 89 e2 call 0x1c512 ; 0x1c512 383dc: 53 01 movw r10, r6 for (i = 0; i < length; ++ i) 383de: c5 01 movw r24, r10 383e0: 86 19 sub r24, r6 383e2: 97 09 sbc r25, r7 383e4: 8c 15 cp r24, r12 383e6: 9d 05 cpc r25, r13 383e8: 08 f0 brcs .+2 ; 0x383ec 383ea: 19 cf rjmp .-462 ; 0x3821e putch(buff[i]); 383ec: f5 01 movw r30, r10 383ee: 81 91 ld r24, Z+ 383f0: 5f 01 movw r10, r30 383f2: 0f 94 32 a1 call 0x34264 ; 0x34264 383f6: f3 cf rjmp .-26 ; 0x383de } /* Get device signature bytes */ else if(ch == STK_READ_SIGN) { 383f8: 85 37 cpi r24, 0x75 ; 117 383fa: 51 f4 brne .+20 ; 0x38410 // READ SIGN - return what Avrdude wants to hear verifySpace(); 383fc: 0f 94 b1 a3 call 0x34762 ; 0x34762 putch(XFLASH_SIGNATURE_0); 38400: 8e e1 ldi r24, 0x1E ; 30 38402: 0f 94 32 a1 call 0x34264 ; 0x34264 putch(XFLASH_SIGNATURE_1); 38406: 88 e9 ldi r24, 0x98 ; 152 38408: 0f 94 32 a1 call 0x34264 ; 0x34264 putch(XFLASH_SIGNATURE_2); 3840c: 81 e0 ldi r24, 0x01 ; 1 3840e: 05 cf rjmp .-502 ; 0x3821a } else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */ 38410: 81 35 cpi r24, 0x51 ; 81 38412: 09 f0 breq .+2 ; 0x38416 38414: 29 cf rjmp .-430 ; 0x38268 : "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" ); 38416: f8 e1 ldi r31, 0x18 ; 24 38418: 28 e0 ldi r18, 0x08 ; 8 3841a: 0f b6 in r0, 0x3f ; 63 3841c: f8 94 cli 3841e: a8 95 wdr 38420: f0 93 60 00 sts 0x0060, r31 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38424: 0f be out 0x3f, r0 ; 63 38426: 20 93 60 00 sts 0x0060, r18 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3842a: 1e cf rjmp .-452 ; 0x38268 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; 3842c: 81 e0 ldi r24, 0x01 ; 1 3842e: 7c ce rjmp .-776 ; 0x38128 00038430 : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 38430: 81 e0 ldi r24, 0x01 ; 1 38432: 0c 94 5a 70 jmp 0xe0b4 ; 0xe0b4 00038436 : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 38436: 0f 93 push r16 38438: 1f 93 push r17 3843a: cf 93 push r28 3843c: 8c 01 movw r16, r24 3843e: c6 2f mov r28, r22 lcd_update_enable(false); 38440: 80 e0 ldi r24, 0x00 ; 0 38442: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_clear(); 38446: 0e 94 48 70 call 0xe090 ; 0xe090 lcd_puts_at_P(0, 1, pgmS); 3844a: a8 01 movw r20, r16 3844c: 61 e0 ldi r22, 0x01 ; 1 3844e: 80 e0 ldi r24, 0x00 ; 0 38450: 0e 94 29 70 call 0xe052 ; 0xe052 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 38454: 80 e2 ldi r24, 0x20 ; 32 38456: 0e 94 c4 70 call 0xe188 ; 0xe188 lcd_print(' '); lcd_print(slot + 1); 3845a: 6c 2f mov r22, r28 3845c: 70 e0 ldi r23, 0x00 ; 0 3845e: 6f 5f subi r22, 0xFF ; 255 38460: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 38462: 07 2e mov r0, r23 38464: 00 0c add r0, r0 38466: 88 0b sbc r24, r24 38468: 99 0b sbc r25, r25 } 3846a: cf 91 pop r28 3846c: 1f 91 pop r17 3846e: 0f 91 pop r16 38470: 0c 94 ce 71 jmp 0xe39c ; 0xe39c 00038474 : 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); 38474: 82 ed ldi r24, 0xD2 ; 210 38476: 9e e0 ldi r25, 0x0E ; 14 38478: 0e 94 33 78 call 0xf066 ; 0xf066 eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 3847c: 83 ed ldi r24, 0xD3 ; 211 3847e: 9e e0 ldi r25, 0x0E ; 14 38480: 0c 94 26 78 jmp 0xf04c ; 0xf04c 00038484 : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 38484: 41 e0 ldi r20, 0x01 ; 1 38486: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 3848a: 81 11 cpse r24, r1 3848c: 01 c0 rjmp .+2 ; 0x38490 3848e: 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'); 38490: 40 5d subi r20, 0xD0 ; 208 38492: 62 e0 ldi r22, 0x02 ; 2 38494: 83 e0 ldi r24, 0x03 ; 3 38496: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 3849a: 0e 94 df e3 call 0x1c7be ; 0x1c7be 3849e: 40 e3 ldi r20, 0x30 ; 48 384a0: 48 0f add r20, r24 384a2: 62 e0 ldi r22, 0x02 ; 2 384a4: 88 e0 ldi r24, 0x08 ; 8 384a6: 0e 94 35 70 call 0xe06a ; 0xe06a // print active/changing filament slot lcd_set_cursor(10, 2); 384aa: 62 e0 ldi r22, 0x02 ; 2 384ac: 8a e0 ldi r24, 0x0A ; 10 384ae: 0e 94 15 70 call 0xe02a ; 0xe02a lcdui_print_extruder(); 384b2: 0f 94 a4 36 call 0x26d48 ; 0x26d48 // Print active extruder temperature lcd_set_cursor(16, 2); 384b6: 62 e0 ldi r22, 0x02 ; 2 384b8: 80 e1 ldi r24, 0x10 ; 16 384ba: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 384be: 20 e0 ldi r18, 0x00 ; 0 384c0: 30 e0 ldi r19, 0x00 ; 0 384c2: 40 e0 ldi r20, 0x00 ; 0 384c4: 5f e3 ldi r21, 0x3F ; 63 384c6: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 384ca: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 384ce: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 384d2: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 384d6: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 384da: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> 384de: 7f 93 push r23 384e0: 6f 93 push r22 384e2: 8b e3 ldi r24, 0x3B ; 59 384e4: 9b ea ldi r25, 0xAB ; 171 384e6: 9f 93 push r25 384e8: 8f 93 push r24 384ea: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 384ee: 0f 90 pop r0 384f0: 0f 90 pop r0 384f2: 0f 90 pop r0 384f4: 0f 90 pop r0 } 384f6: 08 95 ret 000384f8 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 384f8: 8a 30 cpi r24, 0x0A ; 10 384fa: 20 f0 brcs .+8 ; 0x38504 384fc: 80 31 cpi r24, 0x10 ; 16 384fe: 20 f4 brcc .+8 ; 0x38508 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 38500: 89 5a subi r24, 0xA9 ; 169 38502: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 38504: 80 5d subi r24, 0xD0 ; 208 38506: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 38508: 80 e0 ldi r24, 0x00 ; 0 } } 3850a: 08 95 ret 0003850c : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 3850c: 0f 93 push r16 3850e: 1f 93 push r17 38510: cf 93 push r28 38512: df 93 push r29 38514: 08 2f mov r16, r24 38516: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 38518: 90 e0 ldi r25, 0x00 ; 0 3851a: 24 e0 ldi r18, 0x04 ; 4 3851c: 95 95 asr r25 3851e: 87 95 ror r24 38520: 2a 95 dec r18 38522: e1 f7 brne .-8 ; 0x3851c uint8_t charsOut = 1; 38524: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 38526: 00 97 sbiw r24, 0x00 ; 0 38528: 21 f0 breq .+8 ; 0x38532 *dst = Nibble2Char(v); 3852a: 0f 94 7c c2 call 0x384f8 ; 0x384f8 3852e: 89 93 st Y+, r24 ++dst; charsOut = 2; 38530: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 38532: 80 2f mov r24, r16 38534: 8f 70 andi r24, 0x0F ; 15 38536: 0f 94 7c c2 call 0x384f8 ; 0x384f8 3853a: 88 83 st Y, r24 return charsOut; } 3853c: 81 2f mov r24, r17 3853e: df 91 pop r29 38540: cf 91 pop r28 38542: 1f 91 pop r17 38544: 0f 91 pop r16 38546: 08 95 ret 00038548 : } 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) { 38548: 80 33 cpi r24, 0x30 ; 48 3854a: 30 f0 brcs .+12 ; 0x38558 3854c: 8a 33 cpi r24, 0x3A ; 58 3854e: 30 f0 brcs .+12 ; 0x3855c 38550: 9f e9 ldi r25, 0x9F ; 159 38552: 98 0f add r25, r24 38554: 96 30 cpi r25, 0x06 ; 6 38556: 20 f0 brcs .+8 ; 0x38560 case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 38558: 80 e0 ldi r24, 0x00 ; 0 } } 3855a: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 3855c: 80 53 subi r24, 0x30 ; 48 3855e: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 38560: 87 55 subi r24, 0x57 ; 87 38562: 08 95 ret 00038564 : /// 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 { 38564: cf 93 push r28 38566: df 93 push r29 38568: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 3856a: 68 81 ld r22, Y 3856c: 80 e0 ldi r24, 0x00 ; 0 3856e: 0f 94 45 a1 call 0x3428a ; 0x3428a crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 38572: 69 81 ldd r22, Y+1 ; 0x01 38574: 0f 94 45 a1 call 0x3428a ; 0x3428a crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 38578: 6a 81 ldd r22, Y+2 ; 0x02 3857a: 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]); 3857c: 0f 94 45 a1 call 0x3428a ; 0x3428a 38580: 6c 2f mov r22, r28 return crc; } 38582: df 91 pop r29 38584: cf 91 pop r28 38586: 0d 94 45 a1 jmp 0x3428a ; 0x3428a 0003858a : 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 { 3858a: cf 93 push r28 3858c: df 93 push r29 3858e: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 38590: 0f 94 b2 c2 call 0x38564 ; 0x38564 crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 38594: 6d 81 ldd r22, Y+5 ; 0x05 38596: 0f 94 45 a1 call 0x3428a ; 0x3428a crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 3859a: 6e 81 ldd r22, Y+6 ; 0x06 3859c: cf 81 ldd r28, Y+7 ; 0x07 3859e: 0f 94 45 a1 call 0x3428a ; 0x3428a 385a2: 6c 2f mov r22, r28 return crc; } 385a4: df 91 pop r29 385a6: cf 91 pop r28 385a8: 0d 94 45 a1 jmp 0x3428a ; 0x3428a 000385ac : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 385ac: cf 93 push r28 385ae: df 93 push r29 385b0: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 385b2: 68 83 st Y, r22 385b4: 49 83 std Y+1, r20 ; 0x01 385b6: 1b 82 std Y+3, r1 ; 0x03 385b8: 1a 82 std Y+2, r1 ; 0x02 385ba: 0f 94 b2 c2 call 0x38564 ; 0x38564 385be: 8c 83 std Y+4, r24 ; 0x04 } 385c0: df 91 pop r29 385c2: cf 91 pop r28 385c4: 08 95 ret 000385c6 : void power_off() { } void reset() { #ifdef MMU_HWRESET // HW - pulse reset pin WRITE(MMU_RST_PIN, 0); 385c6: 9f b7 in r25, 0x3f ; 63 385c8: f8 94 cli 385ca: e5 e0 ldi r30, 0x05 ; 5 385cc: f1 e0 ldi r31, 0x01 ; 1 385ce: 80 81 ld r24, Z 385d0: 8f 7d andi r24, 0xDF ; 223 385d2: 80 83 st Z, r24 385d4: 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); 385d6: 8f e8 ldi r24, 0x8F ; 143 385d8: 91 e0 ldi r25, 0x01 ; 1 385da: 01 97 sbiw r24, 0x01 ; 1 385dc: f1 f7 brne .-4 ; 0x385da 385de: 00 c0 rjmp .+0 ; 0x385e0 385e0: 00 00 nop _delay_us(100); WRITE(MMU_RST_PIN, 1); 385e2: 9f b7 in r25, 0x3f ; 63 385e4: f8 94 cli 385e6: 80 81 ld r24, Z 385e8: 80 62 ori r24, 0x20 ; 32 385ea: 80 83 st Z, r24 385ec: 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 } 385ee: 08 95 ret 000385f0 : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 385f0: 14 9a sbi 0x02, 4 ; 2 } 385f2: 08 95 ret 000385f4 : 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) { 385f4: cf 92 push r12 385f6: df 92 push r13 385f8: ef 92 push r14 385fa: ff 92 push r15 385fc: cf 93 push r28 385fe: df 93 push r29 38600: 69 01 movw r12, r18 38602: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 38604: c3 e4 ldi r28, 0x43 ; 67 38606: d7 e0 ldi r29, 0x07 ; 7 38608: 9b 01 movw r18, r22 3860a: ac 01 movw r20, r24 3860c: 6c 85 ldd r22, Y+12 ; 0x0c 3860e: 7d 85 ldd r23, Y+13 ; 0x0d 38610: 8e 85 ldd r24, Y+14 ; 0x0e 38612: 9f 85 ldd r25, Y+15 ; 0x0f 38614: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 38618: 6c 87 std Y+12, r22 ; 0x0c 3861a: 7d 87 std Y+13, r23 ; 0x0d 3861c: 8e 87 std Y+14, r24 ; 0x0e 3861e: 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); 38620: c7 01 movw r24, r14 38622: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 38624: df 91 pop r29 38626: cf 91 pop r28 38628: ff 90 pop r15 3862a: ef 90 pop r14 3862c: df 90 pop r13 3862e: 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); 38630: 0d 94 5d ba jmp 0x374ba ; 0x374ba 00038634 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 38634: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 38638: 0d 94 27 58 jmp 0x2b04e ; 0x2b04e 0003863c : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 3863c: cf 93 push r28 3863e: df 93 push r29 38640: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 38642: 82 ef ldi r24, 0xF2 ; 242 38644: 9a ea ldi r25, 0xAA ; 170 38646: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_MMU2(); 3864a: 85 e3 ldi r24, 0x35 ; 53 3864c: 9b ea ldi r25, 0xAB ; 171 3864e: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 SERIAL_ECHOLNRPGM(msg); 38652: ce 01 movw r24, r28 } 38654: df 91 pop r29 38656: 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); 38658: 0c 94 86 7b jmp 0xf70c ; 0xf70c 0003865c : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 3865c: 0c 94 df e3 jmp 0x1c7be ; 0x1c7be 00038660 : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38660: 89 32 cpi r24, 0x29 ; 41 38662: 20 e8 ldi r18, 0x80 ; 128 38664: 92 07 cpc r25, r18 38666: 09 f4 brne .+2 ; 0x3866a 38668: 97 c0 rjmp .+302 ; 0x38798 3866a: 08 f0 brcs .+2 ; 0x3866e 3866c: 48 c0 rjmp .+144 ; 0x386fe 3866e: 86 30 cpi r24, 0x06 ; 6 38670: 60 e8 ldi r22, 0x80 ; 128 38672: 96 07 cpc r25, r22 38674: 09 f4 brne .+2 ; 0x38678 38676: 9a c0 rjmp .+308 ; 0x387ac 38678: 30 f5 brcc .+76 ; 0x386c6 3867a: 83 30 cpi r24, 0x03 ; 3 3867c: 40 e8 ldi r20, 0x80 ; 128 3867e: 94 07 cpc r25, r20 38680: 09 f4 brne .+2 ; 0x38684 38682: 80 c0 rjmp .+256 ; 0x38784 38684: a8 f4 brcc .+42 ; 0x386b0 38686: 81 30 cpi r24, 0x01 ; 1 38688: 20 e8 ldi r18, 0x80 ; 128 3868a: 92 07 cpc r25, r18 3868c: 09 f4 brne .+2 ; 0x38690 3868e: 17 c1 rjmp .+558 ; 0x388be 38690: 82 30 cpi r24, 0x02 ; 2 38692: 40 e8 ldi r20, 0x80 ; 128 38694: 94 07 cpc r25, r20 38696: 09 f4 brne .+2 ; 0x3869a 38698: 73 c0 rjmp .+230 ; 0x38780 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); 3869a: 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)) { 3869c: 86 ff sbrs r24, 6 3869e: 8e c0 rjmp .+284 ; 0x387bc 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); 386a0: 22 27 eor r18, r18 386a2: 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) { 386a4: 21 15 cp r18, r1 386a6: 32 4c sbci r19, 0xC2 ; 194 386a8: 09 f0 breq .+2 ; 0x386ac 386aa: 9e c0 rjmp .+316 ; 0x387e8 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 386ac: 8e e1 ldi r24, 0x1E ; 30 386ae: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 386b0: 84 30 cpi r24, 0x04 ; 4 386b2: 60 e8 ldi r22, 0x80 ; 128 386b4: 96 07 cpc r25, r22 386b6: 09 f4 brne .+2 ; 0x386ba 386b8: 67 c0 rjmp .+206 ; 0x38788 386ba: 85 30 cpi r24, 0x05 ; 5 386bc: 20 e8 ldi r18, 0x80 ; 128 386be: 92 07 cpc r25, r18 386c0: 61 f7 brne .-40 ; 0x3869a 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); 386c2: 84 e2 ldi r24, 0x24 ; 36 386c4: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 386c6: 8a 30 cpi r24, 0x0A ; 10 386c8: 40 e8 ldi r20, 0x80 ; 128 386ca: 94 07 cpc r25, r20 386cc: 09 f4 brne .+2 ; 0x386d0 386ce: 5e c0 rjmp .+188 ; 0x3878c 386d0: 58 f4 brcc .+22 ; 0x386e8 386d2: 88 30 cpi r24, 0x08 ; 8 386d4: 20 e8 ldi r18, 0x80 ; 128 386d6: 92 07 cpc r25, r18 386d8: 09 f4 brne .+2 ; 0x386dc 386da: 6e c0 rjmp .+220 ; 0x387b8 386dc: 89 30 cpi r24, 0x09 ; 9 386de: 40 e8 ldi r20, 0x80 ; 128 386e0: 94 07 cpc r25, r20 386e2: d9 f6 brne .-74 ; 0x3869a 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); 386e4: 85 e0 ldi r24, 0x05 ; 5 386e6: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 386e8: 8c 30 cpi r24, 0x0C ; 12 386ea: 60 e8 ldi r22, 0x80 ; 128 386ec: 96 07 cpc r25, r22 386ee: 09 f4 brne .+2 ; 0x386f2 386f0: 51 c0 rjmp .+162 ; 0x38794 386f2: 8d 30 cpi r24, 0x0D ; 13 386f4: 20 e8 ldi r18, 0x80 ; 128 386f6: 92 07 cpc r25, r18 386f8: 81 f6 brne .-96 ; 0x3869a 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); 386fa: 81 e2 ldi r24, 0x21 ; 33 386fc: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 386fe: 8f 32 cpi r24, 0x2F ; 47 38700: 40 e8 ldi r20, 0x80 ; 128 38702: 94 07 cpc r25, r20 38704: 09 f4 brne .+2 ; 0x38708 38706: 56 c0 rjmp .+172 ; 0x387b4 38708: e0 f4 brcc .+56 ; 0x38742 3870a: 8c 32 cpi r24, 0x2C ; 44 3870c: 20 e8 ldi r18, 0x80 ; 128 3870e: 92 07 cpc r25, r18 38710: 09 f4 brne .+2 ; 0x38714 38712: 4e c0 rjmp .+156 ; 0x387b0 38714: 58 f4 brcc .+22 ; 0x3872c 38716: 8a 32 cpi r24, 0x2A ; 42 38718: 60 e8 ldi r22, 0x80 ; 128 3871a: 96 07 cpc r25, r22 3871c: c9 f1 breq .+114 ; 0x38790 3871e: 8b 32 cpi r24, 0x2B ; 43 38720: 20 e8 ldi r18, 0x80 ; 128 38722: 92 07 cpc r25, r18 38724: 09 f0 breq .+2 ; 0x38728 38726: b9 cf rjmp .-142 ; 0x3869a 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); 38728: 86 e2 ldi r24, 0x26 ; 38 3872a: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 3872c: 8d 32 cpi r24, 0x2D ; 45 3872e: 40 e8 ldi r20, 0x80 ; 128 38730: 94 07 cpc r25, r20 38732: d1 f1 breq .+116 ; 0x387a8 38734: 8e 32 cpi r24, 0x2E ; 46 38736: 60 e8 ldi r22, 0x80 ; 128 38738: 96 07 cpc r25, r22 3873a: 09 f0 breq .+2 ; 0x3873e 3873c: ae cf rjmp .-164 ; 0x3869a 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); 3873e: 82 e2 ldi r24, 0x22 ; 34 38740: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38742: 87 38 cpi r24, 0x87 ; 135 38744: 20 e8 ldi r18, 0x80 ; 128 38746: 92 07 cpc r25, r18 38748: 49 f1 breq .+82 ; 0x3879c 3874a: 58 f4 brcc .+22 ; 0x38762 3874c: 87 34 cpi r24, 0x47 ; 71 3874e: 60 e8 ldi r22, 0x80 ; 128 38750: 96 07 cpc r25, r22 38752: 29 f0 breq .+10 ; 0x3875e 38754: 8b 34 cpi r24, 0x4B ; 75 38756: 20 e8 ldi r18, 0x80 ; 128 38758: 92 07 cpc r25, r18 3875a: 09 f0 breq .+2 ; 0x3875e 3875c: 9e cf rjmp .-196 ; 0x3869a 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); 3875e: 84 e0 ldi r24, 0x04 ; 4 38760: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38762: 87 30 cpi r24, 0x07 ; 7 38764: 41 e8 ldi r20, 0x81 ; 129 38766: 94 07 cpc r25, r20 38768: d9 f0 breq .+54 ; 0x387a0 3876a: 8b 30 cpi r24, 0x0B ; 11 3876c: 61 e8 ldi r22, 0x81 ; 129 3876e: 96 07 cpc r25, r22 38770: c9 f0 breq .+50 ; 0x387a4 38772: 8b 38 cpi r24, 0x8B ; 139 38774: 20 e8 ldi r18, 0x80 ; 128 38776: 92 07 cpc r25, r18 38778: 09 f0 breq .+2 ; 0x3877c 3877a: 8f cf rjmp .-226 ; 0x3869a 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); 3877c: 89 e0 ldi r24, 0x09 ; 9 3877e: 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); 38780: 81 e0 ldi r24, 0x01 ; 1 38782: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 38784: 82 e0 ldi r24, 0x02 ; 2 38786: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 38788: 83 e0 ldi r24, 0x03 ; 3 3878a: 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); 3878c: 86 e0 ldi r24, 0x06 ; 6 3878e: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 38790: 87 e0 ldi r24, 0x07 ; 7 38792: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 38794: 8a e2 ldi r24, 0x2A ; 42 38796: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 38798: 8b e2 ldi r24, 0x2B ; 43 3879a: 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); 3879c: 88 e0 ldi r24, 0x08 ; 8 3879e: 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); 387a0: 8a e0 ldi r24, 0x0A ; 10 387a2: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 387a4: 8b e0 ldi r24, 0x0B ; 11 387a6: 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); 387a8: 83 e2 ldi r24, 0x23 ; 35 387aa: 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); 387ac: 85 e2 ldi r24, 0x25 ; 37 387ae: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 387b0: 87 e2 ldi r24, 0x27 ; 39 387b2: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 387b4: 88 e2 ldi r24, 0x28 ; 40 387b6: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 387b8: 89 e2 ldi r24, 0x29 ; 41 387ba: 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)) { 387bc: 87 ff sbrs r24, 7 387be: 07 c0 rjmp .+14 ; 0x387ce 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); 387c0: 22 27 eor r18, r18 387c2: 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) { 387c4: 21 15 cp r18, r1 387c6: 32 4c sbci r19, 0xC2 ; 194 387c8: a1 f5 brne .+104 ; 0x38832 return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 387ca: 8f e1 ldi r24, 0x1F ; 31 387cc: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 387ce: 22 27 eor r18, r18 387d0: 31 70 andi r19, 0x01 ; 1 387d2: 90 ff sbrs r25, 0 387d4: 52 c0 rjmp .+164 ; 0x3887a 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); 387d6: ac 01 movw r20, r24 387d8: 44 27 eor r20, r20 387da: 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) { 387dc: 41 15 cp r20, r1 387de: 52 4c sbci r21, 0xC2 ; 194 387e0: 09 f0 breq .+2 ; 0x387e4 387e2: 4b c0 rjmp .+150 ; 0x3887a return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 387e4: 80 e2 ldi r24, 0x20 ; 32 387e6: 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; 387e8: 9c 01 movw r18, r24 387ea: 22 27 eor r18, r18 387ec: 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)) { 387ee: 23 2b or r18, r19 387f0: 09 f0 breq .+2 ; 0x387f4 387f2: 67 c0 rjmp .+206 ; 0x388c2 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; 387f4: 9c 01 movw r18, r24 387f6: 22 27 eor r18, r18 387f8: 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)) { 387fa: 23 2b or r18, r19 387fc: 09 f0 breq .+2 ; 0x38800 387fe: 63 c0 rjmp .+198 ; 0x388c6 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; 38800: 9c 01 movw r18, r24 38802: 22 27 eor r18, r18 38804: 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)) { 38806: 23 2b or r18, r19 38808: 09 f0 breq .+2 ; 0x3880c 3880a: 5f c0 rjmp .+190 ; 0x388ca 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; 3880c: 9c 01 movw r18, r24 3880e: 22 27 eor r18, r18 38810: 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)) { 38812: 23 2b or r18, r19 38814: 09 f0 breq .+2 ; 0x38818 38816: 5b c0 rjmp .+182 ; 0x388ce 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; 38818: 9c 01 movw r18, r24 3881a: 22 27 eor r18, r18 3881c: 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)) { 3881e: 23 2b or r18, r19 38820: 09 f0 breq .+2 ; 0x38824 38822: 57 c0 rjmp .+174 ; 0x388d2 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; 38824: 88 27 eor r24, r24 38826: 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)) { 38828: 89 2b or r24, r25 3882a: 09 f4 brne .+2 ; 0x3882e 3882c: 68 c0 rjmp .+208 ; 0x388fe return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 3882e: 8f e0 ldi r24, 0x0F ; 15 38830: 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; 38832: 9c 01 movw r18, r24 38834: 22 27 eor r18, r18 38836: 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)) { 38838: 23 2b or r18, r19 3883a: 09 f0 breq .+2 ; 0x3883e 3883c: 4c c0 rjmp .+152 ; 0x388d6 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; 3883e: 9c 01 movw r18, r24 38840: 22 27 eor r18, r18 38842: 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)) { 38844: 23 2b or r18, r19 38846: 09 f0 breq .+2 ; 0x3884a 38848: 48 c0 rjmp .+144 ; 0x388da 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; 3884a: 9c 01 movw r18, r24 3884c: 22 27 eor r18, r18 3884e: 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)) { 38850: 23 2b or r18, r19 38852: 09 f0 breq .+2 ; 0x38856 38854: 44 c0 rjmp .+136 ; 0x388de 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; 38856: 9c 01 movw r18, r24 38858: 22 27 eor r18, r18 3885a: 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)) { 3885c: 23 2b or r18, r19 3885e: 09 f0 breq .+2 ; 0x38862 38860: 40 c0 rjmp .+128 ; 0x388e2 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; 38862: 9c 01 movw r18, r24 38864: 22 27 eor r18, r18 38866: 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)) { 38868: 23 2b or r18, r19 3886a: e9 f5 brne .+122 ; 0x388e6 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; 3886c: 88 27 eor r24, r24 3886e: 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)) { 38870: 89 2b or r24, r25 38872: 09 f4 brne .+2 ; 0x38876 38874: 44 c0 rjmp .+136 ; 0x388fe return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 38876: 80 e1 ldi r24, 0x10 ; 16 38878: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 3887a: 23 2b or r18, r19 3887c: 09 f4 brne .+2 ; 0x38880 3887e: 3f c0 rjmp .+126 ; 0x388fe 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; 38880: 9c 01 movw r18, r24 38882: 22 27 eor r18, r18 38884: 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)) { 38886: 23 2b or r18, r19 38888: 81 f5 brne .+96 ; 0x388ea 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; 3888a: 9c 01 movw r18, r24 3888c: 22 27 eor r18, r18 3888e: 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)) { 38890: 23 2b or r18, r19 38892: 69 f5 brne .+90 ; 0x388ee 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; 38894: 9c 01 movw r18, r24 38896: 22 27 eor r18, r18 38898: 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)) { 3889a: 23 2b or r18, r19 3889c: 51 f5 brne .+84 ; 0x388f2 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; 3889e: 9c 01 movw r18, r24 388a0: 22 27 eor r18, r18 388a2: 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)) { 388a4: 23 2b or r18, r19 388a6: 39 f5 brne .+78 ; 0x388f6 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; 388a8: 9c 01 movw r18, r24 388aa: 22 27 eor r18, r18 388ac: 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)) { 388ae: 23 2b or r18, r19 388b0: 21 f5 brne .+72 ; 0x388fa 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; 388b2: 88 27 eor r24, r24 388b4: 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)) { 388b6: 89 2b or r24, r25 388b8: 11 f1 breq .+68 ; 0x388fe return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 388ba: 81 e1 ldi r24, 0x11 ; 17 388bc: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 388be: 80 e0 ldi r24, 0x00 ; 0 388c0: 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); 388c2: 82 e1 ldi r24, 0x12 ; 18 388c4: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 388c6: 85 e1 ldi r24, 0x15 ; 21 388c8: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 388ca: 88 e1 ldi r24, 0x18 ; 24 388cc: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 388ce: 8b e1 ldi r24, 0x1B ; 27 388d0: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 388d2: 8c e0 ldi r24, 0x0C ; 12 388d4: 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); 388d6: 83 e1 ldi r24, 0x13 ; 19 388d8: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 388da: 86 e1 ldi r24, 0x16 ; 22 388dc: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 388de: 89 e1 ldi r24, 0x19 ; 25 388e0: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 388e2: 8c e1 ldi r24, 0x1C ; 28 388e4: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 388e6: 8d e0 ldi r24, 0x0D ; 13 388e8: 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); 388ea: 84 e1 ldi r24, 0x14 ; 20 388ec: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 388ee: 87 e1 ldi r24, 0x17 ; 23 388f0: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 388f2: 8a e1 ldi r24, 0x1A ; 26 388f4: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 388f6: 8d e1 ldi r24, 0x1D ; 29 388f8: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 388fa: 8e e0 ldi r24, 0x0E ; 14 388fc: 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); 388fe: 8c e2 ldi r24, 0x2C ; 44 } 38900: 08 95 ret 00038902 : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 38902: cf 92 push r12 38904: df 92 push r13 38906: ef 92 push r14 38908: ff 92 push r15 3890a: 0f 93 push r16 3890c: 1f 93 push r17 3890e: cf 93 push r28 38910: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 38912: 20 91 69 13 lds r18, 0x1369 ; 0x801369 38916: 30 91 6a 13 lds r19, 0x136A ; 0x80136a 3891a: 21 30 cpi r18, 0x01 ; 1 3891c: 31 05 cpc r19, r1 3891e: 39 f4 brne .+14 ; 0x3892e 38920: 20 91 92 13 lds r18, 0x1392 ; 0x801392 38924: 21 30 cpi r18, 0x01 ; 1 38926: 19 f4 brne .+6 ; 0x3892e // 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; 38928: 22 e0 ldi r18, 0x02 ; 2 3892a: 20 93 d2 17 sts 0x17D2, r18 ; 0x8017d2 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 3892e: 0f 94 30 c3 call 0x38660 ; 0x38660 38932: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 38934: 80 91 d2 17 lds r24, 0x17D2 ; 0x8017d2 38938: 81 30 cpi r24, 0x01 ; 1 3893a: 09 f4 brne .+2 ; 0x3893e 3893c: 64 c0 rjmp .+200 ; 0x38a06 3893e: 60 f0 brcs .+24 ; 0x38958 38940: 82 30 cpi r24, 0x02 ; 2 38942: 09 f4 brne .+2 ; 0x38946 38944: f4 c0 rjmp .+488 ; 0x38b2e ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 38946: df 91 pop r29 38948: cf 91 pop r28 3894a: 1f 91 pop r17 3894c: 0f 91 pop r16 3894e: ff 90 pop r15 38950: ef 90 pop r14 38952: df 90 pop r13 38954: cf 90 pop r12 38956: 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); 38958: 84 e0 ldi r24, 0x04 ; 4 3895a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 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); 3895e: 0d 2f mov r16, r29 38960: 10 e0 ldi r17, 0x00 ; 0 38962: f8 01 movw r30, r16 38964: e1 56 subi r30, 0x61 ; 97 38966: f4 45 sbci r31, 0x54 ; 84 38968: 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); 3896a: fc 2e mov r15, r28 3896c: f2 94 swap r15 3896e: 6f e0 ldi r22, 0x0F ; 15 38970: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 38972: 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); 38974: 80 e0 ldi r24, 0x00 ; 0 38976: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_clear(); 3897a: 0e 94 48 70 call 0xe090 ; 0xe090 // 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); 3897e: 00 0f add r16, r16 38980: 11 1f adc r17, r17 38982: f8 01 movw r30, r16 38984: e4 53 subi r30, 0x34 ; 52 38986: f4 45 sbci r31, 0x54 ; 84 38988: c5 90 lpm r12, Z+ 3898a: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 3898c: 05 55 subi r16, 0x55 ; 85 3898e: 17 45 sbci r17, 0x57 ; 87 38990: f8 01 movw r30, r16 38992: 85 91 lpm r24, Z+ 38994: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 38996: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 3899a: df 92 push r13 3899c: cf 92 push r12 3899e: 9f 93 push r25 389a0: 8f 93 push r24 389a2: 88 e3 ldi r24, 0x38 ; 56 389a4: 9c ea ldi r25, 0xAC ; 172 389a6: 9f 93 push r25 389a8: 8f 93 push r24 389aa: 0e 94 ee 6f call 0xdfdc ; 0xdfdc 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)); 389ae: 43 e2 ldi r20, 0x23 ; 35 389b0: 59 ea ldi r21, 0xA9 ; 169 389b2: 62 e0 ldi r22, 0x02 ; 2 389b4: 80 e0 ldi r24, 0x00 ; 0 389b6: 0e 94 29 70 call 0xe052 ; 0xe052 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()); 389ba: 0f 90 pop r0 389bc: 0f 90 pop r0 389be: 0f 90 pop r0 389c0: 0f 90 pop r0 389c2: 0f 90 pop r0 389c4: 0f 90 pop r0 389c6: f1 10 cpse r15, r1 389c8: c6 c0 rjmp .+396 ; 0x38b56 389ca: 10 e0 ldi r17, 0x00 ; 0 389cc: 00 e0 ldi r16, 0x00 ; 0 389ce: 42 e1 ldi r20, 0x12 ; 18 389d0: e4 2e mov r14, r20 389d2: 5c e9 ldi r21, 0x9C ; 156 389d4: c5 2e mov r12, r21 389d6: 51 e7 ldi r21, 0x71 ; 113 389d8: 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); 389da: ec 2f mov r30, r28 389dc: f0 e0 ldi r31, 0x00 ; 0 389de: ee 0f add r30, r30 389e0: ff 1f adc r31, r31 389e2: ec 5d subi r30, 0xDC ; 220 389e4: f3 45 sbci r31, 0x53 ; 83 389e6: 85 91 lpm r24, Z+ 389e8: 94 91 lpm r25, Z 389ea: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 389ee: bc 01 movw r22, r24 389f0: 81 e0 ldi r24, 0x01 ; 1 389f2: f1 10 cpse r15, r1 389f4: 01 c0 rjmp .+2 ; 0x389f8 389f6: 80 e0 ldi r24, 0x00 ; 0 389f8: 2e 2d mov r18, r14 389fa: a6 01 movw r20, r12 389fc: 0f 94 2f 34 call 0x2685e ; 0x2685e switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 38a00: 81 e0 ldi r24, 0x01 ; 1 38a02: 80 93 d2 17 sts 0x17D2, r24 ; 0x8017d2 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 38a06: 81 e0 ldi r24, 0x01 ; 1 38a08: 80 93 74 07 sts 0x0774, r24 ; 0x800774 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.507> ReportErrorHookDynamicRender(); // Render dynamic characters 38a0c: 0f 94 42 c2 call 0x38484 ; 0x38484 sound_wait_for_user(); 38a10: 0f 94 0a 6a call 0x2d414 ; 0x2d414 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); 38a14: 0d 2f mov r16, r29 38a16: 10 e0 ldi r17, 0x00 ; 0 38a18: f8 01 movw r30, r16 38a1a: e1 56 subi r30, 0x61 ; 97 38a1c: f4 45 sbci r31, 0x54 ; 84 38a1e: 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); 38a20: dc 2f mov r29, r28 38a22: d2 95 swap r29 38a24: 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; 38a26: 80 91 ca 17 lds r24, 0x17CA ; 0x8017ca 38a2a: 81 11 cpse r24, r1 38a2c: 09 c0 rjmp .+18 ; 0x38a40 38a2e: 81 e0 ldi r24, 0x01 ; 1 38a30: d1 11 cpse r29, r1 38a32: 01 c0 rjmp .+2 ; 0x38a36 38a34: 80 e0 ldi r24, 0x00 ; 0 38a36: 80 93 c9 17 sts 0x17C9, r24 ; 0x8017c9 38a3a: 81 e0 ldi r24, 0x01 ; 1 38a3c: 80 93 ca 17 sts 0x17CA, r24 ; 0x8017ca static int8_t choice_selected = -1; if (reset_button_selection) { 38a40: 80 91 c8 17 lds r24, 0x17C8 ; 0x8017c8 38a44: 88 23 and r24, r24 38a46: 41 f0 breq .+16 ; 0x38a58 // 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; 38a48: 81 e0 ldi r24, 0x01 ; 1 38a4a: d1 11 cpse r29, r1 38a4c: 01 c0 rjmp .+2 ; 0x38a50 38a4e: 80 e0 ldi r24, 0x00 ; 0 38a50: 80 93 c9 17 sts 0x17C9, r24 ; 0x8017c9 choice_selected = -1; reset_button_selection = 0; 38a54: 10 92 c8 17 sts 0x17C8, r1 ; 0x8017c8 } // Check if knob was rotated if (lcd_encoder) { 38a58: 20 91 37 05 lds r18, 0x0537 ; 0x800537 38a5c: 30 91 38 05 lds r19, 0x0538 ; 0x800538 38a60: 21 15 cp r18, r1 38a62: 31 05 cpc r19, r1 38a64: b9 f1 breq .+110 ; 0x38ad4 38a66: 80 91 c9 17 lds r24, 0x17C9 ; 0x8017c9 if (two_choices == false) { // third_choice is not nullptr, safe to dereference 38a6a: dd 23 and r29, r29 38a6c: 61 f0 breq .+24 ; 0x38a86 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38a6e: 37 ff sbrs r19, 7 38a70: 06 c0 rjmp .+12 ; 0x38a7e 38a72: 88 23 and r24, r24 38a74: 69 f0 breq .+26 ; 0x38a90 // Rotating knob counter clockwise current_selection--; 38a76: 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; 38a78: 80 93 c9 17 sts 0x17C9, r24 ; 0x8017c9 38a7c: 09 c0 rjmp .+18 ; 0x38a90 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) { 38a7e: 82 30 cpi r24, 0x02 ; 2 38a80: 39 f0 breq .+14 ; 0x38a90 // Rotating knob clockwise current_selection++; 38a82: 8f 5f subi r24, 0xFF ; 255 38a84: f9 cf rjmp .-14 ; 0x38a78 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38a86: 37 ff sbrs r19, 7 38a88: 41 c0 rjmp .+130 ; 0x38b0c 38a8a: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 38a8c: 10 92 c9 17 sts 0x17C9, r1 ; 0x8017c9 //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 38a90: 80 91 c9 17 lds r24, 0x17C9 ; 0x8017c9 38a94: 4e e3 ldi r20, 0x3E ; 62 38a96: 81 11 cpse r24, r1 38a98: 40 e2 ldi r20, 0x20 ; 32 38a9a: 63 e0 ldi r22, 0x03 ; 3 38a9c: 80 e0 ldi r24, 0x00 ; 0 38a9e: 0e 94 35 70 call 0xe06a ; 0xe06a 38aa2: 80 91 c9 17 lds r24, 0x17C9 ; 0x8017c9 if (two_choices == false) 38aa6: dd 23 and r29, r29 38aa8: b1 f1 breq .+108 ; 0x38b16 { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 38aaa: 4e e3 ldi r20, 0x3E ; 62 38aac: 81 30 cpi r24, 0x01 ; 1 38aae: 09 f0 breq .+2 ; 0x38ab2 38ab0: 40 e2 ldi r20, 0x20 ; 32 38ab2: 63 e0 ldi r22, 0x03 ; 3 38ab4: 89 e0 ldi r24, 0x09 ; 9 38ab6: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 38aba: 80 91 c9 17 lds r24, 0x17C9 ; 0x8017c9 38abe: 82 30 cpi r24, 0x02 ; 2 38ac0: 61 f5 brne .+88 ; 0x38b1a } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 38ac2: 4e e3 ldi r20, 0x3E ; 62 38ac4: 63 e0 ldi r22, 0x03 ; 3 38ac6: 82 e1 ldi r24, 0x12 ; 18 38ac8: 0e 94 35 70 call 0xe06a ; 0xe06a } // Consume rotation event lcd_encoder = 0; 38acc: 10 92 38 05 sts 0x0538, r1 ; 0x800538 38ad0: 10 92 37 05 sts 0x0537, r1 ; 0x800537 } // Check if knob was clicked and consume the event if (lcd_clicked()) { 38ad4: 0e 94 32 72 call 0xe464 ; 0xe464 38ad8: 88 23 and r24, r24 38ada: 09 f4 brne .+2 ; 0x38ade 38adc: 34 cf rjmp .-408 ; 0x38946 choice_selected = current_selection; 38ade: 80 91 c9 17 lds r24, 0x17C9 ; 0x8017c9 } else { // continue monitoring return ret; } if ((two_choices && choice_selected == LCD_MIDDLE_BUTTON_CHOICE) // Two choices and middle button selected 38ae2: d1 11 cpse r29, r1 38ae4: 1c c0 rjmp .+56 ; 0x38b1e 38ae6: 81 30 cpi r24, 0x01 ; 1 38ae8: 89 f5 brne .+98 ; 0x38b4c 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); 38aea: f8 01 movw r30, r16 38aec: ee 0f add r30, r30 38aee: ff 1f adc r31, r31 38af0: eb 5b subi r30, 0xBB ; 187 38af2: f4 45 sbci r31, 0x54 ; 84 38af4: 85 91 lpm r24, Z+ 38af6: 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))); 38af8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 38afc: 0f 94 07 35 call 0x26a0e ; 0x26a0e SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38b00: 81 e0 ldi r24, 0x01 ; 1 38b02: 80 93 c8 17 sts 0x17C8, r24 ; 0x8017c8 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; 38b06: 10 92 d2 17 sts 0x17D2, r1 ; 0x8017d2 38b0a: 1d cf rjmp .-454 ; 0x38946 } } 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) { 38b0c: 81 30 cpi r24, 0x01 ; 1 38b0e: 09 f4 brne .+2 ; 0x38b12 38b10: bf cf rjmp .-130 ; 0x38a90 // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 38b12: 81 e0 ldi r24, 0x01 ; 1 38b14: b1 cf rjmp .-158 ; 0x38a78 { 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 ? '>': ' '); 38b16: 81 30 cpi r24, 0x01 ; 1 38b18: a1 f2 breq .-88 ; 0x38ac2 38b1a: 40 e2 ldi r20, 0x20 ; 32 38b1c: d3 cf rjmp .-90 ; 0x38ac4 // 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 38b1e: 82 30 cpi r24, 0x02 ; 2 38b20: 21 f3 breq .-56 ; 0x38aea { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 38b22: 81 30 cpi r24, 0x01 ; 1 38b24: 99 f4 brne .+38 ; 0x38b4c return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 38b26: d0 93 5f 0e sts 0x0E5F, r29 ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38b2a: 80 93 c8 17 sts 0x17C8, r24 ; 0x8017c8 // More button selected, change state ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; case 2: // Exit error screen and enable lcd updates lcd_update_enable(true); 38b2e: 81 e0 ldi r24, 0x01 ; 1 38b30: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 lcd_return_to_status(); 38b34: 0f 94 4e 26 call 0x24c9c ; 0x24c9c 38b38: 10 92 6c 05 sts 0x056C, r1 ; 0x80056c <_ZL10beep_timer.lto_priv.511> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 38b3c: 10 92 6f 05 sts 0x056F, r1 ; 0x80056f <_ZL6bFirst.lto_priv.512> sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; 38b40: 10 92 74 07 sts 0x0774, r1 ; 0x800774 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.507> KEEPALIVE_STATE(IN_HANDLER); 38b44: 82 e0 ldi r24, 0x02 ; 2 38b46: 80 93 96 02 sts 0x0296, r24 ; 0x800296 38b4a: dd cf rjmp .-70 ; 0x38b06 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); 38b4c: cf 70 andi r28, 0x0F ; 15 38b4e: c0 93 5f 0e sts 0x0E5F, r28 ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38b52: 81 e0 ldi r24, 0x01 ; 1 38b54: ea cf rjmp .-44 ; 0x38b2a 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); 38b56: ef 2d mov r30, r15 38b58: f0 e0 ldi r31, 0x00 ; 0 38b5a: ee 0f add r30, r30 38b5c: ff 1f adc r31, r31 38b5e: ec 5d subi r30, 0xDC ; 220 38b60: f3 45 sbci r31, 0x53 ; 83 38b62: 85 91 lpm r24, Z+ 38b64: 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()); 38b66: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 38b6a: 6c 01 movw r12, r24 38b6c: 0c e9 ldi r16, 0x9C ; 156 38b6e: 11 e7 ldi r17, 0x71 ; 113 38b70: 99 e0 ldi r25, 0x09 ; 9 38b72: e9 2e mov r14, r25 38b74: 32 cf rjmp .-412 ; 0x389da 00038b76 : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 38b76: 0f 94 30 c3 call 0x38660 ; 0x38660 // 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); 38b7a: e8 2f mov r30, r24 38b7c: f0 e0 ldi r31, 0x00 ; 0 38b7e: ee 0f add r30, r30 38b80: ff 1f adc r31, r31 38b82: e4 53 subi r30, 0x34 ; 52 38b84: f4 45 sbci r31, 0x54 ; 84 38b86: 25 91 lpm r18, Z+ 38b88: 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) ) { 38b8a: 23 33 cpi r18, 0x33 ; 51 38b8c: 81 e0 ldi r24, 0x01 ; 1 38b8e: 38 07 cpc r19, r24 38b90: 08 f0 brcs .+2 ; 0x38b94 38b92: 41 c0 rjmp .+130 ; 0x38c16 38b94: 2d 32 cpi r18, 0x2D ; 45 38b96: 81 e0 ldi r24, 0x01 ; 1 38b98: 38 07 cpc r19, r24 38b9a: 78 f5 brcc .+94 ; 0x38bfa 38b9c: 2e 37 cpi r18, 0x7E ; 126 38b9e: 31 05 cpc r19, r1 38ba0: 09 f4 brne .+2 ; 0x38ba4 38ba2: 83 c0 rjmp .+262 ; 0x38caa 38ba4: f0 f4 brcc .+60 ; 0x38be2 38ba6: 2c 36 cpi r18, 0x6C ; 108 38ba8: 31 05 cpc r19, r1 38baa: 09 f4 brne .+2 ; 0x38bae 38bac: 85 c0 rjmp .+266 ; 0x38cb8 38bae: 30 f4 brcc .+12 ; 0x38bbc 38bb0: 25 36 cpi r18, 0x65 ; 101 38bb2: 31 05 cpc r19, r1 38bb4: 08 f0 brcs .+2 ; 0x38bb8 38bb6: 79 c0 rjmp .+242 ; 0x38caa default: break; } return Buttons::NoButton; 38bb8: 8f ef ldi r24, 0xFF ; 255 38bba: 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) ) { 38bbc: 24 37 cpi r18, 0x74 ; 116 38bbe: 31 05 cpc r19, r1 38bc0: 09 f4 brne .+2 ; 0x38bc4 38bc2: 73 c0 rjmp .+230 ; 0x38caa 38bc4: 2d 37 cpi r18, 0x7D ; 125 38bc6: 31 05 cpc r19, r1 38bc8: 19 f0 breq .+6 ; 0x38bd0 38bca: 23 37 cpi r18, 0x73 ; 115 38bcc: 31 05 cpc r19, r1 38bce: a1 f7 brne .-24 ; 0x38bb8 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 38bd0: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> 38bd4: 81 30 cpi r24, 0x01 ; 1 38bd6: 09 f4 brne .+2 ; 0x38bda 38bd8: 6d c0 rjmp .+218 ; 0x38cb4 38bda: 87 30 cpi r24, 0x07 ; 7 38bdc: 69 f7 brne .-38 ; 0x38bb8 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 38bde: 88 e0 ldi r24, 0x08 ; 8 38be0: 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) ) { 38be2: 23 3d cpi r18, 0xD3 ; 211 38be4: 31 05 cpc r19, r1 38be6: 09 f4 brne .+2 ; 0x38bea 38be8: 6e c0 rjmp .+220 ; 0x38cc6 38bea: 50 f4 brcc .+20 ; 0x38c00 38bec: 29 3c cpi r18, 0xC9 ; 201 38bee: 31 05 cpc r19, r1 38bf0: 09 f4 brne .+2 ; 0x38bf4 38bf2: 69 c0 rjmp .+210 ; 0x38cc6 38bf4: 2a 3c cpi r18, 0xCA ; 202 38bf6: 31 05 cpc r19, r1 38bf8: f9 f6 brne .-66 ; 0x38bb8 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) { 38bfa: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> 38bfe: 67 c0 rjmp .+206 ; 0x38cce // 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) ) { 38c00: 2d 3d cpi r18, 0xDD ; 221 38c02: 31 05 cpc r19, r1 38c04: 09 f4 brne .+2 ; 0x38c08 38c06: 5f c0 rjmp .+190 ; 0x38cc6 38c08: 2e 3d cpi r18, 0xDE ; 222 38c0a: 31 05 cpc r19, r1 38c0c: b1 f3 breq .-20 ; 0x38bfa 38c0e: 24 3d cpi r18, 0xD4 ; 212 38c10: 31 05 cpc r19, r1 38c12: 91 f6 brne .-92 ; 0x38bb8 38c14: f2 cf rjmp .-28 ; 0x38bfa 38c16: 25 3f cpi r18, 0xF5 ; 245 38c18: 81 e0 ldi r24, 0x01 ; 1 38c1a: 38 07 cpc r19, r24 38c1c: 09 f4 brne .+2 ; 0x38c20 38c1e: 5c c0 rjmp .+184 ; 0x38cd8 38c20: f8 f4 brcc .+62 ; 0x38c60 38c22: 26 34 cpi r18, 0x46 ; 70 38c24: 81 e0 ldi r24, 0x01 ; 1 38c26: 38 07 cpc r19, r24 38c28: 58 f4 brcc .+22 ; 0x38c40 38c2a: 21 34 cpi r18, 0x41 ; 65 38c2c: 81 e0 ldi r24, 0x01 ; 1 38c2e: 38 07 cpc r19, r24 38c30: 20 f7 brcc .-56 ; 0x38bfa 38c32: 27 53 subi r18, 0x37 ; 55 38c34: 31 40 sbci r19, 0x01 ; 1 38c36: 25 30 cpi r18, 0x05 ; 5 38c38: 31 05 cpc r19, r1 38c3a: 08 f0 brcs .+2 ; 0x38c3e 38c3c: bd cf rjmp .-134 ; 0x38bb8 38c3e: dd cf rjmp .-70 ; 0x38bfa 38c40: 21 59 subi r18, 0x91 ; 145 38c42: 31 40 sbci r19, 0x01 ; 1 38c44: 22 30 cpi r18, 0x02 ; 2 38c46: 31 05 cpc r19, r1 38c48: 08 f0 brcs .+2 ; 0x38c4c 38c4a: b6 cf rjmp .-148 ; 0x38bb8 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 38c4c: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> 38c50: 83 30 cpi r24, 0x03 ; 3 38c52: 09 f4 brne .+2 ; 0x38c56 38c54: 3f c0 rjmp .+126 ; 0x38cd4 38c56: 89 30 cpi r24, 0x09 ; 9 38c58: 09 f0 breq .+2 ; 0x38c5c 38c5a: ae cf rjmp .-164 ; 0x38bb8 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 38c5c: 87 e0 ldi r24, 0x07 ; 7 38c5e: 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) ) { 38c60: 29 3f cpi r18, 0xF9 ; 249 38c62: 81 e0 ldi r24, 0x01 ; 1 38c64: 38 07 cpc r19, r24 38c66: 49 f2 breq .-110 ; 0x38bfa 38c68: 70 f4 brcc .+28 ; 0x38c86 38c6a: 27 3f cpi r18, 0xF7 ; 247 38c6c: 81 e0 ldi r24, 0x01 ; 1 38c6e: 38 07 cpc r19, r24 38c70: 21 f2 breq .-120 ; 0x38bfa 38c72: 60 f7 brcc .-40 ; 0x38c4c break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 38c74: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> 38c78: 83 30 cpi r24, 0x03 ; 3 38c7a: 61 f1 breq .+88 ; 0x38cd4 38c7c: 88 30 cpi r24, 0x08 ; 8 38c7e: 09 f0 breq .+2 ; 0x38c82 38c80: 9b cf rjmp .-202 ; 0x38bb8 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 38c82: 86 e0 ldi r24, 0x06 ; 6 38c84: 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) ) { 38c86: 2b 3f cpi r18, 0xFB ; 251 38c88: 81 e0 ldi r24, 0x01 ; 1 38c8a: 38 07 cpc r19, r24 38c8c: a9 f0 breq .+42 ; 0x38cb8 38c8e: 68 f0 brcs .+26 ; 0x38caa 38c90: 2c 3f cpi r18, 0xFC ; 252 38c92: 31 40 sbci r19, 0x01 ; 1 38c94: 09 f0 breq .+2 ; 0x38c98 38c96: 90 cf rjmp .-224 ; 0x38bb8 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 38c98: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> 38c9c: 85 30 cpi r24, 0x05 ; 5 38c9e: 89 f0 breq .+34 ; 0x38cc2 38ca0: 86 30 cpi r24, 0x06 ; 6 38ca2: 09 f0 breq .+2 ; 0x38ca6 38ca4: 89 cf rjmp .-238 ; 0x38bb8 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 38ca6: 85 e0 ldi r24, 0x05 ; 5 38ca8: 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) { 38caa: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> 38cae: 81 30 cpi r24, 0x01 ; 1 38cb0: 09 f0 breq .+2 ; 0x38cb4 38cb2: 82 cf rjmp .-252 ; 0x38bb8 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; 38cb4: 81 e0 ldi r24, 0x01 ; 1 38cb6: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 38cb8: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> 38cbc: 82 30 cpi r24, 0x02 ; 2 38cbe: d1 f3 breq .-12 ; 0x38cb4 38cc0: 7b cf rjmp .-266 ; 0x38bb8 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 38cc2: 84 e0 ldi r24, 0x04 ; 4 38cc4: 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) { 38cc6: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> 38cca: 82 30 cpi r24, 0x02 ; 2 38ccc: 61 f0 breq .+24 ; 0x38ce6 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) { 38cce: 83 30 cpi r24, 0x03 ; 3 38cd0: 09 f0 breq .+2 ; 0x38cd4 38cd2: 72 cf rjmp .-284 ; 0x38bb8 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; 38cd4: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 38cd6: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 38cd8: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.510> 38cdc: 82 30 cpi r24, 0x02 ; 2 38cde: 29 f0 breq .+10 ; 0x38cea 38ce0: 84 30 cpi r24, 0x04 ; 4 38ce2: 09 f0 breq .+2 ; 0x38ce6 38ce4: 69 cf rjmp .-302 ; 0x38bb8 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; 38ce6: 82 e0 ldi r24, 0x02 ; 2 38ce8: 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; 38cea: 80 e0 ldi r24, 0x00 ; 0 38cec: 08 95 ret 00038cee (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 38cee: cf 93 push r28 38cf0: df 93 push r29 38cf2: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 38cf4: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 38cf8: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 38cfc: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 38d00: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 38d04: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 38d08: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d 38d0c: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e 38d10: c9 01 movw r24, r18 38d12: 86 1b sub r24, r22 38d14: 97 0b sbc r25, r23 38d16: 06 97 sbiw r24, 0x06 ; 6 38d18: 24 f0 brlt .+8 ; 0x38d22 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]+0x34> void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 38d1a: ce 01 movw r24, r28 38d1c: 0e 94 ff 8e call 0x11dfe ; 0x11dfe 38d20: e9 cf rjmp .-46 ; 0x38cf4 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]+0x6> f(); safe_delay_keep_alive(delay); } } 38d22: df 91 pop r29 38d24: cf 91 pop r28 38d26: 08 95 ret 00038d28 : } //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) { 38d28: cf 93 push r28 38d2a: df 93 push r29 38d2c: 00 d0 rcall .+0 ; 0x38d2e 38d2e: 00 d0 rcall .+0 ; 0x38d30 38d30: 1f 92 push r1 38d32: cd b7 in r28, 0x3d ; 61 38d34: 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)) 38d36: 87 30 cpi r24, 0x07 ; 7 38d38: 50 f5 brcc .+84 ; 0x38d8e 38d3a: 67 30 cpi r22, 0x07 ; 7 38d3c: 40 f5 brcc .+80 ; 0x38d8e return false; uint8_t valid_points_mask[7] = { 38d3e: 97 e0 ldi r25, 0x07 ; 7 38d40: e6 ec ldi r30, 0xC6 ; 198 38d42: f2 e0 ldi r31, 0x02 ; 2 38d44: de 01 movw r26, r28 38d46: 11 96 adiw r26, 0x01 ; 1 38d48: 01 90 ld r0, Z+ 38d4a: 0d 92 st X+, r0 38d4c: 9a 95 dec r25 38d4e: e1 f7 brne .-8 ; 0x38d48 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 38d50: 46 e0 ldi r20, 0x06 ; 6 38d52: 50 e0 ldi r21, 0x00 ; 0 38d54: fa 01 movw r30, r20 38d56: e6 1b sub r30, r22 38d58: f1 09 sbc r31, r1 38d5a: 21 e0 ldi r18, 0x01 ; 1 38d5c: 30 e0 ldi r19, 0x00 ; 0 38d5e: 2c 0f add r18, r28 38d60: 3d 1f adc r19, r29 38d62: e2 0f add r30, r18 38d64: f3 1f adc r31, r19 38d66: 20 81 ld r18, Z 38d68: 30 e0 ldi r19, 0x00 ; 0 38d6a: 48 1b sub r20, r24 38d6c: 51 09 sbc r21, r1 38d6e: c9 01 movw r24, r18 38d70: 02 c0 rjmp .+4 ; 0x38d76 38d72: 95 95 asr r25 38d74: 87 95 ror r24 38d76: 4a 95 dec r20 38d78: e2 f7 brpl .-8 ; 0x38d72 38d7a: 81 70 andi r24, 0x01 ; 1 } 38d7c: 27 96 adiw r28, 0x07 ; 7 38d7e: 0f b6 in r0, 0x3f ; 63 38d80: f8 94 cli 38d82: de bf out 0x3e, r29 ; 62 38d84: 0f be out 0x3f, r0 ; 63 38d86: cd bf out 0x3d, r28 ; 61 38d88: df 91 pop r29 38d8a: cf 91 pop r28 38d8c: 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; 38d8e: 80 e0 ldi r24, 0x00 ; 0 38d90: f5 cf rjmp .-22 ; 0x38d7c 00038d92 : // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 38d92: 10 92 6b 05 sts 0x056B, r1 ; 0x80056b <_ZL13babystepLoadZ.lto_priv.514+0x1> 38d96: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a <_ZL13babystepLoadZ.lto_priv.514> // Apply Z height correction aka baby stepping before mesh bed leveling gets activated. if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 38d9a: 80 e1 ldi r24, 0x10 ; 16 38d9c: 0e 94 6d f8 call 0x1f0da ; 0x1f0da 38da0: 88 23 and r24, r24 38da2: 91 f0 breq .+36 ; 0x38dc8 { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 38da4: 0e 94 8a 7b call 0xf714 ; 0xf714 // 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))); 38da8: 81 ea ldi r24, 0xA1 ; 161 38daa: 9d e0 ldi r25, 0x0D ; 13 38dac: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 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-> 38db0: 2b e0 ldi r18, 0x0B ; 11 38db2: 82 9f mul r24, r18 38db4: c0 01 movw r24, r0 38db6: 11 24 eor r1, r1 38db8: 80 5b subi r24, 0xB0 ; 176 38dba: 92 4f sbci r25, 0xF2 ; 242 38dbc: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 38dc0: 90 93 6b 05 sts 0x056B, r25 ; 0x80056b <_ZL13babystepLoadZ.lto_priv.514+0x1> 38dc4: 80 93 6a 05 sts 0x056A, r24 ; 0x80056a <_ZL13babystepLoadZ.lto_priv.514> SERIAL_ECHO("correction: "); SERIAL_ECHO(float(babystepLoadZ) / float(axis_steps_per_mm[Z_AXIS])); SERIAL_ECHOLN(""); #endif } } 38dc8: 08 95 ret 00038dca : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 38dca: 0f 93 push r16 38dcc: 1f 93 push r17 38dce: cf 93 push r28 38dd0: df 93 push r29 38dd2: 00 d0 rcall .+0 ; 0x38dd4 38dd4: 1f 92 push r1 38dd6: cd b7 in r28, 0x3d ; 61 38dd8: de b7 in r29, 0x3e ; 62 38dda: 9b 01 movw r18, r22 38ddc: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 38dde: 03 e4 ldi r16, 0x43 ; 67 38de0: 17 e0 ldi r17, 0x07 ; 7 38de2: f8 01 movw r30, r16 38de4: 60 85 ldd r22, Z+8 ; 0x08 38de6: 71 85 ldd r23, Z+9 ; 0x09 38de8: 82 85 ldd r24, Z+10 ; 0x0a 38dea: 93 85 ldd r25, Z+11 ; 0x0b 38dec: 69 83 std Y+1, r22 ; 0x01 38dee: 7a 83 std Y+2, r23 ; 0x02 38df0: 8b 83 std Y+3, r24 ; 0x03 38df2: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 38df4: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 38df8: f8 01 movw r30, r16 38dfa: 60 87 std Z+8, r22 ; 0x08 38dfc: 71 87 std Z+9, r23 ; 0x09 38dfe: 82 87 std Z+10, r24 ; 0x0a 38e00: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 38e02: 65 e5 ldi r22, 0x55 ; 85 38e04: 75 e5 ldi r23, 0x55 ; 85 38e06: 85 e5 ldi r24, 0x55 ; 85 38e08: 91 e4 ldi r25, 0x41 ; 65 38e0a: 0f 94 5d ba call 0x374ba ; 0x374ba st_synchronize(); 38e0e: 0f 94 27 58 call 0x2b04e ; 0x2b04e current_position[Z_AXIS] = curpos_z; 38e12: 89 81 ldd r24, Y+1 ; 0x01 38e14: 9a 81 ldd r25, Y+2 ; 0x02 38e16: ab 81 ldd r26, Y+3 ; 0x03 38e18: bc 81 ldd r27, Y+4 ; 0x04 38e1a: f8 01 movw r30, r16 38e1c: 80 87 std Z+8, r24 ; 0x08 38e1e: 91 87 std Z+9, r25 ; 0x09 38e20: a2 87 std Z+10, r26 ; 0x0a 38e22: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 38e24: ce 01 movw r24, r28 38e26: 01 96 adiw r24, 0x01 ; 1 38e28: 0f 94 e1 aa call 0x355c2 ; 0x355c2 } 38e2c: 0f 90 pop r0 38e2e: 0f 90 pop r0 38e30: 0f 90 pop r0 38e32: 0f 90 pop r0 38e34: df 91 pop r29 38e36: cf 91 pop r28 38e38: 1f 91 pop r17 38e3a: 0f 91 pop r16 38e3c: 08 95 ret 00038e3e : 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])); 38e3e: 60 91 6a 05 lds r22, 0x056A ; 0x80056a <_ZL13babystepLoadZ.lto_priv.514> 38e42: 70 91 6b 05 lds r23, 0x056B ; 0x80056b <_ZL13babystepLoadZ.lto_priv.514+0x1> 38e46: 07 2e mov r0, r23 38e48: 00 0c add r0, r0 38e4a: 88 0b sbc r24, r24 38e4c: 99 0b sbc r25, r25 38e4e: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 38e52: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 38e56: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 38e5a: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 38e5e: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 38e62: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 38e66: 0f 94 e5 c6 call 0x38dca ; 0x38dca babystepLoadZ = 0; 38e6a: 10 92 6b 05 sts 0x056B, r1 ; 0x80056b <_ZL13babystepLoadZ.lto_priv.514+0x1> 38e6e: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a <_ZL13babystepLoadZ.lto_priv.514> } 38e72: 08 95 ret 00038e74 : return sampled; } void go_home_with_z_lift() { 38e74: cf 93 push r28 38e76: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 38e78: 0e 94 f8 67 call 0xcff0 ; 0xcff0 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 38e7c: c3 e4 ldi r28, 0x43 ; 67 38e7e: d7 e0 ldi r29, 0x07 ; 7 38e80: 80 e0 ldi r24, 0x00 ; 0 38e82: 90 e0 ldi r25, 0x00 ; 0 38e84: a0 ea ldi r26, 0xA0 ; 160 38e86: b0 e4 ldi r27, 0x40 ; 64 38e88: 88 87 std Y+8, r24 ; 0x08 38e8a: 99 87 std Y+9, r25 ; 0x09 38e8c: aa 87 std Y+10, r26 ; 0x0a 38e8e: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 38e90: 65 e5 ldi r22, 0x55 ; 85 38e92: 75 e5 ldi r23, 0x55 ; 85 38e94: 85 e5 ldi r24, 0x55 ; 85 38e96: 91 e4 ldi r25, 0x41 ; 65 38e98: 0f 94 1a c3 call 0x38634 ; 0x38634 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 38e9c: 8d ec ldi r24, 0xCD ; 205 38e9e: 9c ec ldi r25, 0xCC ; 204 38ea0: ac e4 ldi r26, 0x4C ; 76 38ea2: be e3 ldi r27, 0x3E ; 62 38ea4: 88 83 st Y, r24 38ea6: 99 83 std Y+1, r25 ; 0x01 38ea8: aa 83 std Y+2, r26 ; 0x02 38eaa: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 38eac: 83 e3 ldi r24, 0x33 ; 51 38eae: 93 e3 ldi r25, 0x33 ; 51 38eb0: a3 e7 ldi r26, 0x73 ; 115 38eb2: b0 ec ldi r27, 0xC0 ; 192 38eb4: 8c 83 std Y+4, r24 ; 0x04 38eb6: 9d 83 std Y+5, r25 ; 0x05 38eb8: ae 83 std Y+6, r26 ; 0x06 38eba: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 38ebc: 67 e4 ldi r22, 0x47 ; 71 38ebe: 77 e0 ldi r23, 0x07 ; 7 38ec0: ce 01 movw r24, r28 38ec2: 0e 94 df 6b call 0xd7be ; 0xd7be go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 38ec6: 60 e0 ldi r22, 0x00 ; 0 38ec8: 70 e0 ldi r23, 0x00 ; 0 38eca: 86 e1 ldi r24, 0x16 ; 22 38ecc: 93 e4 ldi r25, 0x43 ; 67 38ece: 0f 94 1a c3 call 0x38634 ; 0x38634 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 38ed2: 8a e9 ldi r24, 0x9A ; 154 38ed4: 99 e9 ldi r25, 0x99 ; 153 38ed6: a9 e1 ldi r26, 0x19 ; 25 38ed8: be e3 ldi r27, 0x3E ; 62 38eda: 88 87 std Y+8, r24 ; 0x08 38edc: 99 87 std Y+9, r25 ; 0x09 38ede: aa 87 std Y+10, r26 ; 0x0a 38ee0: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 38ee2: 65 e5 ldi r22, 0x55 ; 85 38ee4: 75 e5 ldi r23, 0x55 ; 85 38ee6: 85 e5 ldi r24, 0x55 ; 85 38ee8: 91 e4 ldi r25, 0x41 ; 65 } 38eea: df 91 pop r29 38eec: 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); 38eee: 0d 94 1a c3 jmp 0x38634 ; 0x38634 00038ef2 : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 38ef2: 68 2f mov r22, r24 38ef4: 70 e0 ldi r23, 0x00 ; 0 38ef6: 90 e0 ldi r25, 0x00 ; 0 38ef8: 80 e0 ldi r24, 0x00 ; 0 38efa: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 38efe: 20 e0 ldi r18, 0x00 ; 0 38f00: 30 e0 ldi r19, 0x00 ; 0 38f02: 48 e0 ldi r20, 0x08 ; 8 38f04: 52 e4 ldi r21, 0x42 ; 66 38f06: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 38f0a: 20 e0 ldi r18, 0x00 ; 0 38f0c: 30 e0 ldi r19, 0x00 ; 0 38f0e: 40 e8 ldi r20, 0x80 ; 128 38f10: 5f e3 ldi r21, 0x3F ; 63 38f12: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> } 38f16: 08 95 ret 00038f18 : // 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() { 38f18: 2f 92 push r2 38f1a: 3f 92 push r3 38f1c: 4f 92 push r4 38f1e: 5f 92 push r5 38f20: 6f 92 push r6 38f22: 7f 92 push r7 38f24: 8f 92 push r8 38f26: 9f 92 push r9 38f28: af 92 push r10 38f2a: bf 92 push r11 38f2c: cf 92 push r12 38f2e: df 92 push r13 38f30: ef 92 push r14 38f32: ff 92 push r15 38f34: 0f 93 push r16 38f36: 1f 93 push r17 38f38: cf 93 push r28 38f3a: df 93 push r29 38f3c: 00 d0 rcall .+0 ; 0x38f3e 38f3e: 00 d0 rcall .+0 ; 0x38f40 38f40: cd b7 in r28, 0x3d ; 61 38f42: de b7 in r29, 0x3e ; 62 bool result = false; #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 38f44: 84 e0 ldi r24, 0x04 ; 4 38f46: 0f 94 8e 3a call 0x2751c ; 0x2751c return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 38f4a: 80 91 8f 02 lds r24, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 38f4e: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 38f50: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> #endif bool endstops_enabled = enable_endstops(false); bool endstop_z_enabled = enable_z_endstop(false); 38f54: 80 e0 ldi r24, 0x00 ; 0 38f56: 0f 94 55 63 call 0x2c6aa ; 0x2c6aa 38f5a: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 38f5c: 0e 94 f8 67 call 0xcff0 ; 0xcff0 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 38f60: 8c e9 ldi r24, 0x9C ; 156 38f62: 99 e4 ldi r25, 0x49 ; 73 38f64: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 38f68: 0f 94 80 34 call 0x26900 ; 0x26900 // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 38f6c: 48 e9 ldi r20, 0x98 ; 152 38f6e: 51 e7 ldi r21, 0x71 ; 113 38f70: 63 e0 ldi r22, 0x03 ; 3 38f72: 80 e0 ldi r24, 0x00 ; 0 38f74: 0e 94 29 70 call 0xe052 ; 0xe052 38f78: 81 e0 ldi r24, 0x01 ; 1 38f7a: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> // 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; 38f7e: 80 e0 ldi r24, 0x00 ; 0 38f80: 90 e0 ldi r25, 0x00 ; 0 38f82: a0 ea ldi r26, 0xA0 ; 160 38f84: b0 e4 ldi r27, 0x40 ; 64 38f86: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 38f8a: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 38f8e: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 38f92: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e go_to_current(homing_feedrate[Z_AXIS]/60); 38f96: 65 e5 ldi r22, 0x55 ; 85 38f98: 75 e5 ldi r23, 0x55 ; 85 38f9a: 85 e5 ldi r24, 0x55 ; 85 38f9c: 91 e4 ldi r25, 0x41 ; 65 38f9e: 0f 94 1a c3 call 0x38634 ; 0x38634 #ifdef TMC2130 check_Z_crash(); 38fa2: 0e 94 3c 7c call 0xf878 ; 0xf878 38fa6: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> #endif enable_endstops(false); // Move XY to first point current_position[X_AXIS] = BED_X0; 38faa: 80 e0 ldi r24, 0x00 ; 0 38fac: 90 e0 ldi r25, 0x00 ; 0 38fae: a0 e8 ldi r26, 0x80 ; 128 38fb0: bf e3 ldi r27, 0x3F ; 63 38fb2: 80 93 43 07 sts 0x0743, r24 ; 0x800743 38fb6: 90 93 44 07 sts 0x0744, r25 ; 0x800744 38fba: a0 93 45 07 sts 0x0745, r26 ; 0x800745 38fbe: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = BED_Y0; 38fc2: 80 93 47 07 sts 0x0747, r24 ; 0x800747 38fc6: 90 93 48 07 sts 0x0748, r25 ; 0x800748 38fca: a0 93 49 07 sts 0x0749, r26 ; 0x800749 38fce: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 38fd2: 67 e4 ldi r22, 0x47 ; 71 38fd4: 77 e0 ldi r23, 0x07 ; 7 38fd6: 83 e4 ldi r24, 0x43 ; 67 38fd8: 97 e0 ldi r25, 0x07 ; 7 38fda: 0e 94 df 6b call 0xd7be ; 0xd7be go_to_current(homing_feedrate[X_AXIS]/60); 38fde: 60 e0 ldi r22, 0x00 ; 0 38fe0: 70 e0 ldi r23, 0x00 ; 0 38fe2: 88 e4 ldi r24, 0x48 ; 72 38fe4: 92 e4 ldi r25, 0x42 ; 66 38fe6: 0f 94 1a c3 call 0x38634 ; 0x38634 set_destination_to_current(); 38fea: 0e 94 6f 69 call 0xd2de ; 0xd2de homeaxis(Z_AXIS); 38fee: 50 e0 ldi r21, 0x00 ; 0 38ff0: 40 e0 ldi r20, 0x00 ; 0 38ff2: 61 e0 ldi r22, 0x01 ; 1 38ff4: 82 e0 ldi r24, 0x02 ; 2 38ff6: 0e 94 76 7c call 0xf8ec ; 0xf8ec if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 38ffa: 43 e0 ldi r20, 0x03 ; 3 38ffc: 60 e0 ldi r22, 0x00 ; 0 38ffe: 70 e0 ldi r23, 0x00 ; 0 39000: 80 e2 ldi r24, 0x20 ; 32 39002: 91 ec ldi r25, 0xC1 ; 193 39004: 0f 94 f3 8b call 0x317e6 ; 0x317e6 39008: 81 11 cpse r24, r1 3900a: 06 c0 rjmp .+12 ; 0x39018 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)); 3900c: 82 e8 ldi r24, 0x82 ; 130 3900e: 95 e6 ldi r25, 0x65 ; 101 39010: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 39014: 0e 94 15 7c call 0xf82a ; 0xf82a float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 39018: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 3901c: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 39020: a0 91 4d 07 lds r26, 0x074D ; 0x80074d 39024: b0 91 4e 07 lds r27, 0x074E ; 0x80074e 39028: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 3902c: 90 93 a2 13 sts 0x13A2, r25 ; 0x8013a2 39030: a0 93 a3 13 sts 0x13A3, r26 ; 0x8013a3 39034: b0 93 a4 13 sts 0x13A4, r27 ; 0x8013a4 39038: e2 e0 ldi r30, 0x02 ; 2 3903a: f0 e0 ldi r31, 0x00 ; 0 3903c: fa 83 std Y+2, r31 ; 0x02 3903e: 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; 39040: c1 2c mov r12, r1 39042: d1 2c mov r13, r1 39044: 30 ea ldi r19, 0xA0 ; 160 39046: e3 2e mov r14, r19 39048: 30 e4 ldi r19, 0x40 ; 64 3904a: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 3904c: 43 e0 ldi r20, 0x03 ; 3 3904e: 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 39050: 52 e0 ldi r21, 0x02 ; 2 39052: 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); 39054: 00 e3 ldi r16, 0x30 ; 48 39056: 1b ea ldi r17, 0xAB ; 171 39058: 67 e0 ldi r22, 0x07 ; 7 3905a: 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(); 3905c: 0e 94 f8 67 call 0xcff0 ; 0xcff0 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 39060: c0 92 4b 07 sts 0x074B, r12 ; 0x80074b 39064: d0 92 4c 07 sts 0x074C, r13 ; 0x80074c 39068: e0 92 4d 07 sts 0x074D, r14 ; 0x80074d 3906c: f0 92 4e 07 sts 0x074E, r15 ; 0x80074e go_to_current(homing_feedrate[Z_AXIS]/60); 39070: 65 e5 ldi r22, 0x55 ; 85 39072: 75 e5 ldi r23, 0x55 ; 85 39074: 85 e5 ldi r24, 0x55 ; 85 39076: 91 e4 ldi r25, 0x41 ; 65 39078: 0f 94 1a c3 call 0x38634 ; 0x38634 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 3907c: 29 81 ldd r18, Y+1 ; 0x01 3907e: 21 50 subi r18, 0x01 ; 1 39080: 82 2f mov r24, r18 39082: 6b 2d mov r22, r11 39084: 0f 94 0a de call 0x3bc14 ; 0x3bc14 <__udivmodqi4> 39088: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 3908a: 82 2f mov r24, r18 3908c: 0f 94 16 de call 0x3bc2c ; 0x3bc2c <__divmodqi4> 39090: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 39092: 80 ff sbrs r24, 0 39094: 03 c0 rjmp .+6 ; 0x3909c 39096: f9 2d mov r31, r9 39098: f8 19 sub r31, r8 3909a: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 3909c: 88 2d mov r24, r8 3909e: 88 0f add r24, r24 390a0: 88 0d add r24, r8 390a2: 0f 94 79 c7 call 0x38ef2 ; 0x38ef2 390a6: 60 93 43 07 sts 0x0743, r22 ; 0x800743 390aa: 70 93 44 07 sts 0x0744, r23 ; 0x800744 390ae: 80 93 45 07 sts 0x0745, r24 ; 0x800745 390b2: 90 93 46 07 sts 0x0746, r25 ; 0x800746 current_position[Y_AXIS] = BED_Y(iy * 3); 390b6: 87 2d mov r24, r7 390b8: 88 0f add r24, r24 390ba: 87 0d add r24, r7 390bc: 0f 94 79 c7 call 0x38ef2 ; 0x38ef2 390c0: 60 93 47 07 sts 0x0747, r22 ; 0x800747 390c4: 70 93 48 07 sts 0x0748, r23 ; 0x800748 390c8: 80 93 49 07 sts 0x0749, r24 ; 0x800749 390cc: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 390d0: 67 e4 ldi r22, 0x47 ; 71 390d2: 77 e0 ldi r23, 0x07 ; 7 390d4: 83 e4 ldi r24, 0x43 ; 67 390d6: 97 e0 ldi r25, 0x07 ; 7 390d8: 0e 94 df 6b call 0xd7be ; 0xd7be go_to_current(homing_feedrate[X_AXIS]/60); 390dc: 60 e0 ldi r22, 0x00 ; 0 390de: 70 e0 ldi r23, 0x00 ; 0 390e0: 88 e4 ldi r24, 0x48 ; 72 390e2: 92 e4 ldi r25, 0x42 ; 66 390e4: 0f 94 1a c3 call 0x38634 ; 0x38634 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 390e8: 63 e0 ldi r22, 0x03 ; 3 390ea: 80 e0 ldi r24, 0x00 ; 0 390ec: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_printf_P(PSTR("%d/9"),mesh_point+1); 390f0: 8a 81 ldd r24, Y+2 ; 0x02 390f2: 8f 93 push r24 390f4: 99 81 ldd r25, Y+1 ; 0x01 390f6: 9f 93 push r25 390f8: 1f 93 push r17 390fa: 0f 93 push r16 390fc: 0e 94 ee 6f call 0xdfdc ; 0xdfdc #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 39100: 43 e0 ldi r20, 0x03 ; 3 39102: 60 e0 ldi r22, 0x00 ; 0 39104: 70 e0 ldi r23, 0x00 ; 0 39106: 80 e2 ldi r24, 0x20 ; 32 39108: 91 ec ldi r25, 0xC1 ; 193 3910a: 0f 94 f3 8b call 0x317e6 ; 0x317e6 3910e: 58 2e mov r5, r24 39110: 0f 90 pop r0 39112: 0f 90 pop r0 39114: 0f 90 pop r0 39116: 0f 90 pop r0 39118: 88 23 and r24, r24 3911a: 09 f4 brne .+2 ; 0x3911e 3911c: 77 cf rjmp .-274 ; 0x3900c 3911e: a7 9c mul r10, r7 39120: f0 01 movw r30, r0 39122: 11 24 eor r1, r1 39124: e8 0d add r30, r8 39126: f1 1d adc r31, r1 39128: ee 0f add r30, r30 3912a: ff 1f adc r31, r31 3912c: ee 0f add r30, r30 3912e: ff 1f adc r31, r31 39130: e0 56 subi r30, 0x60 ; 96 39132: fc 4e sbci r31, 0xEC ; 236 39134: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 39138: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 3913c: a0 91 4d 07 lds r26, 0x074D ; 0x80074d 39140: b0 91 4e 07 lds r27, 0x074E ; 0x80074e 39144: 81 83 std Z+1, r24 ; 0x01 39146: 92 83 std Z+2, r25 ; 0x02 39148: a3 83 std Z+3, r26 ; 0x03 3914a: b4 83 std Z+4, r27 ; 0x04 3914c: e9 81 ldd r30, Y+1 ; 0x01 3914e: fa 81 ldd r31, Y+2 ; 0x02 39150: 31 96 adiw r30, 0x01 ; 1 39152: fa 83 std Y+2, r31 ; 0x02 39154: 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) { 39156: 3a 97 sbiw r30, 0x0a ; 10 39158: 09 f0 breq .+2 ; 0x3915c 3915a: 80 cf rjmp .-256 ; 0x3905c mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 3915c: 60 90 a1 13 lds r6, 0x13A1 ; 0x8013a1 39160: 70 90 a2 13 lds r7, 0x13A2 ; 0x8013a2 39164: 80 90 a3 13 lds r8, 0x13A3 ; 0x8013a3 39168: 90 90 a4 13 lds r9, 0x13A4 ; 0x8013a4 float zmax = zmin; 3916c: 46 2c mov r4, r6 3916e: a7 2c mov r10, r7 39170: b8 2c mov r11, r8 39172: 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]; 39174: 1e 82 std Y+6, r1 ; 0x06 39176: 1d 82 std Y+5, r1 ; 0x05 39178: 00 ea ldi r16, 0xA0 ; 160 3917a: 13 e1 ldi r17, 0x13 ; 19 3917c: 8d 81 ldd r24, Y+5 ; 0x05 3917e: 9e 81 ldd r25, Y+6 ; 0x06 39180: 8f 55 subi r24, 0x5F ; 95 39182: 9c 4e sbci r25, 0xEC ; 236 39184: 9a 83 std Y+2, r25 ; 0x02 39186: 89 83 std Y+1, r24 ; 0x01 39188: 93 e0 ldi r25, 0x03 ; 3 3918a: 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]); 3918c: e9 81 ldd r30, Y+1 ; 0x01 3918e: fa 81 ldd r31, Y+2 ; 0x02 39190: c1 90 ld r12, Z+ 39192: d1 90 ld r13, Z+ 39194: e1 90 ld r14, Z+ 39196: f1 90 ld r15, Z+ 39198: fa 83 std Y+2, r31 ; 0x02 3919a: e9 83 std Y+1, r30 ; 0x01 3919c: 93 01 movw r18, r6 3919e: a4 01 movw r20, r8 391a0: c7 01 movw r24, r14 391a2: b6 01 movw r22, r12 391a4: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 391a8: 18 16 cp r1, r24 391aa: 14 f0 brlt .+4 ; 0x391b0 391ac: 36 01 movw r6, r12 391ae: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 391b0: 24 2d mov r18, r4 391b2: 3a 2d mov r19, r10 391b4: 4b 2d mov r20, r11 391b6: 52 2d mov r21, r2 391b8: c7 01 movw r24, r14 391ba: b6 01 movw r22, r12 391bc: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 391c0: 87 fd sbrc r24, 7 391c2: 04 c0 rjmp .+8 ; 0x391cc 391c4: 4c 2c mov r4, r12 391c6: ad 2c mov r10, r13 391c8: be 2c mov r11, r14 391ca: 2f 2c mov r2, r15 391cc: 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) { 391ce: 31 10 cpse r3, r1 391d0: dd cf rjmp .-70 ; 0x3918c 391d2: 8d 81 ldd r24, Y+5 ; 0x05 391d4: 9e 81 ldd r25, Y+6 ; 0x06 391d6: 4c 96 adiw r24, 0x1c ; 28 391d8: 9e 83 std Y+6, r25 ; 0x06 391da: 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) 391dc: 84 35 cpi r24, 0x54 ; 84 391de: 91 05 cpc r25, r1 391e0: 59 f6 brne .-106 ; 0x39178 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) { 391e2: 93 01 movw r18, r6 391e4: a4 01 movw r20, r8 391e6: 64 2d mov r22, r4 391e8: 7a 2d mov r23, r10 391ea: 8b 2d mov r24, r11 391ec: 92 2d mov r25, r2 391ee: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 391f2: 20 e0 ldi r18, 0x00 ; 0 391f4: 30 e0 ldi r19, 0x00 ; 0 391f6: 40 e4 ldi r20, 0x40 ; 64 391f8: 50 e4 ldi r21, 0x40 ; 64 391fa: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 391fe: 18 16 cp r1, r24 39200: 3c f5 brge .+78 ; 0x39250 // 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!"); 39202: 83 e1 ldi r24, 0x13 ; 19 39204: 9b ea ldi r25, 0xAB ; 171 39206: 0e 94 86 7b call 0xf70c ; 0xf70c // 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; 3920a: 51 2c mov r5, r1 3920c: fc 81 ldd r31, Y+4 ; 0x04 3920e: f0 93 8f 02 sts 0x028F, r31 ; 0x80028f <_ZL14check_endstops.lto_priv.389> go_home_with_z_lift(); result = true; end: enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 39212: 8b 81 ldd r24, Y+3 ; 0x03 39214: 0f 94 55 63 call 0x2c6aa ; 0x2c6aa #ifdef TMC2130 tmc2130_home_exit(); 39218: 0f 94 5f 3a call 0x274be ; 0x274be #endif return result; } 3921c: 85 2d mov r24, r5 3921e: 26 96 adiw r28, 0x06 ; 6 39220: 0f b6 in r0, 0x3f ; 63 39222: f8 94 cli 39224: de bf out 0x3e, r29 ; 62 39226: 0f be out 0x3f, r0 ; 63 39228: cd bf out 0x3d, r28 ; 61 3922a: df 91 pop r29 3922c: cf 91 pop r28 3922e: 1f 91 pop r17 39230: 0f 91 pop r16 39232: ff 90 pop r15 39234: ef 90 pop r14 39236: df 90 pop r13 39238: cf 90 pop r12 3923a: bf 90 pop r11 3923c: af 90 pop r10 3923e: 9f 90 pop r9 39240: 8f 90 pop r8 39242: 7f 90 pop r7 39244: 6f 90 pop r6 39246: 5f 90 pop r5 39248: 4f 90 pop r4 3924a: 3f 90 pop r3 3924c: 2f 90 pop r2 3924e: 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) 39250: 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; 39252: 85 ec ldi r24, 0xC5 ; 197 39254: e8 2e mov r14, r24 39256: 8f e0 ldi r24, 0x0F ; 15 39258: f8 2e mov r15, r24 3925a: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 3925c: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 3925e: 9d 81 ldd r25, Y+5 ; 0x05 39260: 91 11 cpse r25, r1 39262: 03 c0 rjmp .+6 ; 0x3926a 39264: e9 81 ldd r30, Y+1 ; 0x01 39266: ee 23 and r30, r30 39268: 29 f1 breq .+74 ; 0x392b4 continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 3926a: 20 91 a1 13 lds r18, 0x13A1 ; 0x8013a1 3926e: 30 91 a2 13 lds r19, 0x13A2 ; 0x8013a2 39272: 40 91 a3 13 lds r20, 0x13A3 ; 0x8013a3 39276: 50 91 a4 13 lds r21, 0x13A4 ; 0x8013a4 3927a: f6 01 movw r30, r12 3927c: 61 81 ldd r22, Z+1 ; 0x01 3927e: 72 81 ldd r23, Z+2 ; 0x02 39280: 83 81 ldd r24, Z+3 ; 0x03 39282: 94 81 ldd r25, Z+4 ; 0x04 39284: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 39288: 20 e0 ldi r18, 0x00 ; 0 3928a: 30 e0 ldi r19, 0x00 ; 0 3928c: 48 ec ldi r20, 0xC8 ; 200 3928e: 52 e4 ldi r21, 0x42 ; 66 39290: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 39294: 20 e0 ldi r18, 0x00 ; 0 39296: 30 e0 ldi r19, 0x00 ; 0 39298: 40 e0 ldi r20, 0x00 ; 0 3929a: 5f e3 ldi r21, 0x3F ; 63 3929c: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 392a0: 0f 94 2a e0 call 0x3c054 ; 0x3c054 392a4: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 392a8: c7 01 movw r24, r14 392aa: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 392ae: f2 e0 ldi r31, 0x02 ; 2 392b0: ef 0e add r14, r31 392b2: f1 1c adc r15, r1 392b4: 84 e0 ldi r24, 0x04 ; 4 392b6: c8 0e add r12, r24 392b8: d1 1c adc r13, r1 392ba: 9d 81 ldd r25, Y+5 ; 0x05 392bc: 9f 5f subi r25, 0xFF ; 255 392be: 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) { 392c0: 93 30 cpi r25, 0x03 ; 3 392c2: 69 f6 brne .-102 ; 0x3925e 392c4: 04 5e subi r16, 0xE4 ; 228 392c6: 1f 4f sbci r17, 0xFF ; 255 392c8: e9 81 ldd r30, Y+1 ; 0x01 392ca: ef 5f subi r30, 0xFF ; 255 392cc: 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) 392ce: e3 30 cpi r30, 0x03 ; 3 392d0: 21 f6 brne .-120 ; 0x3925a #endif addr += 2; } } mbl.reset(); 392d2: 0f 94 e9 8b call 0x317d2 ; 0x317d2 go_home_with_z_lift(); 392d6: 0f 94 3a c7 call 0x38e74 ; 0x38e74 392da: 98 cf rjmp .-208 ; 0x3920c 000392dc : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 392dc: 82 e0 ldi r24, 0x02 ; 2 392de: 0f 94 13 58 call 0x2b026 ; 0x2b026 392e2: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 392e6: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 392ea: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 392ee: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e plan_set_z_position(current_position[Z_AXIS]); 392f2: 8b e4 ldi r24, 0x4B ; 75 392f4: 97 e0 ldi r25, 0x07 ; 7 392f6: 0d 94 e1 aa jmp 0x355c2 ; 0x355c2 000392fa : * 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() { 392fa: 4f 92 push r4 392fc: 5f 92 push r5 392fe: 6f 92 push r6 39300: 7f 92 push r7 39302: 8f 92 push r8 39304: 9f 92 push r9 39306: af 92 push r10 39308: bf 92 push r11 3930a: cf 92 push r12 3930c: df 92 push r13 3930e: ef 92 push r14 39310: ff 92 push r15 39312: 0f 93 push r16 39314: 1f 93 push r17 39316: cf 93 push r28 39318: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 3931a: 03 e4 ldi r16, 0x43 ; 67 3931c: 17 e0 ldi r17, 0x07 ; 7 3931e: c3 ee ldi r28, 0xE3 ; 227 39320: d7 e1 ldi r29, 0x17 ; 23 39322: 28 81 ld r18, Y 39324: 39 81 ldd r19, Y+1 ; 0x01 39326: 4a 81 ldd r20, Y+2 ; 0x02 39328: 5b 81 ldd r21, Y+3 ; 0x03 3932a: f8 01 movw r30, r16 3932c: 60 81 ld r22, Z 3932e: 71 81 ldd r23, Z+1 ; 0x01 39330: 82 81 ldd r24, Z+2 ; 0x02 39332: 93 81 ldd r25, Z+3 ; 0x03 39334: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 39338: 4b 01 movw r8, r22 3933a: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 3933c: 2c 81 ldd r18, Y+4 ; 0x04 3933e: 3d 81 ldd r19, Y+5 ; 0x05 39340: 4e 81 ldd r20, Y+6 ; 0x06 39342: 5f 81 ldd r21, Y+7 ; 0x07 39344: f8 01 movw r30, r16 39346: 64 81 ldd r22, Z+4 ; 0x04 39348: 75 81 ldd r23, Z+5 ; 0x05 3934a: 86 81 ldd r24, Z+6 ; 0x06 3934c: 97 81 ldd r25, Z+7 ; 0x07 3934e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 39352: 6b 01 movw r12, r22 39354: 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; 39356: c3 ed ldi r28, 0xD3 ; 211 39358: d7 e1 ldi r29, 0x17 ; 23 3935a: 28 81 ld r18, Y 3935c: 39 81 ldd r19, Y+1 ; 0x01 3935e: 4a 81 ldd r20, Y+2 ; 0x02 39360: 5b 81 ldd r21, Y+3 ; 0x03 39362: c5 01 movw r24, r10 39364: b4 01 movw r22, r8 39366: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3936a: 2b 01 movw r4, r22 3936c: 3c 01 movw r6, r24 3936e: 2c 81 ldd r18, Y+4 ; 0x04 39370: 3d 81 ldd r19, Y+5 ; 0x05 39372: 4e 81 ldd r20, Y+6 ; 0x06 39374: 5f 81 ldd r21, Y+7 ; 0x07 39376: c7 01 movw r24, r14 39378: b6 01 movw r22, r12 3937a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3937e: 9b 01 movw r18, r22 39380: ac 01 movw r20, r24 39382: c3 01 movw r24, r6 39384: b2 01 movw r22, r4 39386: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3938a: f8 01 movw r30, r16 3938c: 60 83 st Z, r22 3938e: 71 83 std Z+1, r23 ; 0x01 39390: 82 83 std Z+2, r24 ; 0x02 39392: 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; 39394: 28 85 ldd r18, Y+8 ; 0x08 39396: 39 85 ldd r19, Y+9 ; 0x09 39398: 4a 85 ldd r20, Y+10 ; 0x0a 3939a: 5b 85 ldd r21, Y+11 ; 0x0b 3939c: c5 01 movw r24, r10 3939e: b4 01 movw r22, r8 393a0: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 393a4: 4b 01 movw r8, r22 393a6: 5c 01 movw r10, r24 393a8: 2c 85 ldd r18, Y+12 ; 0x0c 393aa: 3d 85 ldd r19, Y+13 ; 0x0d 393ac: 4e 85 ldd r20, Y+14 ; 0x0e 393ae: 5f 85 ldd r21, Y+15 ; 0x0f 393b0: c7 01 movw r24, r14 393b2: b6 01 movw r22, r12 393b4: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 393b8: 9b 01 movw r18, r22 393ba: ac 01 movw r20, r24 393bc: c5 01 movw r24, r10 393be: b4 01 movw r22, r8 393c0: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 393c4: f8 01 movw r30, r16 393c6: 64 83 std Z+4, r22 ; 0x04 393c8: 75 83 std Z+5, r23 ; 0x05 393ca: 86 83 std Z+6, r24 ; 0x06 393cc: 97 83 std Z+7, r25 ; 0x07 } 393ce: df 91 pop r29 393d0: cf 91 pop r28 393d2: 1f 91 pop r17 393d4: 0f 91 pop r16 393d6: ff 90 pop r15 393d8: ef 90 pop r14 393da: df 90 pop r13 393dc: cf 90 pop r12 393de: bf 90 pop r11 393e0: af 90 pop r10 393e2: 9f 90 pop r9 393e4: 8f 90 pop r8 393e6: 7f 90 pop r7 393e8: 6f 90 pop r6 393ea: 5f 90 pop r5 393ec: 4f 90 pop r4 393ee: 08 95 ret 000393f0 : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 393f0: 4f 92 push r4 393f2: 5f 92 push r5 393f4: 6f 92 push r6 393f6: 7f 92 push r7 393f8: 8f 92 push r8 393fa: 9f 92 push r9 393fc: af 92 push r10 393fe: bf 92 push r11 39400: cf 92 push r12 39402: df 92 push r13 39404: ef 92 push r14 39406: ff 92 push r15 39408: 0f 93 push r16 3940a: 1f 93 push r17 3940c: cf 93 push r28 3940e: df 93 push r29 39410: 00 d0 rcall .+0 ; 0x39412 39412: 00 d0 rcall .+0 ; 0x39414 39414: 1f 92 push r1 39416: 1f 92 push r1 39418: cd b7 in r28, 0x3d ; 61 3941a: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 3941c: dc 01 movw r26, r24 3941e: cd 90 ld r12, X+ 39420: dd 90 ld r13, X+ 39422: ed 90 ld r14, X+ 39424: fc 90 ld r15, X 39426: 13 97 sbiw r26, 0x03 ; 3 39428: c0 92 b8 17 sts 0x17B8, r12 ; 0x8017b8 3942c: d0 92 b9 17 sts 0x17B9, r13 ; 0x8017b9 39430: e0 92 ba 17 sts 0x17BA, r14 ; 0x8017ba 39434: f0 92 bb 17 sts 0x17BB, r15 ; 0x8017bb world2machine_rotation_and_skew[1][0] = vec_x[1]; 39438: 14 96 adiw r26, 0x04 ; 4 3943a: 0d 91 ld r16, X+ 3943c: 1d 91 ld r17, X+ 3943e: 2d 91 ld r18, X+ 39440: 3c 91 ld r19, X 39442: 17 97 sbiw r26, 0x07 ; 7 39444: 09 83 std Y+1, r16 ; 0x01 39446: 1a 83 std Y+2, r17 ; 0x02 39448: 2b 83 std Y+3, r18 ; 0x03 3944a: 3c 83 std Y+4, r19 ; 0x04 3944c: 00 93 c0 17 sts 0x17C0, r16 ; 0x8017c0 39450: 10 93 c1 17 sts 0x17C1, r17 ; 0x8017c1 39454: 20 93 c2 17 sts 0x17C2, r18 ; 0x8017c2 39458: 30 93 c3 17 sts 0x17C3, r19 ; 0x8017c3 world2machine_rotation_and_skew[0][1] = vec_y[0]; 3945c: db 01 movw r26, r22 3945e: 0d 91 ld r16, X+ 39460: 1d 91 ld r17, X+ 39462: 2d 91 ld r18, X+ 39464: 3c 91 ld r19, X 39466: 13 97 sbiw r26, 0x03 ; 3 39468: 0d 83 std Y+5, r16 ; 0x05 3946a: 1e 83 std Y+6, r17 ; 0x06 3946c: 2f 83 std Y+7, r18 ; 0x07 3946e: 38 87 std Y+8, r19 ; 0x08 39470: 00 93 bc 17 sts 0x17BC, r16 ; 0x8017bc 39474: 10 93 bd 17 sts 0x17BD, r17 ; 0x8017bd 39478: 20 93 be 17 sts 0x17BE, r18 ; 0x8017be 3947c: 30 93 bf 17 sts 0x17BF, r19 ; 0x8017bf world2machine_rotation_and_skew[1][1] = vec_y[1]; 39480: 14 96 adiw r26, 0x04 ; 4 39482: 4d 90 ld r4, X+ 39484: 5d 90 ld r5, X+ 39486: 6d 90 ld r6, X+ 39488: 7c 90 ld r7, X 3948a: 17 97 sbiw r26, 0x07 ; 7 3948c: 40 92 c4 17 sts 0x17C4, r4 ; 0x8017c4 39490: 50 92 c5 17 sts 0x17C5, r5 ; 0x8017c5 39494: 60 92 c6 17 sts 0x17C6, r6 ; 0x8017c6 39498: 70 92 c7 17 sts 0x17C7, r7 ; 0x8017c7 world2machine_shift[0] = cntr[0]; 3949c: fa 01 movw r30, r20 3949e: 60 81 ld r22, Z 394a0: 71 81 ldd r23, Z+1 ; 0x01 394a2: 82 81 ldd r24, Z+2 ; 0x02 394a4: 93 81 ldd r25, Z+3 ; 0x03 394a6: 60 93 e3 17 sts 0x17E3, r22 ; 0x8017e3 394aa: 70 93 e4 17 sts 0x17E4, r23 ; 0x8017e4 394ae: 80 93 e5 17 sts 0x17E5, r24 ; 0x8017e5 394b2: 90 93 e6 17 sts 0x17E6, r25 ; 0x8017e6 world2machine_shift[1] = cntr[1]; 394b6: 84 80 ldd r8, Z+4 ; 0x04 394b8: 95 80 ldd r9, Z+5 ; 0x05 394ba: a6 80 ldd r10, Z+6 ; 0x06 394bc: b7 80 ldd r11, Z+7 ; 0x07 394be: 80 92 e7 17 sts 0x17E7, r8 ; 0x8017e7 394c2: 90 92 e8 17 sts 0x17E8, r9 ; 0x8017e8 394c6: a0 92 e9 17 sts 0x17E9, r10 ; 0x8017e9 394ca: b0 92 ea 17 sts 0x17EA, r11 ; 0x8017ea // No correction. world2machine_correction_mode = WORLD2MACHINE_CORRECTION_NONE; if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) 394ce: 20 e0 ldi r18, 0x00 ; 0 394d0: 30 e0 ldi r19, 0x00 ; 0 394d2: a9 01 movw r20, r18 394d4: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 394d8: 81 11 cpse r24, r1 394da: aa c0 rjmp .+340 ; 0x39630 394dc: 20 e0 ldi r18, 0x00 ; 0 394de: 30 e0 ldi r19, 0x00 ; 0 394e0: a9 01 movw r20, r18 394e2: c5 01 movw r24, r10 394e4: b4 01 movw r22, r8 394e6: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 394ea: 81 11 cpse r24, r1 394ec: a1 c0 rjmp .+322 ; 0x39630 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; 394ee: 10 92 eb 17 sts 0x17EB, r1 ; 0x8017eb 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 || 394f2: 20 e0 ldi r18, 0x00 ; 0 394f4: 30 e0 ldi r19, 0x00 ; 0 394f6: 40 e8 ldi r20, 0x80 ; 128 394f8: 5f e3 ldi r21, 0x3F ; 63 394fa: c7 01 movw r24, r14 394fc: b6 01 movw r22, r12 394fe: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 39502: 81 11 cpse r24, r1 39504: 21 c0 rjmp .+66 ; 0x39548 39506: 20 e0 ldi r18, 0x00 ; 0 39508: 30 e0 ldi r19, 0x00 ; 0 3950a: a9 01 movw r20, r18 3950c: 6d 81 ldd r22, Y+5 ; 0x05 3950e: 7e 81 ldd r23, Y+6 ; 0x06 39510: 8f 81 ldd r24, Y+7 ; 0x07 39512: 98 85 ldd r25, Y+8 ; 0x08 39514: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 39518: 81 11 cpse r24, r1 3951a: 16 c0 rjmp .+44 ; 0x39548 3951c: 20 e0 ldi r18, 0x00 ; 0 3951e: 30 e0 ldi r19, 0x00 ; 0 39520: a9 01 movw r20, r18 39522: 69 81 ldd r22, Y+1 ; 0x01 39524: 7a 81 ldd r23, Y+2 ; 0x02 39526: 8b 81 ldd r24, Y+3 ; 0x03 39528: 9c 81 ldd r25, Y+4 ; 0x04 3952a: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 3952e: 81 11 cpse r24, r1 39530: 0b c0 rjmp .+22 ; 0x39548 world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 39532: 20 e0 ldi r18, 0x00 ; 0 39534: 30 e0 ldi r19, 0x00 ; 0 39536: 40 e8 ldi r20, 0x80 ; 128 39538: 5f e3 ldi r21, 0x3F ; 63 3953a: c3 01 movw r24, r6 3953c: b2 01 movw r22, r4 3953e: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 39542: 88 23 and r24, r24 39544: 09 f4 brne .+2 ; 0x39548 39546: 78 c0 rjmp .+240 ; 0x39638 // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 39548: 80 91 eb 17 lds r24, 0x17EB ; 0x8017eb 3954c: 82 60 ori r24, 0x02 ; 2 3954e: 80 93 eb 17 sts 0x17EB, r24 ; 0x8017eb // 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]; 39552: a3 01 movw r20, r6 39554: 92 01 movw r18, r4 39556: c7 01 movw r24, r14 39558: b6 01 movw r22, r12 3955a: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3955e: 4b 01 movw r8, r22 39560: 5c 01 movw r10, r24 39562: 2d 81 ldd r18, Y+5 ; 0x05 39564: 3e 81 ldd r19, Y+6 ; 0x06 39566: 4f 81 ldd r20, Y+7 ; 0x07 39568: 58 85 ldd r21, Y+8 ; 0x08 3956a: 69 81 ldd r22, Y+1 ; 0x01 3956c: 7a 81 ldd r23, Y+2 ; 0x02 3956e: 8b 81 ldd r24, Y+3 ; 0x03 39570: 9c 81 ldd r25, Y+4 ; 0x04 39572: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 39576: 9b 01 movw r18, r22 39578: ac 01 movw r20, r24 3957a: c5 01 movw r24, r10 3957c: b4 01 movw r22, r8 3957e: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 39582: 4b 01 movw r8, r22 39584: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 39586: ac 01 movw r20, r24 39588: 9b 01 movw r18, r22 3958a: c3 01 movw r24, r6 3958c: b2 01 movw r22, r4 3958e: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 39592: 60 93 d3 17 sts 0x17D3, r22 ; 0x8017d3 39596: 70 93 d4 17 sts 0x17D4, r23 ; 0x8017d4 3959a: 80 93 d5 17 sts 0x17D5, r24 ; 0x8017d5 3959e: 90 93 d6 17 sts 0x17D6, r25 ; 0x8017d6 world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 395a2: 6d 81 ldd r22, Y+5 ; 0x05 395a4: 7e 81 ldd r23, Y+6 ; 0x06 395a6: 8f 81 ldd r24, Y+7 ; 0x07 395a8: 98 85 ldd r25, Y+8 ; 0x08 395aa: 90 58 subi r25, 0x80 ; 128 395ac: a5 01 movw r20, r10 395ae: 94 01 movw r18, r8 395b0: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 395b4: 60 93 d7 17 sts 0x17D7, r22 ; 0x8017d7 395b8: 70 93 d8 17 sts 0x17D8, r23 ; 0x8017d8 395bc: 80 93 d9 17 sts 0x17D9, r24 ; 0x8017d9 395c0: 90 93 da 17 sts 0x17DA, r25 ; 0x8017da world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 395c4: 69 81 ldd r22, Y+1 ; 0x01 395c6: 7a 81 ldd r23, Y+2 ; 0x02 395c8: 8b 81 ldd r24, Y+3 ; 0x03 395ca: 9c 81 ldd r25, Y+4 ; 0x04 395cc: 90 58 subi r25, 0x80 ; 128 395ce: a5 01 movw r20, r10 395d0: 94 01 movw r18, r8 395d2: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 395d6: 60 93 db 17 sts 0x17DB, r22 ; 0x8017db 395da: 70 93 dc 17 sts 0x17DC, r23 ; 0x8017dc 395de: 80 93 dd 17 sts 0x17DD, r24 ; 0x8017dd 395e2: 90 93 de 17 sts 0x17DE, r25 ; 0x8017de world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 395e6: a5 01 movw r20, r10 395e8: 94 01 movw r18, r8 395ea: c7 01 movw r24, r14 395ec: b6 01 movw r22, r12 395ee: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__divsf3> 395f2: 60 93 df 17 sts 0x17DF, r22 ; 0x8017df 395f6: 70 93 e0 17 sts 0x17E0, r23 ; 0x8017e0 395fa: 80 93 e1 17 sts 0x17E1, r24 ; 0x8017e1 395fe: 90 93 e2 17 sts 0x17E2, r25 ; 0x8017e2 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; } } 39602: 28 96 adiw r28, 0x08 ; 8 39604: 0f b6 in r0, 0x3f ; 63 39606: f8 94 cli 39608: de bf out 0x3e, r29 ; 62 3960a: 0f be out 0x3f, r0 ; 63 3960c: cd bf out 0x3d, r28 ; 61 3960e: df 91 pop r29 39610: cf 91 pop r28 39612: 1f 91 pop r17 39614: 0f 91 pop r16 39616: ff 90 pop r15 39618: ef 90 pop r14 3961a: df 90 pop r13 3961c: cf 90 pop r12 3961e: bf 90 pop r11 39620: af 90 pop r10 39622: 9f 90 pop r9 39624: 8f 90 pop r8 39626: 7f 90 pop r7 39628: 6f 90 pop r6 3962a: 5f 90 pop r5 3962c: 4f 90 pop r4 3962e: 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; 39630: 81 e0 ldi r24, 0x01 ; 1 39632: 80 93 eb 17 sts 0x17EB, r24 ; 0x8017eb 39636: 5d cf rjmp .-326 ; 0x394f2 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; 39638: 80 e0 ldi r24, 0x00 ; 0 3963a: 90 e0 ldi r25, 0x00 ; 0 3963c: a0 e8 ldi r26, 0x80 ; 128 3963e: bf e3 ldi r27, 0x3F ; 63 39640: 80 93 d3 17 sts 0x17D3, r24 ; 0x8017d3 39644: 90 93 d4 17 sts 0x17D4, r25 ; 0x8017d4 39648: a0 93 d5 17 sts 0x17D5, r26 ; 0x8017d5 3964c: b0 93 d6 17 sts 0x17D6, r27 ; 0x8017d6 world2machine_rotation_and_skew_inv[0][1] = 0.f; 39650: 10 92 d7 17 sts 0x17D7, r1 ; 0x8017d7 39654: 10 92 d8 17 sts 0x17D8, r1 ; 0x8017d8 39658: 10 92 d9 17 sts 0x17D9, r1 ; 0x8017d9 3965c: 10 92 da 17 sts 0x17DA, r1 ; 0x8017da world2machine_rotation_and_skew_inv[1][0] = 0.f; 39660: 10 92 db 17 sts 0x17DB, r1 ; 0x8017db 39664: 10 92 dc 17 sts 0x17DC, r1 ; 0x8017dc 39668: 10 92 dd 17 sts 0x17DD, r1 ; 0x8017dd 3966c: 10 92 de 17 sts 0x17DE, r1 ; 0x8017de world2machine_rotation_and_skew_inv[1][1] = 1.f; 39670: 80 93 df 17 sts 0x17DF, r24 ; 0x8017df 39674: 90 93 e0 17 sts 0x17E0, r25 ; 0x8017e0 39678: a0 93 e1 17 sts 0x17E1, r26 ; 0x8017e1 3967c: b0 93 e2 17 sts 0x17E2, r27 ; 0x8017e2 39680: c0 cf rjmp .-128 ; 0x39602 00039682 : * * 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() { 39682: cf 93 push r28 39684: df 93 push r29 39686: cd b7 in r28, 0x3d ; 61 39688: de b7 in r29, 0x3e ; 62 3968a: 68 97 sbiw r28, 0x18 ; 24 3968c: 0f b6 in r0, 0x3f ; 63 3968e: f8 94 cli 39690: de bf out 0x3e, r29 ; 62 39692: 0f be out 0x3f, r0 ; 63 39694: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 39696: 80 e0 ldi r24, 0x00 ; 0 39698: 90 e0 ldi r25, 0x00 ; 0 3969a: a0 e8 ldi r26, 0x80 ; 128 3969c: bf e3 ldi r27, 0x3F ; 63 3969e: 89 83 std Y+1, r24 ; 0x01 396a0: 9a 83 std Y+2, r25 ; 0x02 396a2: ab 83 std Y+3, r26 ; 0x03 396a4: bc 83 std Y+4, r27 ; 0x04 396a6: 1d 82 std Y+5, r1 ; 0x05 396a8: 1e 82 std Y+6, r1 ; 0x06 396aa: 1f 82 std Y+7, r1 ; 0x07 396ac: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 396ae: 19 86 std Y+9, r1 ; 0x09 396b0: 1a 86 std Y+10, r1 ; 0x0a 396b2: 1b 86 std Y+11, r1 ; 0x0b 396b4: 1c 86 std Y+12, r1 ; 0x0c 396b6: 8d 87 std Y+13, r24 ; 0x0d 396b8: 9e 87 std Y+14, r25 ; 0x0e 396ba: af 87 std Y+15, r26 ; 0x0f 396bc: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 396be: 19 8a std Y+17, r1 ; 0x11 396c0: 1a 8a std Y+18, r1 ; 0x12 396c2: 1b 8a std Y+19, r1 ; 0x13 396c4: 1c 8a std Y+20, r1 ; 0x14 396c6: 1d 8a std Y+21, r1 ; 0x15 396c8: 1e 8a std Y+22, r1 ; 0x16 396ca: 1f 8a std Y+23, r1 ; 0x17 396cc: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 396ce: ae 01 movw r20, r28 396d0: 4f 5e subi r20, 0xEF ; 239 396d2: 5f 4f sbci r21, 0xFF ; 255 396d4: be 01 movw r22, r28 396d6: 67 5f subi r22, 0xF7 ; 247 396d8: 7f 4f sbci r23, 0xFF ; 255 396da: ce 01 movw r24, r28 396dc: 01 96 adiw r24, 0x01 ; 1 396de: 0f 94 f8 c9 call 0x393f0 ; 0x393f0 } 396e2: 68 96 adiw r28, 0x18 ; 24 396e4: 0f b6 in r0, 0x3f ; 63 396e6: f8 94 cli 396e8: de bf out 0x3e, r29 ; 62 396ea: 0f be out 0x3f, r0 ; 63 396ec: cd bf out 0x3d, r28 ; 61 396ee: df 91 pop r29 396f0: cf 91 pop r28 396f2: 08 95 ret 000396f4 : * * 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) { 396f4: 80 91 eb 17 lds r24, 0x17EB ; 0x8017eb 396f8: 88 23 and r24, r24 396fa: d1 f0 breq .+52 ; 0x39730 world2machine_reset(); 396fc: 0f 94 41 cb call 0x39682 ; 0x39682 st_synchronize(); 39700: 0f 94 27 58 call 0x2b04e ; 0x2b04e current_position[X_AXIS] = st_get_position_mm(X_AXIS); 39704: 80 e0 ldi r24, 0x00 ; 0 39706: 0f 94 13 58 call 0x2b026 ; 0x2b026 3970a: 60 93 43 07 sts 0x0743, r22 ; 0x800743 3970e: 70 93 44 07 sts 0x0744, r23 ; 0x800744 39712: 80 93 45 07 sts 0x0745, r24 ; 0x800745 39716: 90 93 46 07 sts 0x0746, r25 ; 0x800746 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 3971a: 81 e0 ldi r24, 0x01 ; 1 3971c: 0f 94 13 58 call 0x2b026 ; 0x2b026 39720: 60 93 47 07 sts 0x0747, r22 ; 0x800747 39724: 70 93 48 07 sts 0x0748, r23 ; 0x800748 39728: 80 93 49 07 sts 0x0749, r24 ; 0x800749 3972c: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a } } 39730: 08 95 ret 00039732 : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 39732: 4f ef ldi r20, 0xFF ; 255 39734: 5f ef ldi r21, 0xFF ; 255 39736: ba 01 movw r22, r20 39738: 85 ee ldi r24, 0xE5 ; 229 3973a: 9f e0 ldi r25, 0x0F ; 15 3973c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 39740: 4f ef ldi r20, 0xFF ; 255 39742: 5f ef ldi r21, 0xFF ; 255 39744: ba 01 movw r22, r20 39746: 89 ee ldi r24, 0xE9 ; 233 39748: 9f e0 ldi r25, 0x0F ; 15 3974a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3974e: 4f ef ldi r20, 0xFF ; 255 39750: 5f ef ldi r21, 0xFF ; 255 39752: ba 01 movw r22, r20 39754: 8d ed ldi r24, 0xDD ; 221 39756: 9f e0 ldi r25, 0x0F ; 15 39758: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3975c: 4f ef ldi r20, 0xFF ; 255 3975e: 5f ef ldi r21, 0xFF ; 255 39760: ba 01 movw r22, r20 39762: 81 ee ldi r24, 0xE1 ; 225 39764: 9f e0 ldi r25, 0x0F ; 15 39766: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3976a: 4f ef ldi r20, 0xFF ; 255 3976c: 5f ef ldi r21, 0xFF ; 255 3976e: ba 01 movw r22, r20 39770: 85 ed ldi r24, 0xD5 ; 213 39772: 9f e0 ldi r25, 0x0F ; 15 39774: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 39778: 4f ef ldi r20, 0xFF ; 255 3977a: 5f ef ldi r21, 0xFF ; 255 3977c: ba 01 movw r22, r20 3977e: 89 ed ldi r24, 0xD9 ; 217 39780: 9f e0 ldi r25, 0x0F ; 15 39782: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 39786: 4f ef ldi r20, 0xFF ; 255 39788: 5f ef ldi r21, 0xFF ; 255 3978a: ba 01 movw r22, r20 3978c: 85 ec ldi r24, 0xC5 ; 197 3978e: 9f e0 ldi r25, 0x0F ; 15 39790: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 39794: 4f ef ldi r20, 0xFF ; 255 39796: 5f ef ldi r21, 0xFF ; 255 39798: ba 01 movw r22, r20 3979a: 89 ec ldi r24, 0xC9 ; 201 3979c: 9f e0 ldi r25, 0x0F ; 15 3979e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 397a2: 4f ef ldi r20, 0xFF ; 255 397a4: 5f ef ldi r21, 0xFF ; 255 397a6: ba 01 movw r22, r20 397a8: 8d ec ldi r24, 0xCD ; 205 397aa: 9f e0 ldi r25, 0x0F ; 15 397ac: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 397b0: 4f ef ldi r20, 0xFF ; 255 397b2: 5f ef ldi r21, 0xFF ; 255 397b4: ba 01 movw r22, r20 397b6: 81 ed ldi r24, 0xD1 ; 209 397b8: 9f e0 ldi r25, 0x0F ; 15 397ba: 0d 94 91 dd jmp 0x3bb22 ; 0x3bb22 000397be : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 397be: 4f 92 push r4 397c0: 5f 92 push r5 397c2: 6f 92 push r6 397c4: 7f 92 push r7 397c6: 8f 92 push r8 397c8: 9f 92 push r9 397ca: af 92 push r10 397cc: bf 92 push r11 397ce: cf 92 push r12 397d0: df 92 push r13 397d2: ef 92 push r14 397d4: ff 92 push r15 397d6: 1f 93 push r17 397d8: cf 93 push r28 397da: df 93 push r29 397dc: cd b7 in r28, 0x3d ; 61 397de: de b7 in r29, 0x3e ; 62 397e0: a8 97 sbiw r28, 0x28 ; 40 397e2: 0f b6 in r0, 0x3f ; 63 397e4: f8 94 cli 397e6: de bf out 0x3e, r29 ; 62 397e8: 0f be out 0x3f, r0 ; 63 397ea: 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); 397ec: 48 e0 ldi r20, 0x08 ; 8 397ee: 50 e0 ldi r21, 0x00 ; 0 397f0: 6d ed ldi r22, 0xDD ; 221 397f2: 7f e0 ldi r23, 0x0F ; 15 397f4: ce 01 movw r24, r28 397f6: 01 96 adiw r24, 0x01 ; 1 397f8: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 397fc: 48 e0 ldi r20, 0x08 ; 8 397fe: 50 e0 ldi r21, 0x00 ; 0 39800: 65 ed ldi r22, 0xD5 ; 213 39802: 7f e0 ldi r23, 0x0F ; 15 39804: ce 01 movw r24, r28 39806: 09 96 adiw r24, 0x09 ; 9 39808: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 3980c: 48 e0 ldi r20, 0x08 ; 8 3980e: 50 e0 ldi r21, 0x00 ; 0 39810: 65 ee ldi r22, 0xE5 ; 229 39812: 7f e0 ldi r23, 0x0F ; 15 39814: ce 01 movw r24, r28 39816: 41 96 adiw r24, 0x11 ; 17 39818: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 3981c: 89 89 ldd r24, Y+17 ; 0x11 3981e: 9a 89 ldd r25, Y+18 ; 0x12 39820: ab 89 ldd r26, Y+19 ; 0x13 39822: bc 89 ldd r27, Y+20 ; 0x14 39824: 89 a3 std Y+33, r24 ; 0x21 39826: 9a a3 std Y+34, r25 ; 0x22 39828: ab a3 std Y+35, r26 ; 0x23 3982a: bc a3 std Y+36, r27 ; 0x24 3982c: 8f 3f cpi r24, 0xFF ; 255 3982e: 9f 4f sbci r25, 0xFF ; 255 39830: af 4f sbci r26, 0xFF ; 255 39832: bf 4f sbci r27, 0xFF ; 255 39834: 09 f4 brne .+2 ; 0x39838 39836: b1 c0 rjmp .+354 ; 0x3999a 39838: 8d 89 ldd r24, Y+21 ; 0x15 3983a: 9e 89 ldd r25, Y+22 ; 0x16 3983c: af 89 ldd r26, Y+23 ; 0x17 3983e: b8 8d ldd r27, Y+24 ; 0x18 39840: 8d a3 std Y+37, r24 ; 0x25 39842: 9e a3 std Y+38, r25 ; 0x26 39844: af a3 std Y+39, r26 ; 0x27 39846: b8 a7 std Y+40, r27 ; 0x28 39848: 8f 3f cpi r24, 0xFF ; 255 3984a: 9f 4f sbci r25, 0xFF ; 255 3984c: af 4f sbci r26, 0xFF ; 255 3984e: bf 4f sbci r27, 0xFF ; 255 39850: 09 f4 brne .+2 ; 0x39854 39852: a3 c0 rjmp .+326 ; 0x3999a 39854: 89 80 ldd r8, Y+1 ; 0x01 39856: 9a 80 ldd r9, Y+2 ; 0x02 39858: ab 80 ldd r10, Y+3 ; 0x03 3985a: bc 80 ldd r11, Y+4 ; 0x04 3985c: 8f ef ldi r24, 0xFF ; 255 3985e: 88 16 cp r8, r24 39860: 98 06 cpc r9, r24 39862: a8 06 cpc r10, r24 39864: b8 06 cpc r11, r24 39866: 09 f4 brne .+2 ; 0x3986a 39868: 98 c0 rjmp .+304 ; 0x3999a 3986a: 8d 81 ldd r24, Y+5 ; 0x05 3986c: 9e 81 ldd r25, Y+6 ; 0x06 3986e: af 81 ldd r26, Y+7 ; 0x07 39870: b8 85 ldd r27, Y+8 ; 0x08 39872: 89 8f std Y+25, r24 ; 0x19 39874: 9a 8f std Y+26, r25 ; 0x1a 39876: ab 8f std Y+27, r26 ; 0x1b 39878: bc 8f std Y+28, r27 ; 0x1c 3987a: 8f 3f cpi r24, 0xFF ; 255 3987c: 9f 4f sbci r25, 0xFF ; 255 3987e: af 4f sbci r26, 0xFF ; 255 39880: bf 4f sbci r27, 0xFF ; 255 39882: 09 f4 brne .+2 ; 0x39886 39884: 8a c0 rjmp .+276 ; 0x3999a 39886: c9 84 ldd r12, Y+9 ; 0x09 39888: da 84 ldd r13, Y+10 ; 0x0a 3988a: eb 84 ldd r14, Y+11 ; 0x0b 3988c: fc 84 ldd r15, Y+12 ; 0x0c 3988e: 8f ef ldi r24, 0xFF ; 255 39890: c8 16 cp r12, r24 39892: d8 06 cpc r13, r24 39894: e8 06 cpc r14, r24 39896: f8 06 cpc r15, r24 39898: 09 f4 brne .+2 ; 0x3989c 3989a: 7f c0 rjmp .+254 ; 0x3999a 3989c: 8d 85 ldd r24, Y+13 ; 0x0d 3989e: 9e 85 ldd r25, Y+14 ; 0x0e 398a0: af 85 ldd r26, Y+15 ; 0x0f 398a2: b8 89 ldd r27, Y+16 ; 0x10 398a4: 8d 8f std Y+29, r24 ; 0x1d 398a6: 9e 8f std Y+30, r25 ; 0x1e 398a8: af 8f std Y+31, r26 ; 0x1f 398aa: b8 a3 std Y+32, r27 ; 0x20 398ac: 8f 3f cpi r24, 0xFF ; 255 398ae: 9f 4f sbci r25, 0xFF ; 255 398b0: af 4f sbci r26, 0xFF ; 255 398b2: bf 4f sbci r27, 0xFF ; 255 398b4: 09 f4 brne .+2 ; 0x398b8 398b6: 71 c0 rjmp .+226 ; 0x3999a reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 398b8: 29 8d ldd r18, Y+25 ; 0x19 398ba: 3a 8d ldd r19, Y+26 ; 0x1a 398bc: 4b 8d ldd r20, Y+27 ; 0x1b 398be: 5c 8d ldd r21, Y+28 ; 0x1c 398c0: c5 01 movw r24, r10 398c2: b4 01 movw r22, r8 398c4: 0f 94 1f e1 call 0x3c23e ; 0x3c23e 398c8: 2b 01 movw r4, r22 398ca: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 398cc: 26 e6 ldi r18, 0x66 ; 102 398ce: 36 e6 ldi r19, 0x66 ; 102 398d0: 46 e6 ldi r20, 0x66 ; 102 398d2: 5f e3 ldi r21, 0x3F ; 63 398d4: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__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; 398d8: 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) 398da: 87 fd sbrc r24, 7 398dc: 0b c0 rjmp .+22 ; 0x398f4 398de: 2d ec ldi r18, 0xCD ; 205 398e0: 3c ec ldi r19, 0xCC ; 204 398e2: 4c e8 ldi r20, 0x8C ; 140 398e4: 5f e3 ldi r21, 0x3F ; 63 398e6: c3 01 movw r24, r6 398e8: b2 01 movw r22, r4 398ea: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 398ee: 18 16 cp r1, r24 398f0: 0c f0 brlt .+2 ; 0x398f4 398f2: 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]); 398f4: 2d 8d ldd r18, Y+29 ; 0x1d 398f6: 3e 8d ldd r19, Y+30 ; 0x1e 398f8: 4f 8d ldd r20, Y+31 ; 0x1f 398fa: 58 a1 ldd r21, Y+32 ; 0x20 398fc: c7 01 movw r24, r14 398fe: b6 01 movw r22, r12 39900: 0f 94 1f e1 call 0x3c23e ; 0x3c23e 39904: 2b 01 movw r4, r22 39906: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39908: 26 e6 ldi r18, 0x66 ; 102 3990a: 36 e6 ldi r19, 0x66 ; 102 3990c: 46 e6 ldi r20, 0x66 ; 102 3990e: 5f e3 ldi r21, 0x3F ; 63 39910: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 39914: 87 fd sbrc r24, 7 39916: 7f c0 rjmp .+254 ; 0x39a16 39918: 2d ec ldi r18, 0xCD ; 205 3991a: 3c ec ldi r19, 0xCC ; 204 3991c: 4c e8 ldi r20, 0x8C ; 140 3991e: 5f e3 ldi r21, 0x3F ; 63 39920: c3 01 movw r24, r6 39922: b2 01 movw r22, r4 39924: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 39928: 18 16 cp r1, r24 3992a: 0c f4 brge .+2 ; 0x3992e 3992c: 74 c0 rjmp .+232 ; 0x39a16 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]); 3992e: 2d a1 ldd r18, Y+37 ; 0x25 39930: 3e a1 ldd r19, Y+38 ; 0x26 39932: 4f a1 ldd r20, Y+39 ; 0x27 39934: 58 a5 ldd r21, Y+40 ; 0x28 39936: 69 a1 ldd r22, Y+33 ; 0x21 39938: 7a a1 ldd r23, Y+34 ; 0x22 3993a: 8b a1 ldd r24, Y+35 ; 0x23 3993c: 9c a1 ldd r25, Y+36 ; 0x24 3993e: 0f 94 1f e1 call 0x3c23e ; 0x3c23e if (l > 15.f) 39942: 20 e0 ldi r18, 0x00 ; 0 39944: 30 e0 ldi r19, 0x00 ; 0 39946: 40 e7 ldi r20, 0x70 ; 112 39948: 51 e4 ldi r21, 0x41 ; 65 3994a: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 3994e: 18 16 cp r1, r24 39950: 0c f4 brge .+2 ; 0x39954 #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 39952: 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]; 39954: a5 01 movw r20, r10 39956: 94 01 movw r18, r8 39958: c7 01 movw r24, r14 3995a: b6 01 movw r22, r12 3995c: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 39960: 6b 01 movw r12, r22 39962: 7c 01 movw r14, r24 39964: 2d 8d ldd r18, Y+29 ; 0x1d 39966: 3e 8d ldd r19, Y+30 ; 0x1e 39968: 4f 8d ldd r20, Y+31 ; 0x1f 3996a: 58 a1 ldd r21, Y+32 ; 0x20 3996c: 69 8d ldd r22, Y+25 ; 0x19 3996e: 7a 8d ldd r23, Y+26 ; 0x1a 39970: 8b 8d ldd r24, Y+27 ; 0x1b 39972: 9c 8d ldd r25, Y+28 ; 0x1c 39974: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 39978: 9b 01 movw r18, r22 3997a: ac 01 movw r20, r24 3997c: c7 01 movw r24, r14 3997e: b6 01 movw r22, r12 39980: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> if (fabs(l) > 0.1f) 39984: 9f 77 andi r25, 0x7F ; 127 39986: 2d ec ldi r18, 0xCD ; 205 39988: 3c ec ldi r19, 0xCC ; 204 3998a: 4c ec ldi r20, 0xCC ; 204 3998c: 5d e3 ldi r21, 0x3D ; 61 3998e: 0f 94 0c e1 call 0x3c218 ; 0x3c218 <__gesf2> 39992: 18 16 cp r1, r24 39994: 14 f0 brlt .+4 ; 0x3999a #endif reset = true; } } if (reset) 39996: 11 23 and r17, r17 39998: f1 f0 breq .+60 ; 0x399d6 { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 3999a: 0f 94 99 cb call 0x39732 ; 0x39732 * @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; 3999e: 80 e0 ldi r24, 0x00 ; 0 399a0: 90 e0 ldi r25, 0x00 ; 0 399a2: a0 e8 ldi r26, 0x80 ; 128 399a4: bf e3 ldi r27, 0x3F ; 63 399a6: 89 83 std Y+1, r24 ; 0x01 399a8: 9a 83 std Y+2, r25 ; 0x02 399aa: ab 83 std Y+3, r26 ; 0x03 399ac: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 399ae: 1d 82 std Y+5, r1 ; 0x05 399b0: 1e 82 std Y+6, r1 ; 0x06 399b2: 1f 82 std Y+7, r1 ; 0x07 399b4: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 399b6: 19 86 std Y+9, r1 ; 0x09 399b8: 1a 86 std Y+10, r1 ; 0x0a 399ba: 1b 86 std Y+11, r1 ; 0x0b 399bc: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 399be: 8d 87 std Y+13, r24 ; 0x0d 399c0: 9e 87 std Y+14, r25 ; 0x0e 399c2: af 87 std Y+15, r26 ; 0x0f 399c4: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 399c6: 19 8a std Y+17, r1 ; 0x11 399c8: 1a 8a std Y+18, r1 ; 0x12 399ca: 1b 8a std Y+19, r1 ; 0x13 399cc: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 399ce: 1d 8a std Y+21, r1 ; 0x15 399d0: 1e 8a std Y+22, r1 ; 0x16 399d2: 1f 8a std Y+23, r1 ; 0x17 399d4: 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); 399d6: ae 01 movw r20, r28 399d8: 4f 5e subi r20, 0xEF ; 239 399da: 5f 4f sbci r21, 0xFF ; 255 399dc: be 01 movw r22, r28 399de: 67 5f subi r22, 0xF7 ; 247 399e0: 7f 4f sbci r23, 0xFF ; 255 399e2: ce 01 movw r24, r28 399e4: 01 96 adiw r24, 0x01 ; 1 399e6: 0f 94 f8 c9 call 0x393f0 ; 0x393f0 MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 399ea: a8 96 adiw r28, 0x28 ; 40 399ec: 0f b6 in r0, 0x3f ; 63 399ee: f8 94 cli 399f0: de bf out 0x3e, r29 ; 62 399f2: 0f be out 0x3f, r0 ; 63 399f4: cd bf out 0x3d, r28 ; 61 399f6: df 91 pop r29 399f8: cf 91 pop r28 399fa: 1f 91 pop r17 399fc: ff 90 pop r15 399fe: ef 90 pop r14 39a00: df 90 pop r13 39a02: cf 90 pop r12 39a04: bf 90 pop r11 39a06: af 90 pop r10 39a08: 9f 90 pop r9 39a0a: 8f 90 pop r8 39a0c: 7f 90 pop r7 39a0e: 6f 90 pop r6 39a10: 5f 90 pop r5 39a12: 4f 90 pop r4 39a14: 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; 39a16: 11 e0 ldi r17, 0x01 ; 1 39a18: 8a cf rjmp .-236 ; 0x3992e 00039a1a : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 39a1a: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 39a1c: 24 e1 ldi r18, 0x14 ; 20 39a1e: ac 01 movw r20, r24 39a20: 24 9f mul r18, r20 39a22: c0 01 movw r24, r0 39a24: 25 9f mul r18, r21 39a26: 90 0d add r25, r0 39a28: 11 24 eor r1, r1 39a2a: 60 91 b6 17 lds r22, 0x17B6 ; 0x8017b6 39a2e: 70 91 b7 17 lds r23, 0x17B7 ; 0x8017b7 39a32: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 39a36: c6 2f mov r28, r22 39a38: 65 31 cpi r22, 0x15 ; 21 39a3a: 08 f0 brcs .+2 ; 0x39a3e 39a3c: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 39a3e: 80 91 b5 17 lds r24, 0x17B5 ; 0x8017b5 39a42: 8c 17 cp r24, r28 39a44: 48 f4 brcc .+18 ; 0x39a58 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 39a46: 8f ef ldi r24, 0xFF ; 255 39a48: 0e 94 c4 70 call 0xe188 ; 0xe188 { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 39a4c: 80 91 b5 17 lds r24, 0x17B5 ; 0x8017b5 39a50: 8f 5f subi r24, 0xFF ; 255 39a52: 80 93 b5 17 sts 0x17B5, r24 ; 0x8017b5 39a56: f3 cf rjmp .-26 ; 0x39a3e } } 39a58: cf 91 pop r28 39a5a: 08 95 ret 00039a5c : void menu_progressbar_finish(void) { progressbar_total = 1; 39a5c: 81 e0 ldi r24, 0x01 ; 1 39a5e: 90 e0 ldi r25, 0x00 ; 0 39a60: 90 93 b7 17 sts 0x17B7, r25 ; 0x8017b7 39a64: 80 93 b6 17 sts 0x17B6, r24 ; 0x8017b6 menu_progressbar_update(1); 39a68: 0f 94 0d cd call 0x39a1a ; 0x39a1a _delay(300); 39a6c: 6c e2 ldi r22, 0x2C ; 44 39a6e: 71 e0 ldi r23, 0x01 ; 1 39a70: 80 e0 ldi r24, 0x00 ; 0 39a72: 90 e0 ldi r25, 0x00 ; 0 39a74: 0d 94 8d 3c jmp 0x2791a ; 0x2791a 00039a78 : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 39a78: 0f 93 push r16 39a7a: 1f 93 push r17 39a7c: cf 93 push r28 39a7e: df 93 push r29 39a80: 8c 01 movw r16, r24 39a82: eb 01 movw r28, r22 lcd_clear(); 39a84: 0e 94 48 70 call 0xe090 ; 0xe090 progressbar_block_count = 0; 39a88: 10 92 b5 17 sts 0x17B5, r1 ; 0x8017b5 progressbar_total = total; 39a8c: 10 93 b7 17 sts 0x17B7, r17 ; 0x8017b7 39a90: 00 93 b6 17 sts 0x17B6, r16 ; 0x8017b6 lcd_set_cursor(0, 1); 39a94: 61 e0 ldi r22, 0x01 ; 1 39a96: 80 e0 ldi r24, 0x00 ; 0 39a98: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print_pad_P(title, LCD_WIDTH); 39a9c: 64 e1 ldi r22, 0x14 ; 20 39a9e: ce 01 movw r24, r28 39aa0: 0e 94 ea 71 call 0xe3d4 ; 0xe3d4 lcd_set_cursor(0, 2); 39aa4: 62 e0 ldi r22, 0x02 ; 2 39aa6: 80 e0 ldi r24, 0x00 ; 0 } 39aa8: df 91 pop r29 39aaa: cf 91 pop r28 39aac: 1f 91 pop r17 39aae: 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); 39ab0: 0c 94 15 70 jmp 0xe02a ; 0xe02a 00039ab4 : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 39ab4: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39ab8: 90 91 17 05 lds r25, 0x0517 ; 0x800517 39abc: 89 13 cpse r24, r25 39abe: 0b c0 rjmp .+22 ; 0x39ad6 39ac0: 90 91 16 05 lds r25, 0x0516 ; 0x800516 39ac4: 99 23 and r25, r25 39ac6: 39 f0 breq .+14 ; 0x39ad6 39ac8: 20 91 37 05 lds r18, 0x0537 ; 0x800537 39acc: 30 91 38 05 lds r19, 0x0538 ; 0x800538 39ad0: 82 17 cp r24, r18 39ad2: 13 06 cpc r1, r19 39ad4: 39 f0 breq .+14 ; 0x39ae4 39ad6: 81 e0 ldi r24, 0x01 ; 1 39ad8: 90 91 d3 03 lds r25, 0x03D3 ; 0x8003d3 39adc: 91 11 cpse r25, r1 39ade: 03 c0 rjmp .+6 ; 0x39ae6 39ae0: 80 e0 ldi r24, 0x00 ; 0 39ae2: 08 95 ret 39ae4: 81 e0 ldi r24, 0x01 ; 1 } 39ae6: 08 95 ret 00039ae8 : //! @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) { 39ae8: 0f 93 push r16 39aea: 1f 93 push r17 39aec: cf 93 push r28 39aee: df 93 push r29 39af0: 8c 01 movw r16, r24 39af2: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 39af4: 82 e5 ldi r24, 0x52 ; 82 39af6: 94 e4 ldi r25, 0x44 ; 68 39af8: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 39afc: 9f 93 push r25 39afe: 8f 93 push r24 39b00: 88 e0 ldi r24, 0x08 ; 8 39b02: 9b ea ldi r25, 0xAB ; 171 39b04: 9f 93 push r25 39b06: 8f 93 push r24 39b08: df 93 push r29 39b0a: cf 93 push r28 39b0c: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 39b10: c8 0f add r28, r24 39b12: d1 1d adc r29, r1 39b14: 47 e0 ldi r20, 0x07 ; 7 39b16: 50 e0 ldi r21, 0x00 ; 0 39b18: b8 01 movw r22, r16 39b1a: ce 01 movw r24, r28 39b1c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 //index += 7; buffer.c[index + 7] = '\0'; 39b20: 1f 82 std Y+7, r1 ; 0x07 39b22: 0f 90 pop r0 39b24: 0f 90 pop r0 39b26: 0f 90 pop r0 39b28: 0f 90 pop r0 39b2a: 0f 90 pop r0 39b2c: 0f 90 pop r0 } 39b2e: df 91 pop r29 39b30: cf 91 pop r28 39b32: 1f 91 pop r17 39b34: 0f 91 pop r16 39b36: 08 95 ret 00039b38 : 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)?'>':' '; 39b38: 20 91 18 05 lds r18, 0x0518 ; 0x800518 39b3c: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39b40: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39b44: 28 17 cp r18, r24 39b46: 19 06 cpc r1, r25 39b48: 11 f0 breq .+4 ; 0x39b4e 39b4a: 80 e2 ldi r24, 0x20 ; 32 39b4c: 08 95 ret 39b4e: 8e e3 ldi r24, 0x3E ; 62 } 39b50: 08 95 ret 00039b52 : static void menu_draw_item_puts_P(char type_char, const char* str) { 39b52: 0f 93 push r16 39b54: 1f 93 push r17 39b56: cf 93 push r28 39b58: c8 2f mov r28, r24 39b5a: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 39b5c: 0f 94 9c cd call 0x39b38 ; 0x39b38 39b60: 48 2f mov r20, r24 39b62: 60 91 15 05 lds r22, 0x0515 ; 0x800515 39b66: 80 e0 ldi r24, 0x00 ; 0 39b68: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_print_pad_P(str, LCD_WIDTH - 2); 39b6c: 62 e1 ldi r22, 0x12 ; 18 39b6e: c8 01 movw r24, r16 39b70: 0e 94 ea 71 call 0xe3d4 ; 0xe3d4 lcd_putc(type_char); 39b74: 8c 2f mov r24, r28 } 39b76: cf 91 pop r28 39b78: 1f 91 pop r17 39b7a: 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); 39b7c: 0c 94 04 70 jmp 0xe008 ; 0xe008 00039b80 : } } void menu_item_ret(void) { lcd_draw_update = 2; 39b80: 82 e0 ldi r24, 0x02 ; 2 39b82: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_item++; 39b86: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39b8a: 8f 5f subi r24, 0xFF ; 255 39b8c: 80 93 18 05 sts 0x0518, r24 ; 0x800518 //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 39b90: 84 e0 ldi r24, 0x04 ; 4 39b92: 80 93 15 05 sts 0x0515, r24 ; 0x800515 menu_line = 0; // prevent subsequent menu items from rendering at all in the current MENU_BEGIN() for loop cycle 39b96: 10 92 17 05 sts 0x0517, r1 ; 0x800517 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 39b9a: 10 92 16 05 sts 0x0516, r1 ; 0x800516 } 39b9e: 08 95 ret 00039ba0 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 39ba0: cf 93 push r28 39ba2: df 93 push r29 if (menu_item == menu_line) 39ba4: 30 91 18 05 lds r19, 0x0518 ; 0x800518 39ba8: 20 91 17 05 lds r18, 0x0517 ; 0x800517 39bac: 32 13 cpse r19, r18 39bae: 20 c0 rjmp .+64 ; 0x39bf0 39bb0: eb 01 movw r28, r22 39bb2: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39bb4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39bb8: 88 23 and r24, r24 39bba: 19 f0 breq .+6 ; 0x39bc2 39bbc: 80 e2 ldi r24, 0x20 ; 32 39bbe: 0f 94 a9 cd call 0x39b52 ; 0x39b52 if (menu_clicked && (lcd_encoder == menu_item)) 39bc2: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39bc6: 88 23 and r24, r24 39bc8: 99 f0 breq .+38 ; 0x39bf0 39bca: 20 91 18 05 lds r18, 0x0518 ; 0x800518 39bce: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39bd2: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39bd6: 28 17 cp r18, r24 39bd8: 19 06 cpc r1, r25 39bda: 51 f4 brne .+20 ; 0x39bf0 { if (str_gcode) enquecommand_P(str_gcode); 39bdc: 20 97 sbiw r28, 0x00 ; 0 39bde: 21 f0 breq .+8 ; 0x39be8 39be0: 61 e0 ldi r22, 0x01 ; 1 39be2: ce 01 movw r24, r28 39be4: 0e 94 cb 89 call 0x11396 ; 0x11396 menu_item_ret(); return; } } menu_item++; } 39be8: df 91 pop r29 39bea: 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(); 39bec: 0d 94 c0 cd jmp 0x39b80 ; 0x39b80 return; } } menu_item++; 39bf0: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39bf4: 8f 5f subi r24, 0xFF ; 255 39bf6: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 39bfa: df 91 pop r29 39bfc: cf 91 pop r28 39bfe: 08 95 ret 00039c00 : //! @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) { 39c00: ef 92 push r14 39c02: ff 92 push r15 39c04: 0f 93 push r16 39c06: 1f 93 push r17 39c08: cf 93 push r28 39c0a: df 93 push r29 if (menu_item == menu_line) 39c0c: 70 91 18 05 lds r23, 0x0518 ; 0x800518 39c10: 30 91 17 05 lds r19, 0x0517 ; 0x800517 39c14: 73 13 cpse r23, r19 39c16: 3f c0 rjmp .+126 ; 0x39c96 39c18: 12 2f mov r17, r18 39c1a: ea 01 movw r28, r20 39c1c: 06 2f mov r16, r22 39c1e: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 39c20: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39c24: 88 23 and r24, r24 39c26: d1 f0 breq .+52 ; 0x39c5c } 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()); 39c28: 0f 94 9c cd call 0x39b38 ; 0x39b38 39c2c: 48 2f mov r20, r24 39c2e: 60 91 15 05 lds r22, 0x0515 ; 0x800515 39c32: 80 e0 ldi r24, 0x00 ; 0 39c34: 0e 94 35 70 call 0xe06a ; 0xe06a uint8_t len = lcd_print_pad_P(str, max_strlen); 39c38: 61 e1 ldi r22, 0x11 ; 17 39c3a: c7 01 movw r24, r14 39c3c: 0e 94 ea 71 call 0xe3d4 ; 0xe3d4 lcd_putc_at((max_strlen - len) + 2, menu_row, num); 39c40: 40 2f mov r20, r16 39c42: 60 91 15 05 lds r22, 0x0515 ; 0x800515 39c46: 93 e1 ldi r25, 0x13 ; 19 39c48: 98 1b sub r25, r24 39c4a: 89 2f mov r24, r25 39c4c: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 39c50: 40 e2 ldi r20, 0x20 ; 32 39c52: 60 91 15 05 lds r22, 0x0515 ; 0x800515 39c56: 83 e1 ldi r24, 0x13 ; 19 39c58: 0e 94 35 70 call 0xe06a ; 0xe06a 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)) 39c5c: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39c60: 88 23 and r24, r24 39c62: c9 f0 breq .+50 ; 0x39c96 39c64: 20 91 18 05 lds r18, 0x0518 ; 0x800518 39c68: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39c6c: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39c70: 28 17 cp r18, r24 39c72: 19 06 cpc r1, r25 39c74: 81 f4 brne .+32 ; 0x39c96 { lcd_update_enabled = 0; 39c76: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(fn_par); 39c7a: 81 2f mov r24, r17 39c7c: fe 01 movw r30, r28 39c7e: 19 95 eicall lcd_update_enabled = 1; 39c80: 81 e0 ldi r24, 0x01 ; 1 39c82: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 39c86: df 91 pop r29 39c88: cf 91 pop r28 39c8a: 1f 91 pop r17 39c8c: 0f 91 pop r16 39c8e: ff 90 pop r15 39c90: 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(); 39c92: 0d 94 c0 cd jmp 0x39b80 ; 0x39b80 return; } } menu_item++; 39c96: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39c9a: 8f 5f subi r24, 0xFF ; 255 39c9c: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 39ca0: df 91 pop r29 39ca2: cf 91 pop r28 39ca4: 1f 91 pop r17 39ca6: 0f 91 pop r16 39ca8: ff 90 pop r15 39caa: ef 90 pop r14 39cac: 08 95 ret 00039cae : 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) { 39cae: cf 93 push r28 39cb0: df 93 push r29 if (menu_item == menu_line) 39cb2: 30 91 18 05 lds r19, 0x0518 ; 0x800518 39cb6: 20 91 17 05 lds r18, 0x0517 ; 0x800517 39cba: 32 13 cpse r19, r18 39cbc: 21 c0 rjmp .+66 ; 0x39d00 39cbe: eb 01 movw r28, r22 39cc0: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39cc2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39cc6: 88 23 and r24, r24 39cc8: 19 f0 breq .+6 ; 0x39cd0 39cca: 80 e2 ldi r24, 0x20 ; 32 39ccc: 0f 94 a9 cd call 0x39b52 ; 0x39b52 if (menu_clicked && (lcd_encoder == menu_item)) 39cd0: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39cd4: 88 23 and r24, r24 39cd6: a1 f0 breq .+40 ; 0x39d00 39cd8: 20 91 18 05 lds r18, 0x0518 ; 0x800518 39cdc: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39ce0: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39ce4: 28 17 cp r18, r24 39ce6: 19 06 cpc r1, r25 39ce8: 59 f4 brne .+22 ; 0x39d00 { lcd_update_enabled = 0; 39cea: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 39cee: fe 01 movw r30, r28 39cf0: 19 95 eicall lcd_update_enabled = 1; 39cf2: 81 e0 ldi r24, 0x01 ; 1 39cf4: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 39cf8: df 91 pop r29 39cfa: 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(); 39cfc: 0d 94 c0 cd jmp 0x39b80 ; 0x39b80 return; } } menu_item++; 39d00: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39d04: 8f 5f subi r24, 0xFF ; 255 39d06: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 39d0a: df 91 pop r29 39d0c: cf 91 pop r28 39d0e: 08 95 ret 00039d10 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 39d10: 30 91 18 05 lds r19, 0x0518 ; 0x800518 39d14: 20 91 17 05 lds r18, 0x0517 ; 0x800517 39d18: 32 13 cpse r19, r18 39d1a: 19 c0 rjmp .+50 ; 0x39d4e 39d1c: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39d1e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39d22: 88 23 and r24, r24 39d24: 19 f0 breq .+6 ; 0x39d2c 39d26: 80 e2 ldi r24, 0x20 ; 32 39d28: 0f 94 a9 cd call 0x39b52 ; 0x39b52 if (menu_clicked && (lcd_encoder == menu_item)) 39d2c: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39d30: 88 23 and r24, r24 39d32: 69 f0 breq .+26 ; 0x39d4e 39d34: 20 91 18 05 lds r18, 0x0518 ; 0x800518 39d38: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39d3c: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39d40: 28 17 cp r18, r24 39d42: 19 06 cpc r1, r25 39d44: 21 f4 brne .+8 ; 0x39d4e { menu_item_ret(); 39d46: 0f 94 c0 cd call 0x39b80 ; 0x39b80 return 1; 39d4a: 81 e0 ldi r24, 0x01 ; 1 39d4c: 08 95 ret } } menu_item++; 39d4e: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39d52: 8f 5f subi r24, 0xFF ; 255 39d54: 80 93 18 05 sts 0x0518, r24 ; 0x800518 return 0; 39d58: 80 e0 ldi r24, 0x00 ; 0 } 39d5a: 08 95 ret 00039d5c : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 39d5c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39d60: 84 30 cpi r24, 0x04 ; 4 39d62: 38 f5 brcc .+78 ; 0x39db2 { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 39d64: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39d68: 90 e0 ldi r25, 0x00 ; 0 39d6a: 20 91 37 05 lds r18, 0x0537 ; 0x800537 39d6e: 30 91 38 05 lds r19, 0x0538 ; 0x800538 39d72: 28 17 cp r18, r24 39d74: 39 07 cpc r19, r25 39d76: 44 f0 brlt .+16 ; 0x39d88 { lcd_encoder = menu_item - 1; 39d78: 01 97 sbiw r24, 0x01 ; 1 39d7a: 90 93 38 05 sts 0x0538, r25 ; 0x800538 39d7e: 80 93 37 05 sts 0x0537, r24 ; 0x800537 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 39d82: 87 e0 ldi r24, 0x07 ; 7 39d84: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 39d88: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39d8c: 20 91 a5 03 lds r18, 0x03A5 ; 0x8003a5 39d90: 30 e0 ldi r19, 0x00 ; 0 39d92: 2d 5f subi r18, 0xFD ; 253 39d94: 3f 4f sbci r19, 0xFF ; 255 39d96: 82 17 cp r24, r18 39d98: 13 06 cpc r1, r19 39d9a: 59 f0 breq .+22 ; 0x39db2 39d9c: 54 f0 brlt .+20 ; 0x39db2 { menu_top = lcd_encoder - LCD_HEIGHT + 1; 39d9e: 9d ef ldi r25, 0xFD ; 253 39da0: 98 0f add r25, r24 39da2: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 menu_line = menu_top - 1; 39da6: 84 50 subi r24, 0x04 ; 4 39da8: 80 93 17 05 sts 0x0517, r24 ; 0x800517 menu_row = -1; 39dac: 8f ef ldi r24, 0xFF ; 255 39dae: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } } 39db2: 08 95 ret 00039db4 : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 39db4: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39db8: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39dbc: 97 ff sbrs r25, 7 39dbe: 07 c0 rjmp .+14 ; 0x39dce { lcd_encoder = 0; 39dc0: 10 92 38 05 sts 0x0538, r1 ; 0x800538 39dc4: 10 92 37 05 sts 0x0537, r1 ; 0x800537 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 39dc8: 87 e0 ldi r24, 0x07 ; 7 39dca: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 } if (lcd_encoder < menu_top) 39dce: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39dd2: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39dd6: 20 91 a5 03 lds r18, 0x03A5 ; 0x8003a5 39dda: 28 17 cp r18, r24 39ddc: 19 06 cpc r1, r25 39dde: 19 f0 breq .+6 ; 0x39de6 39de0: 14 f0 brlt .+4 ; 0x39de6 menu_top = lcd_encoder; 39de2: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 menu_line = menu_top; 39de6: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 39dea: 80 93 17 05 sts 0x0517, r24 ; 0x800517 menu_clicked = lcd_clicked(); // Consume click event 39dee: 0e 94 32 72 call 0xe464 ; 0xe464 39df2: 80 93 16 05 sts 0x0516, r24 ; 0x800516 } 39df6: 08 95 ret 00039df8 : 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)); 39df8: e9 ea ldi r30, 0xA9 ; 169 39dfa: f3 e0 ldi r31, 0x03 ; 3 39dfc: 80 e2 ldi r24, 0x20 ; 32 39dfe: df 01 movw r26, r30 39e00: 1d 92 st X+, r1 39e02: 8a 95 dec r24 39e04: e9 f7 brne .-6 ; 0x39e00 } 39e06: 08 95 ret 00039e08 : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 39e08: cf 93 push r28 CRITICAL_SECTION_START; 39e0a: 3f b7 in r19, 0x3f ; 63 39e0c: f8 94 cli if (menu_menu != menu) 39e0e: e0 91 69 0e lds r30, 0x0E69 ; 0x800e69 39e12: f0 91 6a 0e lds r31, 0x0E6A ; 0x800e6a 39e16: e8 17 cp r30, r24 39e18: f9 07 cpc r31, r25 39e1a: c9 f0 breq .+50 ; 0x39e4e 39e1c: c4 2f mov r28, r20 { menu_menu = menu; 39e1e: 90 93 6a 0e sts 0x0E6A, r25 ; 0x800e6a 39e22: 80 93 69 0e sts 0x0E69, r24 ; 0x800e69 lcd_encoder = encoder; 39e26: 70 93 38 05 sts 0x0538, r23 ; 0x800538 39e2a: 60 93 37 05 sts 0x0537, r22 ; 0x800537 menu_top = 0; //reset menu view. Needed if menu_back() is called from deep inside a menu, such as Support 39e2e: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_draw_update = 2; // Full LCD re-draw 39e32: 82 e0 ldi r24, 0x02 ; 2 39e34: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d CRITICAL_SECTION_END; 39e38: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 39e3a: 22 23 and r18, r18 39e3c: 19 f0 breq .+6 ; 0x39e44 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 39e3e: 80 e0 ldi r24, 0x00 ; 0 39e40: 0f 94 7a 63 call 0x2c6f4 ; 0x2c6f4 if (reset_menu_state) menu_data_reset(); 39e44: cc 23 and r28, r28 39e46: 21 f0 breq .+8 ; 0x39e50 } else CRITICAL_SECTION_END; } 39e48: 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(); 39e4a: 0d 94 fc ce jmp 0x39df8 ; 0x39df8 } else CRITICAL_SECTION_END; 39e4e: 3f bf out 0x3f, r19 ; 63 } 39e50: cf 91 pop r28 39e52: 08 95 ret 00039e54 : 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) { 39e54: 7f 92 push r7 39e56: 8f 92 push r8 39e58: 9f 92 push r9 39e5a: af 92 push r10 39e5c: bf 92 push r11 39e5e: cf 92 push r12 39e60: df 92 push r13 39e62: ef 92 push r14 39e64: ff 92 push r15 39e66: 0f 93 push r16 39e68: 1f 93 push r17 39e6a: cf 93 push r28 39e6c: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 39e6e: e0 91 18 05 lds r30, 0x0518 ; 0x800518 39e72: 50 91 17 05 lds r21, 0x0517 ; 0x800517 39e76: e5 13 cpse r30, r21 39e78: 73 c0 rjmp .+230 ; 0x39f60 { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 39e7a: fb 01 movw r30, r22 39e7c: 48 30 cpi r20, 0x08 ; 8 39e7e: 09 f0 breq .+2 ; 0x39e82 39e80: 6c c0 rjmp .+216 ; 0x39f5a 39e82: c0 81 ld r28, Z 39e84: d0 e0 ldi r29, 0x00 ; 0 39e86: 49 01 movw r8, r18 39e88: 74 2e mov r7, r20 39e8a: 6b 01 movw r12, r22 39e8c: 5c 01 movw r10, r24 if (lcd_draw_update) 39e8e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39e92: 88 23 and r24, r24 39e94: 59 f0 breq .+22 ; 0x39eac { lcd_set_cursor(0, menu_row); 39e96: 60 91 15 05 lds r22, 0x0515 ; 0x800515 39e9a: 80 e0 ldi r24, 0x00 ; 0 39e9c: 0e 94 15 70 call 0xe02a ; 0xe02a menu_draw_P(menu_selection_mark(), str, cur_val); 39ea0: 0f 94 9c cd call 0x39b38 ; 0x39b38 39ea4: ae 01 movw r20, r28 39ea6: b5 01 movw r22, r10 39ea8: 0f 94 c6 a3 call 0x3478c ; 0x3478c } if (menu_clicked && (lcd_encoder == menu_item)) 39eac: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39eb0: 88 23 and r24, r24 39eb2: 09 f4 brne .+2 ; 0x39eb6 39eb4: 55 c0 rjmp .+170 ; 0x39f60 39eb6: 90 91 18 05 lds r25, 0x0518 ; 0x800518 39eba: 20 91 37 05 lds r18, 0x0537 ; 0x800537 39ebe: 30 91 38 05 lds r19, 0x0538 ; 0x800538 39ec2: 92 17 cp r25, r18 39ec4: 13 06 cpc r1, r19 39ec6: 09 f0 breq .+2 ; 0x39eca 39ec8: 4b c0 rjmp .+150 ; 0x39f60 } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 39eca: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 39ece: 87 30 cpi r24, 0x07 ; 7 39ed0: d8 f4 brcc .+54 ; 0x39f08 { menu_stack[menu_depth].menu = menu_menu; 39ed2: 28 2f mov r18, r24 39ed4: 30 e0 ldi r19, 0x00 ; 0 39ed6: f9 01 movw r30, r18 39ed8: ee 0f add r30, r30 39eda: ff 1f adc r31, r31 39edc: e2 0f add r30, r18 39ede: f3 1f adc r31, r19 39ee0: e0 56 subi r30, 0x60 ; 96 39ee2: f8 4e sbci r31, 0xE8 ; 232 39ee4: 20 91 69 0e lds r18, 0x0E69 ; 0x800e69 39ee8: 30 91 6a 0e lds r19, 0x0E6A ; 0x800e6a 39eec: 31 83 std Z+1, r19 ; 0x01 39eee: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 39ef0: 8f 5f subi r24, 0xFF ; 255 39ef2: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 39ef6: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 39ef8: 20 e0 ldi r18, 0x00 ; 0 39efa: 40 e0 ldi r20, 0x00 ; 0 39efc: 70 e0 ldi r23, 0x00 ; 0 39efe: 60 e0 ldi r22, 0x00 ; 0 39f00: 8e e9 ldi r24, 0x9E ; 158 39f02: 9a e3 ldi r25, 0x3A ; 58 39f04: 0f 94 04 cf call 0x39e08 ; 0x39e08 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; 39f08: b0 92 aa 03 sts 0x03AA, r11 ; 0x8003aa 39f0c: a0 92 a9 03 sts 0x03A9, r10 ; 0x8003a9 _md->editValuePtr = pval; 39f10: d0 92 ad 03 sts 0x03AD, r13 ; 0x8003ad 39f14: c0 92 ac 03 sts 0x03AC, r12 ; 0x8003ac _md->editValueBits = pbits; 39f18: 70 92 ab 03 sts 0x03AB, r7 ; 0x8003ab _md->currentValue = cur_val; 39f1c: d0 93 af 03 sts 0x03AF, r29 ; 0x8003af 39f20: c0 93 ae 03 sts 0x03AE, r28 ; 0x8003ae _md->minEditValue = min_val; 39f24: 90 92 b1 03 sts 0x03B1, r9 ; 0x8003b1 39f28: 80 92 b0 03 sts 0x03B0, r8 ; 0x8003b0 _md->maxEditValue = max_val; 39f2c: 10 93 b3 03 sts 0x03B3, r17 ; 0x8003b3 39f30: 00 93 b2 03 sts 0x03B2, r16 ; 0x8003b2 _md->minJumpValue = jmp_val; 39f34: f0 92 b5 03 sts 0x03B5, r15 ; 0x8003b5 39f38: e0 92 b4 03 sts 0x03B4, r14 ; 0x8003b4 menu_item_ret(); return; } } menu_item++; } 39f3c: df 91 pop r29 39f3e: cf 91 pop r28 39f40: 1f 91 pop r17 39f42: 0f 91 pop r16 39f44: ff 90 pop r15 39f46: ef 90 pop r14 39f48: df 90 pop r13 39f4a: cf 90 pop r12 39f4c: bf 90 pop r11 39f4e: af 90 pop r10 39f50: 9f 90 pop r9 39f52: 8f 90 pop r8 39f54: 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(); 39f56: 0d 94 c0 cd jmp 0x39b80 ; 0x39b80 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)); 39f5a: c0 81 ld r28, Z 39f5c: d1 81 ldd r29, Z+1 ; 0x01 39f5e: 93 cf rjmp .-218 ; 0x39e86 _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 39f60: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39f64: 8f 5f subi r24, 0xFF ; 255 39f66: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 39f6a: df 91 pop r29 39f6c: cf 91 pop r28 39f6e: 1f 91 pop r17 39f70: 0f 91 pop r16 39f72: ff 90 pop r15 39f74: ef 90 pop r14 39f76: df 90 pop r13 39f78: cf 90 pop r12 39f7a: bf 90 pop r11 39f7c: af 90 pop r10 39f7e: 9f 90 pop r9 39f80: 8f 90 pop r8 39f82: 7f 90 pop r7 39f84: 08 95 ret 00039f86 <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 39f86: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39f8a: 88 23 and r24, r24 39f8c: 09 f4 brne .+2 ; 0x39f90 <_menu_edit_P()+0xa> 39f8e: 52 c0 rjmp .+164 ; 0x3a034 <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 39f90: 20 91 b4 03 lds r18, 0x03B4 ; 0x8003b4 39f94: 30 91 b5 03 lds r19, 0x03B5 ; 0x8003b5 39f98: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 39f9c: 90 91 b1 03 lds r25, 0x03B1 ; 0x8003b1 39fa0: 21 15 cp r18, r1 39fa2: 31 05 cpc r19, r1 39fa4: d9 f0 breq .+54 ; 0x39fdc <_menu_edit_P()+0x56> 39fa6: 40 91 37 05 lds r20, 0x0537 ; 0x800537 39faa: 50 91 38 05 lds r21, 0x0538 ; 0x800538 39fae: 41 15 cp r20, r1 39fb0: 51 05 cpc r21, r1 39fb2: a1 f0 breq .+40 ; 0x39fdc <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 39fb4: 7c f0 brlt .+30 ; 0x39fd4 <_menu_edit_P()+0x4e> 39fb6: 40 91 ae 03 lds r20, 0x03AE ; 0x8003ae 39fba: 50 91 af 03 lds r21, 0x03AF ; 0x8003af 39fbe: 48 17 cp r20, r24 39fc0: 59 07 cpc r21, r25 39fc2: 41 f4 brne .+16 ; 0x39fd4 <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 39fc4: 30 93 af 03 sts 0x03AF, r19 ; 0x8003af 39fc8: 20 93 ae 03 sts 0x03AE, r18 ; 0x8003ae lcd_encoder = 0; 39fcc: 10 92 38 05 sts 0x0538, r1 ; 0x800538 39fd0: 10 92 37 05 sts 0x0537, r1 ; 0x800537 } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 39fd4: 10 92 b5 03 sts 0x03B5, r1 ; 0x8003b5 39fd8: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 } _md->currentValue += lcd_encoder; 39fdc: 20 91 ae 03 lds r18, 0x03AE ; 0x8003ae 39fe0: 30 91 af 03 lds r19, 0x03AF ; 0x8003af 39fe4: 40 91 37 05 lds r20, 0x0537 ; 0x800537 39fe8: 50 91 38 05 lds r21, 0x0538 ; 0x800538 39fec: 24 0f add r18, r20 39fee: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 39ff0: 10 92 38 05 sts 0x0538, r1 ; 0x800538 39ff4: 10 92 37 05 sts 0x0537, r1 ; 0x800537 // Constrain the value in case it's outside the allowed limits _md->currentValue = constrain(_md->currentValue, _md->minEditValue, _md->maxEditValue); 39ff8: 28 17 cp r18, r24 39ffa: 39 07 cpc r19, r25 39ffc: 44 f0 brlt .+16 ; 0x3a00e <_menu_edit_P()+0x88> 39ffe: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 3a002: 90 91 b3 03 lds r25, 0x03B3 ; 0x8003b3 3a006: 28 17 cp r18, r24 3a008: 39 07 cpc r19, r25 3a00a: 0c f4 brge .+2 ; 0x3a00e <_menu_edit_P()+0x88> 3a00c: c9 01 movw r24, r18 3a00e: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af 3a012: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae lcd_set_cursor(0, 1); 3a016: 61 e0 ldi r22, 0x01 ; 1 3a018: 80 e0 ldi r24, 0x00 ; 0 3a01a: 0e 94 15 70 call 0xe02a ; 0xe02a menu_draw_P(' ', _md->editLabel, _md->currentValue); 3a01e: 40 91 ae 03 lds r20, 0x03AE ; 0x8003ae 3a022: 50 91 af 03 lds r21, 0x03AF ; 0x8003af 3a026: 60 91 a9 03 lds r22, 0x03A9 ; 0x8003a9 3a02a: 70 91 aa 03 lds r23, 0x03AA ; 0x8003aa 3a02e: 80 e2 ldi r24, 0x20 ; 32 3a030: 0f 94 c6 a3 call 0x3478c ; 0x3478c } if (lcd_clicked()) 3a034: 0e 94 32 72 call 0xe464 ; 0xe464 3a038: 88 23 and r24, r24 3a03a: 41 f1 breq .+80 ; 0x3a08c <_menu_edit_P()+0x106> 3a03c: e0 91 ac 03 lds r30, 0x03AC ; 0x8003ac 3a040: f0 91 ad 03 lds r31, 0x03AD ; 0x8003ad 3a044: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 3a048: 90 91 af 03 lds r25, 0x03AF ; 0x8003af { if (_md->editValueBits == 8) 3a04c: 20 91 ab 03 lds r18, 0x03AB ; 0x8003ab *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 3a050: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 3a052: 28 30 cpi r18, 0x08 ; 8 3a054: c9 f4 brne .+50 ; 0x3a088 <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 3a056: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 3a05a: 88 23 and r24, r24 3a05c: b9 f0 breq .+46 ; 0x3a08c <_menu_edit_P()+0x106> { menu_depth--; 3a05e: 81 50 subi r24, 0x01 ; 1 3a060: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 3a064: 90 e0 ldi r25, 0x00 ; 0 3a066: fc 01 movw r30, r24 3a068: ee 0f add r30, r30 3a06a: ff 1f adc r31, r31 3a06c: e8 0f add r30, r24 3a06e: f9 1f adc r31, r25 3a070: e0 56 subi r30, 0x60 ; 96 3a072: f8 4e sbci r31, 0xE8 ; 232 3a074: 62 81 ldd r22, Z+2 ; 0x02 3a076: 06 2e mov r0, r22 3a078: 00 0c add r0, r0 3a07a: 77 0b sbc r23, r23 3a07c: 20 e0 ldi r18, 0x00 ; 0 3a07e: 40 e0 ldi r20, 0x00 ; 0 3a080: 80 81 ld r24, Z 3a082: 91 81 ldd r25, Z+1 ; 0x01 3a084: 0d 94 04 cf jmp 0x39e08 ; 0x39e08 if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 3a088: 91 83 std Z+1, r25 ; 0x01 3a08a: e5 cf rjmp .-54 ; 0x3a056 <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 3a08c: 08 95 ret 0003a08e : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 3a08e: dc 01 movw r26, r24 3a090: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 3a092: 90 91 f4 03 lds r25, 0x03F4 ; 0x8003f4 3a096: 97 30 cpi r25, 0x07 ; 7 3a098: d8 f4 brcc .+54 ; 0x3a0d0 { menu_stack[menu_depth].menu = menu_menu; 3a09a: 49 2f mov r20, r25 3a09c: 50 e0 ldi r21, 0x00 ; 0 3a09e: fa 01 movw r30, r20 3a0a0: ee 0f add r30, r30 3a0a2: ff 1f adc r31, r31 3a0a4: e4 0f add r30, r20 3a0a6: f5 1f adc r31, r21 3a0a8: e0 56 subi r30, 0x60 ; 96 3a0aa: f8 4e sbci r31, 0xE8 ; 232 3a0ac: 40 91 69 0e lds r20, 0x0E69 ; 0x800e69 3a0b0: 50 91 6a 0e lds r21, 0x0E6A ; 0x800e6a 3a0b4: 51 83 std Z+1, r21 ; 0x01 3a0b6: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 3a0b8: 80 91 37 05 lds r24, 0x0537 ; 0x800537 3a0bc: 9f 5f subi r25, 0xFF ; 255 3a0be: 90 93 f4 03 sts 0x03F4, r25 ; 0x8003f4 3a0c2: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 3a0c4: 41 e0 ldi r20, 0x01 ; 1 3a0c6: 70 e0 ldi r23, 0x00 ; 0 3a0c8: 60 e0 ldi r22, 0x00 ; 0 3a0ca: cd 01 movw r24, r26 3a0cc: 0d 94 04 cf jmp 0x39e08 ; 0x39e08 } } 3a0d0: 08 95 ret 0003a0d2 : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 3a0d2: 8f 92 push r8 3a0d4: 9f 92 push r9 3a0d6: af 92 push r10 3a0d8: bf 92 push r11 3a0da: cf 92 push r12 3a0dc: df 92 push r13 3a0de: ef 92 push r14 3a0e0: ff 92 push r15 3a0e2: 0f 93 push r16 3a0e4: 1f 93 push r17 3a0e6: cf 93 push r28 3a0e8: df 93 push r29 if (menu_item == menu_line) 3a0ea: e0 91 18 05 lds r30, 0x0518 ; 0x800518 3a0ee: 30 91 17 05 lds r19, 0x0517 ; 0x800517 3a0f2: e3 13 cpse r30, r19 3a0f4: 73 c0 rjmp .+230 ; 0x3a1dc 3a0f6: c2 2f mov r28, r18 3a0f8: 6a 01 movw r12, r20 3a0fa: 7b 01 movw r14, r22 3a0fc: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 3a0fe: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a102: 88 23 and r24, r24 3a104: a1 f1 breq .+104 ; 0x3a16e 3a106: 0f 94 9c cd call 0x39b38 ; 0x39b38 3a10a: 01 e0 ldi r16, 0x01 ; 1 3a10c: 8e 33 cpi r24, 0x3E ; 62 3a10e: 09 f0 breq .+2 ; 0x3a112 3a110: 00 e0 ldi r16, 0x00 ; 0 3a112: 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; 3a114: 80 2f mov r24, r16 3a116: 82 70 andi r24, 0x02 ; 2 3a118: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 3a11a: e1 14 cp r14, r1 3a11c: f1 04 cpc r15, r1 3a11e: 09 f4 brne .+2 ; 0x3a122 3a120: 6f c0 rjmp .+222 ; 0x3a200 3a122: e7 01 movw r28, r14 3a124: 90 e2 ldi r25, 0x20 ; 32 3a126: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 3a128: 88 20 and r8, r8 3a12a: 09 f4 brne .+2 ; 0x3a12e 3a12c: 41 c0 rjmp .+130 ; 0x3a1b0 3a12e: ce 01 movw r24, r28 3a130: 0f 94 19 db call 0x3b632 ; 0x3b632 <__strlen_P> 3a134: 14 e0 ldi r17, 0x04 ; 4 3a136: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 3a138: 4e e3 ldi r20, 0x3E ; 62 3a13a: 00 ff sbrs r16, 0 3a13c: 40 e2 ldi r20, 0x20 ; 32 3a13e: 60 91 15 05 lds r22, 0x0515 ; 0x800515 3a142: 80 e0 ldi r24, 0x00 ; 0 3a144: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_print_pad_P(str, LCD_WIDTH - len); 3a148: 64 e1 ldi r22, 0x14 ; 20 3a14a: 61 1b sub r22, r17 3a14c: c5 01 movw r24, r10 3a14e: 0e 94 ea 71 call 0xe3d4 ; 0xe3d4 lcd_putc('['); 3a152: 8b e5 ldi r24, 0x5B ; 91 3a154: 0e 94 04 70 call 0xe008 ; 0xe008 if (is_progmem) { lcd_puts_P(toggle); 3a158: 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) 3a15a: 88 20 and r8, r8 3a15c: 89 f1 breq .+98 ; 0x3a1c0 { lcd_puts_P(toggle); 3a15e: 0e 94 00 70 call 0xe000 ; 0xe000 } else { lcd_print(toggle); } lcd_putc(']'); 3a162: 8d e5 ldi r24, 0x5D ; 93 3a164: 0e 94 04 70 call 0xe008 ; 0xe008 lcd_putc(eol); 3a168: 89 2d mov r24, r9 3a16a: 0e 94 04 70 call 0xe008 ; 0xe008 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)) 3a16e: 80 91 16 05 lds r24, 0x0516 ; 0x800516 3a172: 88 23 and r24, r24 3a174: 99 f1 breq .+102 ; 0x3a1dc 3a176: 20 91 18 05 lds r18, 0x0518 ; 0x800518 3a17a: 80 91 37 05 lds r24, 0x0537 ; 0x800537 3a17e: 90 91 38 05 lds r25, 0x0538 ; 0x800538 3a182: 28 17 cp r18, r24 3a184: 19 06 cpc r1, r25 3a186: 51 f5 brne .+84 ; 0x3a1dc { if (toggle == NULL) // print N/A warning message 3a188: ef 28 or r14, r15 3a18a: e9 f4 brne .+58 ; 0x3a1c6 { menu_submenu(func); 3a18c: 60 e0 ldi r22, 0x00 ; 0 3a18e: c6 01 movw r24, r12 3a190: 0f 94 47 d0 call 0x3a08e ; 0x3a08e menu_item_ret(); return; } } menu_item++; } 3a194: df 91 pop r29 3a196: cf 91 pop r28 3a198: 1f 91 pop r17 3a19a: 0f 91 pop r16 3a19c: ff 90 pop r15 3a19e: ef 90 pop r14 3a1a0: df 90 pop r13 3a1a2: cf 90 pop r12 3a1a4: bf 90 pop r11 3a1a6: af 90 pop r10 3a1a8: 9f 90 pop r9 3a1aa: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 3a1ac: 0d 94 c0 cd jmp 0x39b80 ; 0x39b80 //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)); 3a1b0: fe 01 movw r30, r28 3a1b2: 01 90 ld r0, Z+ 3a1b4: 00 20 and r0, r0 3a1b6: e9 f7 brne .-6 ; 0x3a1b2 3a1b8: ec 1b sub r30, r28 3a1ba: 13 e0 ldi r17, 0x03 ; 3 3a1bc: 1e 0f add r17, r30 3a1be: bc cf rjmp .-136 ; 0x3a138 lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 3a1c0: 0e 94 1c 72 call 0xe438 ; 0xe438 3a1c4: ce cf rjmp .-100 ; 0x3a162 { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 3a1c6: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a1ca: c1 14 cp r12, r1 3a1cc: d1 04 cpc r13, r1 3a1ce: 11 f0 breq .+4 ; 0x3a1d4 3a1d0: f6 01 movw r30, r12 3a1d2: 19 95 eicall lcd_update_enabled = 1; 3a1d4: 81 e0 ldi r24, 0x01 ; 1 3a1d6: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 3a1da: dc cf rjmp .-72 ; 0x3a194 } menu_item_ret(); return; } } menu_item++; 3a1dc: 80 91 18 05 lds r24, 0x0518 ; 0x800518 3a1e0: 8f 5f subi r24, 0xFF ; 255 3a1e2: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 3a1e6: df 91 pop r29 3a1e8: cf 91 pop r28 3a1ea: 1f 91 pop r17 3a1ec: 0f 91 pop r16 3a1ee: ff 90 pop r15 3a1f0: ef 90 pop r14 3a1f2: df 90 pop r13 3a1f4: cf 90 pop r12 3a1f6: bf 90 pop r11 3a1f8: af 90 pop r10 3a1fa: 9f 90 pop r9 3a1fc: 8f 90 pop r8 3a1fe: 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); 3a200: 88 e5 ldi r24, 0x58 ; 88 3a202: 9d e3 ldi r25, 0x3D ; 61 3a204: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 3a208: 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] : ' '; 3a20a: 8e e7 ldi r24, 0x7E ; 126 3a20c: 98 2e mov r9, r24 3a20e: 8c cf rjmp .-232 ; 0x3a128 0003a210 : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 3a210: cf 93 push r28 3a212: df 93 push r29 if (menu_item == menu_line) 3a214: 30 91 18 05 lds r19, 0x0518 ; 0x800518 3a218: 20 91 17 05 lds r18, 0x0517 ; 0x800517 3a21c: 32 13 cpse r19, r18 3a21e: 1e c0 rjmp .+60 ; 0x3a25c 3a220: eb 01 movw r28, r22 3a222: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 3a224: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a228: 88 23 and r24, r24 3a22a: 19 f0 breq .+6 ; 0x3a232 3a22c: 8e e7 ldi r24, 0x7E ; 126 3a22e: 0f 94 a9 cd call 0x39b52 ; 0x39b52 if (menu_clicked && (lcd_encoder == menu_item)) 3a232: 80 91 16 05 lds r24, 0x0516 ; 0x800516 3a236: 88 23 and r24, r24 3a238: 89 f0 breq .+34 ; 0x3a25c 3a23a: 20 91 18 05 lds r18, 0x0518 ; 0x800518 3a23e: 80 91 37 05 lds r24, 0x0537 ; 0x800537 3a242: 90 91 38 05 lds r25, 0x0538 ; 0x800538 3a246: 28 17 cp r18, r24 3a248: 19 06 cpc r1, r25 3a24a: 41 f4 brne .+16 ; 0x3a25c { menu_submenu(submenu); 3a24c: 60 e0 ldi r22, 0x00 ; 0 3a24e: ce 01 movw r24, r28 3a250: 0f 94 47 d0 call 0x3a08e ; 0x3a08e menu_item_ret(); return; } } menu_item++; } 3a254: df 91 pop r29 3a256: 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(); 3a258: 0d 94 c0 cd jmp 0x39b80 ; 0x39b80 return; } } menu_item++; 3a25c: 80 91 18 05 lds r24, 0x0518 ; 0x800518 3a260: 8f 5f subi r24, 0xFF ; 255 3a262: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 3a266: df 91 pop r29 3a268: cf 91 pop r28 3a26a: 08 95 ret 0003a26c : void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 3a26c: 0f 93 push r16 3a26e: 1f 93 push r17 3a270: cf 93 push r28 3a272: df 93 push r29 3a274: cd b7 in r28, 0x3d ; 61 3a276: de b7 in r29, 0x3e ; 62 3a278: 63 97 sbiw r28, 0x13 ; 19 3a27a: 0f b6 in r0, 0x3f ; 63 3a27c: f8 94 cli 3a27e: de bf out 0x3e, r29 ; 62 3a280: 0f be out 0x3f, r0 ; 63 3a282: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 3a284: 30 91 18 05 lds r19, 0x0518 ; 0x800518 3a288: 20 91 17 05 lds r18, 0x0517 ; 0x800517 3a28c: 32 13 cpse r19, r18 3a28e: 38 c0 rjmp .+112 ; 0x3a300 3a290: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 3a292: 20 91 6d 02 lds r18, 0x026D ; 0x80026d 3a296: 22 23 and r18, r18 3a298: a9 f0 breq .+42 ; 0x3a2c4 static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 3a29a: be 01 movw r22, r28 3a29c: 6f 5f subi r22, 0xFF ; 255 3a29e: 7f 4f sbci r23, 0xFF ; 255 3a2a0: 0f 94 74 cd call 0x39ae8 ; 0x39ae8 lcd_putc_at(0, menu_row, menu_selection_mark()); 3a2a4: 0f 94 9c cd call 0x39b38 ; 0x39b38 3a2a8: 48 2f mov r20, r24 3a2aa: 60 91 15 05 lds r22, 0x0515 ; 0x800515 3a2ae: 80 e0 ldi r24, 0x00 ; 0 3a2b0: 0e 94 35 70 call 0xe06a ; 0xe06a lcd_print_pad(buffer.c, LCD_WIDTH - 2); 3a2b4: 62 e1 ldi r22, 0x12 ; 18 3a2b6: ce 01 movw r24, r28 3a2b8: 01 96 adiw r24, 0x01 ; 1 3a2ba: 0e 94 04 72 call 0xe408 ; 0xe408 lcd_putc(type_char); 3a2be: 8e e7 ldi r24, 0x7E ; 126 3a2c0: 0e 94 04 70 call 0xe008 ; 0xe008 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)) 3a2c4: 80 91 16 05 lds r24, 0x0516 ; 0x800516 3a2c8: 88 23 and r24, r24 3a2ca: d1 f0 breq .+52 ; 0x3a300 3a2cc: 20 91 18 05 lds r18, 0x0518 ; 0x800518 3a2d0: 80 91 37 05 lds r24, 0x0537 ; 0x800537 3a2d4: 90 91 38 05 lds r25, 0x0538 ; 0x800538 3a2d8: 28 17 cp r18, r24 3a2da: 19 06 cpc r1, r25 3a2dc: 89 f4 brne .+34 ; 0x3a300 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); 3a2de: 60 e0 ldi r22, 0x00 ; 0 3a2e0: c8 01 movw r24, r16 3a2e2: 0f 94 47 d0 call 0x3a08e ; 0x3a08e menu_item_ret(); 3a2e6: 0f 94 c0 cd call 0x39b80 ; 0x39b80 menu_item_ret(); return; } } menu_item++; } 3a2ea: 63 96 adiw r28, 0x13 ; 19 3a2ec: 0f b6 in r0, 0x3f ; 63 3a2ee: f8 94 cli 3a2f0: de bf out 0x3e, r29 ; 62 3a2f2: 0f be out 0x3f, r0 ; 63 3a2f4: cd bf out 0x3d, r28 ; 61 3a2f6: df 91 pop r29 3a2f8: cf 91 pop r28 3a2fa: 1f 91 pop r17 3a2fc: 0f 91 pop r16 3a2fe: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 3a300: 80 91 18 05 lds r24, 0x0518 ; 0x800518 3a304: 8f 5f subi r24, 0xFF ; 255 3a306: 80 93 18 05 sts 0x0518, r24 ; 0x800518 3a30a: ef cf rjmp .-34 ; 0x3a2ea 0003a30c : menu_row = -1; } } void menu_back(uint8_t nLevel) { 3a30c: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a30e: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 3a312: 98 17 cp r25, r24 3a314: a8 f4 brcc .+42 ; 0x3a340 3a316: 89 1b sub r24, r25 3a318: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 3a31c: 90 e0 ldi r25, 0x00 ; 0 3a31e: fc 01 movw r30, r24 3a320: ee 0f add r30, r30 3a322: ff 1f adc r31, r31 3a324: e8 0f add r30, r24 3a326: f9 1f adc r31, r25 3a328: e0 56 subi r30, 0x60 ; 96 3a32a: f8 4e sbci r31, 0xE8 ; 232 3a32c: 62 81 ldd r22, Z+2 ; 0x02 3a32e: 06 2e mov r0, r22 3a330: 00 0c add r0, r0 3a332: 77 0b sbc r23, r23 3a334: 20 e0 ldi r18, 0x00 ; 0 3a336: 41 e0 ldi r20, 0x01 ; 1 3a338: 80 81 ld r24, Z 3a33a: 91 81 ldd r25, Z+1 ; 0x01 3a33c: 0d 94 04 cf jmp 0x39e08 ; 0x39e08 } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a340: 80 e0 ldi r24, 0x00 ; 0 3a342: ea cf rjmp .-44 ; 0x3a318 0003a344 : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 3a344: 81 e0 ldi r24, 0x01 ; 1 3a346: 0d 94 86 d1 jmp 0x3a30c ; 0x3a30c 0003a34a : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 3a34a: 30 91 18 05 lds r19, 0x0518 ; 0x800518 3a34e: 20 91 17 05 lds r18, 0x0517 ; 0x800517 3a352: 32 13 cpse r19, r18 3a354: 19 c0 rjmp .+50 ; 0x3a388 3a356: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 3a358: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a35c: 88 23 and r24, r24 3a35e: 19 f0 breq .+6 ; 0x3a366 3a360: 83 e8 ldi r24, 0x83 ; 131 3a362: 0f 94 a9 cd call 0x39b52 ; 0x39b52 if (menu_clicked && (lcd_encoder == menu_item)) 3a366: 80 91 16 05 lds r24, 0x0516 ; 0x800516 3a36a: 88 23 and r24, r24 3a36c: 69 f0 breq .+26 ; 0x3a388 3a36e: 20 91 18 05 lds r18, 0x0518 ; 0x800518 3a372: 80 91 37 05 lds r24, 0x0537 ; 0x800537 3a376: 90 91 38 05 lds r25, 0x0538 ; 0x800538 3a37a: 28 17 cp r18, r24 3a37c: 19 06 cpc r1, r25 3a37e: 21 f4 brne .+8 ; 0x3a388 { menu_back(); 3a380: 0f 94 a2 d1 call 0x3a344 ; 0x3a344 menu_item_ret(); 3a384: 0d 94 c0 cd jmp 0x39b80 ; 0x39b80 return; } } menu_item++; 3a388: 80 91 18 05 lds r24, 0x0518 ; 0x800518 3a38c: 8f 5f subi r24, 0xFF ; 255 3a38e: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 3a392: 08 95 ret 0003a394 : }; 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() { 3a394: ef 92 push r14 3a396: ff 92 push r15 3a398: 0f 93 push r16 3a39a: 1f 93 push r17 3a39c: cf 93 push r28 3a39e: df 93 push r29 3a3a0: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 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) 3a3a4: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 3a3a8: 81 11 cpse r24, r1 3a3aa: 23 c0 rjmp .+70 ; 0x3a3f2 { _md->status = 1; // Menu entered for the first time 3a3ac: 81 e0 ldi r24, 0x01 ; 1 3a3ae: 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; 3a3b2: 81 e0 ldi r24, 0x01 ; 1 3a3b4: 90 e0 ldi r25, 0x00 ; 0 3a3b6: 20 91 69 13 lds r18, 0x1369 ; 0x801369 3a3ba: 30 91 6a 13 lds r19, 0x136A ; 0x80136a 3a3be: 27 30 cpi r18, 0x07 ; 7 3a3c0: 31 48 sbci r19, 0x81 ; 129 3a3c2: 11 f0 breq .+4 ; 0x3a3c8 3a3c4: 90 e0 ldi r25, 0x00 ; 0 3a3c6: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 3a3c8: bc 01 movw r22, r24 3a3ca: 66 0f add r22, r22 3a3cc: 77 1f adc r23, r23 3a3ce: 68 0f add r22, r24 3a3d0: 79 1f adc r23, r25 3a3d2: 61 5c subi r22, 0xC1 ; 193 3a3d4: 74 45 sbci r23, 0x54 ; 84 3a3d6: 43 e0 ldi r20, 0x03 ; 3 3a3d8: 50 e0 ldi r21, 0x00 ; 0 3a3da: 88 eb ldi r24, 0xB8 ; 184 3a3dc: 93 e0 ldi r25, 0x03 ; 3 3a3de: 0f 94 f5 da call 0x3b5ea ; 0x3b5ea // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 3a3e2: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 3a3e6: 0f 94 d3 1c call 0x239a6 ; 0x239a6 _md->currentValue = mmu2.GetLastReadRegisterValue(); 3a3ea: 80 91 94 13 lds r24, 0x1394 ; 0x801394 3a3ee: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 } MENU_BEGIN(); 3a3f2: 0f 94 da ce call 0x39db4 ; 0x39db4 3a3f6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 3a3fa: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a3fe: 84 30 cpi r24, 0x04 ; 4 3a400: e0 f5 brcc .+120 ; 0x3a47a 3a402: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 3a406: 0f 94 5a cd call 0x39ab4 ; 0x39ab4 3a40a: 88 23 and r24, r24 3a40c: 89 f0 breq .+34 ; 0x3a430 3a40e: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 3a412: 70 e0 ldi r23, 0x00 ; 0 3a414: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 3a418: 0e 94 e6 dd call 0x1bbcc ; 0x1bbcc 3a41c: 10 92 5e 0e sts 0x0E5E, r1 ; 0x800e5e <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.513> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a420: df 91 pop r29 3a422: cf 91 pop r28 3a424: 1f 91 pop r17 3a426: 0f 91 pop r16 3a428: ff 90 pop r15 3a42a: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 3a42c: 0d 94 4e 26 jmp 0x24c9c ; 0x24c9c mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 3a430: 83 ee ldi r24, 0xE3 ; 227 3a432: 95 e6 ldi r25, 0x65 ; 101 3a434: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 3a438: 0f 94 a5 d1 call 0x3a34a ; 0x3a34a MENU_ITEM_EDIT_int3_P( 3a43c: 00 91 ba 03 lds r16, 0x03BA ; 0x8003ba 3a440: 10 e0 ldi r17, 0x00 ; 0 3a442: c0 91 b9 03 lds r28, 0x03B9 ; 0x8003b9 3a446: d0 e0 ldi r29, 0x00 ; 0 3a448: 85 ed ldi r24, 0xD5 ; 213 3a44a: 95 e6 ldi r25, 0x65 ; 101 3a44c: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 3a450: f1 2c mov r15, r1 3a452: e1 2c mov r14, r1 3a454: 9e 01 movw r18, r28 3a456: 48 e0 ldi r20, 0x08 ; 8 3a458: 67 eb ldi r22, 0xB7 ; 183 3a45a: 73 e0 ldi r23, 0x03 ; 3 3a45c: 0f 94 2a cf call 0x39e54 ; 0x39e54 _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 3a460: 0f 94 ae ce call 0x39d5c ; 0x39d5c // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 3a464: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a468: 8f 5f subi r24, 0xFF ; 255 3a46a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 3a46e: 80 91 17 05 lds r24, 0x0517 ; 0x800517 3a472: 8f 5f subi r24, 0xFF ; 255 3a474: 80 93 17 05 sts 0x0517, r24 ; 0x800517 3a478: c0 cf rjmp .-128 ; 0x3a3fa &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a47a: df 91 pop r29 3a47c: cf 91 pop r28 3a47e: 1f 91 pop r17 3a480: 0f 91 pop r16 3a482: ff 90 pop r15 3a484: ef 90 pop r14 3a486: 08 95 ret 0003a488 : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 3a488: 0e 94 32 72 call 0xe464 ; 0xe464 3a48c: 81 11 cpse r24, r1 menu_back(); 3a48e: 0d 94 a2 d1 jmp 0x3a344 ; 0x3a344 } 3a492: 08 95 ret 0003a494 : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 3a494: 8f 92 push r8 3a496: 9f 92 push r9 3a498: af 92 push r10 3a49a: bf 92 push r11 3a49c: ef 92 push r14 3a49e: ff 92 push r15 3a4a0: 0f 93 push r16 3a4a2: 1f 93 push r17 3a4a4: cf 93 push r28 3a4a6: df 93 push r29 3a4a8: cd b7 in r28, 0x3d ; 61 3a4aa: de b7 in r29, 0x3e ; 62 3a4ac: a0 97 sbiw r28, 0x20 ; 32 3a4ae: 0f b6 in r0, 0x3f ; 63 3a4b0: f8 94 cli 3a4b2: de bf out 0x3e, r29 ; 62 3a4b4: 0f be out 0x3f, r0 ; 63 3a4b6: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 3a4b8: 61 15 cp r22, r1 3a4ba: 71 05 cpc r23, r1 3a4bc: 81 05 cpc r24, r1 3a4be: 91 05 cpc r25, r1 3a4c0: 99 f4 brne .+38 ; 0x3a4e8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a4c2: 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)); } 3a4c4: a0 96 adiw r28, 0x20 ; 32 3a4c6: 0f b6 in r0, 0x3f ; 63 3a4c8: f8 94 cli 3a4ca: de bf out 0x3e, r29 ; 62 3a4cc: 0f be out 0x3f, r0 ; 63 3a4ce: cd bf out 0x3d, r28 ; 61 3a4d0: df 91 pop r29 3a4d2: cf 91 pop r28 3a4d4: 1f 91 pop r17 3a4d6: 0f 91 pop r16 3a4d8: ff 90 pop r15 3a4da: ef 90 pop r14 3a4dc: bf 90 pop r11 3a4de: af 90 pop r10 3a4e0: 9f 90 pop r9 3a4e2: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a4e4: 0c 94 42 79 jmp 0xf284 ; 0xf284 // 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; 3a4e8: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3a4ea: 84 2e mov r8, r20 3a4ec: 91 2c mov r9, r1 3a4ee: b1 2c mov r11, r1 3a4f0: a1 2c mov r10, r1 3a4f2: 9e 01 movw r18, r28 3a4f4: 2f 5f subi r18, 0xFF ; 255 3a4f6: 3f 4f sbci r19, 0xFF ; 255 3a4f8: 79 01 movw r14, r18 3a4fa: a5 01 movw r20, r10 3a4fc: 94 01 movw r18, r8 3a4fe: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 3a502: f7 01 movw r30, r14 3a504: e0 0f add r30, r16 3a506: f1 1d adc r31, r1 3a508: 60 83 st Z, r22 n /= base; 3a50a: b9 01 movw r22, r18 3a50c: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3a50e: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 3a510: 61 15 cp r22, r1 3a512: 71 05 cpc r23, r1 3a514: 81 05 cpc r24, r1 3a516: 91 05 cpc r25, r1 3a518: 81 f7 brne .-32 ; 0x3a4fa 3a51a: 0e 0d add r16, r14 3a51c: 1f 2d mov r17, r15 3a51e: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 3a520: e0 16 cp r14, r16 3a522: f1 06 cpc r15, r17 3a524: 59 f0 breq .+22 ; 0x3a53c print((char) (buf[i - 1] < 10 ? 3a526: f8 01 movw r30, r16 3a528: 82 91 ld r24, -Z 3a52a: 8f 01 movw r16, r30 3a52c: 8a 30 cpi r24, 0x0A ; 10 3a52e: 20 f4 brcc .+8 ; 0x3a538 '0' + buf[i - 1] : 3a530: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a532: 0e 94 42 79 call 0xf284 ; 0xf284 3a536: f4 cf rjmp .-24 ; 0x3a520 } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 3a538: 89 5c subi r24, 0xC9 ; 201 3a53a: fb cf rjmp .-10 ; 0x3a532 } 3a53c: a0 96 adiw r28, 0x20 ; 32 3a53e: 0f b6 in r0, 0x3f ; 63 3a540: f8 94 cli 3a542: de bf out 0x3e, r29 ; 62 3a544: 0f be out 0x3f, r0 ; 63 3a546: cd bf out 0x3d, r28 ; 61 3a548: df 91 pop r29 3a54a: cf 91 pop r28 3a54c: 1f 91 pop r17 3a54e: 0f 91 pop r16 3a550: ff 90 pop r15 3a552: ef 90 pop r14 3a554: bf 90 pop r11 3a556: af 90 pop r10 3a558: 9f 90 pop r9 3a55a: 8f 90 pop r8 3a55c: 08 95 ret 0003a55e : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 3a55e: cf 92 push r12 3a560: df 92 push r13 3a562: ef 92 push r14 3a564: ff 92 push r15 3a566: 6b 01 movw r12, r22 3a568: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 3a56a: f7 fe sbrs r15, 7 3a56c: 0b c0 rjmp .+22 ; 0x3a584 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a56e: 8d e2 ldi r24, 0x2D ; 45 3a570: 0e 94 42 79 call 0xf284 ; 0xf284 } else if (base == 10) { if (n < 0) { print('-'); n = -n; 3a574: f0 94 com r15 3a576: e0 94 com r14 3a578: d0 94 com r13 3a57a: c0 94 com r12 3a57c: c1 1c adc r12, r1 3a57e: d1 1c adc r13, r1 3a580: e1 1c adc r14, r1 3a582: f1 1c adc r15, r1 } printNumber(n, 10); 3a584: 4a e0 ldi r20, 0x0A ; 10 3a586: c7 01 movw r24, r14 3a588: b6 01 movw r22, r12 } else { printNumber(n, base); } } 3a58a: ff 90 pop r15 3a58c: ef 90 pop r14 3a58e: df 90 pop r13 3a590: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 3a592: 0d 94 4a d2 jmp 0x3a494 ; 0x3a494 0003a596 : void recover_print(uint8_t automatic) { 3a596: 4f 92 push r4 3a598: 5f 92 push r5 3a59a: 6f 92 push r6 3a59c: 7f 92 push r7 3a59e: 8f 92 push r8 3a5a0: 9f 92 push r9 3a5a2: af 92 push r10 3a5a4: bf 92 push r11 3a5a6: cf 92 push r12 3a5a8: df 92 push r13 3a5aa: ef 92 push r14 3a5ac: ff 92 push r15 3a5ae: 0f 93 push r16 3a5b0: 1f 93 push r17 3a5b2: cf 93 push r28 3a5b4: df 93 push r29 3a5b6: 1f 92 push r1 3a5b8: 1f 92 push r1 3a5ba: cd b7 in r28, 0x3d ; 61 3a5bc: de b7 in r29, 0x3e ; 62 3a5be: a8 2e mov r10, r24 lcd_setstatuspgm(_T(MSG_RECOVERING_PRINT)); 3a5c0: 8a ee ldi r24, 0xEA ; 234 3a5c2: 95 e6 ldi r25, 0x65 ; 101 3a5c4: 0e 94 e1 73 call 0xe7c2 ; 0xe7c2 3a5c8: 0f 94 0c 0b call 0x21618 ; 0x21618 gcode_M114(); } bool recover_machine_state_after_power_panic() { // 1) Preset some dummy values for the XY axes current_position[X_AXIS] = 0; 3a5cc: 10 92 43 07 sts 0x0743, r1 ; 0x800743 3a5d0: 10 92 44 07 sts 0x0744, r1 ; 0x800744 3a5d4: 10 92 45 07 sts 0x0745, r1 ; 0x800745 3a5d8: 10 92 46 07 sts 0x0746, r1 ; 0x800746 current_position[Y_AXIS] = 0; 3a5dc: 10 92 47 07 sts 0x0747, r1 ; 0x800747 3a5e0: 10 92 48 07 sts 0x0748, r1 ; 0x800748 3a5e4: 10 92 49 07 sts 0x0749, r1 ; 0x800749 3a5e8: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a 3a5ec: 9e ea ldi r25, 0xAE ; 174 3a5ee: e9 2e mov r14, r25 3a5f0: 9d e0 ldi r25, 0x0D ; 13 3a5f2: 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; 3a5f4: d1 2c mov r13, r1 for (int8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) { 3a5f6: c1 2c mov r12, r1 uint8_t ix = mesh_point % MESH_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 3a5f8: 27 e0 ldi r18, 0x07 ; 7 3a5fa: b2 2e mov r11, r18 3a5fc: 8c 2d mov r24, r12 3a5fe: 6b 2d mov r22, r11 3a600: 0f 94 16 de call 0x3bc2c ; 0x3bc2c <__divmodqi4> 3a604: 08 2f mov r16, r24 3a606: 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); 3a608: 42 e0 ldi r20, 0x02 ; 2 3a60a: 50 e0 ldi r21, 0x00 ; 0 3a60c: b7 01 movw r22, r14 3a60e: ce 01 movw r24, r28 3a610: 01 96 adiw r24, 0x01 ; 1 3a612: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 if (v != 0) 3a616: 69 81 ldd r22, Y+1 ; 0x01 3a618: 7a 81 ldd r23, Y+2 ; 0x02 3a61a: 61 15 cp r22, r1 3a61c: 71 05 cpc r23, r1 3a61e: 11 f0 breq .+4 ; 0x3a624 mbl_was_active = true; 3a620: dd 24 eor r13, r13 3a622: d3 94 inc r13 mbl.z_values[iy][ix] = float(v) * 0.001f; 3a624: 2b 2d mov r18, r11 3a626: 02 03 mulsu r16, r18 3a628: 80 01 movw r16, r0 3a62a: 11 24 eor r1, r1 3a62c: 09 0d add r16, r9 3a62e: 11 1d adc r17, r1 3a630: 97 fc sbrc r9, 7 3a632: 1a 95 dec r17 3a634: 00 0f add r16, r16 3a636: 11 1f adc r17, r17 3a638: 00 0f add r16, r16 3a63a: 11 1f adc r17, r17 3a63c: 00 56 subi r16, 0x60 ; 96 3a63e: 1c 4e sbci r17, 0xEC ; 236 3a640: 07 2e mov r0, r23 3a642: 00 0c add r0, r0 3a644: 88 0b sbc r24, r24 3a646: 99 0b sbc r25, r25 3a648: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 3a64c: 2f e6 ldi r18, 0x6F ; 111 3a64e: 32 e1 ldi r19, 0x12 ; 18 3a650: 43 e8 ldi r20, 0x83 ; 131 3a652: 5a e3 ldi r21, 0x3A ; 58 3a654: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3a658: f8 01 movw r30, r16 3a65a: 61 83 std Z+1, r22 ; 0x01 3a65c: 72 83 std Z+2, r23 ; 0x02 3a65e: 83 83 std Z+3, r24 ; 0x03 3a660: 94 83 std Z+4, r25 ; 0x04 3a662: f2 e0 ldi r31, 0x02 ; 2 3a664: ef 0e add r14, r31 3a666: f1 1c adc r15, r1 3a668: 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) { 3a66a: 21 e3 ldi r18, 0x31 ; 49 3a66c: c2 12 cpse r12, r18 3a66e: c6 cf rjmp .-116 ; 0x3a5fc 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)); 3a670: 8a ed ldi r24, 0xDA ; 218 3a672: 9e e0 ldi r25, 0x0E ; 14 3a674: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 3a678: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 3a67c: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 3a680: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 3a684: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e // Recover last E axis position current_position[E_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 3a688: 8e e6 ldi r24, 0x6E ; 110 3a68a: 9f e0 ldi r25, 0x0F ; 15 3a68c: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 3a690: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 3a694: 70 93 50 07 sts 0x0750, r23 ; 0x800750 3a698: 80 93 51 07 sts 0x0751, r24 ; 0x800751 3a69c: 90 93 52 07 sts 0x0752, r25 ; 0x800752 // 3) Initialize the logical to physical coordinate system transformation. world2machine_initialize(); 3a6a0: 0f 94 df cb call 0x397be ; 0x397be // 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(); 3a6a4: 0f 94 c9 c6 call 0x38d92 ; 0x38d92 // 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); 3a6a8: 83 e4 ldi r24, 0x43 ; 67 3a6aa: 97 e0 ldi r25, 0x07 ; 7 3a6ac: 0e 94 fe 6c call 0xd9fc ; 0xd9fc set_destination_to_current(); 3a6b0: 0e 94 6f 69 call 0xd2de ; 0xd2de plan_set_position_curposXYZE(); 3a6b4: 0f 94 1d b9 call 0x3723a ; 0x3723a SERIAL_ECHOPGM("recover_machine_state_after_power_panic, initial "); 3a6b8: 88 e9 ldi r24, 0x98 ; 152 3a6ba: 9c ea ldi r25, 0xAC ; 172 3a6bc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 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]); 3a6c0: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 3a6c4: 8f 93 push r24 3a6c6: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 3a6ca: 8f 93 push r24 3a6cc: 80 91 4c 07 lds r24, 0x074C ; 0x80074c 3a6d0: 8f 93 push r24 3a6d2: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 3a6d6: 8f 93 push r24 3a6d8: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3a6dc: 8f 93 push r24 3a6de: 80 91 49 07 lds r24, 0x0749 ; 0x800749 3a6e2: 8f 93 push r24 3a6e4: 80 91 48 07 lds r24, 0x0748 ; 0x800748 3a6e8: 8f 93 push r24 3a6ea: 80 91 47 07 lds r24, 0x0747 ; 0x800747 3a6ee: 8f 93 push r24 3a6f0: 80 91 46 07 lds r24, 0x0746 ; 0x800746 3a6f4: 8f 93 push r24 3a6f6: 80 91 45 07 lds r24, 0x0745 ; 0x800745 3a6fa: 8f 93 push r24 3a6fc: 80 91 44 07 lds r24, 0x0744 ; 0x800744 3a700: 8f 93 push r24 3a702: 80 91 43 07 lds r24, 0x0743 ; 0x800743 3a706: 8f 93 push r24 3a708: 8b e1 ldi r24, 0x1B ; 27 3a70a: 92 e7 ldi r25, 0x72 ; 114 3a70c: 9f 93 push r25 3a70e: 8f 93 push r24 3a710: 0f 94 1d dc call 0x3b83a ; 0x3b83a print_world_coordinates(); // 6) Power up the Z motors, mark their positions as known. axis_known_position[Z_AXIS] = true; 3a714: 81 e0 ldi r24, 0x01 ; 1 3a716: 80 93 42 07 sts 0x0742, r24 ; 0x800742 enable_z(); 3a71a: 15 98 cbi 0x02, 5 ; 2 // 7) Recover the target temperatures. target_temperature[active_extruder] = eeprom_read_word((uint16_t*)EEPROM_UVLO_TARGET_HOTEND); 3a71c: 88 ed ldi r24, 0xD8 ; 216 3a71e: 9e e0 ldi r25, 0x0E ; 14 3a720: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 3a724: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e 3a728: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d target_temperature_bed = eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED); 3a72c: 8b e8 ldi r24, 0x8B ; 139 3a72e: 9f e0 ldi r25, 0x0F ; 15 3a730: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 3a734: 90 e0 ldi r25, 0x00 ; 0 3a736: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c 3a73a: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b // 8) Recover extruder multipilers extruder_multiplier[0] = eeprom_read_float((float*)(EEPROM_EXTRUDER_MULTIPLIER_0)); 3a73e: 88 ee ldi r24, 0xE8 ; 232 3a740: 9e e0 ldi r25, 0x0E ; 14 3a742: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 3a746: 60 93 bb 02 sts 0x02BB, r22 ; 0x8002bb 3a74a: 70 93 bc 02 sts 0x02BC, r23 ; 0x8002bc 3a74e: 80 93 bd 02 sts 0x02BD, r24 ; 0x8002bd 3a752: 90 93 be 02 sts 0x02BE, r25 ; 0x8002be extrudemultiply = (int)eeprom_read_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY)); 3a756: 8e ed ldi r24, 0xDE ; 222 3a758: 9e e0 ldi r25, 0x0E ; 14 3a75a: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 3a75e: 90 93 95 02 sts 0x0295, r25 ; 0x800295 3a762: 80 93 94 02 sts 0x0294, r24 ; 0x800294 // 9) Recover the saved target eeprom_read_block(saved_start_position, (float *)EEPROM_UVLO_SAVED_START_POSITION, sizeof(saved_start_position)); 3a766: 40 e1 ldi r20, 0x10 ; 16 3a768: 50 e0 ldi r21, 0x00 ; 0 3a76a: 67 e3 ldi r22, 0x37 ; 55 3a76c: 7d e0 ldi r23, 0x0D ; 13 3a76e: 8b ea ldi r24, 0xAB ; 171 3a770: 92 e0 ldi r25, 0x02 ; 2 3a772: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 saved_segment_idx = eeprom_read_word((uint16_t*)EEPROM_UVLO_SAVED_SEGMENT_IDX); 3a776: 8c e6 ldi r24, 0x6C ; 108 3a778: 9f e0 ldi r25, 0x0F ; 15 3a77a: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 3a77e: 90 93 0c 18 sts 0x180C, r25 ; 0x80180c 3a782: 80 93 0b 18 sts 0x180B, r24 ; 0x80180b #ifdef LIN_ADVANCE extruder_advance_K = eeprom_read_float((float*)EEPROM_UVLO_LA_K); 3a786: 8c e2 ldi r24, 0x2C ; 44 3a788: 9d e0 ldi r25, 0x0D ; 13 3a78a: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 3a78e: 60 93 07 18 sts 0x1807, r22 ; 0x801807 3a792: 70 93 08 18 sts 0x1808, r23 ; 0x801808 3a796: 80 93 09 18 sts 0x1809, r24 ; 0x801809 3a79a: 90 93 0a 18 sts 0x180A, r25 ; 0x80180a #endif #ifdef PREVENT_DANGEROUS_EXTRUDE extrude_min_temp = eeprom_read_word((uint16_t*)EEPROM_UVLO_EXTRUDE_MINTEMP); 3a79e: 8d e7 ldi r24, 0x7D ; 125 3a7a0: 9c e0 ldi r25, 0x0C ; 12 3a7a2: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 3a7a6: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 3a7aa: 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)); 3a7ae: 40 e1 ldi r20, 0x10 ; 16 3a7b0: 50 e0 ldi r21, 0x00 ; 0 3a7b2: 6d e6 ldi r22, 0x6D ; 109 3a7b4: 7c e0 ldi r23, 0x0C ; 12 3a7b6: 82 e9 ldi r24, 0x92 ; 146 3a7b8: 96 e0 ldi r25, 0x06 ; 6 3a7ba: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 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)); 3a7be: 40 e1 ldi r20, 0x10 ; 16 3a7c0: 50 e0 ldi r21, 0x00 ; 0 3a7c2: 6d e5 ldi r22, 0x5D ; 93 3a7c4: 7c e0 ldi r23, 0x0C ; 12 3a7c6: 8a e1 ldi r24, 0x1A ; 26 3a7c8: 97 e0 ldi r25, 0x07 ; 7 3a7ca: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 eeprom_read_block(cs.max_feedrate_normal, (float *)EEPROM_UVLO_MAX_FEEDRATE_NORMAL, sizeof(cs.max_feedrate_normal)); 3a7ce: 40 e1 ldi r20, 0x10 ; 16 3a7d0: 50 e0 ldi r21, 0x00 ; 0 3a7d2: 6d e4 ldi r22, 0x4D ; 77 3a7d4: 7c e0 ldi r23, 0x0C ; 12 3a7d6: 82 e8 ldi r24, 0x82 ; 130 3a7d8: 96 e0 ldi r25, 0x06 ; 6 3a7da: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 eeprom_read_block(cs.max_feedrate_silent, (float *)EEPROM_UVLO_MAX_FEEDRATE_SILENT, sizeof(cs.max_feedrate_silent)); 3a7de: 40 e1 ldi r20, 0x10 ; 16 3a7e0: 50 e0 ldi r21, 0x00 ; 0 3a7e2: 6d e3 ldi r22, 0x3D ; 61 3a7e4: 7c e0 ldi r23, 0x0C ; 12 3a7e6: 8a e0 ldi r24, 0x0A ; 10 3a7e8: 97 e0 ldi r25, 0x07 ; 7 3a7ea: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 cs.minimumfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_FEEDRATE); 3a7ee: 89 e3 ldi r24, 0x39 ; 57 3a7f0: 9c e0 ldi r25, 0x0C ; 12 3a7f2: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 3a7f6: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 3a7fa: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 3a7fe: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 3a802: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad cs.mintravelfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_TRAVEL_FEEDRATE); 3a806: 85 e3 ldi r24, 0x35 ; 53 3a808: 9c e0 ldi r25, 0x0C ; 12 3a80a: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 3a80e: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 3a812: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 3a816: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 3a81a: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 cs.min_segment_time_us = eeprom_read_dword((uint32_t *)EEPROM_UVLO_MIN_SEGMENT_TIME_US); 3a81e: 81 e3 ldi r24, 0x31 ; 49 3a820: 9c e0 ldi r25, 0x0C ; 12 3a822: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 3a826: 60 93 b2 06 sts 0x06B2, r22 ; 0x8006b2 3a82a: 70 93 b3 06 sts 0x06B3, r23 ; 0x8006b3 3a82e: 80 93 b4 06 sts 0x06B4, r24 ; 0x8006b4 3a832: 90 93 b5 06 sts 0x06B5, r25 ; 0x8006b5 eeprom_read_block(cs.max_jerk, (float *)EEPROM_UVLO_MAX_JERK, sizeof(cs.max_jerk)); 3a836: 40 e1 ldi r20, 0x10 ; 16 3a838: 50 e0 ldi r21, 0x00 ; 0 3a83a: 61 e2 ldi r22, 0x21 ; 33 3a83c: 7c e0 ldi r23, 0x0C ; 12 3a83e: 86 eb ldi r24, 0xB6 ; 182 3a840: 96 e0 ldi r25, 0x06 ; 6 3a842: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 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 ) { 3a846: 8f e7 ldi r24, 0x7F ; 127 3a848: 9c e0 ldi r25, 0x0C ; 12 3a84a: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 3a84e: 0f b6 in r0, 0x3f ; 63 3a850: f8 94 cli 3a852: de bf out 0x3e, r29 ; 62 3a854: 0f be out 0x3f, r0 ; 63 3a856: cd bf out 0x3d, r28 ; 61 3a858: 81 30 cpi r24, 0x01 ; 1 3a85a: b1 f4 brne .+44 ; 0x3a888 current_position[Z_AXIS] += Z_PAUSE_LIFT; 3a85c: 20 e0 ldi r18, 0x00 ; 0 3a85e: 30 e0 ldi r19, 0x00 ; 0 3a860: 40 ea ldi r20, 0xA0 ; 160 3a862: 51 e4 ldi r21, 0x41 ; 65 3a864: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 3a868: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 3a86c: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 3a870: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 3a874: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3a878: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 3a87c: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 3a880: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 3a884: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e } // 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) { 3a888: 8f e7 ldi r24, 0x7F ; 127 3a88a: 9c e0 ldi r25, 0x0C ; 12 3a88c: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 3a890: 81 11 cpse r24, r1 3a892: 23 c0 rjmp .+70 ; 0x3a8da enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + Z_PAUSE_LIFT); 3a894: 20 e0 ldi r18, 0x00 ; 0 3a896: 30 e0 ldi r19, 0x00 ; 0 3a898: 40 ea ldi r20, 0xA0 ; 160 3a89a: 51 e4 ldi r21, 0x41 ; 65 3a89c: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 3a8a0: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 3a8a4: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 3a8a8: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 3a8ac: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3a8b0: 9f 93 push r25 3a8b2: 8f 93 push r24 3a8b4: 7f 93 push r23 3a8b6: 6f 93 push r22 3a8b8: 8d e9 ldi r24, 0x9D ; 157 3a8ba: 9d ea ldi r25, 0xAD ; 173 3a8bc: 9f 93 push r25 3a8be: 8f 93 push r24 3a8c0: 0e 94 61 8a call 0x114c2 ; 0x114c2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 3a8c4: 61 e0 ldi r22, 0x01 ; 1 3a8c6: 8f e7 ldi r24, 0x7F ; 127 3a8c8: 9c e0 ldi r25, 0x0C ; 12 3a8ca: 0f 94 7f dd call 0x3bafe ; 0x3bafe 3a8ce: 0f 90 pop r0 3a8d0: 0f 90 pop r0 3a8d2: 0f 90 pop r0 3a8d4: 0f 90 pop r0 3a8d6: 0f 90 pop r0 3a8d8: 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")); 3a8da: 61 e0 ldi r22, 0x01 ; 1 3a8dc: 85 e9 ldi r24, 0x95 ; 149 3a8de: 9d ea ldi r25, 0xAD ; 173 3a8e0: 0e 94 cb 89 call 0x11396 ; 0x11396 // Set the target bed and nozzle temperatures and wait. enquecommandf_P(PSTR("M104 S%d"), target_temperature[active_extruder]); 3a8e4: 80 91 6e 0e lds r24, 0x0E6E ; 0x800e6e 3a8e8: 8f 93 push r24 3a8ea: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 3a8ee: 8f 93 push r24 3a8f0: 8c e8 ldi r24, 0x8C ; 140 3a8f2: 9d ea ldi r25, 0xAD ; 173 3a8f4: 9f 93 push r25 3a8f6: 8f 93 push r24 3a8f8: 0e 94 61 8a call 0x114c2 ; 0x114c2 enquecommandf_P(PSTR("M140 S%d"), target_temperature_bed); 3a8fc: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 3a900: 8f 93 push r24 3a902: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 3a906: 8f 93 push r24 3a908: 83 e8 ldi r24, 0x83 ; 131 3a90a: 9d ea ldi r25, 0xAD ; 173 3a90c: 9f 93 push r25 3a90e: 8f 93 push r24 3a910: 0e 94 61 8a call 0x114c2 ; 0x114c2 //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) { 3a914: 8c e8 ldi r24, 0x8C ; 140 3a916: 9f e0 ldi r25, 0x0F ; 15 3a918: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 3a91c: 0f b6 in r0, 0x3f ; 63 3a91e: f8 94 cli 3a920: de bf out 0x3e, r29 ; 62 3a922: 0f be out 0x3f, r0 ; 63 3a924: cd bf out 0x3d, r28 ; 61 3a926: 81 11 cpse r24, r1 3a928: 10 c0 rjmp .+32 ; 0x3a94a enquecommandf_P(PSTR("M109 S%d"), target_temperature[active_extruder]); 3a92a: 80 91 6e 0e lds r24, 0x0E6E ; 0x800e6e 3a92e: 8f 93 push r24 3a930: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 3a934: 8f 93 push r24 3a936: 8a e7 ldi r24, 0x7A ; 122 3a938: 9d ea ldi r25, 0xAD ; 173 3a93a: 9f 93 push r25 3a93c: 8f 93 push r24 3a93e: 0e 94 61 8a call 0x114c2 ; 0x114c2 3a942: 0f 90 pop r0 3a944: 0f 90 pop r0 3a946: 0f 90 pop r0 3a948: 0f 90 pop r0 } enquecommand_P(MSG_M83); //E axis relative mode 3a94a: 61 e0 ldi r22, 0x01 ; 1 3a94c: 81 ec ldi r24, 0xC1 ; 193 3a94e: 9c e6 ldi r25, 0x6C ; 108 3a950: 0e 94 cb 89 call 0x11396 ; 0x11396 // If not automatically recoreverd (long power loss) if(automatic == 0){ 3a954: a1 10 cpse r10, r1 3a956: 17 c0 rjmp .+46 ; 0x3a986 //Extrude some filament to stabilize the pressure enquecommand_P(PSTR("G1 E5 F120")); 3a958: 61 e0 ldi r22, 0x01 ; 1 3a95a: 8f e6 ldi r24, 0x6F ; 111 3a95c: 9d ea ldi r25, 0xAD ; 173 3a95e: 0e 94 cb 89 call 0x11396 ; 0x11396 // Retract to be consistent with a short pause enquecommandf_P(G1_E_F2700, default_retraction); 3a962: 8f e3 ldi r24, 0x3F ; 63 3a964: 8f 93 push r24 3a966: 80 e8 ldi r24, 0x80 ; 128 3a968: 8f 93 push r24 3a96a: 1f 92 push r1 3a96c: 1f 92 push r1 3a96e: 86 e7 ldi r24, 0x76 ; 118 3a970: 92 e7 ldi r25, 0x72 ; 114 3a972: 9f 93 push r25 3a974: 8f 93 push r24 3a976: 0e 94 61 8a call 0x114c2 ; 0x114c2 3a97a: 0f 90 pop r0 3a97c: 0f 90 pop r0 3a97e: 0f 90 pop r0 3a980: 0f 90 pop r0 3a982: 0f 90 pop r0 3a984: 0f 90 pop r0 } puts_P(_N("Temperature Restored\n")); 3a986: 80 e6 ldi r24, 0x60 ; 96 3a988: 92 e7 ldi r25, 0x72 ; 114 3a98a: 0f 94 44 dc call 0x3b888 ; 0x3b888 gcode_M114(); 3a98e: 0e 94 52 7a call 0xf4a4 ; 0xf4a4 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); 3a992: 88 e8 ldi r24, 0x88 ; 136 3a994: 9f e0 ldi r25, 0x0F ; 15 3a996: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 3a99a: 88 2e mov r8, r24 feedrate_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDRATE); 3a99c: 89 e8 ldi r24, 0x89 ; 137 3a99e: 9f e0 ldi r25, 0x0F ; 15 3a9a0: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 3a9a4: 8c 01 movw r16, r24 feedmultiply_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDMULTIPLY); 3a9a6: 85 e3 ldi r24, 0x35 ; 53 3a9a8: 9d e0 ldi r25, 0x0D ; 13 3a9aa: 0f 94 69 dd call 0x3bad2 ; 0x3bad2 3a9ae: f8 2e mov r15, r24 3a9b0: e9 2e mov r14, r25 SERIAL_ECHOPGM("Feedrate:"); 3a9b2: 85 e6 ldi r24, 0x65 ; 101 3a9b4: 9d ea ldi r25, 0xAD ; 173 3a9b6: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3a9ba: b8 01 movw r22, r16 3a9bc: 01 2e mov r0, r17 3a9be: 00 0c add r0, r0 3a9c0: 88 0b sbc r24, r24 3a9c2: 99 0b sbc r25, r25 3a9c4: 0f 94 af d2 call 0x3a55e ; 0x3a55e MYSERIAL.print(feedrate_rec); SERIAL_ECHOPGM(", feedmultiply:"); 3a9c8: 85 e5 ldi r24, 0x55 ; 85 3a9ca: 9d ea ldi r25, 0xAD ; 173 3a9cc: 0e 94 5b 79 call 0xf2b6 ; 0xf2b6 MYSERIAL.println(feedmultiply_rec); 3a9d0: 8f 2d mov r24, r15 3a9d2: 9e 2d mov r25, r14 3a9d4: 0f 94 e0 75 call 0x2ebc0 ; 0x2ebc0 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 3a9d8: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 3a9dc: 81 11 cpse r24, r1 3a9de: 02 c0 rjmp .+4 ; 0x3a9e4 { // M23 restore_file_from_sd(); 3a9e0: 0e 94 86 8a call 0x1150c ; 0x1150c } // 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)); 3a9e4: 8d e9 ldi r24, 0x9D ; 157 3a9e6: 9f e0 ldi r25, 0x0F ; 15 3a9e8: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 3a9ec: c6 2e mov r12, r22 3a9ee: b7 2e mov r11, r23 3a9f0: a8 2e mov r10, r24 3a9f2: 99 2e mov r9, r25 float pos_y = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 4)); 3a9f4: 81 ea ldi r24, 0xA1 ; 161 3a9f6: 9f e0 ldi r25, 0x0F ; 15 3a9f8: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 3a9fc: 76 2e mov r7, r22 3a9fe: 67 2e mov r6, r23 3aa00: 58 2e mov r5, r24 3aa02: 49 2e mov r4, r25 if (pos_x != X_COORD_INVALID) { 3aa04: 20 e0 ldi r18, 0x00 ; 0 3aa06: 30 e0 ldi r19, 0x00 ; 0 3aa08: 40 e8 ldi r20, 0x80 ; 128 3aa0a: 5f eb ldi r21, 0xBF ; 191 3aa0c: 6c 2d mov r22, r12 3aa0e: 7b 2d mov r23, r11 3aa10: 8a 2d mov r24, r10 3aa12: 99 2d mov r25, r9 3aa14: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 3aa18: 88 23 and r24, r24 3aa1a: 99 f0 breq .+38 ; 0x3aa42 enquecommandf_P(PSTR("G1 X%-.3f Y%-.3f F3000"), pos_x, pos_y); 3aa1c: 4f 92 push r4 3aa1e: 5f 92 push r5 3aa20: 6f 92 push r6 3aa22: 7f 92 push r7 3aa24: 9f 92 push r9 3aa26: af 92 push r10 3aa28: bf 92 push r11 3aa2a: cf 92 push r12 3aa2c: 8e e3 ldi r24, 0x3E ; 62 3aa2e: 9d ea ldi r25, 0xAD ; 173 3aa30: 9f 93 push r25 3aa32: 8f 93 push r24 3aa34: 0e 94 61 8a call 0x114c2 ; 0x114c2 3aa38: 0f b6 in r0, 0x3f ; 63 3aa3a: f8 94 cli 3aa3c: de bf out 0x3e, r29 ; 62 3aa3e: 0f be out 0x3f, r0 ; 63 3aa40: cd bf out 0x3d, r28 ; 61 } // Enable MBL and switch to logical positioning if (mbl_was_active) 3aa42: dd 20 and r13, r13 3aa44: 29 f0 breq .+10 ; 0x3aa50 enquecommand_P(PSTR("PRUSA MBL V1")); 3aa46: 61 e0 ldi r22, 0x01 ; 1 3aa48: 81 e3 ldi r24, 0x31 ; 49 3aa4a: 9d ea ldi r25, 0xAD ; 173 3aa4c: 0e 94 cb 89 call 0x11396 ; 0x11396 // 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))); 3aa50: 8d e8 ldi r24, 0x8D ; 141 3aa52: 9f e0 ldi r25, 0x0F ; 15 3aa54: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 3aa58: 9f 93 push r25 3aa5a: 8f 93 push r24 3aa5c: 7f 93 push r23 3aa5e: 6f 93 push r22 3aa60: 87 e2 ldi r24, 0x27 ; 39 3aa62: 9d ea ldi r25, 0xAD ; 173 3aa64: 9f 93 push r25 3aa66: 8f 93 push r24 3aa68: 0e 94 61 8a call 0x114c2 ; 0x114c2 // Restore acceleration settings float acceleration = eeprom_read_float((float*)(EEPROM_UVLO_ACCELL)); 3aa6c: 81 e1 ldi r24, 0x11 ; 17 3aa6e: 9d e0 ldi r25, 0x0D ; 13 3aa70: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 3aa74: d6 2e mov r13, r22 3aa76: c7 2e mov r12, r23 3aa78: b8 2e mov r11, r24 3aa7a: a9 2e mov r10, r25 float retract_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_RETRACT_ACCELL)); 3aa7c: 8d e0 ldi r24, 0x0D ; 13 3aa7e: 9d e0 ldi r25, 0x0D ; 13 3aa80: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 3aa84: 96 2e mov r9, r22 3aa86: 77 2e mov r7, r23 3aa88: 68 2e mov r6, r24 3aa8a: 59 2e mov r5, r25 float travel_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL)); 3aa8c: 89 e0 ldi r24, 0x09 ; 9 3aa8e: 9d e0 ldi r25, 0x0D ; 13 3aa90: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 // 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); 3aa94: 9f 93 push r25 3aa96: 8f 93 push r24 3aa98: 7f 93 push r23 3aa9a: 6f 93 push r22 3aa9c: 5f 92 push r5 3aa9e: 6f 92 push r6 3aaa0: 7f 92 push r7 3aaa2: 9f 92 push r9 3aaa4: af 92 push r10 3aaa6: bf 92 push r11 3aaa8: cf 92 push r12 3aaaa: df 92 push r13 3aaac: 8d e0 ldi r24, 0x0D ; 13 3aaae: 9d ea ldi r25, 0xAD ; 173 3aab0: 9f 93 push r25 3aab2: 8f 93 push r24 3aab4: 0e 94 61 8a call 0x114c2 ; 0x114c2 // Unretract. enquecommandf_P(G1_E_F2700, default_retraction); 3aab8: 8f e3 ldi r24, 0x3F ; 63 3aaba: 8f 93 push r24 3aabc: 80 e8 ldi r24, 0x80 ; 128 3aabe: 8f 93 push r24 3aac0: 1f 92 push r1 3aac2: 1f 92 push r1 3aac4: 86 e7 ldi r24, 0x76 ; 118 3aac6: 92 e7 ldi r25, 0x72 ; 114 3aac8: 9f 93 push r25 3aaca: 8f 93 push r24 3aacc: 0e 94 61 8a call 0x114c2 ; 0x114c2 // Recover final E axis position and mode float pos_e = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 3aad0: 8e e6 ldi r24, 0x6E ; 110 3aad2: 9f e0 ldi r25, 0x0F ; 15 3aad4: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 enquecommandf_P(PSTR("G92 E%-.3f"), pos_e); 3aad8: 9f 93 push r25 3aada: 8f 93 push r24 3aadc: 7f 93 push r23 3aade: 6f 93 push r22 3aae0: 82 e0 ldi r24, 0x02 ; 2 3aae2: 9d ea ldi r25, 0xAD ; 173 3aae4: 9f 93 push r25 3aae6: 8f 93 push r24 3aae8: 0e 94 61 8a call 0x114c2 ; 0x114c2 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS)) 3aaec: 0f b6 in r0, 0x3f ; 63 3aaee: f8 94 cli 3aaf0: de bf out 0x3e, r29 ; 62 3aaf2: 0f be out 0x3f, r0 ; 63 3aaf4: cd bf out 0x3d, r28 ; 61 3aaf6: 82 e7 ldi r24, 0x72 ; 114 3aaf8: 9f e0 ldi r25, 0x0F ; 15 3aafa: 0f 94 5b dd call 0x3bab6 ; 0x3bab6 3aafe: 88 23 and r24, r24 3ab00: 29 f0 breq .+10 ; 0x3ab0c enquecommand_P(PSTR("M82")); //E axis abslute mode 3ab02: 61 e0 ldi r22, 0x01 ; 1 3ab04: 8e ef ldi r24, 0xFE ; 254 3ab06: 9c ea ldi r25, 0xAC ; 172 3ab08: 0e 94 cb 89 call 0x11396 ; 0x11396 // Set the feedrates saved at the power panic. enquecommandf_P(PSTR("G1 F%d"), feedrate_rec); 3ab0c: 1f 93 push r17 3ab0e: 0f 93 push r16 3ab10: 87 ef ldi r24, 0xF7 ; 247 3ab12: 9c ea ldi r25, 0xAC ; 172 3ab14: 9f 93 push r25 3ab16: 8f 93 push r24 3ab18: 0e 94 61 8a call 0x114c2 ; 0x114c2 enquecommandf_P(MSG_M220, feedmultiply_rec); 3ab1c: ef 92 push r14 3ab1e: ff 92 push r15 3ab20: 82 e4 ldi r24, 0x42 ; 66 3ab22: 92 e7 ldi r25, 0x72 ; 114 3ab24: 9f 93 push r25 3ab26: 8f 93 push r24 3ab28: 0e 94 61 8a call 0x114c2 ; 0x114c2 // Set the fan speed saved at the power panic. enquecommandf_P(PSTR("M106 S%u"), fan_speed_rec); 3ab2c: 1f 92 push r1 3ab2e: 8f 92 push r8 3ab30: 8e ee ldi r24, 0xEE ; 238 3ab32: 9c ea ldi r25, 0xAC ; 172 3ab34: 9f 93 push r25 3ab36: 8f 93 push r24 3ab38: 0e 94 61 8a call 0x114c2 ; 0x114c2 // SD: Position in file, USB: g-code line number uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION)); 3ab3c: 81 e9 ldi r24, 0x91 ; 145 3ab3e: 9f e0 ldi r25, 0x0F ; 15 3ab40: 0f 94 63 dd call 0x3bac6 ; 0x3bac6 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 3ab44: 20 91 6a 02 lds r18, 0x026A ; 0x80026a 3ab48: 0f b6 in r0, 0x3f ; 63 3ab4a: f8 94 cli 3ab4c: de bf out 0x3e, r29 ; 62 3ab4e: 0f be out 0x3f, r0 ; 63 3ab50: cd bf out 0x3d, r28 ; 61 3ab52: 21 11 cpse r18, r1 3ab54: 33 c0 rjmp .+102 ; 0x3abbc { // Set a position in the file. enquecommandf_P(PSTR("M26 S%lu"), position); 3ab56: 9f 93 push r25 3ab58: 8f 93 push r24 3ab5a: 7f 93 push r23 3ab5c: 6f 93 push r22 3ab5e: 85 ee ldi r24, 0xE5 ; 229 3ab60: 9c ea ldi r25, 0xAC ; 172 } else if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 3ab62: 9f 93 push r25 3ab64: 8f 93 push r24 3ab66: 0e 94 61 8a call 0x114c2 ; 0x114c2 3ab6a: 0f 90 pop r0 3ab6c: 0f 90 pop r0 3ab6e: 0f 90 pop r0 3ab70: 0f 90 pop r0 3ab72: 0f 90 pop r0 3ab74: 0f 90 pop r0 } enquecommand_P(PSTR("G4 S0")); 3ab76: 61 e0 ldi r22, 0x01 ; 1 3ab78: 85 ed ldi r24, 0xD5 ; 213 3ab7a: 9c ea ldi r25, 0xAC ; 172 3ab7c: 0e 94 cb 89 call 0x11396 ; 0x11396 enquecommand_P(PSTR("PRUSA uvlo")); 3ab80: 61 e0 ldi r22, 0x01 ; 1 3ab82: 8a ec ldi r24, 0xCA ; 202 3ab84: 9c ea ldi r25, 0xAC ; 172 3ab86: 0e 94 cb 89 call 0x11396 ; 0x11396 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")); 3ab8a: 8b e4 ldi r24, 0x4B ; 75 3ab8c: 92 e7 ldi r25, 0x72 ; 114 3ab8e: 0f 94 44 dc call 0x3b888 ; 0x3b888 gcode_M114(); 3ab92: 0e 94 52 7a call 0xf4a4 ; 0xf4a4 } 3ab96: 0f 90 pop r0 3ab98: 0f 90 pop r0 3ab9a: df 91 pop r29 3ab9c: cf 91 pop r28 3ab9e: 1f 91 pop r17 3aba0: 0f 91 pop r16 3aba2: ff 90 pop r15 3aba4: ef 90 pop r14 3aba6: df 90 pop r13 3aba8: cf 90 pop r12 3abaa: bf 90 pop r11 3abac: af 90 pop r10 3abae: 9f 90 pop r9 3abb0: 8f 90 pop r8 3abb2: 7f 90 pop r7 3abb4: 6f 90 pop r6 3abb6: 5f 90 pop r5 3abb8: 4f 90 pop r4 3abba: 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) 3abbc: 21 30 cpi r18, 0x01 ; 1 3abbe: d9 f6 brne .-74 ; 0x3ab76 { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 3abc0: 9f 93 push r25 3abc2: 8f 93 push r24 3abc4: 7f 93 push r23 3abc6: 6f 93 push r22 3abc8: 8b ed ldi r24, 0xDB ; 219 3abca: 9c ea ldi r25, 0xAC ; 172 3abcc: ca cf rjmp .-108 ; 0x3ab62 0003abce : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 3abce: 8f 92 push r8 3abd0: 9f 92 push r9 3abd2: af 92 push r10 3abd4: bf 92 push r11 3abd6: cf 92 push r12 3abd8: df 92 push r13 3abda: ef 92 push r14 3abdc: ff 92 push r15 3abde: cf 93 push r28 3abe0: 6b 01 movw r12, r22 3abe2: 7c 01 movw r14, r24 3abe4: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 3abe6: 20 e0 ldi r18, 0x00 ; 0 3abe8: 30 e0 ldi r19, 0x00 ; 0 3abea: a9 01 movw r20, r18 3abec: 0f 94 78 df call 0x3bef0 ; 0x3bef0 <__cmpsf2> 3abf0: 87 ff sbrs r24, 7 3abf2: 07 c0 rjmp .+14 ; 0x3ac02 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3abf4: 8d e2 ldi r24, 0x2D ; 45 3abf6: 0e 94 42 79 call 0xf284 ; 0xf284 { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 3abfa: f7 fa bst r15, 7 3abfc: f0 94 com r15 3abfe: f7 f8 bld r15, 7 3ac00: 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; 3ac10: 20 e0 ldi r18, 0x00 ; 0 3ac12: 30 e0 ldi r19, 0x00 ; 0 3ac14: 40 e2 ldi r20, 0x20 ; 32 3ac16: 51 e4 ldi r21, 0x41 ; 65 3ac18: 0f 94 82 df call 0x3bf04 ; 0x3bf04 <__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; 3ac20: 9b 01 movw r18, r22 3ac22: ac 01 movw r20, r24 3ac24: c7 01 movw r24, r14 3ac26: b6 01 movw r22, r12 3ac28: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3ac2c: 6b 01 movw r12, r22 3ac2e: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 3ac30: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 3ac34: 4b 01 movw r8, r22 3ac36: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3ac38: 4a e0 ldi r20, 0x0A ; 10 3ac3a: 0f 94 4a d2 call 0x3a494 ; 0x3a494 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) 3ac3e: cc 23 and r28, r28 3ac40: 91 f1 breq .+100 ; 0x3aca6 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; 3ac42: c5 01 movw r24, r10 3ac44: b4 01 movw r22, r8 3ac46: 0f 94 e7 d7 call 0x3afce ; 0x3afce <__floatunsisf> 3ac4a: 9b 01 movw r18, r22 3ac4c: ac 01 movw r20, r24 3ac4e: c7 01 movw r24, r14 3ac50: b6 01 movw r22, r12 3ac52: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 3ac56: 6b 01 movw r12, r22 3ac58: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ac5a: 8e e2 ldi r24, 0x2E ; 46 3ac5c: 0e 94 42 79 call 0xf284 ; 0xf284 // 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) 3ac60: c1 50 subi r28, 0x01 ; 1 3ac62: 08 f1 brcs .+66 ; 0x3aca6 { remainder *= 10.0; 3ac64: 20 e0 ldi r18, 0x00 ; 0 3ac66: 30 e0 ldi r19, 0x00 ; 0 3ac68: 40 e2 ldi r20, 0x20 ; 32 3ac6a: 51 e4 ldi r21, 0x41 ; 65 3ac6c: c7 01 movw r24, r14 3ac6e: b6 01 movw r22, r12 3ac70: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3ac74: 4b 01 movw r8, r22 3ac76: 5c 01 movw r10, r24 int toPrint = int(remainder); 3ac78: 0f 94 f4 df call 0x3bfe8 ; 0x3bfe8 <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3ac7c: 6b 01 movw r12, r22 3ac7e: 77 0f add r23, r23 3ac80: ee 08 sbc r14, r14 3ac82: ff 08 sbc r15, r15 3ac84: c7 01 movw r24, r14 3ac86: b6 01 movw r22, r12 3ac88: 0f 94 af d2 call 0x3a55e ; 0x3a55e while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 3ac8c: c7 01 movw r24, r14 3ac8e: b6 01 movw r22, r12 3ac90: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 3ac94: 9b 01 movw r18, r22 3ac96: ac 01 movw r20, r24 3ac98: c5 01 movw r24, r10 3ac9a: b4 01 movw r22, r8 3ac9c: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__subsf3> 3aca0: 6b 01 movw r12, r22 3aca2: 7c 01 movw r14, r24 3aca4: dd cf rjmp .-70 ; 0x3ac60 } } 3aca6: cf 91 pop r28 3aca8: ff 90 pop r15 3acaa: ef 90 pop r14 3acac: df 90 pop r13 3acae: cf 90 pop r12 3acb0: bf 90 pop r11 3acb2: af 90 pop r10 3acb4: 9f 90 pop r9 3acb6: 8f 90 pop r8 3acb8: 08 95 ret 0003acba : } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3acba: 8a e0 ldi r24, 0x0A ; 10 3acbc: 0c 94 42 79 jmp 0xf284 ; 0xf284 0003acc0 : 3acc0: 0e 94 bf 89 call 0x1137e ; 0x1137e }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 3acc4: 0d 94 5d d6 jmp 0x3acba ; 0x3acba 0003acc8 : } 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) { 3acc8: 20 91 95 04 lds r18, 0x0495 ; 0x800495 3accc: 30 91 96 04 lds r19, 0x0496 ; 0x800496 3acd0: 80 91 93 04 lds r24, 0x0493 ; 0x800493 3acd4: 90 91 94 04 lds r25, 0x0494 ; 0x800494 3acd8: 82 17 cp r24, r18 3acda: 93 07 cpc r25, r19 3acdc: 71 f0 breq .+28 ; 0x3acfa return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; 3acde: f9 01 movw r30, r18 3ace0: ed 5e subi r30, 0xED ; 237 3ace2: fb 4f sbci r31, 0xFB ; 251 3ace4: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; 3ace6: 2f 5f subi r18, 0xFF ; 255 3ace8: 3f 4f sbci r19, 0xFF ; 255 3acea: 2f 77 andi r18, 0x7F ; 127 3acec: 33 27 eor r19, r19 3acee: 30 93 96 04 sts 0x0496, r19 ; 0x800496 3acf2: 20 93 95 04 sts 0x0495, r18 ; 0x800495 return c; 3acf6: 90 e0 ldi r25, 0x00 ; 0 3acf8: 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; 3acfa: 8f ef ldi r24, 0xFF ; 255 3acfc: 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; } } 3acfe: 08 95 ret 0003ad00 <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 3ad00: 1f 92 push r1 3ad02: 0f 92 push r0 3ad04: 0f b6 in r0, 0x3f ; 63 3ad06: 0f 92 push r0 3ad08: 11 24 eor r1, r1 3ad0a: 0b b6 in r0, 0x3b ; 59 3ad0c: 0f 92 push r0 3ad0e: 2f 93 push r18 3ad10: 3f 93 push r19 3ad12: 4f 93 push r20 3ad14: 6f 93 push r22 3ad16: 7f 93 push r23 3ad18: 8f 93 push r24 3ad1a: 9f 93 push r25 3ad1c: ef 93 push r30 3ad1e: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 3ad24: 84 ff sbrs r24, 4 3ad26: 12 c0 rjmp .+36 ; 0x3ad4c <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 3ad28: 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 } } 3ad2c: ff 91 pop r31 3ad2e: ef 91 pop r30 3ad30: 9f 91 pop r25 3ad32: 8f 91 pop r24 3ad34: 7f 91 pop r23 3ad36: 6f 91 pop r22 3ad38: 4f 91 pop r20 3ad3a: 3f 91 pop r19 3ad3c: 2f 91 pop r18 3ad3e: 0f 90 pop r0 3ad40: 0b be out 0x3b, r0 ; 59 3ad42: 0f 90 pop r0 3ad44: 0f be out 0x3f, r0 ; 63 3ad46: 0f 90 pop r0 3ad48: 1f 90 pop r1 3ad4a: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 3ad4c: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 3ad50: 80 91 21 05 lds r24, 0x0521 ; 0x800521 3ad54: 81 30 cpi r24, 0x01 ; 1 3ad56: 51 f7 brne .-44 ; 0x3ad2c <__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; 3ad58: 20 91 93 04 lds r18, 0x0493 ; 0x800493 3ad5c: 30 91 94 04 lds r19, 0x0494 ; 0x800494 3ad60: c9 01 movw r24, r18 3ad62: 01 96 adiw r24, 0x01 ; 1 3ad64: 8f 77 andi r24, 0x7F ; 127 3ad66: 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) { 3ad68: 60 91 95 04 lds r22, 0x0495 ; 0x800495 3ad6c: 70 91 96 04 lds r23, 0x0496 ; 0x800496 3ad70: 86 17 cp r24, r22 3ad72: 97 07 cpc r25, r23 3ad74: d9 f2 breq .-74 ; 0x3ad2c <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3ad76: 2d 5e subi r18, 0xED ; 237 3ad78: 3b 4f sbci r19, 0xFB ; 251 3ad7a: f9 01 movw r30, r18 3ad7c: 40 83 st Z, r20 rx_buffer.head = i; 3ad7e: 90 93 94 04 sts 0x0494, r25 ; 0x800494 3ad82: 80 93 93 04 sts 0x0493, r24 ; 0x800493 3ad86: d2 cf rjmp .-92 ; 0x3ad2c <__vector_36+0x2c> 0003ad88 <__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) { 3ad88: 1f 92 push r1 3ad8a: 0f 92 push r0 3ad8c: 0f b6 in r0, 0x3f ; 63 3ad8e: 0f 92 push r0 3ad90: 11 24 eor r1, r1 3ad92: 0b b6 in r0, 0x3b ; 59 3ad94: 0f 92 push r0 3ad96: 2f 93 push r18 3ad98: 3f 93 push r19 3ad9a: 4f 93 push r20 3ad9c: 6f 93 push r22 3ad9e: 7f 93 push r23 3ada0: 8f 93 push r24 3ada2: 9f 93 push r25 3ada4: ef 93 push r30 3ada6: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 3adac: 84 ff sbrs r24, 4 3adae: 12 c0 rjmp .+36 ; 0x3add4 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 3adb0: 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 } } 3adb4: ff 91 pop r31 3adb6: ef 91 pop r30 3adb8: 9f 91 pop r25 3adba: 8f 91 pop r24 3adbc: 7f 91 pop r23 3adbe: 6f 91 pop r22 3adc0: 4f 91 pop r20 3adc2: 3f 91 pop r19 3adc4: 2f 91 pop r18 3adc6: 0f 90 pop r0 3adc8: 0b be out 0x3b, r0 ; 59 3adca: 0f 90 pop r0 3adcc: 0f be out 0x3f, r0 ; 63 3adce: 0f 90 pop r0 3add0: 1f 90 pop r1 3add2: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 3add4: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 3add8: 80 91 21 05 lds r24, 0x0521 ; 0x800521 3addc: 81 11 cpse r24, r1 3adde: ea cf rjmp .-44 ; 0x3adb4 <__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; 3ade0: 20 91 93 04 lds r18, 0x0493 ; 0x800493 3ade4: 30 91 94 04 lds r19, 0x0494 ; 0x800494 3ade8: c9 01 movw r24, r18 3adea: 01 96 adiw r24, 0x01 ; 1 3adec: 8f 77 andi r24, 0x7F ; 127 3adee: 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) { 3adf0: 60 91 95 04 lds r22, 0x0495 ; 0x800495 3adf4: 70 91 96 04 lds r23, 0x0496 ; 0x800496 3adf8: 86 17 cp r24, r22 3adfa: 97 07 cpc r25, r23 3adfc: d9 f2 breq .-74 ; 0x3adb4 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3adfe: 2d 5e subi r18, 0xED ; 237 3ae00: 3b 4f sbci r19, 0xFB ; 251 3ae02: f9 01 movw r30, r18 3ae04: 40 83 st Z, r20 rx_buffer.head = i; 3ae06: 90 93 94 04 sts 0x0494, r25 ; 0x800494 3ae0a: 80 93 93 04 sts 0x0493, r24 ; 0x800493 3ae0e: d2 cf rjmp .-92 ; 0x3adb4 <__vector_25+0x2c> 0003ae10 : * 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) { 3ae10: 2f 92 push r2 3ae12: 3f 92 push r3 3ae14: 4f 92 push r4 3ae16: 5f 92 push r5 3ae18: 6f 92 push r6 3ae1a: 7f 92 push r7 3ae1c: 8f 92 push r8 3ae1e: 9f 92 push r9 3ae20: af 92 push r10 3ae22: bf 92 push r11 3ae24: cf 92 push r12 3ae26: df 92 push r13 3ae28: ef 92 push r14 3ae2a: ff 92 push r15 3ae2c: 0f 93 push r16 3ae2e: 1f 93 push r17 3ae30: cf 93 push r28 3ae32: df 93 push r29 3ae34: cd b7 in r28, 0x3d ; 61 3ae36: de b7 in r29, 0x3e ; 62 3ae38: c2 54 subi r28, 0x42 ; 66 3ae3a: d1 09 sbc r29, r1 3ae3c: 0f b6 in r0, 0x3f ; 63 3ae3e: f8 94 cli 3ae40: de bf out 0x3e, r29 ; 62 3ae42: 0f be out 0x3f, r0 ; 63 3ae44: cd bf out 0x3d, r28 ; 61 3ae46: 4c 01 movw r8, r24 3ae48: 5b 01 movw r10, r22 3ae4a: 6a 01 movw r12, r20 3ae4c: 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) {} 3ae4e: 19 82 std Y+1, r1 ; 0x01 3ae50: 1c 82 std Y+4, r1 ; 0x04 3ae52: 1c 8e std Y+28, r1 ; 0x1c 3ae54: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 3ae56: 67 2b or r22, r23 3ae58: 21 f5 brne .+72 ; 0x3aea2 sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 3ae5a: 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; 3ae5c: ce 01 movw r24, r28 3ae5e: 4c 96 adiw r24, 0x1c ; 28 3ae60: 0e 94 3c 79 call 0xf278 ; 0xf278 3ae64: ce 01 movw r24, r28 3ae66: 01 96 adiw r24, 0x01 ; 1 3ae68: 0e 94 3c 79 call 0xf278 ; 0xf278 } return open(parent, dname, oflag); fail: return false; } 3ae6c: 81 2f mov r24, r17 3ae6e: ce 5b subi r28, 0xBE ; 190 3ae70: df 4f sbci r29, 0xFF ; 255 3ae72: 0f b6 in r0, 0x3f ; 63 3ae74: f8 94 cli 3ae76: de bf out 0x3e, r29 ; 62 3ae78: 0f be out 0x3f, r0 ; 63 3ae7a: cd bf out 0x3d, r28 ; 61 3ae7c: df 91 pop r29 3ae7e: cf 91 pop r28 3ae80: 1f 91 pop r17 3ae82: 0f 91 pop r16 3ae84: ff 90 pop r15 3ae86: ef 90 pop r14 3ae88: df 90 pop r13 3ae8a: cf 90 pop r12 3ae8c: bf 90 pop r11 3ae8e: af 90 pop r10 3ae90: 9f 90 pop r9 3ae92: 8f 90 pop r8 3ae94: 7f 90 pop r7 3ae96: 6f 90 pop r6 3ae98: 5f 90 pop r5 3ae9a: 4f 90 pop r4 3ae9c: 3f 90 pop r3 3ae9e: 2f 90 pop r2 3aea0: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 3aea2: fc 01 movw r30, r24 3aea4: 83 81 ldd r24, Z+3 ; 0x03 3aea6: 81 11 cpse r24, r1 3aea8: d8 cf rjmp .-80 ; 0x3ae5a if (*path == '/') { 3aeaa: fa 01 movw r30, r20 3aeac: 80 81 ld r24, Z 3aeae: 8f 32 cpi r24, 0x2F ; 47 3aeb0: c1 f4 brne .+48 ; 0x3aee2 3aeb2: ca 01 movw r24, r20 3aeb4: 6c 01 movw r12, r24 3aeb6: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 3aeb8: f6 01 movw r30, r12 3aeba: 20 81 ld r18, Z 3aebc: 2f 32 cpi r18, 0x2F ; 47 3aebe: d1 f3 breq .-12 ; 0x3aeb4 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; 3aec0: f5 01 movw r30, r10 3aec2: 83 81 ldd r24, Z+3 ; 0x03 3aec4: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 3aec6: 82 30 cpi r24, 0x02 ; 2 3aec8: 60 f0 brcs .+24 ; 0x3aee2 if (!dir2.openRoot(dirFile->vol_)) goto fail; 3aeca: 61 8d ldd r22, Z+25 ; 0x19 3aecc: 72 8d ldd r23, Z+26 ; 0x1a 3aece: ce 01 movw r24, r28 3aed0: 4c 96 adiw r24, 0x1c ; 28 3aed2: 0f 94 ee a3 call 0x347dc ; 0x347dc parent = &dir2; 3aed6: 8e 01 movw r16, r28 3aed8: 04 5e subi r16, 0xE4 ; 228 3aeda: 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; 3aedc: 81 11 cpse r24, r1 3aede: 02 c0 rjmp .+4 ; 0x3aee4 3aee0: bc cf rjmp .-136 ; 0x3ae5a // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 3aee2: 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; 3aee4: ce 01 movw r24, r28 3aee6: 01 96 adiw r24, 0x01 ; 1 3aee8: 7c 01 movw r14, r24 3aeea: 3c 01 movw r6, r24 3aeec: 2e 01 movw r4, r28 3aeee: 9c e1 ldi r25, 0x1C ; 28 3aef0: 49 0e add r4, r25 3aef2: 51 1c adc r5, r1 3aef4: 23 96 adiw r28, 0x03 ; 3 3aef6: ef ae std Y+63, r14 ; 0x3f 3aef8: 23 97 sbiw r28, 0x03 ; 3 3aefa: 2f 2c mov r2, r15 3aefc: fe 01 movw r30, r28 3aefe: f7 96 adiw r30, 0x37 ; 55 3af00: cf 01 movw r24, r30 3af02: 0b 96 adiw r24, 0x0b ; 11 3af04: 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++] = ' '; 3af06: 20 e2 ldi r18, 0x20 ; 32 3af08: 21 93 st Z+, r18 3af0a: e8 17 cp r30, r24 3af0c: f9 07 cpc r31, r25 3af0e: d9 f7 brne .-10 ; 0x3af06 3af10: 96 01 movw r18, r12 i = 0; 3af12: 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 3af14: 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 != '/') { 3af16: d9 01 movw r26, r18 3af18: 8d 91 ld r24, X+ 3af1a: 88 23 and r24, r24 3af1c: 49 f1 breq .+82 ; 0x3af70 3af1e: 8f 32 cpi r24, 0x2F ; 47 3af20: 39 f1 breq .+78 ; 0x3af70 c = *str++; 3af22: 28 2f mov r18, r24 if (c == '.') { 3af24: 8e 32 cpi r24, 0x2E ; 46 3af26: 39 f4 brne .+14 ; 0x3af36 if (n == 10) goto fail; // only one dot allowed 3af28: 6a 30 cpi r22, 0x0A ; 10 3af2a: 09 f4 brne .+2 ; 0x3af2e 3af2c: 96 cf rjmp .-212 ; 0x3ae5a n = 10; // max index for full 8.3 name i = 8; // place for extension 3af2e: 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 3af30: 6a e0 ldi r22, 0x0A ; 10 3af32: 9d 01 movw r18, r26 3af34: f0 cf rjmp .-32 ; 0x3af16 3af36: eb ea ldi r30, 0xAB ; 171 3af38: ff ea ldi r31, 0xAF ; 175 //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; 3af3a: 34 91 lpm r19, Z 3af3c: 33 23 and r19, r19 3af3e: 21 f0 breq .+8 ; 0x3af48 3af40: 31 96 adiw r30, 0x01 ; 1 3af42: 83 13 cpse r24, r19 3af44: fa cf rjmp .-12 ; 0x3af3a 3af46: 89 cf rjmp .-238 ; 0x3ae5a // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 3af48: 69 17 cp r22, r25 3af4a: 08 f4 brcc .+2 ; 0x3af4e 3af4c: 86 cf rjmp .-244 ; 0x3ae5a 3af4e: 3f ed ldi r19, 0xDF ; 223 3af50: 38 0f add r19, r24 3af52: 3e 35 cpi r19, 0x5E ; 94 3af54: 08 f0 brcs .+2 ; 0x3af58 3af56: 81 cf rjmp .-254 ; 0x3ae5a // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 3af58: 3f e9 ldi r19, 0x9F ; 159 3af5a: 38 0f add r19, r24 3af5c: 3a 31 cpi r19, 0x1A ; 26 3af5e: 10 f4 brcc .+4 ; 0x3af64 3af60: 20 ee ldi r18, 0xE0 ; 224 3af62: 28 0f add r18, r24 3af64: fa 01 movw r30, r20 3af66: e9 0f add r30, r25 3af68: f1 1d adc r31, r1 3af6a: 20 83 st Z, r18 3af6c: 9f 5f subi r25, 0xFF ; 255 3af6e: e1 cf rjmp .-62 ; 0x3af32 if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 3af70: 8f a9 ldd r24, Y+55 ; 0x37 3af72: 80 32 cpi r24, 0x20 ; 32 3af74: 09 f4 brne .+2 ; 0x3af78 3af76: 71 cf rjmp .-286 ; 0x3ae5a 3af78: 69 01 movw r12, r18 while (*path == '/') path++; 3af7a: f9 01 movw r30, r18 3af7c: 80 81 ld r24, Z 3af7e: 2f 5f subi r18, 0xFF ; 255 3af80: 3f 4f sbci r19, 0xFF ; 255 3af82: 8f 32 cpi r24, 0x2F ; 47 3af84: c9 f3 breq .-14 ; 0x3af78 if (!*path) break; 3af86: 88 23 and r24, r24 3af88: d9 f0 breq .+54 ; 0x3afc0 if (!sub->open(parent, dname, O_READ)) goto fail; 3af8a: 21 e0 ldi r18, 0x01 ; 1 3af8c: b8 01 movw r22, r16 3af8e: c7 01 movw r24, r14 3af90: 0f 94 3b a8 call 0x35076 ; 0x35076 3af94: 88 23 and r24, r24 3af96: 09 f4 brne .+2 ; 0x3af9a 3af98: 60 cf rjmp .-320 ; 0x3ae5a if (parent != dirFile) parent->close(); 3af9a: 0a 15 cp r16, r10 3af9c: 1b 05 cpc r17, r11 3af9e: 19 f0 breq .+6 ; 0x3afa6 3afa0: c8 01 movw r24, r16 3afa2: 0f 94 3e a4 call 0x3487c ; 0x3487c parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 3afa6: 94 2d mov r25, r4 3afa8: 85 2d mov r24, r5 3afaa: 6e 14 cp r6, r14 3afac: 7f 04 cpc r7, r15 3afae: 21 f0 breq .+8 ; 0x3afb8 3afb0: 23 96 adiw r28, 0x03 ; 3 3afb2: 9f ad ldd r25, Y+63 ; 0x3f 3afb4: 23 97 sbiw r28, 0x03 ; 3 3afb6: 82 2d mov r24, r2 3afb8: 87 01 movw r16, r14 3afba: e9 2e mov r14, r25 3afbc: f8 2e mov r15, r24 3afbe: 9e cf rjmp .-196 ; 0x3aefc } return open(parent, dname, oflag); 3afc0: 23 2d mov r18, r3 3afc2: b8 01 movw r22, r16 3afc4: c4 01 movw r24, r8 3afc6: 0f 94 3b a8 call 0x35076 ; 0x35076 3afca: 18 2f mov r17, r24 3afcc: 47 cf rjmp .-370 ; 0x3ae5c 0003afce <__floatunsisf>: 3afce: e8 94 clt 3afd0: 09 c0 rjmp .+18 ; 0x3afe4 <__floatsisf+0x12> 0003afd2 <__floatsisf>: 3afd2: 97 fb bst r25, 7 3afd4: 3e f4 brtc .+14 ; 0x3afe4 <__floatsisf+0x12> 3afd6: 90 95 com r25 3afd8: 80 95 com r24 3afda: 70 95 com r23 3afdc: 61 95 neg r22 3afde: 7f 4f sbci r23, 0xFF ; 255 3afe0: 8f 4f sbci r24, 0xFF ; 255 3afe2: 9f 4f sbci r25, 0xFF ; 255 3afe4: 99 23 and r25, r25 3afe6: a9 f0 breq .+42 ; 0x3b012 <__floatsisf+0x40> 3afe8: f9 2f mov r31, r25 3afea: 96 e9 ldi r25, 0x96 ; 150 3afec: bb 27 eor r27, r27 3afee: 93 95 inc r25 3aff0: f6 95 lsr r31 3aff2: 87 95 ror r24 3aff4: 77 95 ror r23 3aff6: 67 95 ror r22 3aff8: b7 95 ror r27 3affa: f1 11 cpse r31, r1 3affc: f8 cf rjmp .-16 ; 0x3afee <__floatsisf+0x1c> 3affe: fa f4 brpl .+62 ; 0x3b03e <__floatsisf+0x6c> 3b000: bb 0f add r27, r27 3b002: 11 f4 brne .+4 ; 0x3b008 <__floatsisf+0x36> 3b004: 60 ff sbrs r22, 0 3b006: 1b c0 rjmp .+54 ; 0x3b03e <__floatsisf+0x6c> 3b008: 6f 5f subi r22, 0xFF ; 255 3b00a: 7f 4f sbci r23, 0xFF ; 255 3b00c: 8f 4f sbci r24, 0xFF ; 255 3b00e: 9f 4f sbci r25, 0xFF ; 255 3b010: 16 c0 rjmp .+44 ; 0x3b03e <__floatsisf+0x6c> 3b012: 88 23 and r24, r24 3b014: 11 f0 breq .+4 ; 0x3b01a <__floatsisf+0x48> 3b016: 96 e9 ldi r25, 0x96 ; 150 3b018: 11 c0 rjmp .+34 ; 0x3b03c <__floatsisf+0x6a> 3b01a: 77 23 and r23, r23 3b01c: 21 f0 breq .+8 ; 0x3b026 <__floatsisf+0x54> 3b01e: 9e e8 ldi r25, 0x8E ; 142 3b020: 87 2f mov r24, r23 3b022: 76 2f mov r23, r22 3b024: 05 c0 rjmp .+10 ; 0x3b030 <__floatsisf+0x5e> 3b026: 66 23 and r22, r22 3b028: 71 f0 breq .+28 ; 0x3b046 <__floatsisf+0x74> 3b02a: 96 e8 ldi r25, 0x86 ; 134 3b02c: 86 2f mov r24, r22 3b02e: 70 e0 ldi r23, 0x00 ; 0 3b030: 60 e0 ldi r22, 0x00 ; 0 3b032: 2a f0 brmi .+10 ; 0x3b03e <__floatsisf+0x6c> 3b034: 9a 95 dec r25 3b036: 66 0f add r22, r22 3b038: 77 1f adc r23, r23 3b03a: 88 1f adc r24, r24 3b03c: da f7 brpl .-10 ; 0x3b034 <__floatsisf+0x62> 3b03e: 88 0f add r24, r24 3b040: 96 95 lsr r25 3b042: 87 95 ror r24 3b044: 97 f9 bld r25, 7 3b046: 08 95 ret 0003b048 : 3b048: 9b 01 movw r18, r22 3b04a: ac 01 movw r20, r24 3b04c: 0d 94 28 d8 jmp 0x3b050 ; 0x3b050 <__mulsf3> 0003b050 <__mulsf3>: 3b050: 0f 94 3b d8 call 0x3b076 ; 0x3b076 <__mulsf3x> 3b054: 0d 94 ac d8 jmp 0x3b158 ; 0x3b158 <__fp_round> 3b058: 0f 94 9e d8 call 0x3b13c ; 0x3b13c <__fp_pscA> 3b05c: 38 f0 brcs .+14 ; 0x3b06c <__mulsf3+0x1c> 3b05e: 0f 94 a5 d8 call 0x3b14a ; 0x3b14a <__fp_pscB> 3b062: 20 f0 brcs .+8 ; 0x3b06c <__mulsf3+0x1c> 3b064: 95 23 and r25, r21 3b066: 11 f0 breq .+4 ; 0x3b06c <__mulsf3+0x1c> 3b068: 0d 94 95 d8 jmp 0x3b12a ; 0x3b12a <__fp_inf> 3b06c: 0d 94 9b d8 jmp 0x3b136 ; 0x3b136 <__fp_nan> 3b070: 11 24 eor r1, r1 3b072: 0d 94 e0 d8 jmp 0x3b1c0 ; 0x3b1c0 <__fp_szero> 0003b076 <__mulsf3x>: 3b076: 0f 94 bd d8 call 0x3b17a ; 0x3b17a <__fp_split3> 3b07a: 70 f3 brcs .-36 ; 0x3b058 <__mulsf3+0x8> 0003b07c <__mulsf3_pse>: 3b07c: 95 9f mul r25, r21 3b07e: c1 f3 breq .-16 ; 0x3b070 <__mulsf3+0x20> 3b080: 95 0f add r25, r21 3b082: 50 e0 ldi r21, 0x00 ; 0 3b084: 55 1f adc r21, r21 3b086: 62 9f mul r22, r18 3b088: f0 01 movw r30, r0 3b08a: 72 9f mul r23, r18 3b08c: bb 27 eor r27, r27 3b08e: f0 0d add r31, r0 3b090: b1 1d adc r27, r1 3b092: 63 9f mul r22, r19 3b094: aa 27 eor r26, r26 3b096: f0 0d add r31, r0 3b098: b1 1d adc r27, r1 3b09a: aa 1f adc r26, r26 3b09c: 64 9f mul r22, r20 3b09e: 66 27 eor r22, r22 3b0a0: b0 0d add r27, r0 3b0a2: a1 1d adc r26, r1 3b0a4: 66 1f adc r22, r22 3b0a6: 82 9f mul r24, r18 3b0a8: 22 27 eor r18, r18 3b0aa: b0 0d add r27, r0 3b0ac: a1 1d adc r26, r1 3b0ae: 62 1f adc r22, r18 3b0b0: 73 9f mul r23, r19 3b0b2: b0 0d add r27, r0 3b0b4: a1 1d adc r26, r1 3b0b6: 62 1f adc r22, r18 3b0b8: 83 9f mul r24, r19 3b0ba: a0 0d add r26, r0 3b0bc: 61 1d adc r22, r1 3b0be: 22 1f adc r18, r18 3b0c0: 74 9f mul r23, r20 3b0c2: 33 27 eor r19, r19 3b0c4: a0 0d add r26, r0 3b0c6: 61 1d adc r22, r1 3b0c8: 23 1f adc r18, r19 3b0ca: 84 9f mul r24, r20 3b0cc: 60 0d add r22, r0 3b0ce: 21 1d adc r18, r1 3b0d0: 82 2f mov r24, r18 3b0d2: 76 2f mov r23, r22 3b0d4: 6a 2f mov r22, r26 3b0d6: 11 24 eor r1, r1 3b0d8: 9f 57 subi r25, 0x7F ; 127 3b0da: 50 40 sbci r21, 0x00 ; 0 3b0dc: 9a f0 brmi .+38 ; 0x3b104 <__mulsf3_pse+0x88> 3b0de: f1 f0 breq .+60 ; 0x3b11c <__mulsf3_pse+0xa0> 3b0e0: 88 23 and r24, r24 3b0e2: 4a f0 brmi .+18 ; 0x3b0f6 <__mulsf3_pse+0x7a> 3b0e4: ee 0f add r30, r30 3b0e6: ff 1f adc r31, r31 3b0e8: bb 1f adc r27, r27 3b0ea: 66 1f adc r22, r22 3b0ec: 77 1f adc r23, r23 3b0ee: 88 1f adc r24, r24 3b0f0: 91 50 subi r25, 0x01 ; 1 3b0f2: 50 40 sbci r21, 0x00 ; 0 3b0f4: a9 f7 brne .-22 ; 0x3b0e0 <__mulsf3_pse+0x64> 3b0f6: 9e 3f cpi r25, 0xFE ; 254 3b0f8: 51 05 cpc r21, r1 3b0fa: 80 f0 brcs .+32 ; 0x3b11c <__mulsf3_pse+0xa0> 3b0fc: 0d 94 95 d8 jmp 0x3b12a ; 0x3b12a <__fp_inf> 3b100: 0d 94 e0 d8 jmp 0x3b1c0 ; 0x3b1c0 <__fp_szero> 3b104: 5f 3f cpi r21, 0xFF ; 255 3b106: e4 f3 brlt .-8 ; 0x3b100 <__mulsf3_pse+0x84> 3b108: 98 3e cpi r25, 0xE8 ; 232 3b10a: d4 f3 brlt .-12 ; 0x3b100 <__mulsf3_pse+0x84> 3b10c: 86 95 lsr r24 3b10e: 77 95 ror r23 3b110: 67 95 ror r22 3b112: b7 95 ror r27 3b114: f7 95 ror r31 3b116: e7 95 ror r30 3b118: 9f 5f subi r25, 0xFF ; 255 3b11a: c1 f7 brne .-16 ; 0x3b10c <__mulsf3_pse+0x90> 3b11c: fe 2b or r31, r30 3b11e: 88 0f add r24, r24 3b120: 91 1d adc r25, r1 3b122: 96 95 lsr r25 3b124: 87 95 ror r24 3b126: 97 f9 bld r25, 7 3b128: 08 95 ret 0003b12a <__fp_inf>: 3b12a: 97 f9 bld r25, 7 3b12c: 9f 67 ori r25, 0x7F ; 127 3b12e: 80 e8 ldi r24, 0x80 ; 128 3b130: 70 e0 ldi r23, 0x00 ; 0 3b132: 60 e0 ldi r22, 0x00 ; 0 3b134: 08 95 ret 0003b136 <__fp_nan>: 3b136: 9f ef ldi r25, 0xFF ; 255 3b138: 80 ec ldi r24, 0xC0 ; 192 3b13a: 08 95 ret 0003b13c <__fp_pscA>: 3b13c: 00 24 eor r0, r0 3b13e: 0a 94 dec r0 3b140: 16 16 cp r1, r22 3b142: 17 06 cpc r1, r23 3b144: 18 06 cpc r1, r24 3b146: 09 06 cpc r0, r25 3b148: 08 95 ret 0003b14a <__fp_pscB>: 3b14a: 00 24 eor r0, r0 3b14c: 0a 94 dec r0 3b14e: 12 16 cp r1, r18 3b150: 13 06 cpc r1, r19 3b152: 14 06 cpc r1, r20 3b154: 05 06 cpc r0, r21 3b156: 08 95 ret 0003b158 <__fp_round>: 3b158: 09 2e mov r0, r25 3b15a: 03 94 inc r0 3b15c: 00 0c add r0, r0 3b15e: 11 f4 brne .+4 ; 0x3b164 <__fp_round+0xc> 3b160: 88 23 and r24, r24 3b162: 52 f0 brmi .+20 ; 0x3b178 <__fp_round+0x20> 3b164: bb 0f add r27, r27 3b166: 40 f4 brcc .+16 ; 0x3b178 <__fp_round+0x20> 3b168: bf 2b or r27, r31 3b16a: 11 f4 brne .+4 ; 0x3b170 <__fp_round+0x18> 3b16c: 60 ff sbrs r22, 0 3b16e: 04 c0 rjmp .+8 ; 0x3b178 <__fp_round+0x20> 3b170: 6f 5f subi r22, 0xFF ; 255 3b172: 7f 4f sbci r23, 0xFF ; 255 3b174: 8f 4f sbci r24, 0xFF ; 255 3b176: 9f 4f sbci r25, 0xFF ; 255 3b178: 08 95 ret 0003b17a <__fp_split3>: 3b17a: 57 fd sbrc r21, 7 3b17c: 90 58 subi r25, 0x80 ; 128 3b17e: 44 0f add r20, r20 3b180: 55 1f adc r21, r21 3b182: 59 f0 breq .+22 ; 0x3b19a <__fp_splitA+0x10> 3b184: 5f 3f cpi r21, 0xFF ; 255 3b186: 71 f0 breq .+28 ; 0x3b1a4 <__fp_splitA+0x1a> 3b188: 47 95 ror r20 0003b18a <__fp_splitA>: 3b18a: 88 0f add r24, r24 3b18c: 97 fb bst r25, 7 3b18e: 99 1f adc r25, r25 3b190: 61 f0 breq .+24 ; 0x3b1aa <__fp_splitA+0x20> 3b192: 9f 3f cpi r25, 0xFF ; 255 3b194: 79 f0 breq .+30 ; 0x3b1b4 <__fp_splitA+0x2a> 3b196: 87 95 ror r24 3b198: 08 95 ret 3b19a: 12 16 cp r1, r18 3b19c: 13 06 cpc r1, r19 3b19e: 14 06 cpc r1, r20 3b1a0: 55 1f adc r21, r21 3b1a2: f2 cf rjmp .-28 ; 0x3b188 <__fp_split3+0xe> 3b1a4: 46 95 lsr r20 3b1a6: f1 df rcall .-30 ; 0x3b18a <__fp_splitA> 3b1a8: 08 c0 rjmp .+16 ; 0x3b1ba <__fp_splitA+0x30> 3b1aa: 16 16 cp r1, r22 3b1ac: 17 06 cpc r1, r23 3b1ae: 18 06 cpc r1, r24 3b1b0: 99 1f adc r25, r25 3b1b2: f1 cf rjmp .-30 ; 0x3b196 <__fp_splitA+0xc> 3b1b4: 86 95 lsr r24 3b1b6: 71 05 cpc r23, r1 3b1b8: 61 05 cpc r22, r1 3b1ba: 08 94 sec 3b1bc: 08 95 ret 0003b1be <__fp_zero>: 3b1be: e8 94 clt 0003b1c0 <__fp_szero>: 3b1c0: bb 27 eor r27, r27 3b1c2: 66 27 eor r22, r22 3b1c4: 77 27 eor r23, r23 3b1c6: cb 01 movw r24, r22 3b1c8: 97 f9 bld r25, 7 3b1ca: 08 95 ret 0003b1cc : 3b1cc: 3f 92 push r3 3b1ce: 4f 92 push r4 3b1d0: 5f 92 push r5 3b1d2: 6f 92 push r6 3b1d4: 7f 92 push r7 3b1d6: 8f 92 push r8 3b1d8: 9f 92 push r9 3b1da: af 92 push r10 3b1dc: bf 92 push r11 3b1de: cf 92 push r12 3b1e0: df 92 push r13 3b1e2: ef 92 push r14 3b1e4: ff 92 push r15 3b1e6: 0f 93 push r16 3b1e8: 1f 93 push r17 3b1ea: cf 93 push r28 3b1ec: df 93 push r29 3b1ee: 5c 01 movw r10, r24 3b1f0: 6b 01 movw r12, r22 3b1f2: 7a 01 movw r14, r20 3b1f4: 61 15 cp r22, r1 3b1f6: 71 05 cpc r23, r1 3b1f8: 19 f0 breq .+6 ; 0x3b200 3b1fa: fb 01 movw r30, r22 3b1fc: 91 83 std Z+1, r25 ; 0x01 3b1fe: 80 83 st Z, r24 3b200: e1 14 cp r14, r1 3b202: f1 04 cpc r15, r1 3b204: 51 f0 breq .+20 ; 0x3b21a 3b206: c7 01 movw r24, r14 3b208: 02 97 sbiw r24, 0x02 ; 2 3b20a: 83 97 sbiw r24, 0x23 ; 35 3b20c: 30 f0 brcs .+12 ; 0x3b21a 3b20e: 40 e0 ldi r20, 0x00 ; 0 3b210: 30 e0 ldi r19, 0x00 ; 0 3b212: 20 e0 ldi r18, 0x00 ; 0 3b214: 90 e0 ldi r25, 0x00 ; 0 3b216: 6b c0 rjmp .+214 ; 0x3b2ee 3b218: 5e 01 movw r10, r28 3b21a: e5 01 movw r28, r10 3b21c: 21 96 adiw r28, 0x01 ; 1 3b21e: f5 01 movw r30, r10 3b220: 10 81 ld r17, Z 3b222: 81 2f mov r24, r17 3b224: 90 e0 ldi r25, 0x00 ; 0 3b226: 0f 94 ec da call 0x3b5d8 ; 0x3b5d8 3b22a: 89 2b or r24, r25 3b22c: a9 f7 brne .-22 ; 0x3b218 3b22e: 1d 32 cpi r17, 0x2D ; 45 3b230: 01 f5 brne .+64 ; 0x3b272 3b232: 21 96 adiw r28, 0x01 ; 1 3b234: f5 01 movw r30, r10 3b236: 11 81 ldd r17, Z+1 ; 0x01 3b238: 01 e0 ldi r16, 0x01 ; 1 3b23a: e1 14 cp r14, r1 3b23c: f1 04 cpc r15, r1 3b23e: 09 f4 brne .+2 ; 0x3b242 3b240: e6 c0 rjmp .+460 ; 0x3b40e 3b242: f0 e1 ldi r31, 0x10 ; 16 3b244: ef 16 cp r14, r31 3b246: f1 04 cpc r15, r1 3b248: 09 f0 breq .+2 ; 0x3b24c 3b24a: 88 c0 rjmp .+272 ; 0x3b35c 3b24c: 10 33 cpi r17, 0x30 ; 48 3b24e: 59 f4 brne .+22 ; 0x3b266 3b250: 88 81 ld r24, Y 3b252: 8f 7d andi r24, 0xDF ; 223 3b254: 88 35 cpi r24, 0x58 ; 88 3b256: 09 f0 breq .+2 ; 0x3b25a 3b258: 7c c0 rjmp .+248 ; 0x3b352 3b25a: 19 81 ldd r17, Y+1 ; 0x01 3b25c: 22 96 adiw r28, 0x02 ; 2 3b25e: 02 60 ori r16, 0x02 ; 2 3b260: f0 e1 ldi r31, 0x10 ; 16 3b262: ef 2e mov r14, r31 3b264: f1 2c mov r15, r1 3b266: 81 2c mov r8, r1 3b268: 91 2c mov r9, r1 3b26a: a1 2c mov r10, r1 3b26c: 88 e0 ldi r24, 0x08 ; 8 3b26e: b8 2e mov r11, r24 3b270: 92 c0 rjmp .+292 ; 0x3b396 3b272: 1b 32 cpi r17, 0x2B ; 43 3b274: 21 f4 brne .+8 ; 0x3b27e 3b276: e5 01 movw r28, r10 3b278: 22 96 adiw r28, 0x02 ; 2 3b27a: f5 01 movw r30, r10 3b27c: 11 81 ldd r17, Z+1 ; 0x01 3b27e: 00 e0 ldi r16, 0x00 ; 0 3b280: dc cf rjmp .-72 ; 0x3b23a 3b282: ea e0 ldi r30, 0x0A ; 10 3b284: ee 16 cp r14, r30 3b286: f1 04 cpc r15, r1 3b288: 09 f4 brne .+2 ; 0x3b28c 3b28a: c7 c0 rjmp .+398 ; 0x3b41a 3b28c: f0 e1 ldi r31, 0x10 ; 16 3b28e: ef 16 cp r14, r31 3b290: f1 04 cpc r15, r1 3b292: 09 f0 breq .+2 ; 0x3b296 3b294: 73 c0 rjmp .+230 ; 0x3b37c 3b296: e7 cf rjmp .-50 ; 0x3b266 3b298: 78 e0 ldi r23, 0x08 ; 8 3b29a: e7 2e mov r14, r23 3b29c: f1 2c mov r15, r1 3b29e: 81 2c mov r8, r1 3b2a0: 91 2c mov r9, r1 3b2a2: a1 2c mov r10, r1 3b2a4: 60 e1 ldi r22, 0x10 ; 16 3b2a6: b6 2e mov r11, r22 3b2a8: 76 c0 rjmp .+236 ; 0x3b396 3b2aa: 21 e0 ldi r18, 0x01 ; 1 3b2ac: ad c0 rjmp .+346 ; 0x3b408 3b2ae: 30 2f mov r19, r16 3b2b0: 31 70 andi r19, 0x01 ; 1 3b2b2: c1 14 cp r12, r1 3b2b4: d1 04 cpc r13, r1 3b2b6: 31 f0 breq .+12 ; 0x3b2c4 3b2b8: 22 23 and r18, r18 3b2ba: 71 f1 breq .+92 ; 0x3b318 3b2bc: 21 97 sbiw r28, 0x01 ; 1 3b2be: f6 01 movw r30, r12 3b2c0: d1 83 std Z+1, r29 ; 0x01 3b2c2: c0 83 st Z, r28 3b2c4: 27 ff sbrs r18, 7 3b2c6: 2e c0 rjmp .+92 ; 0x3b324 3b2c8: 60 e0 ldi r22, 0x00 ; 0 3b2ca: 70 e0 ldi r23, 0x00 ; 0 3b2cc: 80 e0 ldi r24, 0x00 ; 0 3b2ce: 90 e8 ldi r25, 0x80 ; 128 3b2d0: 31 11 cpse r19, r1 3b2d2: 04 c0 rjmp .+8 ; 0x3b2dc 3b2d4: 6f ef ldi r22, 0xFF ; 255 3b2d6: 7f ef ldi r23, 0xFF ; 255 3b2d8: 8f ef ldi r24, 0xFF ; 255 3b2da: 9f e7 ldi r25, 0x7F ; 127 3b2dc: 22 e2 ldi r18, 0x22 ; 34 3b2de: 30 e0 ldi r19, 0x00 ; 0 3b2e0: 30 93 0e 18 sts 0x180E, r19 ; 0x80180e 3b2e4: 20 93 0d 18 sts 0x180D, r18 ; 0x80180d 3b2e8: 46 2f mov r20, r22 3b2ea: 37 2f mov r19, r23 3b2ec: 28 2f mov r18, r24 3b2ee: 64 2f mov r22, r20 3b2f0: 73 2f mov r23, r19 3b2f2: 82 2f mov r24, r18 3b2f4: df 91 pop r29 3b2f6: cf 91 pop r28 3b2f8: 1f 91 pop r17 3b2fa: 0f 91 pop r16 3b2fc: ff 90 pop r15 3b2fe: ef 90 pop r14 3b300: df 90 pop r13 3b302: cf 90 pop r12 3b304: bf 90 pop r11 3b306: af 90 pop r10 3b308: 9f 90 pop r9 3b30a: 8f 90 pop r8 3b30c: 7f 90 pop r7 3b30e: 6f 90 pop r6 3b310: 5f 90 pop r5 3b312: 4f 90 pop r4 3b314: 3f 90 pop r3 3b316: 08 95 ret 3b318: 01 ff sbrs r16, 1 3b31a: 04 c0 rjmp .+8 ; 0x3b324 3b31c: 22 97 sbiw r28, 0x02 ; 2 3b31e: f6 01 movw r30, r12 3b320: d1 83 std Z+1, r29 ; 0x01 3b322: c0 83 st Z, r28 3b324: 33 23 and r19, r19 3b326: 41 f0 breq .+16 ; 0x3b338 3b328: 90 95 com r25 3b32a: 80 95 com r24 3b32c: 70 95 com r23 3b32e: 61 95 neg r22 3b330: 7f 4f sbci r23, 0xFF ; 255 3b332: 8f 4f sbci r24, 0xFF ; 255 3b334: 9f 4f sbci r25, 0xFF ; 255 3b336: d8 cf rjmp .-80 ; 0x3b2e8 3b338: 97 ff sbrs r25, 7 3b33a: d6 cf rjmp .-84 ; 0x3b2e8 3b33c: 82 e2 ldi r24, 0x22 ; 34 3b33e: 90 e0 ldi r25, 0x00 ; 0 3b340: 90 93 0e 18 sts 0x180E, r25 ; 0x80180e 3b344: 80 93 0d 18 sts 0x180D, r24 ; 0x80180d 3b348: 6f ef ldi r22, 0xFF ; 255 3b34a: 7f ef ldi r23, 0xFF ; 255 3b34c: 8f ef ldi r24, 0xFF ; 255 3b34e: 9f e7 ldi r25, 0x7F ; 127 3b350: cb cf rjmp .-106 ; 0x3b2e8 3b352: 10 e3 ldi r17, 0x30 ; 48 3b354: e1 14 cp r14, r1 3b356: f1 04 cpc r15, r1 3b358: 09 f4 brne .+2 ; 0x3b35c 3b35a: 9e cf rjmp .-196 ; 0x3b298 3b35c: 28 e0 ldi r18, 0x08 ; 8 3b35e: e2 16 cp r14, r18 3b360: f1 04 cpc r15, r1 3b362: 09 f4 brne .+2 ; 0x3b366 3b364: 9c cf rjmp .-200 ; 0x3b29e 3b366: 0c f0 brlt .+2 ; 0x3b36a 3b368: 8c cf rjmp .-232 ; 0x3b282 3b36a: 81 2c mov r8, r1 3b36c: 91 2c mov r9, r1 3b36e: a1 2c mov r10, r1 3b370: e0 e4 ldi r30, 0x40 ; 64 3b372: be 2e mov r11, r30 3b374: 82 e0 ldi r24, 0x02 ; 2 3b376: e8 16 cp r14, r24 3b378: f1 04 cpc r15, r1 3b37a: 69 f0 breq .+26 ; 0x3b396 3b37c: 60 e0 ldi r22, 0x00 ; 0 3b37e: 70 e0 ldi r23, 0x00 ; 0 3b380: 80 e0 ldi r24, 0x00 ; 0 3b382: 90 e8 ldi r25, 0x80 ; 128 3b384: 97 01 movw r18, r14 3b386: 0f 2c mov r0, r15 3b388: 00 0c add r0, r0 3b38a: 44 0b sbc r20, r20 3b38c: 55 0b sbc r21, r21 3b38e: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 3b392: 49 01 movw r8, r18 3b394: 5a 01 movw r10, r20 3b396: 20 e0 ldi r18, 0x00 ; 0 3b398: 60 e0 ldi r22, 0x00 ; 0 3b39a: 70 e0 ldi r23, 0x00 ; 0 3b39c: cb 01 movw r24, r22 3b39e: 27 01 movw r4, r14 3b3a0: 0f 2c mov r0, r15 3b3a2: 00 0c add r0, r0 3b3a4: 66 08 sbc r6, r6 3b3a6: 77 08 sbc r7, r7 3b3a8: fe 01 movw r30, r28 3b3aa: 50 ed ldi r21, 0xD0 ; 208 3b3ac: 35 2e mov r3, r21 3b3ae: 31 0e add r3, r17 3b3b0: 39 e0 ldi r19, 0x09 ; 9 3b3b2: 33 15 cp r19, r3 3b3b4: 70 f4 brcc .+28 ; 0x3b3d2 3b3b6: 3f eb ldi r19, 0xBF ; 191 3b3b8: 31 0f add r19, r17 3b3ba: 49 ec ldi r20, 0xC9 ; 201 3b3bc: 34 2e mov r3, r20 3b3be: 3a 31 cpi r19, 0x1A ; 26 3b3c0: 38 f0 brcs .+14 ; 0x3b3d0 3b3c2: 3f e9 ldi r19, 0x9F ; 159 3b3c4: 31 0f add r19, r17 3b3c6: 3a 31 cpi r19, 0x1A ; 26 3b3c8: 08 f0 brcs .+2 ; 0x3b3cc 3b3ca: 71 cf rjmp .-286 ; 0x3b2ae 3b3cc: 39 ea ldi r19, 0xA9 ; 169 3b3ce: 33 2e mov r3, r19 3b3d0: 31 0e add r3, r17 3b3d2: 3e 14 cp r3, r14 3b3d4: 1f 04 cpc r1, r15 3b3d6: 0c f0 brlt .+2 ; 0x3b3da 3b3d8: 6a cf rjmp .-300 ; 0x3b2ae 3b3da: 27 fd sbrc r18, 7 3b3dc: 15 c0 rjmp .+42 ; 0x3b408 3b3de: 86 16 cp r8, r22 3b3e0: 97 06 cpc r9, r23 3b3e2: a8 06 cpc r10, r24 3b3e4: b9 06 cpc r11, r25 3b3e6: 78 f0 brcs .+30 ; 0x3b406 3b3e8: a3 01 movw r20, r6 3b3ea: 92 01 movw r18, r4 3b3ec: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__mulsi3> 3b3f0: 63 0d add r22, r3 3b3f2: 71 1d adc r23, r1 3b3f4: 81 1d adc r24, r1 3b3f6: 91 1d adc r25, r1 3b3f8: 61 30 cpi r22, 0x01 ; 1 3b3fa: 71 05 cpc r23, r1 3b3fc: 81 05 cpc r24, r1 3b3fe: 20 e8 ldi r18, 0x80 ; 128 3b400: 92 07 cpc r25, r18 3b402: 08 f4 brcc .+2 ; 0x3b406 3b404: 52 cf rjmp .-348 ; 0x3b2aa 3b406: 2f ef ldi r18, 0xFF ; 255 3b408: 21 96 adiw r28, 0x01 ; 1 3b40a: 10 81 ld r17, Z 3b40c: cd cf rjmp .-102 ; 0x3b3a8 3b40e: 10 33 cpi r17, 0x30 ; 48 3b410: 09 f4 brne .+2 ; 0x3b414 3b412: 1e cf rjmp .-452 ; 0x3b250 3b414: 2a e0 ldi r18, 0x0A ; 10 3b416: e2 2e mov r14, r18 3b418: f1 2c mov r15, r1 3b41a: 9c ec ldi r25, 0xCC ; 204 3b41c: 89 2e mov r8, r25 3b41e: 98 2c mov r9, r8 3b420: a8 2c mov r10, r8 3b422: 9c e0 ldi r25, 0x0C ; 12 3b424: b9 2e mov r11, r25 3b426: b7 cf rjmp .-146 ; 0x3b396 0003b428 <__ftoa_engine>: 3b428: 28 30 cpi r18, 0x08 ; 8 3b42a: 08 f0 brcs .+2 ; 0x3b42e <__ftoa_engine+0x6> 3b42c: 27 e0 ldi r18, 0x07 ; 7 3b42e: 33 27 eor r19, r19 3b430: da 01 movw r26, r20 3b432: 99 0f add r25, r25 3b434: 31 1d adc r19, r1 3b436: 87 fd sbrc r24, 7 3b438: 91 60 ori r25, 0x01 ; 1 3b43a: 00 96 adiw r24, 0x00 ; 0 3b43c: 61 05 cpc r22, r1 3b43e: 71 05 cpc r23, r1 3b440: 39 f4 brne .+14 ; 0x3b450 <__ftoa_engine+0x28> 3b442: 32 60 ori r19, 0x02 ; 2 3b444: 2e 5f subi r18, 0xFE ; 254 3b446: 3d 93 st X+, r19 3b448: 30 e3 ldi r19, 0x30 ; 48 3b44a: 2a 95 dec r18 3b44c: e1 f7 brne .-8 ; 0x3b446 <__ftoa_engine+0x1e> 3b44e: 08 95 ret 3b450: 9f 3f cpi r25, 0xFF ; 255 3b452: 30 f0 brcs .+12 ; 0x3b460 <__ftoa_engine+0x38> 3b454: 80 38 cpi r24, 0x80 ; 128 3b456: 71 05 cpc r23, r1 3b458: 61 05 cpc r22, r1 3b45a: 09 f0 breq .+2 ; 0x3b45e <__ftoa_engine+0x36> 3b45c: 3c 5f subi r19, 0xFC ; 252 3b45e: 3c 5f subi r19, 0xFC ; 252 3b460: 3d 93 st X+, r19 3b462: 91 30 cpi r25, 0x01 ; 1 3b464: 08 f0 brcs .+2 ; 0x3b468 <__ftoa_engine+0x40> 3b466: 80 68 ori r24, 0x80 ; 128 3b468: 91 1d adc r25, r1 3b46a: df 93 push r29 3b46c: cf 93 push r28 3b46e: 1f 93 push r17 3b470: 0f 93 push r16 3b472: ff 92 push r15 3b474: ef 92 push r14 3b476: 19 2f mov r17, r25 3b478: 98 7f andi r25, 0xF8 ; 248 3b47a: 96 95 lsr r25 3b47c: e9 2f mov r30, r25 3b47e: 96 95 lsr r25 3b480: 96 95 lsr r25 3b482: e9 0f add r30, r25 3b484: ff 27 eor r31, r31 3b486: e6 50 subi r30, 0x06 ; 6 3b488: f8 48 sbci r31, 0x88 ; 136 3b48a: 99 27 eor r25, r25 3b48c: 33 27 eor r19, r19 3b48e: ee 24 eor r14, r14 3b490: ff 24 eor r15, r15 3b492: a7 01 movw r20, r14 3b494: e7 01 movw r28, r14 3b496: 05 90 lpm r0, Z+ 3b498: 08 94 sec 3b49a: 07 94 ror r0 3b49c: 28 f4 brcc .+10 ; 0x3b4a8 <__ftoa_engine+0x80> 3b49e: 36 0f add r19, r22 3b4a0: e7 1e adc r14, r23 3b4a2: f8 1e adc r15, r24 3b4a4: 49 1f adc r20, r25 3b4a6: 51 1d adc r21, r1 3b4a8: 66 0f add r22, r22 3b4aa: 77 1f adc r23, r23 3b4ac: 88 1f adc r24, r24 3b4ae: 99 1f adc r25, r25 3b4b0: 06 94 lsr r0 3b4b2: a1 f7 brne .-24 ; 0x3b49c <__ftoa_engine+0x74> 3b4b4: 05 90 lpm r0, Z+ 3b4b6: 07 94 ror r0 3b4b8: 28 f4 brcc .+10 ; 0x3b4c4 <__ftoa_engine+0x9c> 3b4ba: e7 0e add r14, r23 3b4bc: f8 1e adc r15, r24 3b4be: 49 1f adc r20, r25 3b4c0: 56 1f adc r21, r22 3b4c2: c1 1d adc r28, r1 3b4c4: 77 0f add r23, r23 3b4c6: 88 1f adc r24, r24 3b4c8: 99 1f adc r25, r25 3b4ca: 66 1f adc r22, r22 3b4cc: 06 94 lsr r0 3b4ce: a1 f7 brne .-24 ; 0x3b4b8 <__ftoa_engine+0x90> 3b4d0: 05 90 lpm r0, Z+ 3b4d2: 07 94 ror r0 3b4d4: 28 f4 brcc .+10 ; 0x3b4e0 <__ftoa_engine+0xb8> 3b4d6: f8 0e add r15, r24 3b4d8: 49 1f adc r20, r25 3b4da: 56 1f adc r21, r22 3b4dc: c7 1f adc r28, r23 3b4de: d1 1d adc r29, r1 3b4e0: 88 0f add r24, r24 3b4e2: 99 1f adc r25, r25 3b4e4: 66 1f adc r22, r22 3b4e6: 77 1f adc r23, r23 3b4e8: 06 94 lsr r0 3b4ea: a1 f7 brne .-24 ; 0x3b4d4 <__ftoa_engine+0xac> 3b4ec: 05 90 lpm r0, Z+ 3b4ee: 07 94 ror r0 3b4f0: 20 f4 brcc .+8 ; 0x3b4fa <__ftoa_engine+0xd2> 3b4f2: 49 0f add r20, r25 3b4f4: 56 1f adc r21, r22 3b4f6: c7 1f adc r28, r23 3b4f8: d8 1f adc r29, r24 3b4fa: 99 0f add r25, r25 3b4fc: 66 1f adc r22, r22 3b4fe: 77 1f adc r23, r23 3b500: 88 1f adc r24, r24 3b502: 06 94 lsr r0 3b504: a9 f7 brne .-22 ; 0x3b4f0 <__ftoa_engine+0xc8> 3b506: 84 91 lpm r24, Z 3b508: 10 95 com r17 3b50a: 17 70 andi r17, 0x07 ; 7 3b50c: 41 f0 breq .+16 ; 0x3b51e <__ftoa_engine+0xf6> 3b50e: d6 95 lsr r29 3b510: c7 95 ror r28 3b512: 57 95 ror r21 3b514: 47 95 ror r20 3b516: f7 94 ror r15 3b518: e7 94 ror r14 3b51a: 1a 95 dec r17 3b51c: c1 f7 brne .-16 ; 0x3b50e <__ftoa_engine+0xe6> 3b51e: e0 ea ldi r30, 0xA0 ; 160 3b520: f7 e7 ldi r31, 0x77 ; 119 3b522: 68 94 set 3b524: 15 90 lpm r1, Z+ 3b526: 15 91 lpm r17, Z+ 3b528: 35 91 lpm r19, Z+ 3b52a: 65 91 lpm r22, Z+ 3b52c: 95 91 lpm r25, Z+ 3b52e: 05 90 lpm r0, Z+ 3b530: 7f e2 ldi r23, 0x2F ; 47 3b532: 73 95 inc r23 3b534: e1 18 sub r14, r1 3b536: f1 0a sbc r15, r17 3b538: 43 0b sbc r20, r19 3b53a: 56 0b sbc r21, r22 3b53c: c9 0b sbc r28, r25 3b53e: d0 09 sbc r29, r0 3b540: c0 f7 brcc .-16 ; 0x3b532 <__ftoa_engine+0x10a> 3b542: e1 0c add r14, r1 3b544: f1 1e adc r15, r17 3b546: 43 1f adc r20, r19 3b548: 56 1f adc r21, r22 3b54a: c9 1f adc r28, r25 3b54c: d0 1d adc r29, r0 3b54e: 7e f4 brtc .+30 ; 0x3b56e <__ftoa_engine+0x146> 3b550: 70 33 cpi r23, 0x30 ; 48 3b552: 11 f4 brne .+4 ; 0x3b558 <__ftoa_engine+0x130> 3b554: 8a 95 dec r24 3b556: e6 cf rjmp .-52 ; 0x3b524 <__ftoa_engine+0xfc> 3b558: e8 94 clt 3b55a: 01 50 subi r16, 0x01 ; 1 3b55c: 30 f0 brcs .+12 ; 0x3b56a <__ftoa_engine+0x142> 3b55e: 08 0f add r16, r24 3b560: 0a f4 brpl .+2 ; 0x3b564 <__ftoa_engine+0x13c> 3b562: 00 27 eor r16, r16 3b564: 02 17 cp r16, r18 3b566: 08 f4 brcc .+2 ; 0x3b56a <__ftoa_engine+0x142> 3b568: 20 2f mov r18, r16 3b56a: 23 95 inc r18 3b56c: 02 2f mov r16, r18 3b56e: 7a 33 cpi r23, 0x3A ; 58 3b570: 28 f0 brcs .+10 ; 0x3b57c <__ftoa_engine+0x154> 3b572: 79 e3 ldi r23, 0x39 ; 57 3b574: 7d 93 st X+, r23 3b576: 2a 95 dec r18 3b578: e9 f7 brne .-6 ; 0x3b574 <__ftoa_engine+0x14c> 3b57a: 10 c0 rjmp .+32 ; 0x3b59c <__ftoa_engine+0x174> 3b57c: 7d 93 st X+, r23 3b57e: 2a 95 dec r18 3b580: 89 f6 brne .-94 ; 0x3b524 <__ftoa_engine+0xfc> 3b582: 06 94 lsr r0 3b584: 97 95 ror r25 3b586: 67 95 ror r22 3b588: 37 95 ror r19 3b58a: 17 95 ror r17 3b58c: 17 94 ror r1 3b58e: e1 18 sub r14, r1 3b590: f1 0a sbc r15, r17 3b592: 43 0b sbc r20, r19 3b594: 56 0b sbc r21, r22 3b596: c9 0b sbc r28, r25 3b598: d0 09 sbc r29, r0 3b59a: 98 f0 brcs .+38 ; 0x3b5c2 <__ftoa_engine+0x19a> 3b59c: 23 95 inc r18 3b59e: 7e 91 ld r23, -X 3b5a0: 73 95 inc r23 3b5a2: 7a 33 cpi r23, 0x3A ; 58 3b5a4: 08 f0 brcs .+2 ; 0x3b5a8 <__ftoa_engine+0x180> 3b5a6: 70 e3 ldi r23, 0x30 ; 48 3b5a8: 7c 93 st X, r23 3b5aa: 20 13 cpse r18, r16 3b5ac: b8 f7 brcc .-18 ; 0x3b59c <__ftoa_engine+0x174> 3b5ae: 7e 91 ld r23, -X 3b5b0: 70 61 ori r23, 0x10 ; 16 3b5b2: 7d 93 st X+, r23 3b5b4: 30 f0 brcs .+12 ; 0x3b5c2 <__ftoa_engine+0x19a> 3b5b6: 83 95 inc r24 3b5b8: 71 e3 ldi r23, 0x31 ; 49 3b5ba: 7d 93 st X+, r23 3b5bc: 70 e3 ldi r23, 0x30 ; 48 3b5be: 2a 95 dec r18 3b5c0: e1 f7 brne .-8 ; 0x3b5ba <__ftoa_engine+0x192> 3b5c2: 11 24 eor r1, r1 3b5c4: ef 90 pop r14 3b5c6: ff 90 pop r15 3b5c8: 0f 91 pop r16 3b5ca: 1f 91 pop r17 3b5cc: cf 91 pop r28 3b5ce: df 91 pop r29 3b5d0: 99 27 eor r25, r25 3b5d2: 87 fd sbrc r24, 7 3b5d4: 90 95 com r25 3b5d6: 08 95 ret 0003b5d8 : 3b5d8: 91 11 cpse r25, r1 3b5da: 0d 94 48 dd jmp 0x3ba90 ; 0x3ba90 <__ctype_isfalse> 3b5de: 80 32 cpi r24, 0x20 ; 32 3b5e0: 19 f0 breq .+6 ; 0x3b5e8 3b5e2: 89 50 subi r24, 0x09 ; 9 3b5e4: 85 50 subi r24, 0x05 ; 5 3b5e6: c8 f7 brcc .-14 ; 0x3b5da 3b5e8: 08 95 ret 0003b5ea : 3b5ea: fb 01 movw r30, r22 3b5ec: dc 01 movw r26, r24 3b5ee: 02 c0 rjmp .+4 ; 0x3b5f4 3b5f0: 05 90 lpm r0, Z+ 3b5f2: 0d 92 st X+, r0 3b5f4: 41 50 subi r20, 0x01 ; 1 3b5f6: 50 40 sbci r21, 0x00 ; 0 3b5f8: d8 f7 brcc .-10 ; 0x3b5f0 3b5fa: 08 95 ret 0003b5fc : 3b5fc: fb 01 movw r30, r22 3b5fe: dc 01 movw r26, r24 3b600: 0d 90 ld r0, X+ 3b602: 00 20 and r0, r0 3b604: e9 f7 brne .-6 ; 0x3b600 3b606: 11 97 sbiw r26, 0x01 ; 1 3b608: 05 90 lpm r0, Z+ 3b60a: 0d 92 st X+, r0 3b60c: 00 20 and r0, r0 3b60e: e1 f7 brne .-8 ; 0x3b608 3b610: 08 95 ret 0003b612 : 3b612: fb 01 movw r30, r22 3b614: dc 01 movw r26, r24 3b616: 8d 91 ld r24, X+ 3b618: 05 90 lpm r0, Z+ 3b61a: 80 19 sub r24, r0 3b61c: 01 10 cpse r0, r1 3b61e: d9 f3 breq .-10 ; 0x3b616 3b620: 99 0b sbc r25, r25 3b622: 08 95 ret 0003b624 : 3b624: fb 01 movw r30, r22 3b626: dc 01 movw r26, r24 3b628: 05 90 lpm r0, Z+ 3b62a: 0d 92 st X+, r0 3b62c: 00 20 and r0, r0 3b62e: e1 f7 brne .-8 ; 0x3b628 3b630: 08 95 ret 0003b632 <__strlen_P>: 3b632: fc 01 movw r30, r24 3b634: 05 90 lpm r0, Z+ 3b636: 00 20 and r0, r0 3b638: e9 f7 brne .-6 ; 0x3b634 <__strlen_P+0x2> 3b63a: 80 95 com r24 3b63c: 90 95 com r25 3b63e: 8e 0f add r24, r30 3b640: 9f 1f adc r25, r31 3b642: 08 95 ret 0003b644 : 3b644: fb 01 movw r30, r22 3b646: dc 01 movw r26, r24 3b648: 41 50 subi r20, 0x01 ; 1 3b64a: 50 40 sbci r21, 0x00 ; 0 3b64c: 88 f0 brcs .+34 ; 0x3b670 3b64e: 8d 91 ld r24, X+ 3b650: 81 34 cpi r24, 0x41 ; 65 3b652: 1c f0 brlt .+6 ; 0x3b65a 3b654: 8b 35 cpi r24, 0x5B ; 91 3b656: 0c f4 brge .+2 ; 0x3b65a 3b658: 80 5e subi r24, 0xE0 ; 224 3b65a: 65 91 lpm r22, Z+ 3b65c: 61 34 cpi r22, 0x41 ; 65 3b65e: 1c f0 brlt .+6 ; 0x3b666 3b660: 6b 35 cpi r22, 0x5B ; 91 3b662: 0c f4 brge .+2 ; 0x3b666 3b664: 60 5e subi r22, 0xE0 ; 224 3b666: 86 1b sub r24, r22 3b668: 61 11 cpse r22, r1 3b66a: 71 f3 breq .-36 ; 0x3b648 3b66c: 99 0b sbc r25, r25 3b66e: 08 95 ret 3b670: 88 1b sub r24, r24 3b672: fc cf rjmp .-8 ; 0x3b66c 0003b674 : 3b674: fb 01 movw r30, r22 3b676: dc 01 movw r26, r24 3b678: 41 50 subi r20, 0x01 ; 1 3b67a: 50 40 sbci r21, 0x00 ; 0 3b67c: 30 f0 brcs .+12 ; 0x3b68a 3b67e: 8d 91 ld r24, X+ 3b680: 05 90 lpm r0, Z+ 3b682: 80 19 sub r24, r0 3b684: 19 f4 brne .+6 ; 0x3b68c 3b686: 00 20 and r0, r0 3b688: b9 f7 brne .-18 ; 0x3b678 3b68a: 88 1b sub r24, r24 3b68c: 99 0b sbc r25, r25 3b68e: 08 95 ret 0003b690 : 3b690: fb 01 movw r30, r22 3b692: dc 01 movw r26, r24 3b694: 41 50 subi r20, 0x01 ; 1 3b696: 50 40 sbci r21, 0x00 ; 0 3b698: 48 f0 brcs .+18 ; 0x3b6ac 3b69a: 05 90 lpm r0, Z+ 3b69c: 0d 92 st X+, r0 3b69e: 00 20 and r0, r0 3b6a0: c9 f7 brne .-14 ; 0x3b694 3b6a2: 01 c0 rjmp .+2 ; 0x3b6a6 3b6a4: 1d 92 st X+, r1 3b6a6: 41 50 subi r20, 0x01 ; 1 3b6a8: 50 40 sbci r21, 0x00 ; 0 3b6aa: e0 f7 brcc .-8 ; 0x3b6a4 3b6ac: 08 95 ret 0003b6ae : 3b6ae: fc 01 movw r30, r24 3b6b0: 05 90 lpm r0, Z+ 3b6b2: 61 50 subi r22, 0x01 ; 1 3b6b4: 70 40 sbci r23, 0x00 ; 0 3b6b6: 01 10 cpse r0, r1 3b6b8: d8 f7 brcc .-10 ; 0x3b6b0 3b6ba: 80 95 com r24 3b6bc: 90 95 com r25 3b6be: 8e 0f add r24, r30 3b6c0: 9f 1f adc r25, r31 3b6c2: 08 95 ret 0003b6c4 : 3b6c4: fb 01 movw r30, r22 3b6c6: 55 91 lpm r21, Z+ 3b6c8: 55 23 and r21, r21 3b6ca: a9 f0 breq .+42 ; 0x3b6f6 3b6cc: bf 01 movw r22, r30 3b6ce: dc 01 movw r26, r24 3b6d0: 4d 91 ld r20, X+ 3b6d2: 45 17 cp r20, r21 3b6d4: 41 11 cpse r20, r1 3b6d6: e1 f7 brne .-8 ; 0x3b6d0 3b6d8: 59 f4 brne .+22 ; 0x3b6f0 3b6da: cd 01 movw r24, r26 3b6dc: 05 90 lpm r0, Z+ 3b6de: 00 20 and r0, r0 3b6e0: 49 f0 breq .+18 ; 0x3b6f4 3b6e2: 4d 91 ld r20, X+ 3b6e4: 40 15 cp r20, r0 3b6e6: 41 11 cpse r20, r1 3b6e8: c9 f3 breq .-14 ; 0x3b6dc 3b6ea: fb 01 movw r30, r22 3b6ec: 41 11 cpse r20, r1 3b6ee: ef cf rjmp .-34 ; 0x3b6ce 3b6f0: 81 e0 ldi r24, 0x01 ; 1 3b6f2: 90 e0 ldi r25, 0x00 ; 0 3b6f4: 01 97 sbiw r24, 0x01 ; 1 3b6f6: 08 95 ret 0003b6f8 : 3b6f8: fc 01 movw r30, r24 3b6fa: 61 50 subi r22, 0x01 ; 1 3b6fc: 70 40 sbci r23, 0x00 ; 0 3b6fe: 01 90 ld r0, Z+ 3b700: 01 10 cpse r0, r1 3b702: d8 f7 brcc .-10 ; 0x3b6fa 3b704: 80 95 com r24 3b706: 90 95 com r25 3b708: 8e 0f add r24, r30 3b70a: 9f 1f adc r25, r31 3b70c: 08 95 ret 0003b70e : 3b70e: cf 93 push r28 3b710: df 93 push r29 3b712: ec 01 movw r28, r24 3b714: 2b 81 ldd r18, Y+3 ; 0x03 3b716: 20 ff sbrs r18, 0 3b718: 1a c0 rjmp .+52 ; 0x3b74e 3b71a: 26 ff sbrs r18, 6 3b71c: 0c c0 rjmp .+24 ; 0x3b736 3b71e: 2f 7b andi r18, 0xBF ; 191 3b720: 2b 83 std Y+3, r18 ; 0x03 3b722: 8e 81 ldd r24, Y+6 ; 0x06 3b724: 9f 81 ldd r25, Y+7 ; 0x07 3b726: 01 96 adiw r24, 0x01 ; 1 3b728: 9f 83 std Y+7, r25 ; 0x07 3b72a: 8e 83 std Y+6, r24 ; 0x06 3b72c: 8a 81 ldd r24, Y+2 ; 0x02 3b72e: 90 e0 ldi r25, 0x00 ; 0 3b730: df 91 pop r29 3b732: cf 91 pop r28 3b734: 08 95 ret 3b736: 22 ff sbrs r18, 2 3b738: 18 c0 rjmp .+48 ; 0x3b76a 3b73a: e8 81 ld r30, Y 3b73c: f9 81 ldd r31, Y+1 ; 0x01 3b73e: 80 81 ld r24, Z 3b740: 08 2e mov r0, r24 3b742: 00 0c add r0, r0 3b744: 99 0b sbc r25, r25 3b746: 00 97 sbiw r24, 0x00 ; 0 3b748: 29 f4 brne .+10 ; 0x3b754 3b74a: 20 62 ori r18, 0x20 ; 32 3b74c: 2b 83 std Y+3, r18 ; 0x03 3b74e: 8f ef ldi r24, 0xFF ; 255 3b750: 9f ef ldi r25, 0xFF ; 255 3b752: ee cf rjmp .-36 ; 0x3b730 3b754: 31 96 adiw r30, 0x01 ; 1 3b756: f9 83 std Y+1, r31 ; 0x01 3b758: e8 83 st Y, r30 3b75a: 2e 81 ldd r18, Y+6 ; 0x06 3b75c: 3f 81 ldd r19, Y+7 ; 0x07 3b75e: 2f 5f subi r18, 0xFF ; 255 3b760: 3f 4f sbci r19, 0xFF ; 255 3b762: 3f 83 std Y+7, r19 ; 0x07 3b764: 2e 83 std Y+6, r18 ; 0x06 3b766: 99 27 eor r25, r25 3b768: e3 cf rjmp .-58 ; 0x3b730 3b76a: ea 85 ldd r30, Y+10 ; 0x0a 3b76c: fb 85 ldd r31, Y+11 ; 0x0b 3b76e: 19 95 eicall 3b770: 97 ff sbrs r25, 7 3b772: f3 cf rjmp .-26 ; 0x3b75a 3b774: 2b 81 ldd r18, Y+3 ; 0x03 3b776: 01 96 adiw r24, 0x01 ; 1 3b778: 21 f0 breq .+8 ; 0x3b782 3b77a: 80 e2 ldi r24, 0x20 ; 32 3b77c: 82 2b or r24, r18 3b77e: 8b 83 std Y+3, r24 ; 0x03 3b780: e6 cf rjmp .-52 ; 0x3b74e 3b782: 80 e1 ldi r24, 0x10 ; 16 3b784: fb cf rjmp .-10 ; 0x3b77c 0003b786 : 3b786: 0f 93 push r16 3b788: 1f 93 push r17 3b78a: cf 93 push r28 3b78c: df 93 push r29 3b78e: 18 2f mov r17, r24 3b790: 09 2f mov r16, r25 3b792: eb 01 movw r28, r22 3b794: 8b 81 ldd r24, Y+3 ; 0x03 3b796: 81 fd sbrc r24, 1 3b798: 09 c0 rjmp .+18 ; 0x3b7ac 3b79a: 1f ef ldi r17, 0xFF ; 255 3b79c: 0f ef ldi r16, 0xFF ; 255 3b79e: 81 2f mov r24, r17 3b7a0: 90 2f mov r25, r16 3b7a2: df 91 pop r29 3b7a4: cf 91 pop r28 3b7a6: 1f 91 pop r17 3b7a8: 0f 91 pop r16 3b7aa: 08 95 ret 3b7ac: 82 ff sbrs r24, 2 3b7ae: 14 c0 rjmp .+40 ; 0x3b7d8 3b7b0: 2e 81 ldd r18, Y+6 ; 0x06 3b7b2: 3f 81 ldd r19, Y+7 ; 0x07 3b7b4: 8c 81 ldd r24, Y+4 ; 0x04 3b7b6: 9d 81 ldd r25, Y+5 ; 0x05 3b7b8: 28 17 cp r18, r24 3b7ba: 39 07 cpc r19, r25 3b7bc: 3c f4 brge .+14 ; 0x3b7cc 3b7be: e8 81 ld r30, Y 3b7c0: f9 81 ldd r31, Y+1 ; 0x01 3b7c2: cf 01 movw r24, r30 3b7c4: 01 96 adiw r24, 0x01 ; 1 3b7c6: 99 83 std Y+1, r25 ; 0x01 3b7c8: 88 83 st Y, r24 3b7ca: 10 83 st Z, r17 3b7cc: 8e 81 ldd r24, Y+6 ; 0x06 3b7ce: 9f 81 ldd r25, Y+7 ; 0x07 3b7d0: 01 96 adiw r24, 0x01 ; 1 3b7d2: 9f 83 std Y+7, r25 ; 0x07 3b7d4: 8e 83 std Y+6, r24 ; 0x06 3b7d6: e3 cf rjmp .-58 ; 0x3b79e 3b7d8: e8 85 ldd r30, Y+8 ; 0x08 3b7da: f9 85 ldd r31, Y+9 ; 0x09 3b7dc: 81 2f mov r24, r17 3b7de: 19 95 eicall 3b7e0: 89 2b or r24, r25 3b7e2: a1 f3 breq .-24 ; 0x3b7cc 3b7e4: da cf rjmp .-76 ; 0x3b79a 0003b7e6 : 3b7e6: ef 92 push r14 3b7e8: ff 92 push r15 3b7ea: 0f 93 push r16 3b7ec: 1f 93 push r17 3b7ee: cf 93 push r28 3b7f0: df 93 push r29 3b7f2: 8c 01 movw r16, r24 3b7f4: 7b 01 movw r14, r22 3b7f6: db 01 movw r26, r22 3b7f8: 13 96 adiw r26, 0x03 ; 3 3b7fa: 8c 91 ld r24, X 3b7fc: d0 e0 ldi r29, 0x00 ; 0 3b7fe: c0 e0 ldi r28, 0x00 ; 0 3b800: 81 fd sbrc r24, 1 3b802: 0f c0 rjmp .+30 ; 0x3b822 3b804: cf ef ldi r28, 0xFF ; 255 3b806: df ef ldi r29, 0xFF ; 255 3b808: 10 c0 rjmp .+32 ; 0x3b82a 3b80a: d7 01 movw r26, r14 3b80c: 18 96 adiw r26, 0x08 ; 8 3b80e: ed 91 ld r30, X+ 3b810: fc 91 ld r31, X 3b812: b7 01 movw r22, r14 3b814: 19 95 eicall 3b816: 89 2b or r24, r25 3b818: 11 f0 breq .+4 ; 0x3b81e 3b81a: cf ef ldi r28, 0xFF ; 255 3b81c: df ef ldi r29, 0xFF ; 255 3b81e: 0f 5f subi r16, 0xFF ; 255 3b820: 1f 4f sbci r17, 0xFF ; 255 3b822: f8 01 movw r30, r16 3b824: 84 91 lpm r24, Z 3b826: 81 11 cpse r24, r1 3b828: f0 cf rjmp .-32 ; 0x3b80a 3b82a: ce 01 movw r24, r28 3b82c: df 91 pop r29 3b82e: cf 91 pop r28 3b830: 1f 91 pop r17 3b832: 0f 91 pop r16 3b834: ff 90 pop r15 3b836: ef 90 pop r14 3b838: 08 95 ret 0003b83a : 3b83a: 0f 93 push r16 3b83c: 1f 93 push r17 3b83e: cf 93 push r28 3b840: df 93 push r29 3b842: cd b7 in r28, 0x3d ; 61 3b844: de b7 in r29, 0x3e ; 62 3b846: ae 01 movw r20, r28 3b848: 48 5f subi r20, 0xF8 ; 248 3b84a: 5f 4f sbci r21, 0xFF ; 255 3b84c: da 01 movw r26, r20 3b84e: 6d 91 ld r22, X+ 3b850: 7d 91 ld r23, X+ 3b852: ad 01 movw r20, r26 3b854: 03 e1 ldi r16, 0x13 ; 19 3b856: 18 e1 ldi r17, 0x18 ; 24 3b858: f8 01 movw r30, r16 3b85a: 82 81 ldd r24, Z+2 ; 0x02 3b85c: 93 81 ldd r25, Z+3 ; 0x03 3b85e: dc 01 movw r26, r24 3b860: 13 96 adiw r26, 0x03 ; 3 3b862: 2c 91 ld r18, X 3b864: 13 97 sbiw r26, 0x03 ; 3 3b866: 28 60 ori r18, 0x08 ; 8 3b868: 13 96 adiw r26, 0x03 ; 3 3b86a: 2c 93 st X, r18 3b86c: 0e 94 0f 58 call 0xb01e ; 0xb01e 3b870: d8 01 movw r26, r16 3b872: 12 96 adiw r26, 0x02 ; 2 3b874: ed 91 ld r30, X+ 3b876: fc 91 ld r31, X 3b878: 23 81 ldd r18, Z+3 ; 0x03 3b87a: 27 7f andi r18, 0xF7 ; 247 3b87c: 23 83 std Z+3, r18 ; 0x03 3b87e: df 91 pop r29 3b880: cf 91 pop r28 3b882: 1f 91 pop r17 3b884: 0f 91 pop r16 3b886: 08 95 ret 0003b888 : 3b888: 0f 93 push r16 3b88a: 1f 93 push r17 3b88c: cf 93 push r28 3b88e: df 93 push r29 3b890: 8c 01 movw r16, r24 3b892: e0 91 15 18 lds r30, 0x1815 ; 0x801815 <__iob+0x2> 3b896: f0 91 16 18 lds r31, 0x1816 ; 0x801816 <__iob+0x3> 3b89a: 83 81 ldd r24, Z+3 ; 0x03 3b89c: d0 e0 ldi r29, 0x00 ; 0 3b89e: c0 e0 ldi r28, 0x00 ; 0 3b8a0: 81 fd sbrc r24, 1 3b8a2: 0a c0 rjmp .+20 ; 0x3b8b8 3b8a4: cf ef ldi r28, 0xFF ; 255 3b8a6: df ef ldi r29, 0xFF ; 255 3b8a8: 17 c0 rjmp .+46 ; 0x3b8d8 3b8aa: 19 95 eicall 3b8ac: 89 2b or r24, r25 3b8ae: 11 f0 breq .+4 ; 0x3b8b4 3b8b0: cf ef ldi r28, 0xFF ; 255 3b8b2: df ef ldi r29, 0xFF ; 255 3b8b4: 0f 5f subi r16, 0xFF ; 255 3b8b6: 1f 4f sbci r17, 0xFF ; 255 3b8b8: f8 01 movw r30, r16 3b8ba: 84 91 lpm r24, Z 3b8bc: 60 91 15 18 lds r22, 0x1815 ; 0x801815 <__iob+0x2> 3b8c0: 70 91 16 18 lds r23, 0x1816 ; 0x801816 <__iob+0x3> 3b8c4: db 01 movw r26, r22 3b8c6: 18 96 adiw r26, 0x08 ; 8 3b8c8: ed 91 ld r30, X+ 3b8ca: fc 91 ld r31, X 3b8cc: 81 11 cpse r24, r1 3b8ce: ed cf rjmp .-38 ; 0x3b8aa 3b8d0: 8a e0 ldi r24, 0x0A ; 10 3b8d2: 19 95 eicall 3b8d4: 89 2b or r24, r25 3b8d6: 31 f7 brne .-52 ; 0x3b8a4 3b8d8: ce 01 movw r24, r28 3b8da: df 91 pop r29 3b8dc: cf 91 pop r28 3b8de: 1f 91 pop r17 3b8e0: 0f 91 pop r16 3b8e2: 08 95 ret 0003b8e4 : 3b8e4: 0f 93 push r16 3b8e6: 1f 93 push r17 3b8e8: cf 93 push r28 3b8ea: df 93 push r29 3b8ec: cd b7 in r28, 0x3d ; 61 3b8ee: de b7 in r29, 0x3e ; 62 3b8f0: 2e 97 sbiw r28, 0x0e ; 14 3b8f2: 0f b6 in r0, 0x3f ; 63 3b8f4: f8 94 cli 3b8f6: de bf out 0x3e, r29 ; 62 3b8f8: 0f be out 0x3f, r0 ; 63 3b8fa: cd bf out 0x3d, r28 ; 61 3b8fc: 0e 89 ldd r16, Y+22 ; 0x16 3b8fe: 1f 89 ldd r17, Y+23 ; 0x17 3b900: 8e e0 ldi r24, 0x0E ; 14 3b902: 8c 83 std Y+4, r24 ; 0x04 3b904: 1a 83 std Y+2, r17 ; 0x02 3b906: 09 83 std Y+1, r16 ; 0x01 3b908: 8f ef ldi r24, 0xFF ; 255 3b90a: 9f e7 ldi r25, 0x7F ; 127 3b90c: 9e 83 std Y+6, r25 ; 0x06 3b90e: 8d 83 std Y+5, r24 ; 0x05 3b910: ae 01 movw r20, r28 3b912: 46 5e subi r20, 0xE6 ; 230 3b914: 5f 4f sbci r21, 0xFF ; 255 3b916: 68 8d ldd r22, Y+24 ; 0x18 3b918: 79 8d ldd r23, Y+25 ; 0x19 3b91a: ce 01 movw r24, r28 3b91c: 01 96 adiw r24, 0x01 ; 1 3b91e: 0e 94 0f 58 call 0xb01e ; 0xb01e 3b922: 2f 81 ldd r18, Y+7 ; 0x07 3b924: 38 85 ldd r19, Y+8 ; 0x08 3b926: 02 0f add r16, r18 3b928: 13 1f adc r17, r19 3b92a: f8 01 movw r30, r16 3b92c: 10 82 st Z, r1 3b92e: 2e 96 adiw r28, 0x0e ; 14 3b930: 0f b6 in r0, 0x3f ; 63 3b932: f8 94 cli 3b934: de bf out 0x3e, r29 ; 62 3b936: 0f be out 0x3f, r0 ; 63 3b938: cd bf out 0x3d, r28 ; 61 3b93a: df 91 pop r29 3b93c: cf 91 pop r28 3b93e: 1f 91 pop r17 3b940: 0f 91 pop r16 3b942: 08 95 ret 0003b944 : 3b944: cf 93 push r28 3b946: df 93 push r29 3b948: ec 01 movw r28, r24 3b94a: 8b 81 ldd r24, Y+3 ; 0x03 3b94c: 88 60 ori r24, 0x08 ; 8 3b94e: 8b 83 std Y+3, r24 ; 0x03 3b950: ce 01 movw r24, r28 3b952: 0e 94 0f 58 call 0xb01e ; 0xb01e 3b956: 2b 81 ldd r18, Y+3 ; 0x03 3b958: 27 7f andi r18, 0xF7 ; 247 3b95a: 2b 83 std Y+3, r18 ; 0x03 3b95c: df 91 pop r29 3b95e: cf 91 pop r28 3b960: 08 95 ret 0003b962 : 3b962: 0f 93 push r16 3b964: 1f 93 push r17 3b966: cf 93 push r28 3b968: df 93 push r29 3b96a: cd b7 in r28, 0x3d ; 61 3b96c: de b7 in r29, 0x3e ; 62 3b96e: 2e 97 sbiw r28, 0x0e ; 14 3b970: 0f b6 in r0, 0x3f ; 63 3b972: f8 94 cli 3b974: de bf out 0x3e, r29 ; 62 3b976: 0f be out 0x3f, r0 ; 63 3b978: cd bf out 0x3d, r28 ; 61 3b97a: 8c 01 movw r16, r24 3b97c: fa 01 movw r30, r20 3b97e: 8e e0 ldi r24, 0x0E ; 14 3b980: 8c 83 std Y+4, r24 ; 0x04 3b982: 1a 83 std Y+2, r17 ; 0x02 3b984: 09 83 std Y+1, r16 ; 0x01 3b986: 77 ff sbrs r23, 7 3b988: 02 c0 rjmp .+4 ; 0x3b98e 3b98a: 60 e0 ldi r22, 0x00 ; 0 3b98c: 70 e8 ldi r23, 0x80 ; 128 3b98e: 61 50 subi r22, 0x01 ; 1 3b990: 71 09 sbc r23, r1 3b992: 7e 83 std Y+6, r23 ; 0x06 3b994: 6d 83 std Y+5, r22 ; 0x05 3b996: a9 01 movw r20, r18 3b998: bf 01 movw r22, r30 3b99a: ce 01 movw r24, r28 3b99c: 01 96 adiw r24, 0x01 ; 1 3b99e: 0e 94 0f 58 call 0xb01e ; 0xb01e 3b9a2: 4d 81 ldd r20, Y+5 ; 0x05 3b9a4: 5e 81 ldd r21, Y+6 ; 0x06 3b9a6: 57 fd sbrc r21, 7 3b9a8: 0a c0 rjmp .+20 ; 0x3b9be 3b9aa: 2f 81 ldd r18, Y+7 ; 0x07 3b9ac: 38 85 ldd r19, Y+8 ; 0x08 3b9ae: 42 17 cp r20, r18 3b9b0: 53 07 cpc r21, r19 3b9b2: 0c f4 brge .+2 ; 0x3b9b6 3b9b4: 9a 01 movw r18, r20 3b9b6: 02 0f add r16, r18 3b9b8: 13 1f adc r17, r19 3b9ba: f8 01 movw r30, r16 3b9bc: 10 82 st Z, r1 3b9be: 2e 96 adiw r28, 0x0e ; 14 3b9c0: 0f b6 in r0, 0x3f ; 63 3b9c2: f8 94 cli 3b9c4: de bf out 0x3e, r29 ; 62 3b9c6: 0f be out 0x3f, r0 ; 63 3b9c8: cd bf out 0x3d, r28 ; 61 3b9ca: df 91 pop r29 3b9cc: cf 91 pop r28 3b9ce: 1f 91 pop r17 3b9d0: 0f 91 pop r16 3b9d2: 08 95 ret 0003b9d4 <__ultoa_invert>: 3b9d4: fa 01 movw r30, r20 3b9d6: aa 27 eor r26, r26 3b9d8: 28 30 cpi r18, 0x08 ; 8 3b9da: 51 f1 breq .+84 ; 0x3ba30 <__ultoa_invert+0x5c> 3b9dc: 20 31 cpi r18, 0x10 ; 16 3b9de: 81 f1 breq .+96 ; 0x3ba40 <__ultoa_invert+0x6c> 3b9e0: e8 94 clt 3b9e2: 6f 93 push r22 3b9e4: 6e 7f andi r22, 0xFE ; 254 3b9e6: 6e 5f subi r22, 0xFE ; 254 3b9e8: 7f 4f sbci r23, 0xFF ; 255 3b9ea: 8f 4f sbci r24, 0xFF ; 255 3b9ec: 9f 4f sbci r25, 0xFF ; 255 3b9ee: af 4f sbci r26, 0xFF ; 255 3b9f0: b1 e0 ldi r27, 0x01 ; 1 3b9f2: 3e d0 rcall .+124 ; 0x3ba70 <__ultoa_invert+0x9c> 3b9f4: b4 e0 ldi r27, 0x04 ; 4 3b9f6: 3c d0 rcall .+120 ; 0x3ba70 <__ultoa_invert+0x9c> 3b9f8: 67 0f add r22, r23 3b9fa: 78 1f adc r23, r24 3b9fc: 89 1f adc r24, r25 3b9fe: 9a 1f adc r25, r26 3ba00: a1 1d adc r26, r1 3ba02: 68 0f add r22, r24 3ba04: 79 1f adc r23, r25 3ba06: 8a 1f adc r24, r26 3ba08: 91 1d adc r25, r1 3ba0a: a1 1d adc r26, r1 3ba0c: 6a 0f add r22, r26 3ba0e: 71 1d adc r23, r1 3ba10: 81 1d adc r24, r1 3ba12: 91 1d adc r25, r1 3ba14: a1 1d adc r26, r1 3ba16: 20 d0 rcall .+64 ; 0x3ba58 <__ultoa_invert+0x84> 3ba18: 09 f4 brne .+2 ; 0x3ba1c <__ultoa_invert+0x48> 3ba1a: 68 94 set 3ba1c: 3f 91 pop r19 3ba1e: 2a e0 ldi r18, 0x0A ; 10 3ba20: 26 9f mul r18, r22 3ba22: 11 24 eor r1, r1 3ba24: 30 19 sub r19, r0 3ba26: 30 5d subi r19, 0xD0 ; 208 3ba28: 31 93 st Z+, r19 3ba2a: de f6 brtc .-74 ; 0x3b9e2 <__ultoa_invert+0xe> 3ba2c: cf 01 movw r24, r30 3ba2e: 08 95 ret 3ba30: 46 2f mov r20, r22 3ba32: 47 70 andi r20, 0x07 ; 7 3ba34: 40 5d subi r20, 0xD0 ; 208 3ba36: 41 93 st Z+, r20 3ba38: b3 e0 ldi r27, 0x03 ; 3 3ba3a: 0f d0 rcall .+30 ; 0x3ba5a <__ultoa_invert+0x86> 3ba3c: c9 f7 brne .-14 ; 0x3ba30 <__ultoa_invert+0x5c> 3ba3e: f6 cf rjmp .-20 ; 0x3ba2c <__ultoa_invert+0x58> 3ba40: 46 2f mov r20, r22 3ba42: 4f 70 andi r20, 0x0F ; 15 3ba44: 40 5d subi r20, 0xD0 ; 208 3ba46: 4a 33 cpi r20, 0x3A ; 58 3ba48: 18 f0 brcs .+6 ; 0x3ba50 <__ultoa_invert+0x7c> 3ba4a: 49 5d subi r20, 0xD9 ; 217 3ba4c: 31 fd sbrc r19, 1 3ba4e: 40 52 subi r20, 0x20 ; 32 3ba50: 41 93 st Z+, r20 3ba52: 02 d0 rcall .+4 ; 0x3ba58 <__ultoa_invert+0x84> 3ba54: a9 f7 brne .-22 ; 0x3ba40 <__ultoa_invert+0x6c> 3ba56: ea cf rjmp .-44 ; 0x3ba2c <__ultoa_invert+0x58> 3ba58: b4 e0 ldi r27, 0x04 ; 4 3ba5a: a6 95 lsr r26 3ba5c: 97 95 ror r25 3ba5e: 87 95 ror r24 3ba60: 77 95 ror r23 3ba62: 67 95 ror r22 3ba64: ba 95 dec r27 3ba66: c9 f7 brne .-14 ; 0x3ba5a <__ultoa_invert+0x86> 3ba68: 00 97 sbiw r24, 0x00 ; 0 3ba6a: 61 05 cpc r22, r1 3ba6c: 71 05 cpc r23, r1 3ba6e: 08 95 ret 3ba70: 9b 01 movw r18, r22 3ba72: ac 01 movw r20, r24 3ba74: 0a 2e mov r0, r26 3ba76: 06 94 lsr r0 3ba78: 57 95 ror r21 3ba7a: 47 95 ror r20 3ba7c: 37 95 ror r19 3ba7e: 27 95 ror r18 3ba80: ba 95 dec r27 3ba82: c9 f7 brne .-14 ; 0x3ba76 <__ultoa_invert+0xa2> 3ba84: 62 0f add r22, r18 3ba86: 73 1f adc r23, r19 3ba88: 84 1f adc r24, r20 3ba8a: 95 1f adc r25, r21 3ba8c: a0 1d adc r26, r0 3ba8e: 08 95 ret 0003ba90 <__ctype_isfalse>: 3ba90: 99 27 eor r25, r25 3ba92: 88 27 eor r24, r24 0003ba94 <__ctype_istrue>: 3ba94: 08 95 ret 0003ba96 : 3ba96: dc 01 movw r26, r24 3ba98: cb 01 movw r24, r22 0003ba9a : 3ba9a: fc 01 movw r30, r24 3ba9c: f9 99 sbic 0x1f, 1 ; 31 3ba9e: fe cf rjmp .-4 ; 0x3ba9c 3baa0: 06 c0 rjmp .+12 ; 0x3baae 3baa2: f2 bd out 0x22, r31 ; 34 3baa4: e1 bd out 0x21, r30 ; 33 3baa6: f8 9a sbi 0x1f, 0 ; 31 3baa8: 31 96 adiw r30, 0x01 ; 1 3baaa: 00 b4 in r0, 0x20 ; 32 3baac: 0d 92 st X+, r0 3baae: 41 50 subi r20, 0x01 ; 1 3bab0: 50 40 sbci r21, 0x00 ; 0 3bab2: b8 f7 brcc .-18 ; 0x3baa2 3bab4: 08 95 ret 0003bab6 : 3bab6: f9 99 sbic 0x1f, 1 ; 31 3bab8: fe cf rjmp .-4 ; 0x3bab6 3baba: 92 bd out 0x22, r25 ; 34 3babc: 81 bd out 0x21, r24 ; 33 3babe: f8 9a sbi 0x1f, 0 ; 31 3bac0: 99 27 eor r25, r25 3bac2: 80 b5 in r24, 0x20 ; 32 3bac4: 08 95 ret 0003bac6 : 3bac6: a6 e1 ldi r26, 0x16 ; 22 3bac8: b0 e0 ldi r27, 0x00 ; 0 3baca: 44 e0 ldi r20, 0x04 ; 4 3bacc: 50 e0 ldi r21, 0x00 ; 0 3bace: 0d 94 4d dd jmp 0x3ba9a ; 0x3ba9a 0003bad2 : 3bad2: a8 e1 ldi r26, 0x18 ; 24 3bad4: b0 e0 ldi r27, 0x00 ; 0 3bad6: 42 e0 ldi r20, 0x02 ; 2 3bad8: 50 e0 ldi r21, 0x00 ; 0 3bada: 0d 94 4d dd jmp 0x3ba9a ; 0x3ba9a 0003bade : 3bade: dc 01 movw r26, r24 3bae0: a4 0f add r26, r20 3bae2: b5 1f adc r27, r21 3bae4: 41 50 subi r20, 0x01 ; 1 3bae6: 50 40 sbci r21, 0x00 ; 0 3bae8: 48 f0 brcs .+18 ; 0x3bafc 3baea: cb 01 movw r24, r22 3baec: 84 0f add r24, r20 3baee: 95 1f adc r25, r21 3baf0: 2e 91 ld r18, -X 3baf2: 0f 94 80 dd call 0x3bb00 ; 0x3bb00 3baf6: 41 50 subi r20, 0x01 ; 1 3baf8: 50 40 sbci r21, 0x00 ; 0 3bafa: d0 f7 brcc .-12 ; 0x3baf0 3bafc: 08 95 ret 0003bafe : 3bafe: 26 2f mov r18, r22 0003bb00 : 3bb00: f9 99 sbic 0x1f, 1 ; 31 3bb02: fe cf rjmp .-4 ; 0x3bb00 3bb04: 92 bd out 0x22, r25 ; 34 3bb06: 81 bd out 0x21, r24 ; 33 3bb08: f8 9a sbi 0x1f, 0 ; 31 3bb0a: 01 97 sbiw r24, 0x01 ; 1 3bb0c: 00 b4 in r0, 0x20 ; 32 3bb0e: 02 16 cp r0, r18 3bb10: 39 f0 breq .+14 ; 0x3bb20 3bb12: 1f ba out 0x1f, r1 ; 31 3bb14: 20 bd out 0x20, r18 ; 32 3bb16: 0f b6 in r0, 0x3f ; 63 3bb18: f8 94 cli 3bb1a: fa 9a sbi 0x1f, 2 ; 31 3bb1c: f9 9a sbi 0x1f, 1 ; 31 3bb1e: 0f be out 0x3f, r0 ; 63 3bb20: 08 95 ret 0003bb22 : 3bb22: 03 96 adiw r24, 0x03 ; 3 3bb24: 27 2f mov r18, r23 3bb26: 0f 94 80 dd call 0x3bb00 ; 0x3bb00 3bb2a: 0f 94 7f dd call 0x3bafe ; 0x3bafe 3bb2e: 25 2f mov r18, r21 3bb30: 0f 94 80 dd call 0x3bb00 ; 0x3bb00 3bb34: 24 2f mov r18, r20 3bb36: 0d 94 80 dd jmp 0x3bb00 ; 0x3bb00 0003bb3a : 3bb3a: 01 96 adiw r24, 0x01 ; 1 3bb3c: 27 2f mov r18, r23 3bb3e: 0f 94 80 dd call 0x3bb00 ; 0x3bb00 3bb42: 0d 94 7f dd jmp 0x3bafe ; 0x3bafe 0003bb46 : 3bb46: 26 2f mov r18, r22 0003bb48 : 3bb48: f9 99 sbic 0x1f, 1 ; 31 3bb4a: fe cf rjmp .-4 ; 0x3bb48 3bb4c: 1f ba out 0x1f, r1 ; 31 3bb4e: 92 bd out 0x22, r25 ; 34 3bb50: 81 bd out 0x21, r24 ; 33 3bb52: 20 bd out 0x20, r18 ; 32 3bb54: 0f b6 in r0, 0x3f ; 63 3bb56: f8 94 cli 3bb58: fa 9a sbi 0x1f, 2 ; 31 3bb5a: f9 9a sbi 0x1f, 1 ; 31 3bb5c: 0f be out 0x3f, r0 ; 63 3bb5e: 01 96 adiw r24, 0x01 ; 1 3bb60: 08 95 ret 0003bb62 : 3bb62: 24 2f mov r18, r20 3bb64: 0f 94 a4 dd call 0x3bb48 ; 0x3bb48 3bb68: 25 2f mov r18, r21 3bb6a: 0f 94 a4 dd call 0x3bb48 ; 0x3bb48 3bb6e: 0d 94 b9 dd jmp 0x3bb72 ; 0x3bb72 0003bb72 : 3bb72: 0f 94 a3 dd call 0x3bb46 ; 0x3bb46 3bb76: 27 2f mov r18, r23 3bb78: 0d 94 a4 dd jmp 0x3bb48 ; 0x3bb48 0003bb7c <__mulsi3>: 3bb7c: db 01 movw r26, r22 3bb7e: 8f 93 push r24 3bb80: 9f 93 push r25 3bb82: 0f 94 f0 dd call 0x3bbe0 ; 0x3bbe0 <__muluhisi3> 3bb86: bf 91 pop r27 3bb88: af 91 pop r26 3bb8a: a2 9f mul r26, r18 3bb8c: 80 0d add r24, r0 3bb8e: 91 1d adc r25, r1 3bb90: a3 9f mul r26, r19 3bb92: 90 0d add r25, r0 3bb94: b2 9f mul r27, r18 3bb96: 90 0d add r25, r0 3bb98: 11 24 eor r1, r1 3bb9a: 08 95 ret 0003bb9c <__udivmodsi4>: 3bb9c: a1 e2 ldi r26, 0x21 ; 33 3bb9e: 1a 2e mov r1, r26 3bba0: aa 1b sub r26, r26 3bba2: bb 1b sub r27, r27 3bba4: fd 01 movw r30, r26 3bba6: 0d c0 rjmp .+26 ; 0x3bbc2 <__udivmodsi4_ep> 0003bba8 <__udivmodsi4_loop>: 3bba8: aa 1f adc r26, r26 3bbaa: bb 1f adc r27, r27 3bbac: ee 1f adc r30, r30 3bbae: ff 1f adc r31, r31 3bbb0: a2 17 cp r26, r18 3bbb2: b3 07 cpc r27, r19 3bbb4: e4 07 cpc r30, r20 3bbb6: f5 07 cpc r31, r21 3bbb8: 20 f0 brcs .+8 ; 0x3bbc2 <__udivmodsi4_ep> 3bbba: a2 1b sub r26, r18 3bbbc: b3 0b sbc r27, r19 3bbbe: e4 0b sbc r30, r20 3bbc0: f5 0b sbc r31, r21 0003bbc2 <__udivmodsi4_ep>: 3bbc2: 66 1f adc r22, r22 3bbc4: 77 1f adc r23, r23 3bbc6: 88 1f adc r24, r24 3bbc8: 99 1f adc r25, r25 3bbca: 1a 94 dec r1 3bbcc: 69 f7 brne .-38 ; 0x3bba8 <__udivmodsi4_loop> 3bbce: 60 95 com r22 3bbd0: 70 95 com r23 3bbd2: 80 95 com r24 3bbd4: 90 95 com r25 3bbd6: 9b 01 movw r18, r22 3bbd8: ac 01 movw r20, r24 3bbda: bd 01 movw r22, r26 3bbdc: cf 01 movw r24, r30 3bbde: 08 95 ret 0003bbe0 <__muluhisi3>: 3bbe0: 0f 94 fb dd call 0x3bbf6 ; 0x3bbf6 <__umulhisi3> 3bbe4: a5 9f mul r26, r21 3bbe6: 90 0d add r25, r0 3bbe8: b4 9f mul r27, r20 3bbea: 90 0d add r25, r0 3bbec: a4 9f mul r26, r20 3bbee: 80 0d add r24, r0 3bbf0: 91 1d adc r25, r1 3bbf2: 11 24 eor r1, r1 3bbf4: 08 95 ret 0003bbf6 <__umulhisi3>: 3bbf6: a2 9f mul r26, r18 3bbf8: b0 01 movw r22, r0 3bbfa: b3 9f mul r27, r19 3bbfc: c0 01 movw r24, r0 3bbfe: a3 9f mul r26, r19 3bc00: 70 0d add r23, r0 3bc02: 81 1d adc r24, r1 3bc04: 11 24 eor r1, r1 3bc06: 91 1d adc r25, r1 3bc08: b2 9f mul r27, r18 3bc0a: 70 0d add r23, r0 3bc0c: 81 1d adc r24, r1 3bc0e: 11 24 eor r1, r1 3bc10: 91 1d adc r25, r1 3bc12: 08 95 ret 0003bc14 <__udivmodqi4>: 3bc14: 99 1b sub r25, r25 3bc16: 79 e0 ldi r23, 0x09 ; 9 3bc18: 04 c0 rjmp .+8 ; 0x3bc22 <__udivmodqi4_ep> 0003bc1a <__udivmodqi4_loop>: 3bc1a: 99 1f adc r25, r25 3bc1c: 96 17 cp r25, r22 3bc1e: 08 f0 brcs .+2 ; 0x3bc22 <__udivmodqi4_ep> 3bc20: 96 1b sub r25, r22 0003bc22 <__udivmodqi4_ep>: 3bc22: 88 1f adc r24, r24 3bc24: 7a 95 dec r23 3bc26: c9 f7 brne .-14 ; 0x3bc1a <__udivmodqi4_loop> 3bc28: 80 95 com r24 3bc2a: 08 95 ret 0003bc2c <__divmodqi4>: 3bc2c: 87 fb bst r24, 7 3bc2e: 08 2e mov r0, r24 3bc30: 06 26 eor r0, r22 3bc32: 87 fd sbrc r24, 7 3bc34: 81 95 neg r24 3bc36: 67 fd sbrc r22, 7 3bc38: 61 95 neg r22 3bc3a: 0f 94 0a de call 0x3bc14 ; 0x3bc14 <__udivmodqi4> 3bc3e: 0e f4 brtc .+2 ; 0x3bc42 <__divmodqi4_1> 3bc40: 91 95 neg r25 0003bc42 <__divmodqi4_1>: 3bc42: 07 fc sbrc r0, 7 3bc44: 81 95 neg r24 0003bc46 <__divmodqi4_exit>: 3bc46: 08 95 ret 0003bc48 <__udivmodhi4>: 3bc48: aa 1b sub r26, r26 3bc4a: bb 1b sub r27, r27 3bc4c: 51 e1 ldi r21, 0x11 ; 17 3bc4e: 07 c0 rjmp .+14 ; 0x3bc5e <__udivmodhi4_ep> 0003bc50 <__udivmodhi4_loop>: 3bc50: aa 1f adc r26, r26 3bc52: bb 1f adc r27, r27 3bc54: a6 17 cp r26, r22 3bc56: b7 07 cpc r27, r23 3bc58: 10 f0 brcs .+4 ; 0x3bc5e <__udivmodhi4_ep> 3bc5a: a6 1b sub r26, r22 3bc5c: b7 0b sbc r27, r23 0003bc5e <__udivmodhi4_ep>: 3bc5e: 88 1f adc r24, r24 3bc60: 99 1f adc r25, r25 3bc62: 5a 95 dec r21 3bc64: a9 f7 brne .-22 ; 0x3bc50 <__udivmodhi4_loop> 3bc66: 80 95 com r24 3bc68: 90 95 com r25 3bc6a: bc 01 movw r22, r24 3bc6c: cd 01 movw r24, r26 3bc6e: 08 95 ret 0003bc70 <__divmodhi4>: 3bc70: 97 fb bst r25, 7 3bc72: 07 2e mov r0, r23 3bc74: 16 f4 brtc .+4 ; 0x3bc7a <__divmodhi4+0xa> 3bc76: 00 94 com r0 3bc78: 07 d0 rcall .+14 ; 0x3bc88 <__divmodhi4_neg1> 3bc7a: 77 fd sbrc r23, 7 3bc7c: 09 d0 rcall .+18 ; 0x3bc90 <__divmodhi4_neg2> 3bc7e: 0f 94 24 de call 0x3bc48 ; 0x3bc48 <__udivmodhi4> 3bc82: 07 fc sbrc r0, 7 3bc84: 05 d0 rcall .+10 ; 0x3bc90 <__divmodhi4_neg2> 3bc86: 3e f4 brtc .+14 ; 0x3bc96 <__divmodhi4_exit> 0003bc88 <__divmodhi4_neg1>: 3bc88: 90 95 com r25 3bc8a: 81 95 neg r24 3bc8c: 9f 4f sbci r25, 0xFF ; 255 3bc8e: 08 95 ret 0003bc90 <__divmodhi4_neg2>: 3bc90: 70 95 com r23 3bc92: 61 95 neg r22 3bc94: 7f 4f sbci r23, 0xFF ; 255 0003bc96 <__divmodhi4_exit>: 3bc96: 08 95 ret 0003bc98 <__divmodsi4>: 3bc98: 05 2e mov r0, r21 3bc9a: 97 fb bst r25, 7 3bc9c: 1e f4 brtc .+6 ; 0x3bca4 <__divmodsi4+0xc> 3bc9e: 00 94 com r0 3bca0: 0f 94 63 de call 0x3bcc6 ; 0x3bcc6 <__negsi2> 3bca4: 57 fd sbrc r21, 7 3bca6: 07 d0 rcall .+14 ; 0x3bcb6 <__divmodsi4_neg2> 3bca8: 0f 94 ce dd call 0x3bb9c ; 0x3bb9c <__udivmodsi4> 3bcac: 07 fc sbrc r0, 7 3bcae: 03 d0 rcall .+6 ; 0x3bcb6 <__divmodsi4_neg2> 3bcb0: 4e f4 brtc .+18 ; 0x3bcc4 <__divmodsi4_exit> 3bcb2: 0d 94 63 de jmp 0x3bcc6 ; 0x3bcc6 <__negsi2> 0003bcb6 <__divmodsi4_neg2>: 3bcb6: 50 95 com r21 3bcb8: 40 95 com r20 3bcba: 30 95 com r19 3bcbc: 21 95 neg r18 3bcbe: 3f 4f sbci r19, 0xFF ; 255 3bcc0: 4f 4f sbci r20, 0xFF ; 255 3bcc2: 5f 4f sbci r21, 0xFF ; 255 0003bcc4 <__divmodsi4_exit>: 3bcc4: 08 95 ret 0003bcc6 <__negsi2>: 3bcc6: 90 95 com r25 3bcc8: 80 95 com r24 3bcca: 70 95 com r23 3bccc: 61 95 neg r22 3bcce: 7f 4f sbci r23, 0xFF ; 255 3bcd0: 8f 4f sbci r24, 0xFF ; 255 3bcd2: 9f 4f sbci r25, 0xFF ; 255 3bcd4: 08 95 ret 0003bcd6 <__tablejump2__>: 3bcd6: ee 0f add r30, r30 3bcd8: ff 1f adc r31, r31 3bcda: 88 1f adc r24, r24 3bcdc: 8b bf out 0x3b, r24 ; 59 3bcde: 07 90 elpm r0, Z+ 3bce0: f6 91 elpm r31, Z 3bce2: e0 2d mov r30, r0 3bce4: 19 94 eijmp 0003bce6 <__mulhisi3>: 3bce6: 0f 94 fb dd call 0x3bbf6 ; 0x3bbf6 <__umulhisi3> 3bcea: 33 23 and r19, r19 3bcec: 12 f4 brpl .+4 ; 0x3bcf2 <__mulhisi3+0xc> 3bcee: 8a 1b sub r24, r26 3bcf0: 9b 0b sbc r25, r27 3bcf2: 0d 94 7d de jmp 0x3bcfa ; 0x3bcfa <__usmulhisi3_tail> 0003bcf6 <__usmulhisi3>: 3bcf6: 0f 94 fb dd call 0x3bbf6 ; 0x3bbf6 <__umulhisi3> 0003bcfa <__usmulhisi3_tail>: 3bcfa: b7 ff sbrs r27, 7 3bcfc: 08 95 ret 3bcfe: 82 1b sub r24, r18 3bd00: 93 0b sbc r25, r19 3bd02: 08 95 ret 0003bd04 <__subsf3>: 3bd04: 50 58 subi r21, 0x80 ; 128 0003bd06 <__addsf3>: 3bd06: bb 27 eor r27, r27 3bd08: aa 27 eor r26, r26 3bd0a: 0f 94 9a de call 0x3bd34 ; 0x3bd34 <__addsf3x> 3bd0e: 0d 94 ac d8 jmp 0x3b158 ; 0x3b158 <__fp_round> 3bd12: 0f 94 9e d8 call 0x3b13c ; 0x3b13c <__fp_pscA> 3bd16: 38 f0 brcs .+14 ; 0x3bd26 <__addsf3+0x20> 3bd18: 0f 94 a5 d8 call 0x3b14a ; 0x3b14a <__fp_pscB> 3bd1c: 20 f0 brcs .+8 ; 0x3bd26 <__addsf3+0x20> 3bd1e: 39 f4 brne .+14 ; 0x3bd2e <__addsf3+0x28> 3bd20: 9f 3f cpi r25, 0xFF ; 255 3bd22: 19 f4 brne .+6 ; 0x3bd2a <__addsf3+0x24> 3bd24: 26 f4 brtc .+8 ; 0x3bd2e <__addsf3+0x28> 3bd26: 0d 94 9b d8 jmp 0x3b136 ; 0x3b136 <__fp_nan> 3bd2a: 0e f4 brtc .+2 ; 0x3bd2e <__addsf3+0x28> 3bd2c: e0 95 com r30 3bd2e: e7 fb bst r30, 7 3bd30: 0d 94 95 d8 jmp 0x3b12a ; 0x3b12a <__fp_inf> 0003bd34 <__addsf3x>: 3bd34: e9 2f mov r30, r25 3bd36: 0f 94 bd d8 call 0x3b17a ; 0x3b17a <__fp_split3> 3bd3a: 58 f3 brcs .-42 ; 0x3bd12 <__addsf3+0xc> 3bd3c: ba 17 cp r27, r26 3bd3e: 62 07 cpc r22, r18 3bd40: 73 07 cpc r23, r19 3bd42: 84 07 cpc r24, r20 3bd44: 95 07 cpc r25, r21 3bd46: 20 f0 brcs .+8 ; 0x3bd50 <__addsf3x+0x1c> 3bd48: 79 f4 brne .+30 ; 0x3bd68 <__addsf3x+0x34> 3bd4a: a6 f5 brtc .+104 ; 0x3bdb4 <__addsf3x+0x80> 3bd4c: 0d 94 df d8 jmp 0x3b1be ; 0x3b1be <__fp_zero> 3bd50: 0e f4 brtc .+2 ; 0x3bd54 <__addsf3x+0x20> 3bd52: e0 95 com r30 3bd54: 0b 2e mov r0, r27 3bd56: ba 2f mov r27, r26 3bd58: a0 2d mov r26, r0 3bd5a: 0b 01 movw r0, r22 3bd5c: b9 01 movw r22, r18 3bd5e: 90 01 movw r18, r0 3bd60: 0c 01 movw r0, r24 3bd62: ca 01 movw r24, r20 3bd64: a0 01 movw r20, r0 3bd66: 11 24 eor r1, r1 3bd68: ff 27 eor r31, r31 3bd6a: 59 1b sub r21, r25 3bd6c: 99 f0 breq .+38 ; 0x3bd94 <__addsf3x+0x60> 3bd6e: 59 3f cpi r21, 0xF9 ; 249 3bd70: 50 f4 brcc .+20 ; 0x3bd86 <__addsf3x+0x52> 3bd72: 50 3e cpi r21, 0xE0 ; 224 3bd74: 68 f1 brcs .+90 ; 0x3bdd0 <__addsf3x+0x9c> 3bd76: 1a 16 cp r1, r26 3bd78: f0 40 sbci r31, 0x00 ; 0 3bd7a: a2 2f mov r26, r18 3bd7c: 23 2f mov r18, r19 3bd7e: 34 2f mov r19, r20 3bd80: 44 27 eor r20, r20 3bd82: 58 5f subi r21, 0xF8 ; 248 3bd84: f3 cf rjmp .-26 ; 0x3bd6c <__addsf3x+0x38> 3bd86: 46 95 lsr r20 3bd88: 37 95 ror r19 3bd8a: 27 95 ror r18 3bd8c: a7 95 ror r26 3bd8e: f0 40 sbci r31, 0x00 ; 0 3bd90: 53 95 inc r21 3bd92: c9 f7 brne .-14 ; 0x3bd86 <__addsf3x+0x52> 3bd94: 7e f4 brtc .+30 ; 0x3bdb4 <__addsf3x+0x80> 3bd96: 1f 16 cp r1, r31 3bd98: ba 0b sbc r27, r26 3bd9a: 62 0b sbc r22, r18 3bd9c: 73 0b sbc r23, r19 3bd9e: 84 0b sbc r24, r20 3bda0: ba f0 brmi .+46 ; 0x3bdd0 <__addsf3x+0x9c> 3bda2: 91 50 subi r25, 0x01 ; 1 3bda4: a1 f0 breq .+40 ; 0x3bdce <__addsf3x+0x9a> 3bda6: ff 0f add r31, r31 3bda8: bb 1f adc r27, r27 3bdaa: 66 1f adc r22, r22 3bdac: 77 1f adc r23, r23 3bdae: 88 1f adc r24, r24 3bdb0: c2 f7 brpl .-16 ; 0x3bda2 <__addsf3x+0x6e> 3bdb2: 0e c0 rjmp .+28 ; 0x3bdd0 <__addsf3x+0x9c> 3bdb4: ba 0f add r27, r26 3bdb6: 62 1f adc r22, r18 3bdb8: 73 1f adc r23, r19 3bdba: 84 1f adc r24, r20 3bdbc: 48 f4 brcc .+18 ; 0x3bdd0 <__addsf3x+0x9c> 3bdbe: 87 95 ror r24 3bdc0: 77 95 ror r23 3bdc2: 67 95 ror r22 3bdc4: b7 95 ror r27 3bdc6: f7 95 ror r31 3bdc8: 9e 3f cpi r25, 0xFE ; 254 3bdca: 08 f0 brcs .+2 ; 0x3bdce <__addsf3x+0x9a> 3bdcc: b0 cf rjmp .-160 ; 0x3bd2e <__addsf3+0x28> 3bdce: 93 95 inc r25 3bdd0: 88 0f add r24, r24 3bdd2: 08 f0 brcs .+2 ; 0x3bdd6 <__addsf3x+0xa2> 3bdd4: 99 27 eor r25, r25 3bdd6: ee 0f add r30, r30 3bdd8: 97 95 ror r25 3bdda: 87 95 ror r24 3bddc: 08 95 ret 3bdde: 0f 94 9e d8 call 0x3b13c ; 0x3b13c <__fp_pscA> 3bde2: 60 f0 brcs .+24 ; 0x3bdfc <__addsf3x+0xc8> 3bde4: 80 e8 ldi r24, 0x80 ; 128 3bde6: 91 e0 ldi r25, 0x01 ; 1 3bde8: 09 f4 brne .+2 ; 0x3bdec <__addsf3x+0xb8> 3bdea: 9e ef ldi r25, 0xFE ; 254 3bdec: 0f 94 a5 d8 call 0x3b14a ; 0x3b14a <__fp_pscB> 3bdf0: 28 f0 brcs .+10 ; 0x3bdfc <__addsf3x+0xc8> 3bdf2: 40 e8 ldi r20, 0x80 ; 128 3bdf4: 51 e0 ldi r21, 0x01 ; 1 3bdf6: 71 f4 brne .+28 ; 0x3be14 3bdf8: 5e ef ldi r21, 0xFE ; 254 3bdfa: 0c c0 rjmp .+24 ; 0x3be14 3bdfc: 0d 94 9b d8 jmp 0x3b136 ; 0x3b136 <__fp_nan> 3be00: 0d 94 df d8 jmp 0x3b1be ; 0x3b1be <__fp_zero> 0003be04 : 3be04: e9 2f mov r30, r25 3be06: e0 78 andi r30, 0x80 ; 128 3be08: 0f 94 bd d8 call 0x3b17a ; 0x3b17a <__fp_split3> 3be0c: 40 f3 brcs .-48 ; 0x3bdde <__addsf3x+0xaa> 3be0e: 09 2e mov r0, r25 3be10: 05 2a or r0, r21 3be12: b1 f3 breq .-20 ; 0x3be00 <__addsf3x+0xcc> 3be14: 26 17 cp r18, r22 3be16: 37 07 cpc r19, r23 3be18: 48 07 cpc r20, r24 3be1a: 59 07 cpc r21, r25 3be1c: 38 f0 brcs .+14 ; 0x3be2c 3be1e: 0e 2e mov r0, r30 3be20: 07 f8 bld r0, 7 3be22: e0 25 eor r30, r0 3be24: 69 f0 breq .+26 ; 0x3be40 3be26: e0 25 eor r30, r0 3be28: e0 64 ori r30, 0x40 ; 64 3be2a: 0a c0 rjmp .+20 ; 0x3be40 3be2c: ef 63 ori r30, 0x3F ; 63 3be2e: 07 f8 bld r0, 7 3be30: 00 94 com r0 3be32: 07 fa bst r0, 7 3be34: db 01 movw r26, r22 3be36: b9 01 movw r22, r18 3be38: 9d 01 movw r18, r26 3be3a: dc 01 movw r26, r24 3be3c: ca 01 movw r24, r20 3be3e: ad 01 movw r20, r26 3be40: ef 93 push r30 3be42: 0f 94 99 df call 0x3bf32 ; 0x3bf32 <__divsf3_pse> 3be46: 0f 94 ac d8 call 0x3b158 ; 0x3b158 <__fp_round> 3be4a: 0f 94 32 df call 0x3be64 ; 0x3be64 3be4e: 5f 91 pop r21 3be50: 55 23 and r21, r21 3be52: 39 f0 breq .+14 ; 0x3be62 3be54: 2b ed ldi r18, 0xDB ; 219 3be56: 3f e0 ldi r19, 0x0F ; 15 3be58: 49 e4 ldi r20, 0x49 ; 73 3be5a: 50 fd sbrc r21, 0 3be5c: 49 ec ldi r20, 0xC9 ; 201 3be5e: 0d 94 83 de jmp 0x3bd06 ; 0x3bd06 <__addsf3> 3be62: 08 95 ret 0003be64 : 3be64: df 93 push r29 3be66: dd 27 eor r29, r29 3be68: b9 2f mov r27, r25 3be6a: bf 77 andi r27, 0x7F ; 127 3be6c: 40 e8 ldi r20, 0x80 ; 128 3be6e: 5f e3 ldi r21, 0x3F ; 63 3be70: 16 16 cp r1, r22 3be72: 17 06 cpc r1, r23 3be74: 48 07 cpc r20, r24 3be76: 5b 07 cpc r21, r27 3be78: 18 f4 brcc .+6 ; 0x3be80 3be7a: d9 2f mov r29, r25 3be7c: 0f 94 7e e1 call 0x3c2fc ; 0x3c2fc 3be80: 9f 93 push r25 3be82: 8f 93 push r24 3be84: 7f 93 push r23 3be86: 6f 93 push r22 3be88: 0f 94 24 d8 call 0x3b048 ; 0x3b048 3be8c: e6 e8 ldi r30, 0x86 ; 134 3be8e: f2 e7 ldi r31, 0x72 ; 114 3be90: 0f 94 8e e0 call 0x3c11c ; 0x3c11c <__fp_powser> 3be94: 0f 94 ac d8 call 0x3b158 ; 0x3b158 <__fp_round> 3be98: 2f 91 pop r18 3be9a: 3f 91 pop r19 3be9c: 4f 91 pop r20 3be9e: 5f 91 pop r21 3bea0: 0f 94 3b d8 call 0x3b076 ; 0x3b076 <__mulsf3x> 3bea4: dd 23 and r29, r29 3bea6: 51 f0 breq .+20 ; 0x3bebc 3bea8: 90 58 subi r25, 0x80 ; 128 3beaa: a2 ea ldi r26, 0xA2 ; 162 3beac: 2a ed ldi r18, 0xDA ; 218 3beae: 3f e0 ldi r19, 0x0F ; 15 3beb0: 49 ec ldi r20, 0xC9 ; 201 3beb2: 5f e3 ldi r21, 0x3F ; 63 3beb4: d0 78 andi r29, 0x80 ; 128 3beb6: 5d 27 eor r21, r29 3beb8: 0f 94 9a de call 0x3bd34 ; 0x3bd34 <__addsf3x> 3bebc: df 91 pop r29 3bebe: 0d 94 ac d8 jmp 0x3b158 ; 0x3b158 <__fp_round> 0003bec2 : 3bec2: 0f 94 f4 e0 call 0x3c1e8 ; 0x3c1e8 <__fp_trunc> 3bec6: 90 f0 brcs .+36 ; 0x3beec 3bec8: 9f 37 cpi r25, 0x7F ; 127 3beca: 48 f4 brcc .+18 ; 0x3bede 3becc: 91 11 cpse r25, r1 3bece: 16 f4 brtc .+4 ; 0x3bed4 3bed0: 0d 94 e0 d8 jmp 0x3b1c0 ; 0x3b1c0 <__fp_szero> 3bed4: 60 e0 ldi r22, 0x00 ; 0 3bed6: 70 e0 ldi r23, 0x00 ; 0 3bed8: 80 e8 ldi r24, 0x80 ; 128 3beda: 9f e3 ldi r25, 0x3F ; 63 3bedc: 08 95 ret 3bede: 26 f0 brts .+8 ; 0x3bee8 3bee0: 1b 16 cp r1, r27 3bee2: 61 1d adc r22, r1 3bee4: 71 1d adc r23, r1 3bee6: 81 1d adc r24, r1 3bee8: 0d 94 65 e0 jmp 0x3c0ca ; 0x3c0ca <__fp_mintl> 3beec: 0d 94 80 e0 jmp 0x3c100 ; 0x3c100 <__fp_mpack> 0003bef0 <__cmpsf2>: 3bef0: 0f 94 41 e0 call 0x3c082 ; 0x3c082 <__fp_cmp> 3bef4: 08 f4 brcc .+2 ; 0x3bef8 <__cmpsf2+0x8> 3bef6: 81 e0 ldi r24, 0x01 ; 1 3bef8: 08 95 ret 0003befa : 3befa: 0f 94 b7 e0 call 0x3c16e ; 0x3c16e <__fp_rempio2> 3befe: e3 95 inc r30 3bf00: 0d 94 e0 e0 jmp 0x3c1c0 ; 0x3c1c0 <__fp_sinus> 0003bf04 <__divsf3>: 3bf04: 0f 94 96 df call 0x3bf2c ; 0x3bf2c <__divsf3x> 3bf08: 0d 94 ac d8 jmp 0x3b158 ; 0x3b158 <__fp_round> 3bf0c: 0f 94 a5 d8 call 0x3b14a ; 0x3b14a <__fp_pscB> 3bf10: 58 f0 brcs .+22 ; 0x3bf28 <__divsf3+0x24> 3bf12: 0f 94 9e d8 call 0x3b13c ; 0x3b13c <__fp_pscA> 3bf16: 40 f0 brcs .+16 ; 0x3bf28 <__divsf3+0x24> 3bf18: 29 f4 brne .+10 ; 0x3bf24 <__divsf3+0x20> 3bf1a: 5f 3f cpi r21, 0xFF ; 255 3bf1c: 29 f0 breq .+10 ; 0x3bf28 <__divsf3+0x24> 3bf1e: 0d 94 95 d8 jmp 0x3b12a ; 0x3b12a <__fp_inf> 3bf22: 51 11 cpse r21, r1 3bf24: 0d 94 e0 d8 jmp 0x3b1c0 ; 0x3b1c0 <__fp_szero> 3bf28: 0d 94 9b d8 jmp 0x3b136 ; 0x3b136 <__fp_nan> 0003bf2c <__divsf3x>: 3bf2c: 0f 94 bd d8 call 0x3b17a ; 0x3b17a <__fp_split3> 3bf30: 68 f3 brcs .-38 ; 0x3bf0c <__divsf3+0x8> 0003bf32 <__divsf3_pse>: 3bf32: 99 23 and r25, r25 3bf34: b1 f3 breq .-20 ; 0x3bf22 <__divsf3+0x1e> 3bf36: 55 23 and r21, r21 3bf38: 91 f3 breq .-28 ; 0x3bf1e <__divsf3+0x1a> 3bf3a: 95 1b sub r25, r21 3bf3c: 55 0b sbc r21, r21 3bf3e: bb 27 eor r27, r27 3bf40: aa 27 eor r26, r26 3bf42: 62 17 cp r22, r18 3bf44: 73 07 cpc r23, r19 3bf46: 84 07 cpc r24, r20 3bf48: 38 f0 brcs .+14 ; 0x3bf58 <__divsf3_pse+0x26> 3bf4a: 9f 5f subi r25, 0xFF ; 255 3bf4c: 5f 4f sbci r21, 0xFF ; 255 3bf4e: 22 0f add r18, r18 3bf50: 33 1f adc r19, r19 3bf52: 44 1f adc r20, r20 3bf54: aa 1f adc r26, r26 3bf56: a9 f3 breq .-22 ; 0x3bf42 <__divsf3_pse+0x10> 3bf58: 35 d0 rcall .+106 ; 0x3bfc4 <__divsf3_pse+0x92> 3bf5a: 0e 2e mov r0, r30 3bf5c: 3a f0 brmi .+14 ; 0x3bf6c <__divsf3_pse+0x3a> 3bf5e: e0 e8 ldi r30, 0x80 ; 128 3bf60: 32 d0 rcall .+100 ; 0x3bfc6 <__divsf3_pse+0x94> 3bf62: 91 50 subi r25, 0x01 ; 1 3bf64: 50 40 sbci r21, 0x00 ; 0 3bf66: e6 95 lsr r30 3bf68: 00 1c adc r0, r0 3bf6a: ca f7 brpl .-14 ; 0x3bf5e <__divsf3_pse+0x2c> 3bf6c: 2b d0 rcall .+86 ; 0x3bfc4 <__divsf3_pse+0x92> 3bf6e: fe 2f mov r31, r30 3bf70: 29 d0 rcall .+82 ; 0x3bfc4 <__divsf3_pse+0x92> 3bf72: 66 0f add r22, r22 3bf74: 77 1f adc r23, r23 3bf76: 88 1f adc r24, r24 3bf78: bb 1f adc r27, r27 3bf7a: 26 17 cp r18, r22 3bf7c: 37 07 cpc r19, r23 3bf7e: 48 07 cpc r20, r24 3bf80: ab 07 cpc r26, r27 3bf82: b0 e8 ldi r27, 0x80 ; 128 3bf84: 09 f0 breq .+2 ; 0x3bf88 <__divsf3_pse+0x56> 3bf86: bb 0b sbc r27, r27 3bf88: 80 2d mov r24, r0 3bf8a: bf 01 movw r22, r30 3bf8c: ff 27 eor r31, r31 3bf8e: 93 58 subi r25, 0x83 ; 131 3bf90: 5f 4f sbci r21, 0xFF ; 255 3bf92: 3a f0 brmi .+14 ; 0x3bfa2 <__divsf3_pse+0x70> 3bf94: 9e 3f cpi r25, 0xFE ; 254 3bf96: 51 05 cpc r21, r1 3bf98: 78 f0 brcs .+30 ; 0x3bfb8 <__divsf3_pse+0x86> 3bf9a: 0d 94 95 d8 jmp 0x3b12a ; 0x3b12a <__fp_inf> 3bf9e: 0d 94 e0 d8 jmp 0x3b1c0 ; 0x3b1c0 <__fp_szero> 3bfa2: 5f 3f cpi r21, 0xFF ; 255 3bfa4: e4 f3 brlt .-8 ; 0x3bf9e <__divsf3_pse+0x6c> 3bfa6: 98 3e cpi r25, 0xE8 ; 232 3bfa8: d4 f3 brlt .-12 ; 0x3bf9e <__divsf3_pse+0x6c> 3bfaa: 86 95 lsr r24 3bfac: 77 95 ror r23 3bfae: 67 95 ror r22 3bfb0: b7 95 ror r27 3bfb2: f7 95 ror r31 3bfb4: 9f 5f subi r25, 0xFF ; 255 3bfb6: c9 f7 brne .-14 ; 0x3bfaa <__divsf3_pse+0x78> 3bfb8: 88 0f add r24, r24 3bfba: 91 1d adc r25, r1 3bfbc: 96 95 lsr r25 3bfbe: 87 95 ror r24 3bfc0: 97 f9 bld r25, 7 3bfc2: 08 95 ret 3bfc4: e1 e0 ldi r30, 0x01 ; 1 3bfc6: 66 0f add r22, r22 3bfc8: 77 1f adc r23, r23 3bfca: 88 1f adc r24, r24 3bfcc: bb 1f adc r27, r27 3bfce: 62 17 cp r22, r18 3bfd0: 73 07 cpc r23, r19 3bfd2: 84 07 cpc r24, r20 3bfd4: ba 07 cpc r27, r26 3bfd6: 20 f0 brcs .+8 ; 0x3bfe0 <__divsf3_pse+0xae> 3bfd8: 62 1b sub r22, r18 3bfda: 73 0b sbc r23, r19 3bfdc: 84 0b sbc r24, r20 3bfde: ba 0b sbc r27, r26 3bfe0: ee 1f adc r30, r30 3bfe2: 88 f7 brcc .-30 ; 0x3bfc6 <__divsf3_pse+0x94> 3bfe4: e0 95 com r30 3bfe6: 08 95 ret 0003bfe8 <__fixsfsi>: 3bfe8: 0f 94 fb df call 0x3bff6 ; 0x3bff6 <__fixunssfsi> 3bfec: 68 94 set 3bfee: b1 11 cpse r27, r1 3bff0: 0d 94 e0 d8 jmp 0x3b1c0 ; 0x3b1c0 <__fp_szero> 3bff4: 08 95 ret 0003bff6 <__fixunssfsi>: 3bff6: 0f 94 c5 d8 call 0x3b18a ; 0x3b18a <__fp_splitA> 3bffa: 88 f0 brcs .+34 ; 0x3c01e <__fixunssfsi+0x28> 3bffc: 9f 57 subi r25, 0x7F ; 127 3bffe: 98 f0 brcs .+38 ; 0x3c026 <__fixunssfsi+0x30> 3c000: b9 2f mov r27, r25 3c002: 99 27 eor r25, r25 3c004: b7 51 subi r27, 0x17 ; 23 3c006: b0 f0 brcs .+44 ; 0x3c034 <__fixunssfsi+0x3e> 3c008: e1 f0 breq .+56 ; 0x3c042 <__fixunssfsi+0x4c> 3c00a: 66 0f add r22, r22 3c00c: 77 1f adc r23, r23 3c00e: 88 1f adc r24, r24 3c010: 99 1f adc r25, r25 3c012: 1a f0 brmi .+6 ; 0x3c01a <__fixunssfsi+0x24> 3c014: ba 95 dec r27 3c016: c9 f7 brne .-14 ; 0x3c00a <__fixunssfsi+0x14> 3c018: 14 c0 rjmp .+40 ; 0x3c042 <__fixunssfsi+0x4c> 3c01a: b1 30 cpi r27, 0x01 ; 1 3c01c: 91 f0 breq .+36 ; 0x3c042 <__fixunssfsi+0x4c> 3c01e: 0f 94 df d8 call 0x3b1be ; 0x3b1be <__fp_zero> 3c022: b1 e0 ldi r27, 0x01 ; 1 3c024: 08 95 ret 3c026: 0d 94 df d8 jmp 0x3b1be ; 0x3b1be <__fp_zero> 3c02a: 67 2f mov r22, r23 3c02c: 78 2f mov r23, r24 3c02e: 88 27 eor r24, r24 3c030: b8 5f subi r27, 0xF8 ; 248 3c032: 39 f0 breq .+14 ; 0x3c042 <__fixunssfsi+0x4c> 3c034: b9 3f cpi r27, 0xF9 ; 249 3c036: cc f3 brlt .-14 ; 0x3c02a <__fixunssfsi+0x34> 3c038: 86 95 lsr r24 3c03a: 77 95 ror r23 3c03c: 67 95 ror r22 3c03e: b3 95 inc r27 3c040: d9 f7 brne .-10 ; 0x3c038 <__fixunssfsi+0x42> 3c042: 3e f4 brtc .+14 ; 0x3c052 <__fixunssfsi+0x5c> 3c044: 90 95 com r25 3c046: 80 95 com r24 3c048: 70 95 com r23 3c04a: 61 95 neg r22 3c04c: 7f 4f sbci r23, 0xFF ; 255 3c04e: 8f 4f sbci r24, 0xFF ; 255 3c050: 9f 4f sbci r25, 0xFF ; 255 3c052: 08 95 ret 0003c054 : 3c054: 0f 94 f4 e0 call 0x3c1e8 ; 0x3c1e8 <__fp_trunc> 3c058: 90 f0 brcs .+36 ; 0x3c07e 3c05a: 9f 37 cpi r25, 0x7F ; 127 3c05c: 48 f4 brcc .+18 ; 0x3c070 3c05e: 91 11 cpse r25, r1 3c060: 16 f0 brts .+4 ; 0x3c066 3c062: 0d 94 e0 d8 jmp 0x3b1c0 ; 0x3b1c0 <__fp_szero> 3c066: 60 e0 ldi r22, 0x00 ; 0 3c068: 70 e0 ldi r23, 0x00 ; 0 3c06a: 80 e8 ldi r24, 0x80 ; 128 3c06c: 9f eb ldi r25, 0xBF ; 191 3c06e: 08 95 ret 3c070: 26 f4 brtc .+8 ; 0x3c07a 3c072: 1b 16 cp r1, r27 3c074: 61 1d adc r22, r1 3c076: 71 1d adc r23, r1 3c078: 81 1d adc r24, r1 3c07a: 0d 94 65 e0 jmp 0x3c0ca ; 0x3c0ca <__fp_mintl> 3c07e: 0d 94 80 e0 jmp 0x3c100 ; 0x3c100 <__fp_mpack> 0003c082 <__fp_cmp>: 3c082: 99 0f add r25, r25 3c084: 00 08 sbc r0, r0 3c086: 55 0f add r21, r21 3c088: aa 0b sbc r26, r26 3c08a: e0 e8 ldi r30, 0x80 ; 128 3c08c: fe ef ldi r31, 0xFE ; 254 3c08e: 16 16 cp r1, r22 3c090: 17 06 cpc r1, r23 3c092: e8 07 cpc r30, r24 3c094: f9 07 cpc r31, r25 3c096: c0 f0 brcs .+48 ; 0x3c0c8 <__fp_cmp+0x46> 3c098: 12 16 cp r1, r18 3c09a: 13 06 cpc r1, r19 3c09c: e4 07 cpc r30, r20 3c09e: f5 07 cpc r31, r21 3c0a0: 98 f0 brcs .+38 ; 0x3c0c8 <__fp_cmp+0x46> 3c0a2: 62 1b sub r22, r18 3c0a4: 73 0b sbc r23, r19 3c0a6: 84 0b sbc r24, r20 3c0a8: 95 0b sbc r25, r21 3c0aa: 39 f4 brne .+14 ; 0x3c0ba <__fp_cmp+0x38> 3c0ac: 0a 26 eor r0, r26 3c0ae: 61 f0 breq .+24 ; 0x3c0c8 <__fp_cmp+0x46> 3c0b0: 23 2b or r18, r19 3c0b2: 24 2b or r18, r20 3c0b4: 25 2b or r18, r21 3c0b6: 21 f4 brne .+8 ; 0x3c0c0 <__fp_cmp+0x3e> 3c0b8: 08 95 ret 3c0ba: 0a 26 eor r0, r26 3c0bc: 09 f4 brne .+2 ; 0x3c0c0 <__fp_cmp+0x3e> 3c0be: a1 40 sbci r26, 0x01 ; 1 3c0c0: a6 95 lsr r26 3c0c2: 8f ef ldi r24, 0xFF ; 255 3c0c4: 81 1d adc r24, r1 3c0c6: 81 1d adc r24, r1 3c0c8: 08 95 ret 0003c0ca <__fp_mintl>: 3c0ca: 88 23 and r24, r24 3c0cc: 71 f4 brne .+28 ; 0x3c0ea <__fp_mintl+0x20> 3c0ce: 77 23 and r23, r23 3c0d0: 21 f0 breq .+8 ; 0x3c0da <__fp_mintl+0x10> 3c0d2: 98 50 subi r25, 0x08 ; 8 3c0d4: 87 2b or r24, r23 3c0d6: 76 2f mov r23, r22 3c0d8: 07 c0 rjmp .+14 ; 0x3c0e8 <__fp_mintl+0x1e> 3c0da: 66 23 and r22, r22 3c0dc: 11 f4 brne .+4 ; 0x3c0e2 <__fp_mintl+0x18> 3c0de: 99 27 eor r25, r25 3c0e0: 0d c0 rjmp .+26 ; 0x3c0fc <__fp_mintl+0x32> 3c0e2: 90 51 subi r25, 0x10 ; 16 3c0e4: 86 2b or r24, r22 3c0e6: 70 e0 ldi r23, 0x00 ; 0 3c0e8: 60 e0 ldi r22, 0x00 ; 0 3c0ea: 2a f0 brmi .+10 ; 0x3c0f6 <__fp_mintl+0x2c> 3c0ec: 9a 95 dec r25 3c0ee: 66 0f add r22, r22 3c0f0: 77 1f adc r23, r23 3c0f2: 88 1f adc r24, r24 3c0f4: da f7 brpl .-10 ; 0x3c0ec <__fp_mintl+0x22> 3c0f6: 88 0f add r24, r24 3c0f8: 96 95 lsr r25 3c0fa: 87 95 ror r24 3c0fc: 97 f9 bld r25, 7 3c0fe: 08 95 ret 0003c100 <__fp_mpack>: 3c100: 9f 3f cpi r25, 0xFF ; 255 3c102: 31 f0 breq .+12 ; 0x3c110 <__fp_mpack_finite+0xc> 0003c104 <__fp_mpack_finite>: 3c104: 91 50 subi r25, 0x01 ; 1 3c106: 20 f4 brcc .+8 ; 0x3c110 <__fp_mpack_finite+0xc> 3c108: 87 95 ror r24 3c10a: 77 95 ror r23 3c10c: 67 95 ror r22 3c10e: b7 95 ror r27 3c110: 88 0f add r24, r24 3c112: 91 1d adc r25, r1 3c114: 96 95 lsr r25 3c116: 87 95 ror r24 3c118: 97 f9 bld r25, 7 3c11a: 08 95 ret 0003c11c <__fp_powser>: 3c11c: df 93 push r29 3c11e: cf 93 push r28 3c120: 1f 93 push r17 3c122: 0f 93 push r16 3c124: ff 92 push r15 3c126: ef 92 push r14 3c128: df 92 push r13 3c12a: 7b 01 movw r14, r22 3c12c: 8c 01 movw r16, r24 3c12e: 68 94 set 3c130: 06 c0 rjmp .+12 ; 0x3c13e <__fp_powser+0x22> 3c132: da 2e mov r13, r26 3c134: ef 01 movw r28, r30 3c136: 0f 94 3b d8 call 0x3b076 ; 0x3b076 <__mulsf3x> 3c13a: fe 01 movw r30, r28 3c13c: e8 94 clt 3c13e: a5 91 lpm r26, Z+ 3c140: 25 91 lpm r18, Z+ 3c142: 35 91 lpm r19, Z+ 3c144: 45 91 lpm r20, Z+ 3c146: 55 91 lpm r21, Z+ 3c148: a6 f3 brts .-24 ; 0x3c132 <__fp_powser+0x16> 3c14a: ef 01 movw r28, r30 3c14c: 0f 94 9a de call 0x3bd34 ; 0x3bd34 <__addsf3x> 3c150: fe 01 movw r30, r28 3c152: 97 01 movw r18, r14 3c154: a8 01 movw r20, r16 3c156: da 94 dec r13 3c158: 69 f7 brne .-38 ; 0x3c134 <__fp_powser+0x18> 3c15a: df 90 pop r13 3c15c: ef 90 pop r14 3c15e: ff 90 pop r15 3c160: 0f 91 pop r16 3c162: 1f 91 pop r17 3c164: cf 91 pop r28 3c166: df 91 pop r29 3c168: 08 95 ret 3c16a: 0d 94 9b d8 jmp 0x3b136 ; 0x3b136 <__fp_nan> 0003c16e <__fp_rempio2>: 3c16e: 0f 94 c5 d8 call 0x3b18a ; 0x3b18a <__fp_splitA> 3c172: d8 f3 brcs .-10 ; 0x3c16a <__fp_powser+0x4e> 3c174: e8 94 clt 3c176: e0 e0 ldi r30, 0x00 ; 0 3c178: bb 27 eor r27, r27 3c17a: 9f 57 subi r25, 0x7F ; 127 3c17c: f0 f0 brcs .+60 ; 0x3c1ba <__fp_rempio2+0x4c> 3c17e: 2a ed ldi r18, 0xDA ; 218 3c180: 3f e0 ldi r19, 0x0F ; 15 3c182: 49 ec ldi r20, 0xC9 ; 201 3c184: 06 c0 rjmp .+12 ; 0x3c192 <__fp_rempio2+0x24> 3c186: ee 0f add r30, r30 3c188: bb 0f add r27, r27 3c18a: 66 1f adc r22, r22 3c18c: 77 1f adc r23, r23 3c18e: 88 1f adc r24, r24 3c190: 28 f0 brcs .+10 ; 0x3c19c <__fp_rempio2+0x2e> 3c192: b2 3a cpi r27, 0xA2 ; 162 3c194: 62 07 cpc r22, r18 3c196: 73 07 cpc r23, r19 3c198: 84 07 cpc r24, r20 3c19a: 28 f0 brcs .+10 ; 0x3c1a6 <__fp_rempio2+0x38> 3c19c: b2 5a subi r27, 0xA2 ; 162 3c19e: 62 0b sbc r22, r18 3c1a0: 73 0b sbc r23, r19 3c1a2: 84 0b sbc r24, r20 3c1a4: e3 95 inc r30 3c1a6: 9a 95 dec r25 3c1a8: 72 f7 brpl .-36 ; 0x3c186 <__fp_rempio2+0x18> 3c1aa: 80 38 cpi r24, 0x80 ; 128 3c1ac: 30 f4 brcc .+12 ; 0x3c1ba <__fp_rempio2+0x4c> 3c1ae: 9a 95 dec r25 3c1b0: bb 0f add r27, r27 3c1b2: 66 1f adc r22, r22 3c1b4: 77 1f adc r23, r23 3c1b6: 88 1f adc r24, r24 3c1b8: d2 f7 brpl .-12 ; 0x3c1ae <__fp_rempio2+0x40> 3c1ba: 90 48 sbci r25, 0x80 ; 128 3c1bc: 0d 94 82 e0 jmp 0x3c104 ; 0x3c104 <__fp_mpack_finite> 0003c1c0 <__fp_sinus>: 3c1c0: ef 93 push r30 3c1c2: e0 ff sbrs r30, 0 3c1c4: 07 c0 rjmp .+14 ; 0x3c1d4 <__fp_sinus+0x14> 3c1c6: a2 ea ldi r26, 0xA2 ; 162 3c1c8: 2a ed ldi r18, 0xDA ; 218 3c1ca: 3f e0 ldi r19, 0x0F ; 15 3c1cc: 49 ec ldi r20, 0xC9 ; 201 3c1ce: 5f eb ldi r21, 0xBF ; 191 3c1d0: 0f 94 9a de call 0x3bd34 ; 0x3bd34 <__addsf3x> 3c1d4: 0f 94 ac d8 call 0x3b158 ; 0x3b158 <__fp_round> 3c1d8: 0f 90 pop r0 3c1da: 03 94 inc r0 3c1dc: 01 fc sbrc r0, 1 3c1de: 90 58 subi r25, 0x80 ; 128 3c1e0: e3 eb ldi r30, 0xB3 ; 179 3c1e2: f2 e7 ldi r31, 0x72 ; 114 3c1e4: 0d 94 d7 e2 jmp 0x3c5ae ; 0x3c5ae <__fp_powsodd> 0003c1e8 <__fp_trunc>: 3c1e8: 0f 94 c5 d8 call 0x3b18a ; 0x3b18a <__fp_splitA> 3c1ec: a0 f0 brcs .+40 ; 0x3c216 <__fp_trunc+0x2e> 3c1ee: be e7 ldi r27, 0x7E ; 126 3c1f0: b9 17 cp r27, r25 3c1f2: 88 f4 brcc .+34 ; 0x3c216 <__fp_trunc+0x2e> 3c1f4: bb 27 eor r27, r27 3c1f6: 9f 38 cpi r25, 0x8F ; 143 3c1f8: 60 f4 brcc .+24 ; 0x3c212 <__fp_trunc+0x2a> 3c1fa: 16 16 cp r1, r22 3c1fc: b1 1d adc r27, r1 3c1fe: 67 2f mov r22, r23 3c200: 78 2f mov r23, r24 3c202: 88 27 eor r24, r24 3c204: 98 5f subi r25, 0xF8 ; 248 3c206: f7 cf rjmp .-18 ; 0x3c1f6 <__fp_trunc+0xe> 3c208: 86 95 lsr r24 3c20a: 77 95 ror r23 3c20c: 67 95 ror r22 3c20e: b1 1d adc r27, r1 3c210: 93 95 inc r25 3c212: 96 39 cpi r25, 0x96 ; 150 3c214: c8 f3 brcs .-14 ; 0x3c208 <__fp_trunc+0x20> 3c216: 08 95 ret 0003c218 <__gesf2>: 3c218: 0f 94 41 e0 call 0x3c082 ; 0x3c082 <__fp_cmp> 3c21c: 08 f4 brcc .+2 ; 0x3c220 <__gesf2+0x8> 3c21e: 8f ef ldi r24, 0xFF ; 255 3c220: 08 95 ret 3c222: 0f 94 9e d8 call 0x3b13c ; 0x3b13c <__fp_pscA> 3c226: 29 f0 breq .+10 ; 0x3c232 <__gesf2+0x1a> 3c228: 0f 94 a5 d8 call 0x3b14a ; 0x3b14a <__fp_pscB> 3c22c: 11 f0 breq .+4 ; 0x3c232 <__gesf2+0x1a> 3c22e: 0d 94 9b d8 jmp 0x3b136 ; 0x3b136 <__fp_nan> 3c232: 0d 94 95 d8 jmp 0x3b12a ; 0x3b12a <__fp_inf> 3c236: b9 01 movw r22, r18 3c238: ca 01 movw r24, r20 3c23a: 0d 94 80 e0 jmp 0x3c100 ; 0x3c100 <__fp_mpack> 0003c23e : 3c23e: 9f 77 andi r25, 0x7F ; 127 3c240: 5f 77 andi r21, 0x7F ; 127 3c242: 0f 94 bd d8 call 0x3b17a ; 0x3b17a <__fp_split3> 3c246: 68 f3 brcs .-38 ; 0x3c222 <__gesf2+0xa> 3c248: 99 23 and r25, r25 3c24a: a9 f3 breq .-22 ; 0x3c236 <__gesf2+0x1e> 3c24c: 55 23 and r21, r21 3c24e: a9 f3 breq .-22 ; 0x3c23a <__gesf2+0x22> 3c250: ff 27 eor r31, r31 3c252: 95 17 cp r25, r21 3c254: 58 f4 brcc .+22 ; 0x3c26c 3c256: e5 2f mov r30, r21 3c258: e9 1b sub r30, r25 3c25a: ed 30 cpi r30, 0x0D ; 13 3c25c: 60 f7 brcc .-40 ; 0x3c236 <__gesf2+0x1e> 3c25e: 5e 3b cpi r21, 0xBE ; 190 3c260: 10 f0 brcs .+4 ; 0x3c266 3c262: f1 e4 ldi r31, 0x41 ; 65 3c264: 1c c0 rjmp .+56 ; 0x3c29e 3c266: 90 34 cpi r25, 0x40 ; 64 3c268: e0 f4 brcc .+56 ; 0x3c2a2 3c26a: 0a c0 rjmp .+20 ; 0x3c280 3c26c: e9 2f mov r30, r25 3c26e: e5 1b sub r30, r21 3c270: ed 30 cpi r30, 0x0D ; 13 3c272: 18 f7 brcc .-58 ; 0x3c23a <__gesf2+0x22> 3c274: 9e 3b cpi r25, 0xBE ; 190 3c276: 10 f0 brcs .+4 ; 0x3c27c 3c278: f1 e4 ldi r31, 0x41 ; 65 3c27a: 11 c0 rjmp .+34 ; 0x3c29e 3c27c: 50 34 cpi r21, 0x40 ; 64 3c27e: 88 f4 brcc .+34 ; 0x3c2a2 3c280: f9 ea ldi r31, 0xA9 ; 169 3c282: 88 23 and r24, r24 3c284: 2a f0 brmi .+10 ; 0x3c290 3c286: 9a 95 dec r25 3c288: 66 0f add r22, r22 3c28a: 77 1f adc r23, r23 3c28c: 88 1f adc r24, r24 3c28e: da f7 brpl .-10 ; 0x3c286 3c290: 44 23 and r20, r20 3c292: 2a f0 brmi .+10 ; 0x3c29e 3c294: 5a 95 dec r21 3c296: 22 0f add r18, r18 3c298: 33 1f adc r19, r19 3c29a: 44 1f adc r20, r20 3c29c: da f7 brpl .-10 ; 0x3c294 3c29e: 9f 1b sub r25, r31 3c2a0: 5f 1b sub r21, r31 3c2a2: ff 93 push r31 3c2a4: 1f 93 push r17 3c2a6: 0f 93 push r16 3c2a8: ff 92 push r15 3c2aa: ef 92 push r14 3c2ac: 79 01 movw r14, r18 3c2ae: 8a 01 movw r16, r20 3c2b0: bb 27 eor r27, r27 3c2b2: ab 2f mov r26, r27 3c2b4: 9b 01 movw r18, r22 3c2b6: ac 01 movw r20, r24 3c2b8: 0f 94 3e d8 call 0x3b07c ; 0x3b07c <__mulsf3_pse> 3c2bc: 97 01 movw r18, r14 3c2be: a8 01 movw r20, r16 3c2c0: bf 93 push r27 3c2c2: 7b 01 movw r14, r22 3c2c4: 8c 01 movw r16, r24 3c2c6: aa 27 eor r26, r26 3c2c8: ba 2f mov r27, r26 3c2ca: b9 01 movw r22, r18 3c2cc: ca 01 movw r24, r20 3c2ce: 0f 94 3e d8 call 0x3b07c ; 0x3b07c <__mulsf3_pse> 3c2d2: af 91 pop r26 3c2d4: 97 01 movw r18, r14 3c2d6: a8 01 movw r20, r16 3c2d8: ef 90 pop r14 3c2da: ff 90 pop r15 3c2dc: 0f 91 pop r16 3c2de: 1f 91 pop r17 3c2e0: 0f 94 9a de call 0x3bd34 ; 0x3bd34 <__addsf3x> 3c2e4: 0f 94 ac d8 call 0x3b158 ; 0x3b158 <__fp_round> 3c2e8: 0f 94 51 e2 call 0x3c4a2 ; 0x3c4a2 3c2ec: 4f 91 pop r20 3c2ee: 40 ff sbrs r20, 0 3c2f0: 08 95 ret 3c2f2: 55 27 eor r21, r21 3c2f4: 47 fd sbrc r20, 7 3c2f6: 50 95 com r21 3c2f8: 0d 94 8a e1 jmp 0x3c314 ; 0x3c314 0003c2fc : 3c2fc: 9b 01 movw r18, r22 3c2fe: ac 01 movw r20, r24 3c300: 60 e0 ldi r22, 0x00 ; 0 3c302: 70 e0 ldi r23, 0x00 ; 0 3c304: 80 e8 ldi r24, 0x80 ; 128 3c306: 9f e3 ldi r25, 0x3F ; 63 3c308: 0d 94 82 df jmp 0x3bf04 ; 0x3bf04 <__divsf3> 3c30c: 0d 94 95 d8 jmp 0x3b12a ; 0x3b12a <__fp_inf> 3c310: 0d 94 80 e0 jmp 0x3c100 ; 0x3c100 <__fp_mpack> 0003c314 : 3c314: 0f 94 c5 d8 call 0x3b18a ; 0x3b18a <__fp_splitA> 3c318: d8 f3 brcs .-10 ; 0x3c310 3c31a: 99 23 and r25, r25 3c31c: c9 f3 breq .-14 ; 0x3c310 3c31e: 94 0f add r25, r20 3c320: 51 1d adc r21, r1 3c322: a3 f3 brvs .-24 ; 0x3c30c 3c324: 91 50 subi r25, 0x01 ; 1 3c326: 50 40 sbci r21, 0x00 ; 0 3c328: 94 f0 brlt .+36 ; 0x3c34e 3c32a: 59 f0 breq .+22 ; 0x3c342 3c32c: 88 23 and r24, r24 3c32e: 32 f0 brmi .+12 ; 0x3c33c 3c330: 66 0f add r22, r22 3c332: 77 1f adc r23, r23 3c334: 88 1f adc r24, r24 3c336: 91 50 subi r25, 0x01 ; 1 3c338: 50 40 sbci r21, 0x00 ; 0 3c33a: c1 f7 brne .-16 ; 0x3c32c 3c33c: 9e 3f cpi r25, 0xFE ; 254 3c33e: 51 05 cpc r21, r1 3c340: 2c f7 brge .-54 ; 0x3c30c 3c342: 88 0f add r24, r24 3c344: 91 1d adc r25, r1 3c346: 96 95 lsr r25 3c348: 87 95 ror r24 3c34a: 97 f9 bld r25, 7 3c34c: 08 95 ret 3c34e: 5f 3f cpi r21, 0xFF ; 255 3c350: ac f0 brlt .+42 ; 0x3c37c 3c352: 98 3e cpi r25, 0xE8 ; 232 3c354: 9c f0 brlt .+38 ; 0x3c37c 3c356: bb 27 eor r27, r27 3c358: 86 95 lsr r24 3c35a: 77 95 ror r23 3c35c: 67 95 ror r22 3c35e: b7 95 ror r27 3c360: 08 f4 brcc .+2 ; 0x3c364 3c362: b1 60 ori r27, 0x01 ; 1 3c364: 93 95 inc r25 3c366: c1 f7 brne .-16 ; 0x3c358 3c368: bb 0f add r27, r27 3c36a: 58 f7 brcc .-42 ; 0x3c342 3c36c: 11 f4 brne .+4 ; 0x3c372 3c36e: 60 ff sbrs r22, 0 3c370: e8 cf rjmp .-48 ; 0x3c342 3c372: 6f 5f subi r22, 0xFF ; 255 3c374: 7f 4f sbci r23, 0xFF ; 255 3c376: 8f 4f sbci r24, 0xFF ; 255 3c378: 9f 4f sbci r25, 0xFF ; 255 3c37a: e3 cf rjmp .-58 ; 0x3c342 3c37c: 0d 94 e0 d8 jmp 0x3b1c0 ; 0x3b1c0 <__fp_szero> 0003c380 : 3c380: 0f 94 c5 d8 call 0x3b18a ; 0x3b18a <__fp_splitA> 3c384: 58 f1 brcs .+86 ; 0x3c3dc 3c386: 9e 57 subi r25, 0x7E ; 126 3c388: 60 f1 brcs .+88 ; 0x3c3e2 3c38a: 98 51 subi r25, 0x18 ; 24 3c38c: a0 f0 brcs .+40 ; 0x3c3b6 3c38e: e9 f0 breq .+58 ; 0x3c3ca 3c390: 98 30 cpi r25, 0x08 ; 8 3c392: 20 f5 brcc .+72 ; 0x3c3dc 3c394: 09 2e mov r0, r25 3c396: 99 27 eor r25, r25 3c398: 66 0f add r22, r22 3c39a: 77 1f adc r23, r23 3c39c: 88 1f adc r24, r24 3c39e: 99 1f adc r25, r25 3c3a0: 0a 94 dec r0 3c3a2: d1 f7 brne .-12 ; 0x3c398 3c3a4: 12 c0 rjmp .+36 ; 0x3c3ca 3c3a6: 06 2e mov r0, r22 3c3a8: 67 2f mov r22, r23 3c3aa: 78 2f mov r23, r24 3c3ac: 88 27 eor r24, r24 3c3ae: 98 5f subi r25, 0xF8 ; 248 3c3b0: 11 f4 brne .+4 ; 0x3c3b6 3c3b2: 00 0c add r0, r0 3c3b4: 07 c0 rjmp .+14 ; 0x3c3c4 3c3b6: 99 3f cpi r25, 0xF9 ; 249 3c3b8: b4 f3 brlt .-20 ; 0x3c3a6 3c3ba: 86 95 lsr r24 3c3bc: 77 95 ror r23 3c3be: 67 95 ror r22 3c3c0: 93 95 inc r25 3c3c2: d9 f7 brne .-10 ; 0x3c3ba 3c3c4: 61 1d adc r22, r1 3c3c6: 71 1d adc r23, r1 3c3c8: 81 1d adc r24, r1 3c3ca: 3e f4 brtc .+14 ; 0x3c3da 3c3cc: 90 95 com r25 3c3ce: 80 95 com r24 3c3d0: 70 95 com r23 3c3d2: 61 95 neg r22 3c3d4: 7f 4f sbci r23, 0xFF ; 255 3c3d6: 8f 4f sbci r24, 0xFF ; 255 3c3d8: 9f 4f sbci r25, 0xFF ; 255 3c3da: 08 95 ret 3c3dc: 68 94 set 3c3de: 0d 94 e0 d8 jmp 0x3b1c0 ; 0x3b1c0 <__fp_szero> 3c3e2: 0d 94 df d8 jmp 0x3b1be ; 0x3b1be <__fp_zero> 0003c3e6 : 3c3e6: fa 01 movw r30, r20 3c3e8: ee 0f add r30, r30 3c3ea: ff 1f adc r31, r31 3c3ec: 30 96 adiw r30, 0x00 ; 0 3c3ee: 21 05 cpc r18, r1 3c3f0: 31 05 cpc r19, r1 3c3f2: a1 f1 breq .+104 ; 0x3c45c 3c3f4: 61 15 cp r22, r1 3c3f6: 71 05 cpc r23, r1 3c3f8: 61 f4 brne .+24 ; 0x3c412 3c3fa: 80 38 cpi r24, 0x80 ; 128 3c3fc: bf e3 ldi r27, 0x3F ; 63 3c3fe: 9b 07 cpc r25, r27 3c400: 49 f1 breq .+82 ; 0x3c454 3c402: 68 94 set 3c404: 90 38 cpi r25, 0x80 ; 128 3c406: 81 05 cpc r24, r1 3c408: 61 f0 breq .+24 ; 0x3c422 3c40a: 80 38 cpi r24, 0x80 ; 128 3c40c: bf ef ldi r27, 0xFF ; 255 3c40e: 9b 07 cpc r25, r27 3c410: 41 f0 breq .+16 ; 0x3c422 3c412: 99 23 and r25, r25 3c414: 4a f5 brpl .+82 ; 0x3c468 3c416: ff 3f cpi r31, 0xFF ; 255 3c418: e1 05 cpc r30, r1 3c41a: 31 05 cpc r19, r1 3c41c: 21 05 cpc r18, r1 3c41e: 19 f1 breq .+70 ; 0x3c466 3c420: e8 94 clt 3c422: 08 94 sec 3c424: e7 95 ror r30 3c426: d9 01 movw r26, r18 3c428: aa 23 and r26, r26 3c42a: 29 f4 brne .+10 ; 0x3c436 3c42c: ab 2f mov r26, r27 3c42e: be 2f mov r27, r30 3c430: f8 5f subi r31, 0xF8 ; 248 3c432: d0 f3 brcs .-12 ; 0x3c428 3c434: 10 c0 rjmp .+32 ; 0x3c456 3c436: ff 5f subi r31, 0xFF ; 255 3c438: 70 f4 brcc .+28 ; 0x3c456 3c43a: a6 95 lsr r26 3c43c: e0 f7 brcc .-8 ; 0x3c436 3c43e: f7 39 cpi r31, 0x97 ; 151 3c440: 50 f0 brcs .+20 ; 0x3c456 3c442: 19 f0 breq .+6 ; 0x3c44a 3c444: ff 3a cpi r31, 0xAF ; 175 3c446: 38 f4 brcc .+14 ; 0x3c456 3c448: 9f 77 andi r25, 0x7F ; 127 3c44a: 9f 93 push r25 3c44c: 0d d0 rcall .+26 ; 0x3c468 3c44e: 0f 90 pop r0 3c450: 07 fc sbrc r0, 7 3c452: 90 58 subi r25, 0x80 ; 128 3c454: 08 95 ret 3c456: 46 f0 brts .+16 ; 0x3c468 3c458: 0d 94 9b d8 jmp 0x3b136 ; 0x3b136 <__fp_nan> 3c45c: 60 e0 ldi r22, 0x00 ; 0 3c45e: 70 e0 ldi r23, 0x00 ; 0 3c460: 80 e8 ldi r24, 0x80 ; 128 3c462: 9f e3 ldi r25, 0x3F ; 63 3c464: 08 95 ret 3c466: 4f e7 ldi r20, 0x7F ; 127 3c468: 9f 77 andi r25, 0x7F ; 127 3c46a: 5f 93 push r21 3c46c: 4f 93 push r20 3c46e: 3f 93 push r19 3c470: 2f 93 push r18 3c472: 0f 94 f3 e2 call 0x3c5e6 ; 0x3c5e6 3c476: 2f 91 pop r18 3c478: 3f 91 pop r19 3c47a: 4f 91 pop r20 3c47c: 5f 91 pop r21 3c47e: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3c482: 0d 94 9e e2 jmp 0x3c53c ; 0x3c53c 0003c486 : 3c486: 9f 93 push r25 3c488: 0f 94 b7 e0 call 0x3c16e ; 0x3c16e <__fp_rempio2> 3c48c: 0f 90 pop r0 3c48e: 07 fc sbrc r0, 7 3c490: ee 5f subi r30, 0xFE ; 254 3c492: 0d 94 e0 e0 jmp 0x3c1c0 ; 0x3c1c0 <__fp_sinus> 3c496: 19 f4 brne .+6 ; 0x3c49e 3c498: 16 f4 brtc .+4 ; 0x3c49e 3c49a: 0d 94 9b d8 jmp 0x3b136 ; 0x3b136 <__fp_nan> 3c49e: 0d 94 80 e0 jmp 0x3c100 ; 0x3c100 <__fp_mpack> 0003c4a2 : 3c4a2: 0f 94 c5 d8 call 0x3b18a ; 0x3b18a <__fp_splitA> 3c4a6: b8 f3 brcs .-18 ; 0x3c496 3c4a8: 99 23 and r25, r25 3c4aa: c9 f3 breq .-14 ; 0x3c49e 3c4ac: b6 f3 brts .-20 ; 0x3c49a 3c4ae: 9f 57 subi r25, 0x7F ; 127 3c4b0: 55 0b sbc r21, r21 3c4b2: 87 ff sbrs r24, 7 3c4b4: 0f 94 d0 e2 call 0x3c5a0 ; 0x3c5a0 <__fp_norm2> 3c4b8: 00 24 eor r0, r0 3c4ba: a0 e6 ldi r26, 0x60 ; 96 3c4bc: 40 ea ldi r20, 0xA0 ; 160 3c4be: 90 01 movw r18, r0 3c4c0: 80 58 subi r24, 0x80 ; 128 3c4c2: 56 95 lsr r21 3c4c4: 97 95 ror r25 3c4c6: 28 f4 brcc .+10 ; 0x3c4d2 3c4c8: 80 5c subi r24, 0xC0 ; 192 3c4ca: 66 0f add r22, r22 3c4cc: 77 1f adc r23, r23 3c4ce: 88 1f adc r24, r24 3c4d0: 20 f0 brcs .+8 ; 0x3c4da 3c4d2: 26 17 cp r18, r22 3c4d4: 37 07 cpc r19, r23 3c4d6: 48 07 cpc r20, r24 3c4d8: 30 f4 brcc .+12 ; 0x3c4e6 3c4da: 62 1b sub r22, r18 3c4dc: 73 0b sbc r23, r19 3c4de: 84 0b sbc r24, r20 3c4e0: 20 29 or r18, r0 3c4e2: 31 29 or r19, r1 3c4e4: 4a 2b or r20, r26 3c4e6: a6 95 lsr r26 3c4e8: 17 94 ror r1 3c4ea: 07 94 ror r0 3c4ec: 20 25 eor r18, r0 3c4ee: 31 25 eor r19, r1 3c4f0: 4a 27 eor r20, r26 3c4f2: 58 f7 brcc .-42 ; 0x3c4ca 3c4f4: 66 0f add r22, r22 3c4f6: 77 1f adc r23, r23 3c4f8: 88 1f adc r24, r24 3c4fa: 20 f0 brcs .+8 ; 0x3c504 3c4fc: 26 17 cp r18, r22 3c4fe: 37 07 cpc r19, r23 3c500: 48 07 cpc r20, r24 3c502: 30 f4 brcc .+12 ; 0x3c510 3c504: 62 0b sbc r22, r18 3c506: 73 0b sbc r23, r19 3c508: 84 0b sbc r24, r20 3c50a: 20 0d add r18, r0 3c50c: 31 1d adc r19, r1 3c50e: 41 1d adc r20, r1 3c510: a0 95 com r26 3c512: 81 f7 brne .-32 ; 0x3c4f4 3c514: b9 01 movw r22, r18 3c516: 84 2f mov r24, r20 3c518: 91 58 subi r25, 0x81 ; 129 3c51a: 88 0f add r24, r24 3c51c: 96 95 lsr r25 3c51e: 87 95 ror r24 3c520: 08 95 ret 0003c522 <__unordsf2>: 3c522: 0f 94 41 e0 call 0x3c082 ; 0x3c082 <__fp_cmp> 3c526: 88 0b sbc r24, r24 3c528: 99 0b sbc r25, r25 3c52a: 08 95 ret 3c52c: 29 f4 brne .+10 ; 0x3c538 <__unordsf2+0x16> 3c52e: 16 f0 brts .+4 ; 0x3c534 <__unordsf2+0x12> 3c530: 0d 94 95 d8 jmp 0x3b12a ; 0x3b12a <__fp_inf> 3c534: 0d 94 df d8 jmp 0x3b1be ; 0x3b1be <__fp_zero> 3c538: 0d 94 9b d8 jmp 0x3b136 ; 0x3b136 <__fp_nan> 0003c53c : 3c53c: 0f 94 c5 d8 call 0x3b18a ; 0x3b18a <__fp_splitA> 3c540: a8 f3 brcs .-22 ; 0x3c52c <__unordsf2+0xa> 3c542: 96 38 cpi r25, 0x86 ; 134 3c544: a0 f7 brcc .-24 ; 0x3c52e <__unordsf2+0xc> 3c546: 07 f8 bld r0, 7 3c548: 0f 92 push r0 3c54a: e8 94 clt 3c54c: 2b e3 ldi r18, 0x3B ; 59 3c54e: 3a ea ldi r19, 0xAA ; 170 3c550: 48 eb ldi r20, 0xB8 ; 184 3c552: 5f e7 ldi r21, 0x7F ; 127 3c554: 0f 94 3e d8 call 0x3b07c ; 0x3b07c <__mulsf3_pse> 3c558: 0f 92 push r0 3c55a: 0f 92 push r0 3c55c: 0f 92 push r0 3c55e: 4d b7 in r20, 0x3d ; 61 3c560: 5e b7 in r21, 0x3e ; 62 3c562: 0f 92 push r0 3c564: 0f 94 3b e3 call 0x3c676 ; 0x3c676 3c568: e1 ed ldi r30, 0xD1 ; 209 3c56a: f2 e7 ldi r31, 0x72 ; 114 3c56c: 0f 94 8e e0 call 0x3c11c ; 0x3c11c <__fp_powser> 3c570: 4f 91 pop r20 3c572: 5f 91 pop r21 3c574: ef 91 pop r30 3c576: ff 91 pop r31 3c578: e5 95 asr r30 3c57a: ee 1f adc r30, r30 3c57c: ff 1f adc r31, r31 3c57e: 49 f0 breq .+18 ; 0x3c592 3c580: fe 57 subi r31, 0x7E ; 126 3c582: e0 68 ori r30, 0x80 ; 128 3c584: 44 27 eor r20, r20 3c586: ee 0f add r30, r30 3c588: 44 1f adc r20, r20 3c58a: fa 95 dec r31 3c58c: e1 f7 brne .-8 ; 0x3c586 3c58e: 41 95 neg r20 3c590: 55 0b sbc r21, r21 3c592: 0f 94 8a e1 call 0x3c314 ; 0x3c314 3c596: 0f 90 pop r0 3c598: 07 fe sbrs r0, 7 3c59a: 0d 94 7e e1 jmp 0x3c2fc ; 0x3c2fc 3c59e: 08 95 ret 0003c5a0 <__fp_norm2>: 3c5a0: 91 50 subi r25, 0x01 ; 1 3c5a2: 50 40 sbci r21, 0x00 ; 0 3c5a4: 66 0f add r22, r22 3c5a6: 77 1f adc r23, r23 3c5a8: 88 1f adc r24, r24 3c5aa: d2 f7 brpl .-12 ; 0x3c5a0 <__fp_norm2> 3c5ac: 08 95 ret 0003c5ae <__fp_powsodd>: 3c5ae: 9f 93 push r25 3c5b0: 8f 93 push r24 3c5b2: 7f 93 push r23 3c5b4: 6f 93 push r22 3c5b6: ff 93 push r31 3c5b8: ef 93 push r30 3c5ba: 9b 01 movw r18, r22 3c5bc: ac 01 movw r20, r24 3c5be: 0f 94 28 d8 call 0x3b050 ; 0x3b050 <__mulsf3> 3c5c2: ef 91 pop r30 3c5c4: ff 91 pop r31 3c5c6: 0f 94 8e e0 call 0x3c11c ; 0x3c11c <__fp_powser> 3c5ca: 2f 91 pop r18 3c5cc: 3f 91 pop r19 3c5ce: 4f 91 pop r20 3c5d0: 5f 91 pop r21 3c5d2: 0d 94 28 d8 jmp 0x3b050 ; 0x3b050 <__mulsf3> 3c5d6: 16 f0 brts .+4 ; 0x3c5dc <__fp_powsodd+0x2e> 3c5d8: 0d 94 80 e0 jmp 0x3c100 ; 0x3c100 <__fp_mpack> 3c5dc: 0d 94 9b d8 jmp 0x3b136 ; 0x3b136 <__fp_nan> 3c5e0: 68 94 set 3c5e2: 0d 94 95 d8 jmp 0x3b12a ; 0x3b12a <__fp_inf> 0003c5e6 : 3c5e6: 0f 94 c5 d8 call 0x3b18a ; 0x3b18a <__fp_splitA> 3c5ea: a8 f3 brcs .-22 ; 0x3c5d6 <__fp_powsodd+0x28> 3c5ec: 99 23 and r25, r25 3c5ee: c1 f3 breq .-16 ; 0x3c5e0 <__fp_powsodd+0x32> 3c5f0: ae f3 brts .-22 ; 0x3c5dc <__fp_powsodd+0x2e> 3c5f2: df 93 push r29 3c5f4: cf 93 push r28 3c5f6: 1f 93 push r17 3c5f8: 0f 93 push r16 3c5fa: ff 92 push r15 3c5fc: c9 2f mov r28, r25 3c5fe: dd 27 eor r29, r29 3c600: 88 23 and r24, r24 3c602: 2a f0 brmi .+10 ; 0x3c60e 3c604: 21 97 sbiw r28, 0x01 ; 1 3c606: 66 0f add r22, r22 3c608: 77 1f adc r23, r23 3c60a: 88 1f adc r24, r24 3c60c: da f7 brpl .-10 ; 0x3c604 3c60e: 20 e0 ldi r18, 0x00 ; 0 3c610: 30 e0 ldi r19, 0x00 ; 0 3c612: 40 e8 ldi r20, 0x80 ; 128 3c614: 5f eb ldi r21, 0xBF ; 191 3c616: 9f e3 ldi r25, 0x3F ; 63 3c618: 88 39 cpi r24, 0x98 ; 152 3c61a: 20 f0 brcs .+8 ; 0x3c624 3c61c: 80 3e cpi r24, 0xE0 ; 224 3c61e: 38 f0 brcs .+14 ; 0x3c62e 3c620: 21 96 adiw r28, 0x01 ; 1 3c622: 8f 77 andi r24, 0x7F ; 127 3c624: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3c628: e9 ef ldi r30, 0xF9 ; 249 3c62a: f2 e7 ldi r31, 0x72 ; 114 3c62c: 04 c0 rjmp .+8 ; 0x3c636 3c62e: 0f 94 83 de call 0x3bd06 ; 0x3bd06 <__addsf3> 3c632: e6 e2 ldi r30, 0x26 ; 38 3c634: f3 e7 ldi r31, 0x73 ; 115 3c636: 0f 94 8e e0 call 0x3c11c ; 0x3c11c <__fp_powser> 3c63a: 8b 01 movw r16, r22 3c63c: be 01 movw r22, r28 3c63e: ec 01 movw r28, r24 3c640: fb 2e mov r15, r27 3c642: 6f 57 subi r22, 0x7F ; 127 3c644: 71 09 sbc r23, r1 3c646: 75 95 asr r23 3c648: 77 1f adc r23, r23 3c64a: 88 0b sbc r24, r24 3c64c: 99 0b sbc r25, r25 3c64e: 0f 94 e9 d7 call 0x3afd2 ; 0x3afd2 <__floatsisf> 3c652: 28 e1 ldi r18, 0x18 ; 24 3c654: 32 e7 ldi r19, 0x72 ; 114 3c656: 41 e3 ldi r20, 0x31 ; 49 3c658: 5f e3 ldi r21, 0x3F ; 63 3c65a: 0f 94 3b d8 call 0x3b076 ; 0x3b076 <__mulsf3x> 3c65e: af 2d mov r26, r15 3c660: 98 01 movw r18, r16 3c662: ae 01 movw r20, r28 3c664: ff 90 pop r15 3c666: 0f 91 pop r16 3c668: 1f 91 pop r17 3c66a: cf 91 pop r28 3c66c: df 91 pop r29 3c66e: 0f 94 9a de call 0x3bd34 ; 0x3bd34 <__addsf3x> 3c672: 0d 94 ac d8 jmp 0x3b158 ; 0x3b158 <__fp_round> 0003c676 : 3c676: fa 01 movw r30, r20 3c678: dc 01 movw r26, r24 3c67a: aa 0f add r26, r26 3c67c: bb 1f adc r27, r27 3c67e: 9b 01 movw r18, r22 3c680: ac 01 movw r20, r24 3c682: bf 57 subi r27, 0x7F ; 127 3c684: 28 f4 brcc .+10 ; 0x3c690 3c686: 22 27 eor r18, r18 3c688: 33 27 eor r19, r19 3c68a: 44 27 eor r20, r20 3c68c: 50 78 andi r21, 0x80 ; 128 3c68e: 20 c0 rjmp .+64 ; 0x3c6d0 3c690: b7 51 subi r27, 0x17 ; 23 3c692: 90 f4 brcc .+36 ; 0x3c6b8 3c694: ab 2f mov r26, r27 3c696: 00 24 eor r0, r0 3c698: 46 95 lsr r20 3c69a: 37 95 ror r19 3c69c: 27 95 ror r18 3c69e: 01 1c adc r0, r1 3c6a0: a3 95 inc r26 3c6a2: d2 f3 brmi .-12 ; 0x3c698 3c6a4: 00 20 and r0, r0 3c6a6: 71 f0 breq .+28 ; 0x3c6c4 3c6a8: 22 0f add r18, r18 3c6aa: 33 1f adc r19, r19 3c6ac: 44 1f adc r20, r20 3c6ae: b3 95 inc r27 3c6b0: da f3 brmi .-10 ; 0x3c6a8 3c6b2: 0e d0 rcall .+28 ; 0x3c6d0 3c6b4: 0d 94 82 de jmp 0x3bd04 ; 0x3bd04 <__subsf3> 3c6b8: 61 30 cpi r22, 0x01 ; 1 3c6ba: 71 05 cpc r23, r1 3c6bc: a0 e8 ldi r26, 0x80 ; 128 3c6be: 8a 07 cpc r24, r26 3c6c0: b9 46 sbci r27, 0x69 ; 105 3c6c2: 30 f4 brcc .+12 ; 0x3c6d0 3c6c4: 9b 01 movw r18, r22 3c6c6: ac 01 movw r20, r24 3c6c8: 66 27 eor r22, r22 3c6ca: 77 27 eor r23, r23 3c6cc: 88 27 eor r24, r24 3c6ce: 90 78 andi r25, 0x80 ; 128 3c6d0: 30 96 adiw r30, 0x00 ; 0 3c6d2: 21 f0 breq .+8 ; 0x3c6dc 3c6d4: 20 83 st Z, r18 3c6d6: 31 83 std Z+1, r19 ; 0x01 3c6d8: 42 83 std Z+2, r20 ; 0x02 3c6da: 53 83 std Z+3, r21 ; 0x03 3c6dc: 08 95 ret 0003c6de : 3c6de: 91 11 cpse r25, r1 3c6e0: 08 95 ret 3c6e2: 81 54 subi r24, 0x41 ; 65 3c6e4: 8a 51 subi r24, 0x1A ; 26 3c6e6: 08 f4 brcc .+2 ; 0x3c6ea 3c6e8: 80 5e subi r24, 0xE0 ; 224 3c6ea: 85 5a subi r24, 0xA5 ; 165 3c6ec: 08 95 ret 0003c6ee : 3c6ee: fb 01 movw r30, r22 3c6f0: dc 01 movw r26, r24 3c6f2: 04 c0 rjmp .+8 ; 0x3c6fc 3c6f4: 8d 91 ld r24, X+ 3c6f6: 01 90 ld r0, Z+ 3c6f8: 80 19 sub r24, r0 3c6fa: 21 f4 brne .+8 ; 0x3c704 3c6fc: 41 50 subi r20, 0x01 ; 1 3c6fe: 50 40 sbci r21, 0x00 ; 0 3c700: c8 f7 brcc .-14 ; 0x3c6f4 3c702: 88 1b sub r24, r24 3c704: 99 0b sbc r25, r25 3c706: 08 95 ret 0003c708 : 3c708: fb 01 movw r30, r22 3c70a: dc 01 movw r26, r24 3c70c: 02 c0 rjmp .+4 ; 0x3c712 3c70e: 01 90 ld r0, Z+ 3c710: 0d 92 st X+, r0 3c712: 41 50 subi r20, 0x01 ; 1 3c714: 50 40 sbci r21, 0x00 ; 0 3c716: d8 f7 brcc .-10 ; 0x3c70e 3c718: 08 95 ret 0003c71a : 3c71a: dc 01 movw r26, r24 3c71c: 01 c0 rjmp .+2 ; 0x3c720 3c71e: 6d 93 st X+, r22 3c720: 41 50 subi r20, 0x01 ; 1 3c722: 50 40 sbci r21, 0x00 ; 0 3c724: e0 f7 brcc .-8 ; 0x3c71e 3c726: 08 95 ret 0003c728 : 3c728: fb 01 movw r30, r22 3c72a: dc 01 movw r26, r24 3c72c: 8d 91 ld r24, X+ 3c72e: 81 34 cpi r24, 0x41 ; 65 3c730: 1c f0 brlt .+6 ; 0x3c738 3c732: 8b 35 cpi r24, 0x5B ; 91 3c734: 0c f4 brge .+2 ; 0x3c738 3c736: 80 5e subi r24, 0xE0 ; 224 3c738: 61 91 ld r22, Z+ 3c73a: 61 34 cpi r22, 0x41 ; 65 3c73c: 1c f0 brlt .+6 ; 0x3c744 3c73e: 6b 35 cpi r22, 0x5B ; 91 3c740: 0c f4 brge .+2 ; 0x3c744 3c742: 60 5e subi r22, 0xE0 ; 224 3c744: 86 1b sub r24, r22 3c746: 61 11 cpse r22, r1 3c748: 89 f3 breq .-30 ; 0x3c72c 3c74a: 99 0b sbc r25, r25 3c74c: 08 95 ret 0003c74e : 3c74e: fb 01 movw r30, r22 3c750: dc 01 movw r26, r24 3c752: 0d 90 ld r0, X+ 3c754: 00 20 and r0, r0 3c756: e9 f7 brne .-6 ; 0x3c752 3c758: 11 97 sbiw r26, 0x01 ; 1 3c75a: 01 90 ld r0, Z+ 3c75c: 0d 92 st X+, r0 3c75e: 00 20 and r0, r0 3c760: e1 f7 brne .-8 ; 0x3c75a 3c762: 08 95 ret 0003c764 : 3c764: fc 01 movw r30, r24 3c766: 81 91 ld r24, Z+ 3c768: 86 17 cp r24, r22 3c76a: 21 f0 breq .+8 ; 0x3c774 3c76c: 88 23 and r24, r24 3c76e: d9 f7 brne .-10 ; 0x3c766 3c770: 99 27 eor r25, r25 3c772: 08 95 ret 3c774: 31 97 sbiw r30, 0x01 ; 1 3c776: cf 01 movw r24, r30 3c778: 08 95 ret 0003c77a : 3c77a: fb 01 movw r30, r22 3c77c: dc 01 movw r26, r24 3c77e: 8d 91 ld r24, X+ 3c780: 01 90 ld r0, Z+ 3c782: 80 19 sub r24, r0 3c784: 01 10 cpse r0, r1 3c786: d9 f3 breq .-10 ; 0x3c77e 3c788: 99 0b sbc r25, r25 3c78a: 08 95 ret 0003c78c : 3c78c: fb 01 movw r30, r22 3c78e: dc 01 movw r26, r24 3c790: 01 90 ld r0, Z+ 3c792: 0d 92 st X+, r0 3c794: 00 20 and r0, r0 3c796: e1 f7 brne .-8 ; 0x3c790 3c798: 08 95 ret 0003c79a : 3c79a: fb 01 movw r30, r22 3c79c: dc 01 movw r26, r24 3c79e: 41 50 subi r20, 0x01 ; 1 3c7a0: 50 40 sbci r21, 0x00 ; 0 3c7a2: 30 f0 brcs .+12 ; 0x3c7b0 3c7a4: 8d 91 ld r24, X+ 3c7a6: 01 90 ld r0, Z+ 3c7a8: 80 19 sub r24, r0 3c7aa: 19 f4 brne .+6 ; 0x3c7b2 3c7ac: 00 20 and r0, r0 3c7ae: b9 f7 brne .-18 ; 0x3c79e 3c7b0: 88 1b sub r24, r24 3c7b2: 99 0b sbc r25, r25 3c7b4: 08 95 ret 0003c7b6 : 3c7b6: fb 01 movw r30, r22 3c7b8: dc 01 movw r26, r24 3c7ba: 41 50 subi r20, 0x01 ; 1 3c7bc: 50 40 sbci r21, 0x00 ; 0 3c7be: 48 f0 brcs .+18 ; 0x3c7d2 3c7c0: 01 90 ld r0, Z+ 3c7c2: 0d 92 st X+, r0 3c7c4: 00 20 and r0, r0 3c7c6: c9 f7 brne .-14 ; 0x3c7ba 3c7c8: 01 c0 rjmp .+2 ; 0x3c7cc 3c7ca: 1d 92 st X+, r1 3c7cc: 41 50 subi r20, 0x01 ; 1 3c7ce: 50 40 sbci r21, 0x00 ; 0 3c7d0: e0 f7 brcc .-8 ; 0x3c7ca 3c7d2: 08 95 ret 0003c7d4 : 3c7d4: 0f 93 push r16 3c7d6: 1f 93 push r17 3c7d8: cf 93 push r28 3c7da: df 93 push r29 3c7dc: e0 91 15 18 lds r30, 0x1815 ; 0x801815 <__iob+0x2> 3c7e0: f0 91 16 18 lds r31, 0x1816 ; 0x801816 <__iob+0x3> 3c7e4: 23 81 ldd r18, Z+3 ; 0x03 3c7e6: ec 01 movw r28, r24 3c7e8: 10 e0 ldi r17, 0x00 ; 0 3c7ea: 00 e0 ldi r16, 0x00 ; 0 3c7ec: 21 fd sbrc r18, 1 3c7ee: 08 c0 rjmp .+16 ; 0x3c800 3c7f0: 0f ef ldi r16, 0xFF ; 255 3c7f2: 1f ef ldi r17, 0xFF ; 255 3c7f4: 14 c0 rjmp .+40 ; 0x3c81e 3c7f6: 19 95 eicall 3c7f8: 89 2b or r24, r25 3c7fa: 11 f0 breq .+4 ; 0x3c800 3c7fc: 0f ef ldi r16, 0xFF ; 255 3c7fe: 1f ef ldi r17, 0xFF ; 255 3c800: 89 91 ld r24, Y+ 3c802: 60 91 15 18 lds r22, 0x1815 ; 0x801815 <__iob+0x2> 3c806: 70 91 16 18 lds r23, 0x1816 ; 0x801816 <__iob+0x3> 3c80a: db 01 movw r26, r22 3c80c: 18 96 adiw r26, 0x08 ; 8 3c80e: ed 91 ld r30, X+ 3c810: fc 91 ld r31, X 3c812: 81 11 cpse r24, r1 3c814: f0 cf rjmp .-32 ; 0x3c7f6 3c816: 8a e0 ldi r24, 0x0A ; 10 3c818: 19 95 eicall 3c81a: 89 2b or r24, r25 3c81c: 49 f7 brne .-46 ; 0x3c7f0 3c81e: c8 01 movw r24, r16 3c820: df 91 pop r29 3c822: cf 91 pop r28 3c824: 1f 91 pop r17 3c826: 0f 91 pop r16 3c828: 08 95 ret 0003c82a <__do_global_dtors>: 3c82a: 17 e5 ldi r17, 0x57 ; 87 3c82c: cb ed ldi r28, 0xDB ; 219 3c82e: d7 e5 ldi r29, 0x57 ; 87 3c830: 00 e0 ldi r16, 0x00 ; 0 3c832: 06 c0 rjmp .+12 ; 0x3c840 <__do_global_dtors+0x16> 3c834: 80 2f mov r24, r16 3c836: fe 01 movw r30, r28 3c838: 0f 94 6b de call 0x3bcd6 ; 0x3bcd6 <__tablejump2__> 3c83c: 21 96 adiw r28, 0x01 ; 1 3c83e: 01 1d adc r16, r1 3c840: cc 3d cpi r28, 0xDC ; 220 3c842: d1 07 cpc r29, r17 3c844: 80 e0 ldi r24, 0x00 ; 0 3c846: 08 07 cpc r16, r24 3c848: a9 f7 brne .-22 ; 0x3c834 <__do_global_dtors+0xa> 3c84a: f8 94 cli 0003c84c <__stop_program>: 3c84c: ff cf rjmp .-2 ; 0x3c84c <__stop_program>